feat: Ionic v6 breadcrumbs in catalog module

This commit is contained in:
Thea Schöbl
2022-04-13 14:10:16 +00:00
parent 552911cfcf
commit 7b491ed3bb
66 changed files with 653 additions and 199 deletions

View File

@@ -15,7 +15,12 @@
import {Injectable, OnDestroy, Pipe, PipeTransform} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {isThing, SCThings, SCThingType} from '@openstapps/core';
import {
isThing,
SCThings,
SCThingType,
SCThingWithoutReferences,
} from '@openstapps/core';
import {Subscription} from 'rxjs';
import {ThingTranslateService} from './thing-translate.service';
import {get} from '../_helpers/collections/get';
@@ -30,7 +35,7 @@ export class ThingTranslatePipe implements PipeTransform, OnDestroy {
lastKey?: string;
lastThing: SCThings;
lastThing: SCThingWithoutReferences;
onLangChange: Subscription;
@@ -40,14 +45,14 @@ export class ThingTranslatePipe implements PipeTransform, OnDestroy {
private readonly thingTranslate: ThingTranslateService,
) {}
updateValue(key: string, thing: SCThings): void {
this.value = this.thingTranslate.get(thing, key);
updateValue(key: string, thing: SCThingWithoutReferences): void {
this.value = this.thingTranslate.get(thing as SCThings, key);
}
transform<T extends SCThings, P extends string[] | string | keyof T>(
query: P,
thing: T,
): P extends keyof T ? T[P] : P | unknown {
transform<
T extends SCThingWithoutReferences,
P extends string[] | string | keyof T,
>(query: P, thing: T): P extends keyof T ? T[P] : P | unknown {
if (typeof query !== 'string' || query.length <= 0) {
return query as never;
}