Browse Source

refactor: remove disabled binding from portfolio filter form and streamline tag control logic

pull/5618/head
Germán Martín 3 weeks ago
parent
commit
8be4f3c693
  1. 1
      libs/ui/src/lib/assistant/assistant.html
  2. 5
      libs/ui/src/lib/portfolio-filter-form/portfolio-filter-form.component.ts

1
libs/ui/src/lib/assistant/assistant.html

@ -185,7 +185,6 @@
#portfolioFilterForm
[accounts]="user?.accounts"
[assetClasses]="assetClasses"
[disabled]="!hasPermissionToChangeFilters"
[formControl]="portfolioFilterFormControl"
[holdings]="holdings"
[tags]="tags"

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

@ -124,8 +124,11 @@ export class GfPortfolioFilterFormComponent
this.filterForm.enable({ emitEvent: false });
}
const tagControl = this.filterForm.get('tag');
if (this.tags.length === 0) {
this.filterForm.get('tag')?.disable({ emitEvent: false });
tagControl?.disable({ emitEvent: false });
} else if (!this.disabled) {
tagControl?.enable({ emitEvent: false });
}
this.changeDetectorRef.markForCheck();

Loading…
Cancel
Save