Skip to content
Snippets Groups Projects
Commit e0e3c509 authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: add restricted access warning

parent de55f0d1
No related branches found
No related tags found
No related merge requests found
import { Component, Input } from "@angular/core"; import { Component, Input, OnChanges, SimpleChanges } from "@angular/core";
import { SapiDatasetModel } from "src/atlasComponents/sapi"; import { SapiDatasetModel } from "src/atlasComponents/sapi";
import { CONST } from "common/constants"
const RESTRICTED_ACCESS_ID = "https://nexus.humanbrainproject.org/v0/data/minds/core/embargostatus/v1.0.0/3054f80d-96a8-4dce-9b92-55c68a8b5efd"
@Component({ @Component({
selector: `sxplr-sapiviews-core-datasets-dataset`, selector: `sxplr-sapiviews-core-datasets-dataset`,
...@@ -9,7 +12,17 @@ import { SapiDatasetModel } from "src/atlasComponents/sapi"; ...@@ -9,7 +12,17 @@ import { SapiDatasetModel } from "src/atlasComponents/sapi";
] ]
}) })
export class DatasetView { export class DatasetView implements OnChanges{
@Input('sxplr-sapiviews-core-datasets-dataset-input') @Input('sxplr-sapiviews-core-datasets-dataset-input')
dataset: SapiDatasetModel dataset: SapiDatasetModel
public isRestricted = false
public CONST = CONST
ngOnChanges(changes: SimpleChanges): void {
const { dataset } = changes
if (dataset) {
this.isRestricted = (dataset.currentValue as SapiDatasetModel)?.metadata?.accessibility?.["@id"] === RESTRICTED_ACCESS_ID
}
}
} }
...@@ -24,6 +24,13 @@ ...@@ -24,6 +24,13 @@
<span class="sxplr-m-a"> <span class="sxplr-m-a">
EBRAINS dataset EBRAINS dataset
</span> </span>
<button *ngIf="isRestricted"
[matTooltip]="CONST.GDPR_TEXT"
mat-icon-button color="warn">
<i class="fas fa-exclamation-triangle"></i>
</button>
<mat-divider class="sxplr-pl-1" [vertical]="true"></mat-divider> <mat-divider class="sxplr-pl-1" [vertical]="true"></mat-divider>
<a mat-icon-button *ngFor="let url of dataset.urls" [href]="url.doi | parseDoi" target="_blank"> <a mat-icon-button *ngFor="let url of dataset.urls" [href]="url.doi | parseDoi" target="_blank">
......
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