diff --git a/deploy/datasets/spatialQuery.js b/deploy/datasets/spatialQuery.js index 8ebba4ed54520a0d444e9f156be3a68fc566a2e9..5561e6098a7f2859ddc7a7ad5edef3c215a8bf9c 100644 --- a/deploy/datasets/spatialQuery.js +++ b/deploy/datasets/spatialQuery.js @@ -74,7 +74,7 @@ const fetchSpatialDataFromKg = async ({ templateName, queryGeometry, queryArg, u return { name, templateSpace: templateName, - dataset: dataset.map(ds => ds = {name: ds.name, description: ds.description, externalLink: 'https://kg.ebrains.eu/instances/Dataset/' + ds.identifier}), + dataset: dataset.map(ds => ds = {name: ds.name, description: ds.description, externalLink: 'https://kg.ebrains.eu/instances/Dataset/' + ds.identifier, embargoStatus: ds['embargo_status']}), geometry: { type: 'point', space: 'real', diff --git a/src/atlasViewer/atlasViewer.component.ts b/src/atlasViewer/atlasViewer.component.ts index b92d0e40c6a09d18f3653fc4546c112ca5123166..afff14d6d590c696f586ada3844a670fe477d775 100644 --- a/src/atlasViewer/atlasViewer.component.ts +++ b/src/atlasViewer/atlasViewer.component.ts @@ -127,6 +127,7 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { private hoveringRegions = [] private hoveringLandmark: any + public presentDatasetDialogRef: MatDialogRef<any> constructor( private store: Store<IavRootStoreInterface>, @@ -462,16 +463,21 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { public mouseClickNehuba(event) { // if (this.mouseUpLeftPosition === event.pageX && this.mouseUpTopPosition === event.pageY) {} if (this.hoveringLandmark) { - this.matDialog.open(SingleDatasetView, { + const hoveringLandmark = this.hoveringLandmark + this.hoveringLandmark = null + //ToDo it should be ported into different component with ability to view detailed dataset files + this.presentDatasetDialogRef = this.matDialog.open(SingleDatasetView, { data: { - name: this.hoveringLandmark.landmarkDataset[0].name, - sourceTitle: this.hoveringLandmark.landmarkName, - description: this.hoveringLandmark.landmarkDataset[0].description, - kgExternalLink: this.hoveringLandmark.landmarkDataset[0].externalLink, - //ToDo change to dynamic - underEmbargo: true + name: hoveringLandmark.landmarkDataset[0].name, + title: hoveringLandmark.landmarkName, + description: hoveringLandmark.landmarkDataset[0].description, + kgExternalLink: hoveringLandmark.landmarkDataset[0].externalLink, + underEmbargo: hoveringLandmark.landmarkDataset[0].embargoStatus[0].name === 'Embargoed'? true : false }, }) + this.presentDatasetDialogRef.afterClosed().subscribe(() => { + this.presentDatasetDialogRef = null + }) } if (!this.rClContextualMenu) { return } this.rClContextualMenu.mousePos = [ diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html index 7f84aa51f3e5e5b1f41ca0cc37689f5bfe706ad9..12a0603d04770be9df84b590500ffc4b72b771ea 100644 --- a/src/atlasViewer/atlasViewer.template.html +++ b/src/atlasViewer/atlasViewer.template.html @@ -115,7 +115,7 @@ <div floatingMouseContextualContainerDirective> - <div *ngIf="!ismobile" + <div *ngIf="!ismobile && !presentDatasetDialogRef" class="d-inline-block" iav-mouse-hover #iavMouseHoverConetxtualBlock="iavMouseHover" diff --git a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html index a07a9350edf2dbde3f4454cbdda9a0f6a3956d40..4ac4a8f4730a1923fbf76b276eb01327a6bec86d 100644 --- a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html +++ b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html @@ -1,6 +1,6 @@ -<mat-card-title *ngIf="sourceTitle"> - {{ sourceTitle }} +<mat-card-title *ngIf="title"> + {{ title }} </mat-card-title> <!-- title --> <mat-card-subtitle> diff --git a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts index 093364d0e7e4744cd3945eb1e3ab1197d702fc09..de9b533898531d7aeacfa6a3115bedd44298ce35 100644 --- a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts +++ b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts @@ -22,7 +22,7 @@ export class SingleDatasetBase implements OnInit { * while the actual data is being loaded from KG with kgSchema and kgId */ @Input() public name?: string - @Input() public sourceTitle?: string + @Input() public title?: string @Input() public description?: string @Input() public publications?: IPublication[] @@ -84,9 +84,9 @@ export class SingleDatasetBase implements OnInit { const { kgId, kgSchema, dataset } = this this.dlFromKgHref = this.singleDatasetService.getDownloadZipFromKgHref({ kgSchema, kgId }) if ( dataset ) { - const { name, sourceTitle, description, kgReference, publications, files, preview, kgExternalLink, underEmbargo } = dataset + const { name, title, description, kgReference, publications, files, preview, kgExternalLink, underEmbargo } = dataset this.name = name - this.sourceTitle = sourceTitle + this.title = title this.description = description this.kgReference = kgReference this.publications = publications