diff --git a/src/ui/databrowserModule/kgSingleDatasetService.service.ts b/src/ui/databrowserModule/kgSingleDatasetService.service.ts index 95e57173e77ecad65dec2bf544250bd2aa2852e5..eb2d69f94efdc30e29fe94f26bf7c24a30f39000 100644 --- a/src/ui/databrowserModule/kgSingleDatasetService.service.ts +++ b/src/ui/databrowserModule/kgSingleDatasetService.service.ts @@ -9,7 +9,7 @@ import { FileViewer } from "./fileviewer/fileviewer.component"; import { ADD_NG_LAYER, REMOVE_NG_LAYER, CHANGE_NAVIGATION } from "src/services/stateStore.service"; import { Subscription, Subject } from "rxjs"; import { HttpClient } from "@angular/common/http"; -import { UIService } from "src/services/uiService.service"; +import { GetKgSchemaIdFromFullIdPipe } from "./util/getKgSchemaIdFromFullId.pipe"; @Injectable({ providedIn: 'root' }) export class KgSingleDatasetService implements OnDestroy{ @@ -19,6 +19,8 @@ export class KgSingleDatasetService implements OnDestroy{ private subscriptions: Subscription[] = [] public ngLayers : Set<string> = new Set() + private getKgSchemaIdFromFullIdPipe: GetKgSchemaIdFromFullIdPipe = new GetKgSchemaIdFromFullIdPipe() + constructor( private constantService: AtlasViewerConstantsServices, private store$: Store<any>, @@ -158,6 +160,14 @@ export class KgSingleDatasetService implements OnDestroy{ } }) } + + getKgSchemaKgIdFromFullId(fullId: string){ + const match = this.getKgSchemaIdFromFullIdPipe.transform(fullId) + return match && { + kgSchema: match[0], + kgId: match[1] + } + } } interface KgQueryInterface{ diff --git a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html index ee562aba48d6b0c6e301d36c63a4dc074c9a785b..7712519f9f92f68f5fad0509b22c98ba826b8053 100644 --- a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html +++ b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html @@ -1,133 +1,142 @@ -<mat-card mat-ripple [matRippleDisabled]="!ripple"> - - <!-- title --> - <mat-card-subtitle *ngIf="!simpleMode"> + +<!-- title --> +<mat-card-subtitle *ngIf="!simpleMode"> + {{ name }} +</mat-card-subtitle> + +<mat-card-content *ngIf="simpleMode"> + <small> {{ name }} - </mat-card-subtitle> - - <mat-card-content *ngIf="simpleMode"> - <small> - {{ name }} - </small> - <mat-grid-list [cols]="kgReference.length + (preview ? 1 : 0) + (downloadEnabled ? 2 : 0)" rowHeight="4em"> - - <!-- explore --> - <mat-grid-tile *ngFor="let kgRef of kgReference"> - <a [href]="kgRef | doiParserPipe" - matTooltip="Explore" - iav-stop="click mousedown" - mat-icon-button - target="_blank"> - <i class="fas fa-external-link-alt"></i> - </a> - </mat-grid-tile> - - <!-- pin --> - <mat-grid-tile *ngIf="downloadEnabled"> - - <button - iav-stop="click mousedown" - (click)="toggleFav()" - matTooltip="Pin" - mat-icon-button - [color]="(favedDataentries$ | async | datasetIsFaved : dataset) ? 'primary' : 'basic'"> - <i class="fas fa-thumbtack"></i> - </button> - </mat-grid-tile> - - <!-- preview --> - <mat-grid-tile *ngIf="preview"> - <button - iav-stop="click mousedown" - (click)="showPreviewList(previewFilesListTemplate)" - matTooltip="Preview" - mat-icon-button> - <i class="far fa-eye"></i> - </button> - </mat-grid-tile> - - <!-- download --> - <mat-grid-tile *ngIf="downloadEnabled"> - <button - matTooltip="Download" - iav-stop="click mousedown" - (click)="downloadZipFromKg()" - [disabled]="downloadInProgress" - mat-icon-button> - <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> - </button> - </mat-grid-tile> - </mat-grid-list> - </mat-card-content> - - <!-- description --> - <mat-card-content *ngIf="!simpleMode"> - <small>{{ description }}</small> - </mat-card-content> - - <!-- publications --> - <mat-card-content *ngIf="!simpleMode"> - <div class="d-block mb-2" - *ngFor="let publication of publications"> - <a *ngIf="publication.doi; else plainText" + </small> + <mat-grid-list [cols]="kgReference.length + (preview ? 1 : 0) + (downloadEnabled ? 2 : 0)" rowHeight="4em"> + + <!-- explore --> + <mat-grid-tile *ngFor="let kgRef of kgReference"> + <a [href]="kgRef | doiParserPipe" + matTooltip="Explore" iav-stop="click mousedown" - [href]="publication.doi | doiParserPipe" + mat-icon-button target="_blank"> - {{ publication.cite }} + <i class="fas fa-external-link-alt"></i> </a> - <ng-template #plainText> - {{ publication.cite }} - </ng-template> - </div> - </mat-card-content> + </mat-grid-tile> + <!-- pin --> + <mat-grid-tile *ngIf="downloadEnabled"> - <!-- footer --> - <mat-card-actions *ngIf="!simpleMode"> + <button + iav-stop="click mousedown" + (click)="toggleFav()" + matTooltip="Pin" + mat-icon-button + [color]="(favedDataentries$ | async | datasetIsFaved : dataset) ? 'primary' : 'basic'"> + <i class="fas fa-thumbtack"></i> + </button> + </mat-grid-tile> - <!-- explore --> - <a *ngFor="let kgRef of kgReference" - class="m-2" - [href]="kgRef | doiParserPipe" - target="_blank"> - <button - mat-raised-button - color="primary"> - Explore - <i class="fas fa-external-link-alt"></i> + <!-- preview --> + <mat-grid-tile *ngIf="preview"> + <button + iav-stop="click mousedown" + (click)="showPreviewList(previewFilesListTemplate)" + matTooltip="Preview" + mat-icon-button> + <i class="far fa-eye"></i> </button> - </a> + </mat-grid-tile> + + <!-- download --> + <mat-grid-tile *ngIf="downloadEnabled"> + <button + matTooltip="Download" + iav-stop="click mousedown" + (click)="downloadZipFromKg()" + [disabled]="downloadInProgress" + mat-icon-button> + <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + </button> + </mat-grid-tile> + </mat-grid-list> +</mat-card-content> + +<!-- description --> +<mat-card-content *ngIf="!simpleMode"> + <small>{{ description }}</small> +</mat-card-content> - <!-- pin data --> - <button mat-button - *ngIf="downloadEnabled" +<!-- publications --> +<mat-card-content *ngIf="!simpleMode"> + <small class="d-block mb-2" + *ngFor="let publication of publications"> + <a *ngIf="publication.doi; else plainText" iav-stop="click mousedown" - (click)="toggleFav()" - color="primary" - [color]="(favedDataentries$ | async | datasetIsFaved : dataset) ? 'primary' : 'basic'"> - {{ (favedDataentries$ | async | datasetIsFaved : dataset) ? 'Unpin' : 'Pin' }} this dataset - <i class="fas fa-thumbtack"></i> - </button> + [href]="publication.doi | doiParserPipe" + target="_blank"> + {{ publication.cite }} + </a> + <ng-template #plainText> + {{ publication.cite }} + </ng-template> + </small> +</mat-card-content> - <!-- download --> - <button - (click)="downloadZipFromKg()" - [disabled]="downloadInProgress" - [matTooltip]="tooltipText" - class="m-2" - *ngIf="files.length > 0" - mat-button +<!-- footer --> +<mat-card-actions *ngIf="!simpleMode"> + + <!-- explore --> + <a *ngFor="let kgRef of kgReference" + class="m-2" + [href]="kgRef | doiParserPipe" + target="_blank"> + <button + mat-raised-button color="primary"> - <span> - Download as Zip - </span> - <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + Explore + <i class="fas fa-external-link-alt"></i> </button> - </mat-card-actions> + </a> + + <!-- pin data --> + <button mat-button + *ngIf="downloadEnabled" + iav-stop="click mousedown" + (click)="toggleFav()" + color="primary" + [color]="(favedDataentries$ | async | datasetIsFaved : dataset) ? 'primary' : 'basic'"> + {{ (favedDataentries$ | async | datasetIsFaved : dataset) ? 'Unpin' : 'Pin' }} this dataset + <i class="fas fa-thumbtack"></i> + </button> + + + <!-- download --> + <button + (click)="downloadZipFromKg()" + [disabled]="downloadInProgress" + [matTooltip]="tooltipText" + class="m-2" + *ngIf="files.length > 0" + mat-button + color="basic"> + <span> + Download as Zip + </span> + <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + </button> + + <button mat-button + mat-dialog-close + *ngIf="preview" + (click)="showPreviewList(previewFilesListTemplate)" + color="basic"> + <span> + Preview + </span> + <i class="ml-1 far fa-eye"></i> + </button> +</mat-card-actions> - <mat-card-footer></mat-card-footer> -</mat-card> +<mat-card-footer></mat-card-footer> <ng-template #previewFilesListTemplate> <preview-component diff --git a/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html b/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html index c968f3a8cad3f0c1d150012b1de4e3be794c2403..4b1adc8a52e68acfe1f15df58cc8e273f8d05991 100644 --- a/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html +++ b/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html @@ -1,4 +1,8 @@ -<div class="d-flex flex-row flex-nowrap align-items-center"> +<div mat-ripple + (click)="ripple ? showDetailInfo() : null" + [iav-stop]="ripple ? 'click' : null" + [matRippleDisabled]="!ripple" + class="d-flex flex-row flex-nowrap align-items-center"> <!-- title --> <small class="flex-grow-1 flex-shrink-1"> @@ -12,7 +16,7 @@ <button mat-icon-button *ngIf="favedDataentries$ | async | datasetIsFaved : dataset; else pinTmpl" (click)="undoableRemoveFav()" - iav-stop="click" + iav-stop="mousedown click" class="no-focus flex-grow-0 flex-shrink-0" color="primary"> <mat-icon fontSet="fas" fontIcon="fa-thumbtack"></mat-icon> @@ -22,7 +26,7 @@ <ng-template #pinTmpl> <button mat-icon-button (click)="undoableAddFav()" - iav-stop="click" + iav-stop="mousedown click" class="no-focus flex-grow-0 flex-shrink-0" color="basic"> <mat-icon fontSet="fas" fontIcon="fa-thumbtack"></mat-icon> @@ -33,6 +37,7 @@ <!-- more menu --> <button mat-icon-button + iav-stop="mousedown click" [matMenuTriggerFor]="singleDatasetMenu" class="flex-grow-0 flex-shrink-0 no-focus"> <i class="fas fa-ellipsis-v"></i> @@ -80,7 +85,7 @@ <button mat-menu-item *ngIf="downloadEnabled" class="no-focus" - iav-stop="click" + iav-stop="mousedown click" (click)="downloadZipFromKg()" [disabled]="downloadInProgress"> <mat-icon [ngClass]="{'fa-spinner': downloadInProgress}" fontSet="fas" [fontIcon]="!downloadInProgress? 'fa-download' :'fa-pulse'"></mat-icon> diff --git a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts index 19ff7b893d21c82b0a9ef81527bf2f895429cc90..b7ad552e6e84e0cb7a4f34fdfd8919290b50ce10 100644 --- a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts +++ b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts @@ -62,7 +62,16 @@ export class SingleDatasetBase implements OnInit { dataset?: any ){ this.favedDataentries$ = this.dbService.favedDataentries$ - if (dataset) this.dataset = dataset + if (dataset) { + this.dataset = dataset + const { fullId } = dataset + const obj = this.singleDatasetService.getKgSchemaKgIdFromFullId(fullId) + if (obj) { + const { kgSchema, kgId } = obj + this.kgSchema = kgSchema + this.kgId = kgId + } + } } ngOnInit() { diff --git a/src/ui/signinBanner/signinBanner.style.css b/src/ui/signinBanner/signinBanner.style.css index 03c30963c60253c4bc1e505f5de01bff0a2726ca..74e36a8f2c0145155af957eee3340bdcbcdf1736 100644 --- a/src/ui/signinBanner/signinBanner.style.css +++ b/src/ui/signinBanner/signinBanner.style.css @@ -5,72 +5,7 @@ display:inline-block; } -.loginPopover -{ - width: 0; - overflow: visible; - display:flex; - flex-direction: column; - - align-items: flex-end; -} - -:host > dropdown-component -{ - min-width: 10em; - flex: 1 0 auto; -} - -dropdown-component -{ - font-size:80%; - -} - -.whenMobile { - display: flex; - flex-direction: column; - align-items: center; - min-width: 100%; -} - -.whenNotMobile { - display: flex; -} - -.login-icon { - height: 28px; - margin: 0 3px; -} - -.login-button-panel-mobile { - order: -1; - align-self: flex-start; - width: 100%; - display: flex; - justify-content: space-between; -} - -.login-button-panel-splash { - display: flex; - flex-direction: column; - justify-content: space-between; - margin-left: auto; - text-align: right -} -.login-button-splash > button { - color: #FFFFFF; - outline: none; - background-color: coral; - margin: 5px; -} - -.login-button-mobile > button { - outline: none; - background-color: transparent; -} - :host > * { pointer-events: all; -} \ No newline at end of file +} diff --git a/src/ui/signinBanner/signinBanner.template.html b/src/ui/signinBanner/signinBanner.template.html index cbf5a904bf0d49ab1dbc01be0cd796547f892e16..45b57df89f55b5a7f6c5dbf7a1a321b66f2833ce 100644 --- a/src/ui/signinBanner/signinBanner.template.html +++ b/src/ui/signinBanner/signinBanner.template.html @@ -129,7 +129,6 @@ <!-- TODO maybe use virtual scroll here? --> <mat-list-item - mat-ripple class="align-items-center" *ngFor="let ds of (favDataEntries$ | async)" role="listitem"> @@ -138,7 +137,8 @@ class="d-block pt-1 pb-1 w-100" [kgSchema]="(ds.fullId | getKgSchemaIdFromFullIdPipe)[0]" [kgId]="(ds.fullId | getKgSchemaIdFromFullIdPipe)[1]" - [dataset]="ds"> + [dataset]="ds" + [ripple]="true"> </single-dataset-list-view> diff --git a/src/ui/viewerStateController/viewerStateCFull/viewerState.template.html b/src/ui/viewerStateController/viewerStateCFull/viewerState.template.html index bdc257d4b44531c9b0dc84edbc57fb320633719c..5f72c5990590ccc7a949b14f8937a737b9b9fb3e 100644 --- a/src/ui/viewerStateController/viewerStateCFull/viewerState.template.html +++ b/src/ui/viewerStateController/viewerStateCFull/viewerState.template.html @@ -46,15 +46,16 @@ <i class="fas fa-info"></i> </button> - <single-dataset-view - *ngFor="let originDataset of moreInfo.originDatasets" - class="position-absolute left-0 top-0 w-40em" - [name]="moreInfo.name" - [description]="moreInfo.description" - [publications]="moreInfo.publications" - [kgSchema]="originDataset && originDataset.kgSchema" - [kgId]="originDataset && originDataset.kgId"> - </single-dataset-view> + <mat-card *ngFor="let originDataset of moreInfo.originDatasets" + class="position-absolute left-0 top-0 w-40em"> + <single-dataset-view + [name]="moreInfo.name" + [description]="moreInfo.description" + [publications]="moreInfo.publications" + [kgSchema]="originDataset && originDataset.kgSchema" + [kgId]="originDataset && originDataset.kgId"> + </single-dataset-view> + </mat-card> </div> </div> @@ -109,15 +110,17 @@ <i class="fas fa-info"></i> </button> - <single-dataset-view - *ngFor="let originDataset of moreInfo.originDatasets" - class="position-absolute left-0 top-0 w-40em" - [name]="moreInfo.name" - [description]="moreInfo.description" - [publications]="moreInfo.publications" - [kgSchema]="originDataset && originDataset.kgSchema" - [kgId]="originDataset && originDataset.kgId"> - </single-dataset-view> + <mat-card *ngFor="let originDataset of moreInfo.originDatasets" + class="position-absolute left-0 top-0 w-40em"> + + <single-dataset-view + [name]="moreInfo.name" + [description]="moreInfo.description" + [publications]="moreInfo.publications" + [kgSchema]="originDataset && originDataset.kgSchema" + [kgId]="originDataset && originDataset.kgId"> + </single-dataset-view> + </mat-card> </div> </div> </sleight-of-hand>