Skip to content

Commit

Permalink
Merge pull request #879 from gisaia/feature/rollBackKeepDetailOpen
Browse files Browse the repository at this point in the history
Feat: roll back keep detail open on zoom to
  • Loading branch information
mbarbet authored Sep 16, 2024
2 parents 1918343 + 021473c commit 415e4e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
[currentSortedColumn]="sortOutput.get(list.identifier)"
[isGeoSortActivated]="isGeoSortActivated.get(list.identifier)"
(setFiltersEvent)="list.setFilters($event)"
(clickOnTile)="storeItemIdentifier($event)" (onResultListUpdate)="retrieveOpenedGridItem()"
(paginationEvent)="getBoardEvents({ origin: list.identifier, event: 'paginationEvent', data: $event })"
(geoSortEvent)="getBoardEvents({ origin: list.identifier, event: 'geoSortEvent', data: $event })"
(geoAutoSortEvent)="getBoardEvents({ origin: list.identifier, event: 'geoAutoSortEvent', data: $event })"
Expand Down
37 changes: 3 additions & 34 deletions src/app/components/arlas-wui-root/arlas-wui-root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
/** Destroy subscriptions */
private _onDestroy$ = new Subject<boolean>();

/** store last identifier selected **/
private _lastTileIdentifier: string;
private detailedGridOpen: boolean;

public constructor(
private configService: ArlasConfigService,
protected settingsService: ArlasSettingsService,
Expand Down Expand Up @@ -787,20 +783,6 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
this.mapSettings.openDialog(this.mapSettingsService);
}

public retrieveOpenedGridItem() {
if (this.detailedGridOpen && this._lastTileIdentifier) {
const item = this.resultListComponent.items.find(item => item.identifier === this._lastTileIdentifier);
if (item) {
this.waitFor(this.resultListComponent, () => this.openDetail(this._lastTileIdentifier));
} else {
this._lastTileIdentifier = null;
}
} else {
this._lastTileIdentifier = null;
this.disableRecalculateExtend = false;
}
}

/**
* Applies the selected geo query
*/
Expand Down Expand Up @@ -895,7 +877,6 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
}

public clickOnTile(item: Item) {
this.storeItemIdentifier(item);
this.tabsList.realignInkBar();
const config = this.resultListConfigPerContId.get(this.previewListContrib.identifier);
config.defautMode = this.modeEnum.grid;
Expand Down Expand Up @@ -1185,13 +1166,11 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
const detailGridButton = document.getElementById('show_details_gridmode_btn');
if (!!detailGridButton) {
detailGridButton.click();
this.detailedGridOpen = true;
}
this.disableRecalculateExtend = false;

}, 250);
} else {
this.detailedGridOpen = true;
// If image is displayed switch to detail data
const gridDivs = document.getElementsByClassName('resultgrid__img');
if (gridDivs.length > 0) {
Expand Down Expand Up @@ -1451,14 +1430,11 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
switch (data.action.id) {
case 'zoomToFeature':
if (!!mapContributor) {
// if detailed menu is not open when zoom to feature we reset identifer
this.detailedGridOpen = this.resultListComponent?.isDetailledGridOpen;
if (!this.detailedGridOpen) {
this._lastTileIdentifier = null;
}
mapContributor
.getBoundsToFit(data.elementidentifier, collection)
.subscribe(bounds => this.visualizeService.fitbounds = bounds);
.subscribe(bounds => {
this.visualizeService.fitbounds = bounds;
});
}
break;
case 'visualize':
Expand Down Expand Up @@ -1535,12 +1511,5 @@ export class ArlasWuiRootComponent implements OnInit, AfterViewInit, OnDestroy {
}
}, 100);
}

public storeItemIdentifier($event: Item) {
if ($event.identifier) {
this._lastTileIdentifier = (<Item>$event).identifier;
}
this.disableRecalculateExtend = false;
}
}

0 comments on commit 415e4e2

Please sign in to comment.