Skip to content

Commit 9d7ce6b

Browse files
committed
feat(frontend/projects): added checkbox for hiding archived tasks
1 parent 14c904a commit 9d7ce6b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

frontend/app/projects/controller.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class ProjectsController extends Controller {
1818
@tracked selectedCustomer;
1919
@tracked selectedProject;
2020
@tracked selectedTask;
21+
@tracked hideArchivedTasks = false;
2122

2223
@lastValue("fetchProjectsByUser") projects;
2324

frontend/app/projects/template.hbs

+8
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
>Add Task</button>
102102
</span>
103103
</h3>
104+
<SyCheckbox
105+
data-test-show-archived
106+
@checked={{this.hideArchivedTasks}}
107+
@value={{this.hideArchivedTasks}}
108+
@onChange={{fn (mut this.hideArchivedTasks)}}
109+
>Hide Archived Tasks</SyCheckbox>
104110
<ScrollContainer>
105111
<table
106112
class="table table--striped table--projects"
@@ -128,6 +134,7 @@
128134
</thead>
129135
<tbody>
130136
{{#each this.tasks as |task|}}
137+
{{#unless (and this.hideArchivedTasks task.archived)}}
131138
<tr
132139
class="pointer {{if (eq this.selectedTask task) 'selected'}}"
133140
{{! template-lint-disable }}
@@ -158,6 +165,7 @@
158165
@checked={{task.archived}}
159166
/></td>
160167
</tr>
168+
{{/unless}}
161169
{{/each}}
162170
</tbody>
163171
</table>

0 commit comments

Comments
 (0)