mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 01:32:12 +00:00
feat: Ionic v6 breadcrumbs in catalog module
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user