Skip to content
Snippets Groups Projects
Unverified Commit c2a9fd93 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #1378 from FZJ-INM1-BDA/fix_ptAssignment

fix: point assignment region selectable
parents 7e5c72c6 2285d0d5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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>
......
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([
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment