Skip to content

Commit 6621472

Browse files
committed
feat(all-tasks): add PrimeNG per-column table filters with status dropdown matching
1 parent 6468f56 commit 6621472

2 files changed

Lines changed: 49 additions & 5 deletions

File tree

src/app/features/task-item/components/task-item-list/task-item-list.component.html

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,49 @@ <h2>All Tasks</h2>
8989

9090
<ng-template pTemplate="header">
9191
<tr>
92-
<th style="min-width: 17rem;">Task</th>
93-
<th style="min-width: 8rem;">Status</th>
94-
<th style="min-width: 8rem;">Due Date</th>
95-
<th style="min-width: 12rem;">Assignee</th>
96-
<th style="min-width: 10rem;">Last Updated</th>
92+
<th style="min-width: 17rem;">
93+
<div class="column-head">
94+
Task
95+
<p-columnFilter type="text" field="title" display="menu"></p-columnFilter>
96+
</div>
97+
</th>
98+
<th style="min-width: 8rem;">
99+
<div class="column-head">
100+
Status
101+
<p-columnFilter field="status" matchMode="equals" display="menu" [showMatchModes]="false" [showOperator]="false" [showAddButton]="false">
102+
<ng-template pTemplate="filter" let-value let-filter="filterCallback">
103+
<p-dropdown
104+
[options]="statusOptions"
105+
optionLabel="label"
106+
optionValue="value"
107+
[ngModel]="value"
108+
[appendTo]="'body'"
109+
[showClear]="true"
110+
placeholder="Status"
111+
(onChange)="filter($event.value)">
112+
</p-dropdown>
113+
</ng-template>
114+
</p-columnFilter>
115+
</div>
116+
</th>
117+
<th style="min-width: 8rem;">
118+
<div class="column-head">
119+
Due Date
120+
<p-columnFilter type="text" field="dueDate" display="menu"></p-columnFilter>
121+
</div>
122+
</th>
123+
<th style="min-width: 12rem;">
124+
<div class="column-head">
125+
Assignee
126+
<p-columnFilter type="text" field="assignedUserName" display="menu"></p-columnFilter>
127+
</div>
128+
</th>
129+
<th style="min-width: 10rem;">
130+
<div class="column-head">
131+
Last Updated
132+
<p-columnFilter type="text" field="lastModifiedAt" display="menu"></p-columnFilter>
133+
</div>
134+
</th>
97135
<th style="min-width: 16rem;">Actions</th>
98136
</tr>
99137
</ng-template>

src/app/features/task-item/components/task-item-list/task-item-list.component.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@
146146
flex-wrap: wrap;
147147
}
148148

149+
.column-head {
150+
display: inline-flex;
151+
align-items: center;
152+
gap: 0.45rem;
153+
}
154+
149155
.table-search {
150156
margin-left: auto;
151157
position: relative;

0 commit comments

Comments
 (0)