diff --git a/Dockerfile b/Dockerfile index 56768d28e97b551dec81e1922da162c92b5af077..55c13a784be9eecee69cbdcf44db2bb6915f264c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG DATASET_PREVIEW_URL ENV DATASET_PREVIEW_URL=${DATASET_PREVIEW_URL:-https://hbp-kg-dataset-previewer.apps.hbp.eu/v2} ARG BS_REST_URL -ENV BS_REST_URL=${BS_REST_URL:-https://siibra-api-tmpxgcustom.apps-dev.hbp.eu/v1_0} +ENV BS_REST_URL=${BS_REST_URL:-https://siibra-api-latest.apps-dev.hbp.eu/v1_0} ARG STRICT_LOCAL ENV STRICT_LOCAL=${STRICT_LOCAL:-false} @@ -38,7 +38,7 @@ WORKDIR /iv RUN for f in $(find . -type f); do gzip < $f > $f.gz && brotli < $f > $f.br; done # prod container -FROM node:12-alpine +FROM node:12-alpine ENV NODE_ENV=production diff --git a/build_env.md b/build_env.md index 849c7e068d3c4ec433cbea158c3680f8b6ed0111..ced772f0b08662624f2f2588672ba6c7f58fdfca 100644 --- a/build_env.md +++ b/build_env.md @@ -7,10 +7,10 @@ As interactive atlas viewer uses [webpack define plugin](https://webpack.js.org/ | `VERSION` | printed in console on viewer startup | `GIT_HASH` \|\| unspecificed hash | v2.2.2 | | `PRODUCTION` | if the build is for production, toggles optimisations such as minification | `undefined` | true | | `BACKEND_URL` | backend that the viewer calls to fetch available template spaces, parcellations, plugins, datasets | `null` | https://interactive-viewer.apps.hbp.eu/ | -| `BS_REST_URL` | [brainscape-api](https://jugit.fz-juelich.de/v.marcenko/brainscapes-api) used to fetch different resources | https://siibra-api-tmpfullvolmetadata.apps-dev.hbp.eu/v1_0 | +| `BS_REST_URL` | [brainscape-api](https://jugit.fz-juelich.de/v.marcenko/brainscapes-api) used to fetch different resources | https://siibra-api-latest.apps-dev.hbp.eu/v1_0 | | `DATASET_PREVIEW_URL` | dataset preview url used by component <https://github.com/fzj-inm1-bda/kg-dataset-previewer>. Useful for diagnosing issues with dataset previews.| https://hbp-kg-dataset-previewer.apps.hbp.eu/datasetPreview | http://localhost:1234/datasetPreview | | `MATOMO_URL` | base url for matomo analytics | `null` | https://example.com/matomo/ | | `MATOMO_ID` | application id for matomo analytics | `null` | 6 | | `STRICT_LOCAL` | hides **Explore** and **Download** buttons. Useful for offline demo's | `false` | `true` | | `KIOSK_MODE` | after 5 minutes of inactivity, shows overlay inviting users to interact | `false` | `true` | -| `BUILD_TEXT` | overlay text at bottom right of the viewer. set to `''` to hide. | | \ No newline at end of file +| `BUILD_TEXT` | overlay text at bottom right of the viewer. set to `''` to hide. | | diff --git a/package.json b/package.json index 033485abf231877a5e912c630dd5cfeef30db327..b35b456f28f9dbd58e26dd6cf04a53a025f4c52c 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@ngrx/store": "^9.1.1", "@types/node": "12.12.39", "export-nehuba": "0.0.12", - "hbp-connectivity-component": "^0.4.3", + "hbp-connectivity-component": "^0.4.4", "jszip": "^3.6.0", "zone.js": "^0.10.2" } diff --git a/src/atlasComponents/connectivity/connectivityBrowser/connectivityBrowser.component.ts b/src/atlasComponents/connectivity/connectivityBrowser/connectivityBrowser.component.ts index fa717adcaecc515b4be8fb3f85114872d1231bc7..ffc6727efafb6da3a637f7fd0f5755fedf9a510a 100644 --- a/src/atlasComponents/connectivity/connectivityBrowser/connectivityBrowser.component.ts +++ b/src/atlasComponents/connectivity/connectivityBrowser/connectivityBrowser.component.ts @@ -106,6 +106,9 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe this.atlasId = val.context.atlas['@id'] this.parcellationId = val.context.parcellation['@id'] + this.setConnectivityUrl() + this.setProfileLoadUrl() + // TODO may not be necessary this.changeDetectionRef.detectChanges() } @@ -153,7 +156,7 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe public fullConnectivityLoadUrl: string ngOnInit(): void { - this.connectivityUrl = `${this.siibraApiUrl}/atlases/${encodeURIComponent(this.atlasId)}/parcellations/${encodeURIComponent(this.parcellationId)}/regions/${encodeURIComponent(this.regionId || this.regionName)}/features/ConnectivityProfile` + this.setConnectivityUrl() this.httpClient.get<[]>(this.connectivityUrl).subscribe(res => { this.datasetList = res @@ -286,6 +289,16 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe this.subscriptions.forEach(s => s.unsubscribe()) } + private setConnectivityUrl() { + this.connectivityUrl = `${this.siibraApiUrl}/atlases/${encodeURIComponent(this.atlasId)}/parcellations/${encodeURIComponent(this.parcellationId)}/regions/${encodeURIComponent(this.regionId || this.regionName)}/features/ConnectivityProfile` + } + + private setProfileLoadUrl() { + const url = `${this.connectivityUrl}/${encodeURIComponent(this.selectedDataset)}` + this.connectivityLoadUrl.emit(url) + this.loadUrl = url + } + clearViewer() { this.store$.dispatch( ngViewerActionClearView({ @@ -310,9 +323,7 @@ export class ConnectivityBrowserComponent implements OnInit, AfterViewInit, OnDe this.selectedDatasetKgSchema = foundDataset?.kgschema || null } if (this.datasetList.length && this.selectedDataset) { - const url = `${this.connectivityUrl}/${encodeURIComponent(this.selectedDataset)}` - this.connectivityLoadUrl.emit(url) - this.loadUrl = url + this.setProfileLoadUrl() this.fullConnectivityLoadUrl = `${this.siibraApiUrl}/atlases/${encodeURIComponent(this.atlasId)}/parcellations/${encodeURIComponent(this.parcellationId)}/features/ConnectivityMatrix/${encodeURIComponent(this.selectedDataset)}` } diff --git a/webpack/webpack.staticassets.js b/webpack/webpack.staticassets.js index ac4863ef597ffee8258951de6f89031375bfa277..a5d7ef3eeb12982fcb10716bf747027327e11e1b 100644 --- a/webpack/webpack.staticassets.js +++ b/webpack/webpack.staticassets.js @@ -59,15 +59,15 @@ module.exports = { }), new webpack.DefinePlugin({ - VERSION: process.env.VERSION - ? JSON.stringify(process.env.VERSION) + VERSION: process.env.VERSION + ? JSON.stringify(process.env.VERSION) : process.env.GIT_HASH ? JSON.stringify(process.env.GIT_HASH) : JSON.stringify('unspecificied hash'), PRODUCTION: !!process.env.PRODUCTION, BACKEND_URL: (process.env.BACKEND_URL && JSON.stringify(process.env.BACKEND_URL)) || 'null', DATASET_PREVIEW_URL: JSON.stringify(process.env.DATASET_PREVIEW_URL || 'https://hbp-kg-dataset-previewer.apps.hbp.eu/v2'), - BS_REST_URL: JSON.stringify(process.env.BS_REST_URL || 'https://siibra-api-tmpxgcustom.apps-dev.hbp.eu/v1_0'), + BS_REST_URL: JSON.stringify(process.env.BS_REST_URL || 'https://siibra-api-latest.apps-dev.hbp.eu/v1_0'), SPATIAL_TRANSFORM_BACKEND: JSON.stringify(process.env.SPATIAL_TRANSFORM_BACKEND || 'https://hbp-spatial-backend.apps.hbp.eu'), MATOMO_URL: JSON.stringify(process.env.MATOMO_URL || null), MATOMO_ID: JSON.stringify(process.env.MATOMO_ID || null), @@ -84,4 +84,4 @@ module.exports = { '.scss' ] } -} \ No newline at end of file +}