plan filters fixes (in progress)

This commit is contained in:
CITE\spapacharalampous 2024-08-29 12:20:32 +03:00
parent 3dcc415d5e
commit 1515a761a5
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
<app-navigation-breadcrumb />
</div>
<div *ngIf="!versionsModeEnabled && hasLoadedListingItems && (hasListingItems || hasFilters) && !isPublic" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="listingItems.length > 2 ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="!hasFilters" matBadgePosition="before">
<button mat-raised-button class="p-0" [matBadge]="filtersCount" [matBadgeHidden]="filtersCount === 0" matBadgePosition="before">
<mat-icon class="mr-4 filter-icon">filter_alt</mat-icon>
</button>
</div>

View File

@ -224,7 +224,6 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
this.breadcrumbService.addIdResolvedValue(this.groupId.toString(), latestVersionPlan.label);
}
this.hasLoadedListingItems = true;
if (!result) { return []; }
this.totalCount = result.count;
if (this.lookup?.page?.offset === 0) this.listingItems = [];
@ -381,6 +380,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
let lookup: PlanLookup = JSON.parse(params['lookup']);
if (!lookup) return this.initializeLookup();
lookup.like = lookup.like ?? null;
const queryOffset = 0;
const querySize = (lookup.page?.offset ?? 0) + this.pageSize;
@ -467,6 +467,7 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
private _buildFormFromLookup(lookup: PlanLookup): UntypedFormGroup {
return (new UntypedFormBuilder()).group({
like: lookup.like ?? null,
status: [lookup.statuses?.length > 0 ? lookup.statuses[0] : null],
viewOnlyTenant: [lookup.tenantSubQuery?.codes?.length > 0 ? true : false],
descriptionTemplates: lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds ? [lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds] : [],