Skip to content
Snippets Groups Projects
Commit 47e0d03e authored by fsdavid's avatar fsdavid
Browse files

fetch under embargo from kg

parent 13311c29
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
......@@ -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 = [
......
......@@ -115,7 +115,7 @@
<div floatingMouseContextualContainerDirective>
<div *ngIf="!ismobile"
<div *ngIf="!ismobile && !presentDatasetDialogRef"
class="d-inline-block"
iav-mouse-hover
#iavMouseHoverConetxtualBlock="iavMouseHover"
......
<mat-card-title *ngIf="sourceTitle">
{{ sourceTitle }}
<mat-card-title *ngIf="title">
{{ title }}
</mat-card-title>
<!-- title -->
<mat-card-subtitle>
......
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment