diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05d2613dbfc9e43412161462327e9e803a9e38b6..e73a2d6ed7472217f7a527270ff3e89330a02528 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,8 +34,14 @@ jobs: release_name: Release ${{ needs.check-version.outputs.package-version }} draft: false prerelease: false - - name: Build && zip assets - run: npm run build && zip -r siibra-explorer-${{ needs.check-version.outputs.package-version }}.zip ./dist + + - name: Checkout + uses: actions/checkout@v1 + - name: Build & zip assets + run: | + STRICT_LOCAL=true node ./src/environments/parseEnv.js + npm run build + zip -r siibra-explorer-${{ needs.check-version.outputs.package-version }}.zip ./dist - name: Attach built as release asset id: upload-release-asset uses: actions/upload-release-asset@v1 diff --git a/docs/releases/v2.9.1.md b/docs/releases/v2.9.1.md index 6197f565bb1a5ff3c6ec14de02e52b9aefbb64ed..ef05acf12b83c8394dad0f21f0ec6a0473a68cf9 100644 --- a/docs/releases/v2.9.1.md +++ b/docs/releases/v2.9.1.md @@ -1,5 +1,12 @@ # v2.9.1 +## Feature + +- On clicking the connectivity diagram, the viewer navigates to the connected region + +## Bugfix + +- Fix connectivity bug on cohort filter ## Behind the scenes - Fixed some CSP issues diff --git a/src/atlasComponents/sapiViews/core/region/region/rich/region.rich.template.html b/src/atlasComponents/sapiViews/core/region/region/rich/region.rich.template.html index 18f77fc1b93f298b44f0a0abca283971145655fe..188ba25fa6fa921b2a4192ccf6b74c18fb240723 100644 --- a/src/atlasComponents/sapiViews/core/region/region/rich/region.rich.template.html +++ b/src/atlasComponents/sapiViews/core/region/region/rich/region.rich.template.html @@ -117,6 +117,7 @@ [region]="region" [sxplr-sapiviews-features-connectivity-browser-atlas]="atlas" [sxplr-sapiviews-features-connectivity-browser-parcellation]="parcellation" + [sxplr-sapiviews-features-connectivity-browser-space]="template" [accordionExpanded]="expandedPanel === CONST.CONNECTIVITY" [types]="hasConnectivityDirective.availableModalities" > diff --git a/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.component.ts b/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.component.ts index 579e34570f4bb3d2abf69fe7af7d60ea9eefe433..cd7f4d03202a3967519ef14527b8bd29ba110ef6 100644 --- a/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.component.ts +++ b/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.component.ts @@ -10,7 +10,7 @@ import { } from "src/atlasComponents/sapi"; import { atlasAppearance, atlasSelection } from "src/state"; import {PARSE_TYPEDARRAY} from "src/atlasComponents/sapi/sapi.service"; -import {SapiModalityModel, SapiParcellationFeatureMatrixModel, SapiParcellationFeatureModel} from "src/atlasComponents/sapi/type"; +import {SapiModalityModel, SapiParcellationFeatureMatrixModel, SapiParcellationFeatureModel, SapiSpaceModel} from "src/atlasComponents/sapi/type"; import { of } from "rxjs"; import {CustomLayer} from "src/state/atlasAppearance"; import { HttpClient } from "@angular/common/http"; @@ -25,6 +25,9 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy { @Input('sxplr-sapiviews-features-connectivity-browser-atlas') atlas: SapiAtlasModel + @Input('sxplr-sapiviews-features-connectivity-browser-space') + space: SapiSpaceModel + @Input('sxplr-sapiviews-features-connectivity-browser-parcellation') parcellation: SapiParcellationModel @@ -140,17 +143,9 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy { ) this.subscriptions.push( - fromEvent(this.connectivityComponentElement?.nativeElement, 'customToolEvent', {capture: true}) - .subscribe((e: CustomEvent) => { - if (e.detail.name === 'export csv') { - // ToDo Fix in future to use component - const a = document.querySelector('hbp-connectivity-matrix-row'); - (a as any).downloadCSV() - } - }), fromEvent(this.connectivityComponentElement?.nativeElement, 'connectedRegionClicked', {capture: true}) .subscribe((e: CustomEvent) => { - this.navigateToRegion(this.getRegionWithName(e.detail.name)) + this.navigateToRegion(e.detail.name) }), ) } @@ -351,17 +346,21 @@ export class ConnectivityBrowserComponent implements AfterViewInit, OnDestroy { } //ToDo bestViewPoint is null for the most cases - navigateToRegion(region: SapiRegionModel) { - const regionCentroid = this.region.hasAnnotation?.bestViewPoint?.coordinates - if (regionCentroid) - this.store$.dispatch( - atlasSelection.actions.navigateTo({ - navigation: { - position: regionCentroid.map(v => v.value*1e6), - }, - animation: true - }) - ) + navigateToRegion(regionName: string) { + this.sapi.getRegion(this.atlas["@id"], this.parcellation["@id"], regionName) + .getDetail(this.space["@id"]) + .subscribe(r => { + const regionCentroid = r.hasAnnotation?.bestViewPoint?.coordinates + if (regionCentroid) + this.store$.dispatch( + atlasSelection.actions.navigateTo({ + navigation: { + position: regionCentroid.map(v => v.value*1e6), + }, + animation: true + }) + ) + }) } getRegionWithName(region: string) { diff --git a/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.template.html b/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.template.html index df2a233d6349bfe8de3b4e06ebca492e2d4695fa..17c00557e594cd5edbc564bc2dda2ef99d41b58b 100644 --- a/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.template.html +++ b/src/atlasComponents/sapiViews/features/connectivity/connectivityBrowser/connectivityBrowser.template.html @@ -18,12 +18,13 @@ </mat-select> </mat-form-field> - <mat-form-field *ngIf="!fetching && selectedType" class="flex-grow-1 flex-shrink-1 w-100"> + <mat-form-field *ngIf="selectedType" class="flex-grow-1 flex-shrink-1 w-100"> <mat-label> Cohort </mat-label> <mat-select + [disabled]="fetching" [value]="selectedCohort" (selectionChange)="selectCohort($event.value)"> <mat-option @@ -96,10 +97,10 @@ <i class="fas fa-download mr-2"></i> <span>Export</span> </button> - <button *ngIf="selectedDataset" iav-stop="mousedown click" class="icons" mat-icon-button sxplr-dialog [sxplr-dialog-size]="null" + <button *ngIf="selectedDataset && selectedDataset['@id']" iav-stop="mousedown click" class="icons" mat-icon-button sxplr-dialog [sxplr-dialog-size]="null" [sxplr-dialog-data]="{ title: selectedDataset?.name, - descMd: selectedDataset?.description + '' + selectedDataset?.authors.join(), + descMd: selectedDataset?.description + ' ' + (selectedDataset?.authors? selectedDataset?.authors.join() : ''), actions: selectedDataset | connectivityDoiPipe }"> <i class="fas fa-info"></i> @@ -108,8 +109,8 @@ <hbp-connectivity-matrix-row #connectivityComponent - [style.visibility]="selectedCohort && (selectedSubjectDatasetIndex >= 0 || !averageDisabled)? 'visible' : 'hidden'" - *ngIf="regionName && !fetching && !noConnectivityForRegion" + [style.visibility]="regionName && !fetching && !noConnectivityForRegion && selectedCohort + && (selectedSubjectDatasetIndex >= 0 || !averageDisabled)? 'visible' : 'hidden'" [region]="regionName + (regionHemisphere? ' - ' + regionHemisphere : '')" [connections]="connectionsString" show-export="true" hide-export-view="true"