Browse Source

Filter tags by isUsed in GfAssistantComponent

pull/3859/head
Matej Gerek 11 months ago
committed by Thomas Kaul
parent
commit
88209ca60f
  1. 2
      libs/common/src/lib/interfaces/user.interface.ts
  2. 10
      libs/ui/src/lib/assistant/assistant.component.ts

2
libs/common/src/lib/interfaces/user.interface.ts

@ -23,5 +23,5 @@ export interface User {
offer: SubscriptionOffer; offer: SubscriptionOffer;
type: SubscriptionType; type: SubscriptionType;
}; };
tags: Tag[]; tags: (Tag & { isUsed: boolean })[];
} }

10
libs/ui/src/lib/assistant/assistant.component.ts

@ -269,6 +269,16 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
this.filterForm.enable({ emitEvent: false }); this.filterForm.enable({ emitEvent: false });
} }
this.tags = this.user?.tags
.filter((tag) => tag.isUsed)
.map(({ id, name }) => {
return {
id,
label: translate(name),
type: 'TAG'
};
});
this.filterForm.setValue( this.filterForm.setValue(
{ {
account: this.user?.settings?.['filters.accounts']?.[0] ?? null, account: this.user?.settings?.['filters.accounts']?.[0] ?? null,

Loading…
Cancel
Save