diff --git a/deploy/devBanner/index.js b/deploy/devBanner/index.js index 8f9ee7fef018b40c90d917e687dc65ca0145497b..c7ca44241e225798e03da3d3bd5777adcfd45e62 100644 --- a/deploy/devBanner/index.js +++ b/deploy/devBanner/index.js @@ -1,6 +1,8 @@ const express = require('express') const router = express.Router() +console.log(`BUILD_TEXT: ${process.env.BUILD_TEXT}`) + /** * build flag */ @@ -18,6 +20,7 @@ const buildTextIsDefined = typeof process.env.BUILD_TEXT !== 'undefined' * i.e. in order to show nothing, must EXPLICITLY set envvar BUILD_TEXT as empty string */ router.get('/version.css', (req, res, next) => { + console.log(`runtime BUILD_TEXT: ${process.env.BUILD_TEXT}`) if (!buildTextIsDefined) return next() res.setHeader('Content-Type', 'text/css; charset=UTF-8') res.status(200).send(versionCss) diff --git a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html index 372748eb628a6ce175acb08e79f93d5bae9d3bd0..489c91babf6d522736205a5d70f8afea5c658a0b 100644 --- a/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html +++ b/src/ui/databrowserModule/singleDataset/detailedView/singleDataset.template.html @@ -43,18 +43,21 @@ </mat-grid-tile> <!-- download --> - <mat-grid-tile *ngIf="downloadEnabled"> - <a [href]="dlFromKgHref" - target="_blank" - iav-stop="click mousedown"> - <button - matTooltip="Download" - [disabled]="downloadInProgress" - mat-icon-button> - <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> - </button> - </a> - </mat-grid-tile> + <ng-container *ngIf="!strictLocal"> + + <mat-grid-tile *ngIf="downloadEnabled"> + <a [href]="dlFromKgHref" + target="_blank" + iav-stop="click mousedown"> + <button + matTooltip="Download" + [disabled]="downloadInProgress" + mat-icon-button> + <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + </button> + </a> + </mat-grid-tile> + </ng-container> </mat-grid-list> <!-- description --> @@ -65,18 +68,21 @@ </small> <!-- publications --> - <small class="d-block mb-2" - *ngFor="let publication of publications"> - <a *ngIf="publication.doi; else plainText" - iav-stop="click mousedown" - [href]="publication.doi | doiParserPipe" - target="_blank"> - {{ publication.cite }} - </a> - <ng-template #plainText> - {{ publication.cite }} - </ng-template> - </small> + <ng-container *ngIf="!strictLocal"> + + <small class="d-block mb-2" + *ngFor="let publication of publications"> + <a *ngIf="publication.doi; else plainText" + iav-stop="click mousedown" + [href]="publication.doi | doiParserPipe" + target="_blank"> + {{ publication.cite }} + </a> + <ng-template #plainText> + {{ publication.cite }} + </ng-template> + </small> + </ng-container> </mat-card-content> @@ -84,17 +90,20 @@ <mat-card-actions> <!-- 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> - </button> - </a> + <ng-container *ngIf="!strictLocal"> + + <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> + </button> + </a> + </ng-container> <!-- pin data --> <button mat-button @@ -109,21 +118,24 @@ <!-- download --> - <a *ngIf="files.length > 0" - [href]="dlFromKgHref" - target="_blank"> - <button - [disabled]="downloadInProgress" - [matTooltip]="tooltipText" - class="m-2" - mat-button - color="basic"> - <span> - Download as Zip - </span> - <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> - </button> - </a> + <ng-container *ngIf="!strictLocal"> + + <a *ngIf="files.length > 0" + [href]="dlFromKgHref" + target="_blank"> + <button + [disabled]="downloadInProgress" + [matTooltip]="tooltipText" + class="m-2" + mat-button + color="basic"> + <span> + Download as Zip + </span> + <i class="ml-1 fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + </button> + </a> + </ng-container> <button mat-button mat-dialog-close diff --git a/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html b/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html index 452f019150bdfd99c1367a571cd1f1cf5495aedb..99021b5e8ff295274cfaed1e86cef4ec27b0872d 100644 --- a/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html +++ b/src/ui/databrowserModule/singleDataset/listView/singleDatasetListView.template.html @@ -67,15 +67,18 @@ </button> <!-- Explore --> - <a *ngFor="let kgRef of kgReference" - class="no-hover" - [href]="kgRef | doiParserPipe" - target="_blank" - mat-menu-item> - <mat-icon fontSet="fas" fontIcon="fa-globe-europe"></mat-icon> - Explore - <i class="fas fa-external-link-alt"></i> - </a> + <ng-container *ngIf="!strictLocal"> + + <a *ngFor="let kgRef of kgReference" + class="no-hover" + [href]="kgRef | doiParserPipe" + target="_blank" + mat-menu-item> + <mat-icon fontSet="fas" fontIcon="fa-globe-europe"></mat-icon> + Explore + <i class="fas fa-external-link-alt"></i> + </a> + </ng-container> <!-- preview --> <button mat-menu-item @@ -87,17 +90,20 @@ </button> <!-- download --> - <a *ngIf="downloadEnabled" - [href]="dlFromKgHref" - target="_blank" - iav-stop="mousedown click"> - <button mat-menu-item - class="no-focus" - [disabled]="downloadInProgress"> - <mat-icon [ngClass]="{'fa-spinner': downloadInProgress}" fontSet="fas" [fontIcon]="!downloadInProgress? 'fa-download' :'fa-pulse'"></mat-icon> - Download - </button> - </a> + <ng-container *ngIf="!strictLocal"> + + <a *ngIf="downloadEnabled" + [href]="dlFromKgHref" + target="_blank" + iav-stop="mousedown click"> + <button mat-menu-item + class="no-focus" + [disabled]="downloadInProgress"> + <mat-icon [ngClass]="{'fa-spinner': downloadInProgress}" fontSet="fas" [fontIcon]="!downloadInProgress? 'fa-download' :'fa-pulse'"></mat-icon> + Download + </button> + </a> + </ng-container> </ng-template> </mat-menu> @@ -111,13 +117,16 @@ <ng-template #fullIcons> <!-- references --> - <a *ngFor="let kgRef of kgReference" - [href]="kgRef | doiParserPipe" - target="_blank" - iav-stop="click mousedown" - mat-icon-button> - <mat-icon fontSet="fas" fontIcon="fa-external-link-alt"></mat-icon> - </a> + <ng-container *ngIf="!strictLocal"> + + <a *ngFor="let kgRef of kgReference" + [href]="kgRef | doiParserPipe" + target="_blank" + iav-stop="click mousedown" + mat-icon-button> + <mat-icon fontSet="fas" fontIcon="fa-external-link-alt"></mat-icon> + </a> + </ng-container> <!-- pin dataset --> <button mat-icon-button @@ -129,13 +138,16 @@ </button> <!-- download dataset --> - <a *ngIf="downloadEnabled" - [href]="dlFromKgHref" - target="_blank" - iav-stop="click mousedown"> - <button mat-icon-button - [disabled]="downloadInProgress"> - <i class="fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> - </button> - </a> + <ng-container *ngIf="!strictLocal"> + + <a *ngIf="downloadEnabled" + [href]="dlFromKgHref" + target="_blank" + iav-stop="click mousedown"> + <button mat-icon-button + [disabled]="downloadInProgress"> + <i class="fas" [ngClass]="!downloadInProgress? 'fa-download' :'fa-spinner fa-pulse'"></i> + </button> + </a> + </ng-container> </ng-template> \ No newline at end of file diff --git a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts index d0a8341adf725e656f086cfd8d4af590a5a9e808..b428a1ab20e4912ece7d74aab734ec334f793c23 100644 --- a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts +++ b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts @@ -36,6 +36,8 @@ export class SingleDatasetBase implements OnInit { public preview: boolean = false private humanReadableFileSizePipe: HumanReadableFileSizePipe = new HumanReadableFileSizePipe() + public strictLocal: boolean = STRIC_LOCAL + /** * sic! */ diff --git a/typings/index.d.ts b/typings/index.d.ts index 8e85daee2ef8e949504faa2cba66baf1a5861953..9d7e3f3e5484ca52b69acd9eba99e0e431d82957 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -13,4 +13,5 @@ declare var BUNDLEDPLUGINS : string[] declare var VERSION : string declare var PRODUCTION: boolean declare var BACKEND_URL: string -declare var USE_LOGO: string \ No newline at end of file +declare var USE_LOGO: string +declare var STRIC_LOCAL: boolean \ No newline at end of file diff --git a/webpack.staticassets.js b/webpack.staticassets.js index 0474266a510fe7307caba1aae0aff912f0c4aaf6..a6e069e8afaea68384b16baf78d0d8238e130cc4 100644 --- a/webpack.staticassets.js +++ b/webpack.staticassets.js @@ -70,7 +70,8 @@ module.exports = { ? true : false, BACKEND_URL: (process.env.BACKEND_URL && JSON.stringify(process.env.BACKEND_URL)) || 'null', - USE_LOGO: JSON.stringify(process.env.USE_LOGO || 'hbp' || 'ebrains' || 'fzj') + USE_LOGO: JSON.stringify(process.env.USE_LOGO || 'hbp' || 'ebrains' || 'fzj'), + STRIC_LOCAL: process.env.STRIC_LOCAL === 'true' ? 'true' : 'false' }) ], resolve: {