-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 12791: GB3-1009: Move attribtue filter to map-overlay
On desktop mode, the map-attribute-filter is now displayed like the Legend in the map overlay. When the attribute filter is open and the legend button is clicked, the attribute filter will be closed and the legend opened. On mobile, the behavior is still the same: Attribute filter is opened in button sheet, on close, all bottom sheets are closed. Some components were changed to be standalone, because I added a new standalone component. All its children were modified to be standalone so I don't get cyclic dependencies with the map-module.
- Loading branch information
Showing
21 changed files
with
317 additions
and
83 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...omponents/active-map-items/active-map-item-settings/active-map-item-settings.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...p/map/components/map-attribute-filter-overlay/map-attribute-filter-overlay.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<map-overlay | ||
*ngIf="mapAttributeFiltersItem" | ||
(closeEvent)="close()" | ||
[isVisible]="isVisible" | ||
[showPrintButton]="false" | ||
overlayTitle="Attributfilter: {{ mapAttributeFiltersItem.title }}" | ||
> | ||
<map-attribute-filter></map-attribute-filter> | ||
</map-overlay> |
Empty file.
53 changes: 53 additions & 0 deletions
53
...app/map/components/map-attribute-filter-overlay/map-attribute-filter-overlay.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import {Component, OnDestroy, OnInit} from '@angular/core'; | ||
import {Subscription, tap} from 'rxjs'; | ||
import {Store} from '@ngrx/store'; | ||
import {selectIsAttributeFilterOverlayVisible} from '../../../state/map/reducers/map-ui.reducer'; | ||
import {MapAttributeFilterComponent} from '../map-attribute-filter/map-attribute-filter.component'; | ||
import {MapOverlayComponent} from '../map-overlay/map-overlay.component'; | ||
import {CommonModule} from '@angular/common'; | ||
import {Gb2WmsActiveMapItem} from '../../models/implementations/gb2-wms.model'; | ||
import {MapUiActions} from '../../../state/map/actions/map-ui.actions'; | ||
import {selectMapAttributeFiltersItem} from '../../../state/map/selectors/map-attribute-filters-item.selector'; | ||
|
||
@Component({ | ||
selector: 'map-attribute-filter-overlay', | ||
standalone: true, | ||
imports: [MapAttributeFilterComponent, MapOverlayComponent, CommonModule], | ||
templateUrl: './map-attribute-filter-overlay.component.html', | ||
styleUrl: './map-attribute-filter-overlay.component.scss', | ||
}) | ||
export class MapAttributeFilterOverlayComponent implements OnInit, OnDestroy { | ||
public isVisible = false; | ||
public mapAttributeFiltersItem: Gb2WmsActiveMapItem | undefined; | ||
|
||
private readonly attributeFilterVisibility$ = this.store.select(selectIsAttributeFilterOverlayVisible); | ||
private readonly mapAttributeFiltersItem$ = this.store.select(selectMapAttributeFiltersItem); | ||
private readonly subscriptions: Subscription = new Subscription(); | ||
|
||
constructor(private readonly store: Store) {} | ||
|
||
public ngOnInit() { | ||
this.initSubscriptions(); | ||
} | ||
|
||
public ngOnDestroy() { | ||
this.subscriptions.unsubscribe(); | ||
} | ||
|
||
public close() { | ||
this.store.dispatch(MapUiActions.setAttributeFilterVisibility({isVisible: false})); | ||
} | ||
|
||
private initSubscriptions() { | ||
this.subscriptions.add(this.attributeFilterVisibility$.pipe(tap((isVisible) => (this.isVisible = isVisible))).subscribe()); | ||
this.subscriptions.add( | ||
this.mapAttributeFiltersItem$ | ||
.pipe( | ||
tap((mapAttributeFilterItem) => { | ||
this.mapAttributeFiltersItem = mapAttributeFilterItem; | ||
}), | ||
) | ||
.subscribe(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.