Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ogc-filters): Reshuffle of ogc filter selection #831

Merged
merged 37 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7c0f78a
WIP
PhilippeLafreniere18 Feb 19, 2021
036e3a9
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Feb 26, 2021
7ed8627
WIP
PhilippeLafreniere18 Feb 26, 2021
19e5880
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 10, 2021
5c5f3d1
WIP
PhilippeLafreniere18 Mar 10, 2021
05043cd
WIP
PhilippeLafreniere18 Mar 12, 2021
7d3a98f
WIP
PhilippeLafreniere18 Mar 15, 2021
8e7dd2a
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 15, 2021
c714264
Merge with next
PhilippeLafreniere18 Mar 23, 2021
7017020
OGCfilter selector modif - WIP
PhilippeLafreniere18 Mar 24, 2021
e7631c1
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 25, 2021
245ff38
CSS modifs for checkbox/radio
PhilippeLafreniere18 Mar 25, 2021
296bb17
ogcfilter: allow multiple selector type and groups
PhilippeLafreniere18 Mar 26, 2021
c0251ba
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 29, 2021
801e191
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 29, 2021
cc15968
display less selectors and css modifs (WIP)
PhilippeLafreniere18 Mar 29, 2021
152ae84
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Mar 30, 2021
6ee81b6
Multiple groups selector/bundle title (WIP)
PhilippeLafreniere18 Mar 30, 2021
e963734
add order, css modifs, sous-groupe (WIP)
PhilippeLafreniere18 Mar 31, 2021
37fa688
combine filters from multiple selectors type
PhilippeLafreniere18 Apr 1, 2021
616a72c
Fix CSS / Remove advancedFilters if not in config
PhilippeLafreniere18 Apr 6, 2021
2c4cc27
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Apr 6, 2021
0315b3b
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Apr 7, 2021
270b1d9
feat(ogc-filter): add calendar to ogc filter selector
PhilippeLafreniere18 Apr 7, 2021
3ef9284
Merge remote-tracking branch 'origin/next' into OGCFilterSelectorTime
PhilippeLafreniere18 Apr 8, 2021
4f7a8a7
add calendar to ogc filter selection
PhilippeLafreniere18 Apr 8, 2021
c3f9765
remove time slider toggle and CSS modifs
PhilippeLafreniere18 Apr 9, 2021
7864295
Merge remote-tracking branch 'origin/next' into OGCFilterInterface
PhilippeLafreniere18 Apr 9, 2021
f86d6c4
Merge remote-tracking branch 'origin/OGCFilterSelectorTime' into OGCF…
PhilippeLafreniere18 Apr 9, 2021
e4999e9
add checkboxes/radioButtons possibilities to ogcFilters
PhilippeLafreniere18 Apr 9, 2021
041a002
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
mbarbeau Apr 13, 2021
1b086e3
lint
mbarbeau Apr 13, 2021
955c633
merge with next
PhilippeLafreniere18 Apr 19, 2021
705af00
fix(ogc-filter): fix if time filter is not defined
PhilippeLafreniere18 Apr 19, 2021
56fce76
style(ogc): rename ogc radio button
PhilippeLafreniere18 Apr 19, 2021
f2c33fd
Merge remote-tracking branch 'origin/next' into OGCfilterInterface
PhilippeLafreniere18 Apr 21, 2021
10c80b8
fix(ogcFilter): fix empty selector in order to allow layer to be added
PhilippeLafreniere18 Apr 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 111 additions & 101 deletions demo/src/app/geo/ogc-filter/ogc-filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,112 +512,122 @@ export class AppOgcFilterComponent {
enabled: true,
editable: true,
pushButtons: {
selectorType: 'pushButton',
order: 2,
groups : [
{title: 'Nom du group1', name: '1', ids : ['id1']},
{title: 'Nom du group2', name: '2', ids : ['id1', 'id2']},
{title: 'Nom du group1 - push', name: '1 - push', ids : ['id1']},
],
bundles: [
{
id: 'id1',
logical: 'Or',
buttons: [
{
title: 'Radar photo fixe',
enabled: true,
color: '0,0,255',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo fixe'
}
},
{
title: 'Radar photo mobile',
enabled: false,
color: '255,200,0',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo mobile'
}
},
{
title: 'Radar photo fixe + feu rouge',
enabled: false,
color: '0,200,0',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo fixe et surveillance au feu rouge'
}
},
{
title: 'Radar feu rouge',
enabled: false,
color: '255,0,0',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Appareil de surveillance au feu rouge'
}
}
]
},
{
id: 'id2',
logical: 'Or',
vertical: true,
buttons: [
{
title: 'Montréal & Laval',
enabled: false,
tooltip: 'Here a tooltip explaning ...',
filters: {
logical: 'Or',
filters: [
{
operator: 'PropertyIsEqualTo',
propertyName: 'region',
expression: 'Montréal'
},
{
operator: 'PropertyIsEqualTo',
propertyName: 'region',
expression: 'Laval'
}
]
{
id: 'id1',
title: 'Régions',
logical: 'Or',
vertical: true,
selectors: [
{
title: 'Montréal & Laval',
enabled: false,
tooltip: 'Here a tooltip explaning ...',
filters: {
logical: 'Or',
filters: [
{
operator: 'PropertyIsEqualTo',
propertyName: 'region',
expression: 'Montréal'
},
{
operator: 'PropertyIsEqualTo',
propertyName: 'region',
expression: 'Laval'
}
]
}
},
{
title: 'Outside Montréal & Laval',
enabled: false,
tooltip: 'Here a tooltip explaning ...',
filters: {
logical: 'And',
filters: [
{
operator: 'PropertyIsNotEqualTo',
propertyName: 'region',
expression: 'Montréal'
},
{
operator: 'PropertyIsNotEqualTo',
propertyName: 'region',
expression: 'Laval'
}
]
}
}
},
{
title: 'Outside Montréal & Laval',
enabled: false,
tooltip: 'Here a tooltip explaning ...',
filters: {
logical: 'And',
filters: [
{
operator: 'PropertyIsNotEqualTo',
propertyName: 'region',
expression: 'Montréal'
},
{
operator: 'PropertyIsNotEqualTo',
propertyName: 'region',
expression: 'Laval'
}
]
]
}
]
},
checkboxes: {
selectorType: 'checkbox',
order: 1,
groups : [
{title: 'Nom du group1 - checkbox', name: '1 - checkbox', ids : ['id1']},
],
bundles: [
{
id: 'id1',
title: 'Type de radar photo',
logical: 'Or',
selectors: [
{
title: 'Radar photo fixe',
enabled: true,
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo fixe'
}
},
{
title: 'Radar photo mobile',
enabled: false,
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo mobile'
}
},
{
title: 'Radar photo fixe + feu rouge',
enabled: false,
color: '0,200,0',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Radar photo fixe et surveillance au feu rouge'
}
},
{
title: 'Radar feu rouge',
enabled: false,
color: '255,0,0',
tooltip: 'Here a tooltip explaning ...',
filters: {
operator: 'PropertyIsEqualTo',
propertyName: 'typeAppareil',
expression: 'Appareil de surveillance au feu rouge'
}
}
}
]
}
]
},
]
}
]
},
allowedOperatorsType: OgcFilterOperatorType.Basic
},
},
paramsWFS: {
featureTypes: 'radars_photos',
fieldNameGeometry: 'geometry',
Expand All @@ -633,7 +643,7 @@ export class AppOgcFilterComponent {
.subscribe(dataSource => {
this.map.addLayer(
this.layerService.createLayer({
title: 'Filterable WMS layers with predefined filters (buttons)',
title: 'Filterable WMS layers with predefined filters (push buttons)',
source: dataSource
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class WMSDataSource extends DataSource {
'wms'
);
} else {
initOgcFilters.advancedOgcFilters = initOgcFilters.pushButtons
initOgcFilters.advancedOgcFilters = (initOgcFilters.pushButtons || initOgcFilters.checkboxes || initOgcFilters.radioButtons)
? false
: true;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/lib/filter/filter.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { OgcFilterableListComponent } from './ogc-filterable-list/ogc-filterable
import { OgcFilterButtonComponent } from './ogc-filter-button/ogc-filter-button.component';
import { OGCFilterService } from './shared/ogc-filter.service';
import { OGCFilterTimeService } from './shared/ogc-filter-time.service';
import { OgcFilterToggleButtonComponent } from './ogc-filter-toggle-button/ogc-filter-toggle-button.component';
import { OgcFilterSelectionComponent } from './ogc-filter-selection/ogc-filter-selection.component';

import { SpatialFilterTypeComponent } from './spatial-filter/spatial-filter-type/spatial-filter-type.component';
import { SpatialFilterListComponent } from './spatial-filter/spatial-filter-list/spatial-filter-list.component';
Expand Down Expand Up @@ -105,7 +105,7 @@ import { OgcFilterTimeSliderComponent } from './ogc-filter-time/ogc-filter-time-
TimeFilterListBindingDirective,
OgcFilterFormComponent,
OgcFilterButtonComponent,
OgcFilterToggleButtonComponent,
OgcFilterSelectionComponent,
OgcFilterableFormComponent,
OgcFilterableItemComponent,
OgcFilterableListComponent,
Expand All @@ -125,7 +125,7 @@ import { OgcFilterTimeSliderComponent } from './ogc-filter-time/ogc-filter-time-
TimeFilterListBindingDirective,
OgcFilterFormComponent,
OgcFilterButtonComponent,
OgcFilterToggleButtonComponent,
OgcFilterSelectionComponent,
OgcFilterableFormComponent,
OgcFilterableItemComponent,
OgcFilterableListComponent,
Expand Down
2 changes: 2 additions & 0 deletions packages/geo/src/lib/filter/filter.theming.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import './time-filter-form/time-filter-form.theming';
@import './ogc-filter-time/ogc-filter-time-slider.theming';
@import './ogc-filter-selection/ogc-filter-selection.theming';

@mixin igo-filter-theming($theme, $typography) {
@include igo-time-filter-form-theming($theme);
@include igo-ogc-filter-time-slider-theming($theme);
@include igo-ogc-filter-selection-theming($theme);
}
2 changes: 1 addition & 1 deletion packages/geo/src/lib/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export * from './ogc-filterable-form';
export * from './ogc-filterable-item';
export * from './ogc-filterable-list';
export * from './ogc-filter-form';
export * from './ogc-filter-toggle-button';
export * from './ogc-filter-selection';
export * from './ogc-filter-button';
export * from './ogc-filter-time';
export * from './time-filter-button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button
*ngIf="header && options.ogcFilters && options.ogcFilters.enabled &&
(options.ogcFilters.pushButtons || options.ogcFilters.editable)"
(options.ogcFilters.pushButtons || options.ogcFilters.checkboxes || options.ogcFilters.radioButtons || options.ogcFilters.editable)"
mat-icon-button
collapsibleButton
tooltip-position="below"
Expand All @@ -12,7 +12,7 @@

<div #ogcFilter class="igo-layer-actions-container"
*ngIf="options.ogcFilters && options.ogcFilters.enabled &&
(options.ogcFilters.pushButtons || options.ogcFilters.editable)">
(options.ogcFilters.pushButtons || options.ogcFilters.checkboxes || options.ogcFilters.radioButtons || options.ogcFilters.editable)">
<igo-ogc-filterable-item
*ngIf="ogcFilterCollapse && options.ogcFilters.enabled"
igoListItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, Input, ChangeDetectionStrategy, OnInit } from '@angular/core

import { Layer } from '../../layer/shared/layers/layer';
import { IgoMap } from '../../map';
import { OgcFilterableDataSourceOptions, IgoPushButton, OgcFiltersOptions } from '../shared/ogc-filter.interface';
import { OgcFilterableDataSourceOptions, IgoOgcSelector, OgcFiltersOptions } from '../shared/ogc-filter.interface';

@Component({
selector: 'igo-ogc-filter-button',
Expand All @@ -18,13 +18,32 @@ export class OgcFilterButtonComponent implements OnInit {
const filter = this.options.ogcFilters as any;
if (filter && !filter.advancedOgcFilters) {
if (filter.pushButtons) {
const pushButtons = filter.pushButtons as IgoPushButton;
const pushButtons = filter.pushButtons as IgoOgcSelector;
const currentPushButtonGroup = pushButtons.groups.find(gr => gr.enabled);
let cntPushButtons = 0;
if (currentPushButtonGroup) {
currentPushButtonGroup.computedButtons.map(cb => cntPushButtons += cb.buttons.filter(button => button.enabled).length);
currentPushButtonGroup.computedSelectors.map(cb => cntPushButtons += (cb.selectors as any).filter(
button => button.enabled).length);
}
return cntPushButtons > 0 ? cntPushButtons : undefined;
} else if (filter.checkboxes) {
const checkboxes = filter.checkboxes as IgoOgcSelector;
const currentCheckboxGroup = checkboxes.groups.find(gr => gr.enabled);
let cntCheckboxes = 0;
if (currentCheckboxGroup) {
currentCheckboxGroup.computedSelectors.map(cb => cntCheckboxes += (cb.selectors as any).filter(
checkbox => checkbox.enabled).length);
}
return cntCheckboxes > 0 ? cntCheckboxes : undefined;
} else if (filter.radioButtons) {
const radioButtons = filter.radioButtons as IgoOgcSelector;
const currentRadioButtonsGroup = radioButtons.groups.find(gr => gr.enabled);
let cntRadioButtons = 0;
if (currentRadioButtonsGroup) {
currentRadioButtonsGroup.computedSelectors.map(cb => cntRadioButtons += (cb.selectors as any).filter(
checkbox => checkbox.enabled).length);
}
return cntRadioButtons > 0 ? cntRadioButtons : undefined;
} else {
return;
}
Expand Down
1 change: 1 addition & 0 deletions packages/geo/src/lib/filter/ogc-filter-selection/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ogc-filter-selection.component';
Loading