diff --git a/src/features/feature-view/feature-view.component.html b/src/features/feature-view/feature-view.component.html index 49b778dced8ae0ad0e111b9ded867d4d721318de..f213457ecc229d9aa0db1712d3f949c3b11e4ecb 100644 --- a/src/features/feature-view/feature-view.component.html +++ b/src/features/feature-view/feature-view.component.html @@ -22,7 +22,7 @@ <mat-card-subtitle class="sxplr-d-inline-flex sxplr-align-items-stretch"> <ng-template [ngIf]="feature.category"> <mat-icon class="sxplr-m-a" fontSet="fas" fontIcon="fa-database"></mat-icon> - <span class="sxplr-m-a"> + <span class="sxplr-m-a sxplr-pr-1"> <ng-template [ngIf]="feature.category !== 'Unknown category'" [ngIfElse]="fallbackTmpl"> {{ feature.category }} </ng-template> @@ -32,7 +32,17 @@ </span> </ng-template> - <mat-divider class="sxplr-pl-1" [vertical]="true"></mat-divider> + <ng-template [ngIf]="warnings$ | async" let-warnings> + <mat-divider [vertical]="true"></mat-divider> + <ng-template ngFor [ngForOf]="warnings" let-warning> + <button mat-icon-button + [matTooltip]="warning"> + <i class="fas fa-exclamation-triangle"></i> + </button> + </ng-template> + </ng-template> + + <mat-divider [vertical]="true"></mat-divider> <ng-template [ngIf]="busy$ | async"> <spinner-cmp></spinner-cmp> diff --git a/src/features/feature-view/feature-view.component.ts b/src/features/feature-view/feature-view.component.ts index b73f0e29cf4edc43b3a75e4385f9e264e2a3a683..400644f14c73fe60a0292c13ceb41916b96280c4 100644 --- a/src/features/feature-view/feature-view.component.ts +++ b/src/features/feature-view/feature-view.component.ts @@ -4,7 +4,7 @@ import { distinctUntilChanged, filter, map } from 'rxjs/operators'; import { SAPI } from 'src/atlasComponents/sapi/sapi.service'; import { Feature, TabularFeature, VoiFeature } from 'src/atlasComponents/sapi/sxplrTypes'; import { DARKTHEME } from 'src/util/injectionTokens'; -import { isTabularData, isVoiData } from "../guards" +import { isTabularData, isVoiData, notQuiteRight } from "../guards" type PolarPlotData = { receptor: { @@ -78,6 +78,8 @@ export class FeatureViewComponent implements OnChanges { }) ) + warnings$ = new Subject<string[]>() + constructor( private sapi: SAPI, @Inject(DARKTHEME) public darktheme$: Observable<boolean>, @@ -100,6 +102,10 @@ export class FeatureViewComponent implements OnChanges { this.voi$.next(val) } + this.warnings$.next( + notQuiteRight(val) + ) + this.#detailLinks.next((val.link || []).map(l => l.href)) }, diff --git a/src/features/guards.ts b/src/features/guards.ts index b258c66e7fa67ccc5f008eef071e1c215fc161d4..fefbc7a0bbc14d1a5baf042ec6283de30d6516ed 100644 --- a/src/features/guards.ts +++ b/src/features/guards.ts @@ -7,3 +7,12 @@ export function isTabularData(feature: unknown): feature is TabularFeature<numbe export function isVoiData(feature: unknown): feature is VoiFeature { return !!feature['bbox'] } + +export function notQuiteRight(feature: unknown): string[] { + if (feature['name'].includes("Cellular level 3D reconstructed volumes at 1µm resolution")) { + return [ + "This volume is currently not displayed correctly. We are working to restore the functionality." + ] + } + return [] +}