Skip to content

Commit 86ed9a7

Browse files
committed
Improving the filtering for task-management.
1 parent c7ad4de commit 86ed9a7

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-management/components/task-management-filters/task-management-filters.component.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@
2222
>
2323
</mtx-select>
2424
</mat-form-field>
25-
<button
26-
mat-icon-button
27-
id="updateEntityList"
28-
(click)="onShowEditEntityListModal()"
29-
matTooltip="{{ 'Edit list of areas for task management' | translate }}"
30-
>
31-
<mat-icon>list</mat-icon>
32-
</button>
25+
<ng-container *ngIf="propertyIsSelected">
26+
<div class="p-2">
27+
<button
28+
mat-raised-button
29+
color="accent"
30+
id="updateEntityList"
31+
(click)="onShowEditEntityListModal()"
32+
matTooltip="{{ 'Edit list of areas for task management' | translate }}"
33+
>
34+
{{ 'Areas' | translate }}
35+
<!-- <mat-icon>list</mat-icon>-->
36+
</button>
37+
</div>
38+
</ng-container>
3339
</div>
3440
<div class="d-flex flex-row need-wrapper">
3541
<mat-form-field>

eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-management/components/task-management-filters/task-management-filters.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export class TaskManagementFiltersComponent implements OnInit, OnDestroy {
5959
propertyUpdateSub$: Subscription;
6060
getEntitySelectableGroupSub$: Subscription;
6161
updateEntitySelectableGroupSub$: Subscription;
62+
propertyIsSelected: boolean = false;
6263

6364
selectFiltersSub$: Subscription;
6465
propertyIdValueChangesSub$: Subscription;
@@ -110,11 +111,11 @@ export class TaskManagementFiltersComponent implements OnInit, OnDestroy {
110111
}),
111112
date: new FormGroup({
112113
dateFrom: new FormControl({
113-
value: new Date(),
114+
value: null,
114115
disabled: !filters.propertyId,
115116
}),
116117
dateTo: new FormControl({
117-
value: new Date(),
118+
value: null,
118119
disabled: !filters.propertyId,
119120
}),
120121
}),
@@ -135,14 +136,17 @@ export class TaskManagementFiltersComponent implements OnInit, OnDestroy {
135136
if (this.taskManagementStateService.getCurrentPropertyId() !== value) {
136137
if (value !== -1) {
137138
this.getPropertyAreas(value);
139+
this.propertyIsSelected = true;
140+
} else {
141+
this.propertyIsSelected = false;
138142
}
139143
this.getSites(value);
140144
this.taskManagementStateService.updatePropertyId(value);
141145
this.filtersForm.patchValue({
142146
areaName: null,
143147
createdBy: null,
144148
lastAssignedTo: null,
145-
statuses: [1,3,4],
149+
statuses: [],
146150
date: {
147151
dateTo: null,
148152
dateFrom: null,

0 commit comments

Comments
 (0)