mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Geospatial maps: Angular control flow refactor
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ 'browse.metadata.map' | translate }}</h1>
|
<h1>{{ 'browse.metadata.map' | translate }}</h1>
|
||||||
<ng-container *ngIf="isPlatformBrowser(platformId)">
|
@if (isPlatformBrowser(platformId)) {
|
||||||
<ds-geospatial-map [facetValues]="facetValues$"
|
<ds-geospatial-map [facetValues]="facetValues$"
|
||||||
[currentScope]="this.scope$|async"
|
[currentScope]="this.scope$|async"
|
||||||
[layout]="'browse'"
|
[layout]="'browse'"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
</ds-geospatial-map>
|
</ds-geospatial-map>
|
||||||
</ng-container>
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
<div class="item-page-field" *ngIf="isNotEmpty(points) || isNotEmpty(bboxes)">
|
@if (isNotEmpty(points) || isNotEmpty(bboxes)) {
|
||||||
<ds-metadata-field-wrapper [label]="label | translate">
|
<div>
|
||||||
<ds-geospatial-map [coordinates]="this.points"
|
<ds-metadata-field-wrapper [label]="label | translate">
|
||||||
[bbox]="this.bboxes"
|
<ds-geospatial-map [coordinates]="this.points"
|
||||||
[cluster]="this.cluster"
|
[bbox]="this.bboxes"
|
||||||
[layout]="'item'"
|
[cluster]="this.cluster"
|
||||||
style="width: 100%;">
|
[layout]="'item'"
|
||||||
</ds-geospatial-map>
|
style="width: 100%;">
|
||||||
</ds-metadata-field-wrapper>
|
</ds-geospatial-map>
|
||||||
</div>
|
</ds-metadata-field-wrapper>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<div class="simple-view-element" [class.d-none]="hideIfNoTextContent && hasNoContent">
|
<div class="simple-view-element" [class.d-none]="hideIfNoTextContent && hasNoContent">
|
||||||
<h2 class="simple-view-element-header" *ngIf="label">{{ label }}</h2>
|
@if (label) {
|
||||||
<div #content class="simple-view-element-body">
|
<h2 class="simple-view-element-header">{{ label }}</h2>
|
||||||
<ng-content></ng-content>
|
<div #content class="simple-view-element-body">
|
||||||
</div>
|
<ng-content></ng-content>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,4 +1,9 @@
|
|||||||
@if ((currentMode$ | async) === viewModeEnum.ListElement) {
|
@if ((currentMode$ | async) === viewModeEnum.GeospatialMap) {
|
||||||
|
<ds-object-geospatial-map [objects]="objects">
|
||||||
|
</ds-object-geospatial-map>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if ((currentMode$ | async) === viewModeEnum.ListElement || (currentMode$ | async) === viewModeEnum.GeospatialMap) {
|
||||||
<ds-object-list [ngClass]="placeholderFontClass"
|
<ds-object-list [ngClass]="placeholderFontClass"
|
||||||
[config]="config"
|
[config]="config"
|
||||||
[sortConfig]="sortConfig"
|
[sortConfig]="sortConfig"
|
||||||
|
@@ -35,6 +35,7 @@ import { PageInfo } from '../../core/shared/page-info.model';
|
|||||||
import { ViewMode } from '../../core/shared/view-mode.model';
|
import { ViewMode } from '../../core/shared/view-mode.model';
|
||||||
import { isEmpty } from '../empty.util';
|
import { isEmpty } from '../empty.util';
|
||||||
import { ObjectDetailComponent } from '../object-detail/object-detail.component';
|
import { ObjectDetailComponent } from '../object-detail/object-detail.component';
|
||||||
|
import { ObjectGeospatialMapComponent } from '../object-geospatial-map/object-geospatial-map.component';
|
||||||
import { ObjectGridComponent } from '../object-grid/object-grid.component';
|
import { ObjectGridComponent } from '../object-grid/object-grid.component';
|
||||||
import { ThemedObjectListComponent } from '../object-list/themed-object-list.component';
|
import { ThemedObjectListComponent } from '../object-list/themed-object-list.component';
|
||||||
import { ObjectTableComponent } from '../object-table/object-table.component';
|
import { ObjectTableComponent } from '../object-table/object-table.component';
|
||||||
@@ -51,7 +52,7 @@ import { ListableObject } from './shared/listable-object.model';
|
|||||||
styleUrls: ['./object-collection.component.scss'],
|
styleUrls: ['./object-collection.component.scss'],
|
||||||
templateUrl: './object-collection.component.html',
|
templateUrl: './object-collection.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ThemedObjectListComponent, NgClass, ObjectGridComponent, ObjectDetailComponent, AsyncPipe, ObjectTableComponent],
|
imports: [ThemedObjectListComponent, NgClass, ObjectGridComponent, ObjectDetailComponent, AsyncPipe, ObjectTableComponent, ObjectGeospatialMapComponent],
|
||||||
})
|
})
|
||||||
export class ObjectCollectionComponent implements OnInit {
|
export class ObjectCollectionComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
<ng-container *ngIf="isPlatformBrowser(platformId)">
|
@if (isPlatformBrowser(platformId)) {
|
||||||
<ds-geospatial-map [mapInfo]="mapInfo"></ds-geospatial-map>
|
<ds-geospatial-map [mapInfo]="mapInfo"></ds-geospatial-map>
|
||||||
</ng-container>
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,16 +39,21 @@
|
|||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
[attr.data-test]="'detail-view' | dsBrowserOnly">
|
[attr.data-test]="'detail-view' | dsBrowserOnly">
|
||||||
<i class="far fa-square"></i>
|
<i class="far fa-square"></i>
|
||||||
</button> <button *ngIf="isToShow(viewModeEnum.GeospatialMap)"
|
|
||||||
routerLink="."
|
|
||||||
[queryParams]="{view: 'geospatialMap'}"
|
|
||||||
queryParamsHandling="merge"
|
|
||||||
(click)="switchViewTo(viewModeEnum.GeospatialMap)"
|
|
||||||
routerLinkActive="active"
|
|
||||||
[class.active]="currentMode === viewModeEnum.GeospatialMap"
|
|
||||||
class="btn btn-secondary"
|
|
||||||
[attr.data-test]="'grid-view' | dsBrowserOnly">
|
|
||||||
<span class="fas fa-map"></span><span class="sr-only">{{'search.view-switch.show-geospatialMap' | translate}}</span>
|
|
||||||
</button>
|
</button>
|
||||||
|
@if (isToShow(viewModeEnum.GeospatialMap)) {
|
||||||
|
<button
|
||||||
|
[attr.aria-current]="currentMode === viewModeEnum.GeospatialMap"
|
||||||
|
[attr.aria-label]="'search.view-switch.show-geospatialMap' | translate"
|
||||||
|
routerLink="."
|
||||||
|
[queryParams]="{view: 'geospatialMap'}"
|
||||||
|
queryParamsHandling="merge"
|
||||||
|
(click)="switchViewTo(viewModeEnum.GeospatialMap)"
|
||||||
|
routerLinkActive="active"
|
||||||
|
[class.active]="currentMode === viewModeEnum.GeospatialMap"
|
||||||
|
class="btn btn-secondary"
|
||||||
|
[attr.data-test]="'geospatial-view' | dsBrowserOnly">
|
||||||
|
<span class="fas fa-map"></span><span class="sr-only">{{'search.view-switch.show-geospatialMap' | translate}}</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user