diff --git a/docs/releases/v2.12.2.md b/docs/releases/v2.12.2.md index 8043ff60944528957119ef01c3299f31e352be08..e232505af83b9698261e761af4e89fdccc42f7cc 100644 --- a/docs/releases/v2.12.2.md +++ b/docs/releases/v2.12.2.md @@ -5,3 +5,4 @@ - fixes screenshot in fsaverage - on hover region label in fsaverage now display properly - fixes annotation mode (export annotations, annotations fail to render in viewer on startup (via shared link, local storage etc)) +- fixes an issue where region definition in full assignment table can also be clicked to select the region diff --git a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.html b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.html index 59694f74a9f84f067a93a56eb0f0d9988895d8e1..f031edbf5a99879f0041c02a545f234d0b4cd71a 100644 --- a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.html +++ b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.html @@ -58,15 +58,31 @@ #comphTableSort="matSort" matSortActive="map value" matSortDirection="desc"> - <ng-container *ngFor="let column of columns$ | async" - [matColumnDef]="column"> + + <ng-container matColumnDef="region"> <th mat-header-cell *matHeaderCellDef mat-sort-header> - {{ column }} + region </th> <td mat-cell *matCellDef="let element"> - {{ element[column] | prettyPresent }} + <button mat-button (click)="selectRegion(element['region'], $event)"> + {{ element['region'].name }} + </button> </td> </ng-container> + + <ng-template ngFor [ngForOf]="columns$ | async" let-column> + <ng-template [ngIf]="column !== 'region'"> + <ng-container [matColumnDef]="column"> + <th mat-header-cell *matHeaderCellDef mat-sort-header> + {{ column }} + </th> + <td mat-cell *matCellDef="let element"> + {{ element[column] | prettyPresent }} + </td> + </ng-container> + </ng-template> + </ng-template> + <tr mat-header-row *matHeaderRowDef="columns$ | async"></tr> <tr mat-row *matRowDef="let row; columns: columns$ | async;"></tr> diff --git a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts index 64b0ebdb1a71bdbf9baf0d0d4c687df6afa71cae..00ee69f552743fe8cd9a771dbfb44e6cd00ced89 100644 --- a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts +++ b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnDestroy, Output, TemplateRef, EventEmitter } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { BehaviorSubject, EMPTY, Observable, Subscription, combineLatest, concat, of } from 'rxjs'; import { catchError, map, shareReplay, switchMap, tap } from 'rxjs/operators'; import { SAPI, EXPECTED_SIIBRA_API_VERSION } from 'src/atlasComponents/sapi/sapi.service'; @@ -114,8 +114,12 @@ export class PointAssignmentComponent implements OnDestroy { constructor(private sapi: SAPI, private dialog: MatDialog) {} + #dialogRef: MatDialogRef<unknown> openDialog(tmpl: TemplateRef<unknown>){ - this.dialog.open(tmpl) + this.#dialogRef = this.dialog.open(tmpl) + this.#dialogRef.afterClosed().subscribe(() => { + this.#dialogRef = null + }) } #sub: Subscription[] = [] @@ -125,6 +129,9 @@ export class PointAssignmentComponent implements OnDestroy { async selectRegion(region: PathReturn<"/regions/{region_id}">, event: MouseEvent){ const sxplrReg = await translateV3Entities.translateRegion(region) this.clickOnRegion.emit({ target: sxplrReg, event }) + if (this.#dialogRef) { + this.#dialogRef.close() + } } zipfileConfig$: Observable<TZipFileConfig[]> = combineLatest([