Browse Source

feat(lib): change tags to input signal

pull/6404/head
Kenrick Tandrian 3 days ago
parent
commit
78ededd098
  1. 2
      libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.html
  2. 4
      libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts

2
libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.html

@ -53,7 +53,7 @@
<mat-label i18n>Tag</mat-label>
<mat-select formControlName="tag">
<mat-option [value]="null" />
@for (tag of tags; track tag.id) {
@for (tag of tags(); track tag.id) {
<mat-option [value]="tag.id">{{ tag.label }}</mat-option>
}
</mat-select>

4
libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts

@ -57,12 +57,12 @@ import { PortfolioFilterFormValue } from './interfaces';
export class GfPortfolioFilterFormComponent
implements ControlValueAccessor, OnInit, OnChanges
{
@Input() tags: Filter[] = [];
@Input() disabled = false;
public readonly accounts = input<AccountWithPlatform[]>([]);
public readonly assetClasses = input<Filter[]>([]);
public readonly holdings = input<PortfolioPosition[]>([]);
public readonly tags = input<Filter[]>([]);
public filterForm: FormGroup<{
account: FormControl<string | null>;
@ -123,7 +123,7 @@ export class GfPortfolioFilterFormComponent
const tagControl = this.filterForm.get('tag');
if (this.tags.length === 0) {
if (this.tags().length === 0) {
tagControl?.disable({ emitEvent: false });
} else if (!this.disabled) {
tagControl?.enable({ emitEvent: false });

Loading…
Cancel
Save