diff --git a/src/atlasViewer/atlasViewer.component.ts b/src/atlasViewer/atlasViewer.component.ts index 6c4061386ea4178d3cca27e0b9c2892bf1ae98ac..30d2353b5ca0b71dbccca9ab7f1ebc0135ab4aad 100644 --- a/src/atlasViewer/atlasViewer.component.ts +++ b/src/atlasViewer/atlasViewer.component.ts @@ -374,8 +374,12 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { ) } - public bindFn(fn, arg){ - return () => fn(arg) + public bindFns(fns){ + return () => { + for (const [ fn, ...arg] of fns) { + fn(...arg) + } + } } public clearAdditionalLayer(layer: { ['@id']: string }){ diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html index ebc678e829a5b26c13620c57278b6a142a590519..1373f74d6e65fcd1e0c7b6d41651f3de5ae3c40a 100644 --- a/src/atlasViewer/atlasViewer.template.html +++ b/src/atlasViewer/atlasViewer.template.html @@ -111,7 +111,9 @@ <ng-template #currParcellationTmpl let-parc="parc" let-addParc="addParc"> - <div [matMenuTriggerFor]="layerVersionMenu" #layerVersionMenuTrigger="matMenuTrigger"> + <div [matMenuTriggerFor]="layerVersionMenu" + [matMenuTriggerData]="{ layerVersionMenuTrigger: layerVersionMenuTrigger }" + #layerVersionMenuTrigger="matMenuTrigger"> <ng-template [ngIf]="addParc.length > 0" [ngIfElse]="defaultParcTmpl"> <ng-container *ngFor="let p of addParc"> @@ -142,7 +144,7 @@ let-selected="selected" let-dismissable="dismissable" let-onclick="onclick"> - <mat-chip class="pe-all" (click)="onclick && onclick()" [selected]="selected"> + <mat-chip class="pe-all position-relative z-index-2" (click)="onclick && onclick()" [selected]="selected"> {{ parcel?.groupName ? (parcel?.groupName + ' - ') : '' }}{{ parcel?.name }} @@ -187,17 +189,23 @@ </ng-template> <!-- layer version selector --> - <mat-menu #layerVersionMenu> - <ng-container *ngFor="let parcVer of selectedLayerVersions$ | async"> - <ng-container *ngTemplateOutlet="chipTmpl; context: { - parcel: parcVer, - selected: selectedParcellation && selectedParcellation['@id'] === parcVer['@id'], - dismissable: false, - onclick: bindFn(selectParcellation.bind(this), parcVer) - }"> + <mat-menu #layerVersionMenu class="bg-none"> + <ng-template matMenuContent let-layerVersionMenuTrigger="layerVersionMenuTrigger"> + + <ng-container *ngFor="let parcVer of selectedLayerVersions$ | async"> + <ng-container *ngTemplateOutlet="chipTmpl; context: { + parcel: parcVer, + selected: selectedParcellation && selectedParcellation['@id'] === parcVer['@id'], + dismissable: false, + onclick: bindFns([ + [ selectParcellation.bind(this), parcVer ], + [ layerVersionMenuTrigger.closeMenu.bind(layerVersionMenuTrigger) ] + ]) + }"> + </ng-container> + <div class="mt-1"></div> </ng-container> - <div class="mt-1"></div> - </ng-container> + </ng-template> </mat-menu> <ng-template #selectedRegionTmpl> @@ -208,14 +216,14 @@ iav-region (click)="uiNehubaContainer.matDrawerMinor.open() && uiNehubaContainer.navSideDrawerMainSwitch.open()" [region]="r" - class="pe-all position-relative z-index-1" + class="pe-all position-relative z-index-1 ml-8-n" [ngClass]="{ 'darktheme':regionDirective.rgbDarkmode === true, 'lighttheme': regionDirective.rgbDarkmode === false }" [style.backgroundColor]="regionDirective.rgbString" #regionDirective="iavRegion"> - <span class="iv-custom-comp text text-truncate d-inline"> + <span class="iv-custom-comp text text-truncate d-inline pl-4"> {{ r.name }} </span> <mat-icon diff --git a/src/res/css/extra_styles.css b/src/res/css/extra_styles.css index c541717c4814689796b2461bde2cf319e0d2b6d7..29150dca0832a5d75c61db7d41c2e5056b3da75f 100644 --- a/src/res/css/extra_styles.css +++ b/src/res/css/extra_styles.css @@ -493,6 +493,10 @@ markdown-dom pre code { z-index: 1!important; } +.z-index-2 +{ + z-index: 2!important; +} .z-index-6 { z-index: 6!important; diff --git a/src/services/state/viewerState.store.ts b/src/services/state/viewerState.store.ts index 33750d0d517e7e95b0c23f8c2ec29408c90a95cf..eb1005074da257b2fa07069bf4a2abca2b9d2c67 100644 --- a/src/services/state/viewerState.store.ts +++ b/src/services/state/viewerState.store.ts @@ -259,7 +259,7 @@ export const NEWVIEWER = 'NEWVIEWER' export const FETCHED_TEMPLATE = 'FETCHED_TEMPLATE' export const CHANGE_NAVIGATION = 'CHANGE_NAVIGATION' -export const SELECT_PARCELLATION = `SELECT_PARCELLATION` +export const SELECT_PARCELLATION = viewerStateSelectParcellation.type export const DESELECT_REGIONS = `DESELECT_REGIONS` export const SELECT_REGIONS = `SELECT_REGIONS` diff --git a/src/ui/nehubaContainer/nehubaContainer.template.html b/src/ui/nehubaContainer/nehubaContainer.template.html index a8575e9acc833c3b2149c875fa64b0ac08200ee1..a101fd063b4a31ef79e4d91c9b36bf46cdd2c061 100644 --- a/src/ui/nehubaContainer/nehubaContainer.template.html +++ b/src/ui/nehubaContainer/nehubaContainer.template.html @@ -66,8 +66,21 @@ [attr.aria-label]="ARIA_LABEL_EXPAND" (click)="matDrawerMinor.open()" class="explore-btn pe-all" - color="accent"> - Explore + [ngClass]="{ + 'darktheme': iavRegion.rgbDarkmode === true, + 'lighttheme': iavRegion.rgbDarkmode === false + }" + [style.backgroundColor]="iavRegion?.rgbString || 'accent'"> + <span> + Explore + </span> + + <div class="hidden" + iav-region + [region]="(selectedRegions$ | async) && (selectedRegions$ | async)[0]" + #iavRegion="iavRegion"> + </div> + </button> </mat-drawer> <mat-drawer-content class="visible position-relative"> diff --git a/src/ui/viewerStateController/viewerState.useEffect.ts b/src/ui/viewerStateController/viewerState.useEffect.ts index c3605d204b5eaf8343740b9f99a3111856141550..260b562b6a9988c1b4f4ddddeaccee93ac30d06f 100644 --- a/src/ui/viewerStateController/viewerState.useEffect.ts +++ b/src/ui/viewerStateController/viewerState.useEffect.ts @@ -2,11 +2,9 @@ import { Injectable, OnDestroy } from "@angular/core"; import { Actions, Effect, ofType } from "@ngrx/effects"; import { Action, select, Store } from "@ngrx/store"; import { Observable, Subscription, of, merge } from "rxjs"; -import {distinctUntilChanged, filter, map, shareReplay, withLatestFrom, switchMap, mapTo, tap } from "rxjs/operators"; +import {distinctUntilChanged, filter, map, shareReplay, withLatestFrom, switchMap, mapTo } from "rxjs/operators"; import { AtlasViewerConstantsServices } from "src/atlasViewer/atlasViewer.constantService.service"; -import { CHANGE_NAVIGATION, FETCHED_TEMPLATE, GENERAL_ACTION_TYPES, IavRootStoreInterface, isDefined, NEWVIEWER, SELECT_PARCELLATION, SELECT_REGIONS } from "src/services/stateStore.service"; -import { UIService } from "src/services/uiService.service"; -import { regionFlattener } from "src/util/regionFlattener"; +import { CHANGE_NAVIGATION, FETCHED_TEMPLATE, GENERAL_ACTION_TYPES, IavRootStoreInterface, NEWVIEWER, SELECT_PARCELLATION, SELECT_REGIONS } from "src/services/stateStore.service"; import { VIEWERSTATE_CONTROLLER_ACTION_TYPES } from "./viewerState.base"; import {TemplateCoordinatesTransformation} from "src/services/templateCoordinatesTransformation.service"; import { CLEAR_STANDALONE_VOLUMES } from "src/services/state/viewerState.store";