Skip to content
2 changes: 1 addition & 1 deletion api/resources/translations/messages-en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ tasks.group.leave = Are you sure you want to leave this page? You will no longer
tasks.group.completed = All household tasks completed
tasks.group.title = Other household tasks
tasks.sidebar.filter.title = Filter
tasks.sidebar.filter.reset = Clear all filters
tasks.sidebar.filter.reset = Reset
tasks.sidebar.filter.submit = Apply
tasks.sidebar.filter.overdue = Due date
tasks.sidebar.filter.overdue.overdue = Overdue
Expand Down
5 changes: 3 additions & 2 deletions tests/page-objects/default/tasks/tasks.wdio.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ const filterByOverdue = async (overdueOption) => {
await sidebarFilterSelectors.overdueAccordionBody().waitForDisplayed();
}

const option = sidebarFilterSelectors.overdueAccordionBody().$(`a*=${overdueOption}`);
await option.click();
const option = sidebarFilterSelectors.overdueAccordionBody().$(`label*=${overdueOption}`);
const radio = await option.$('input[type="radio"]');
await radio.click();
};

const filterByTaskType = async (taskType) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
*ngFor="let status of statuses"
[class.selected]="filter?.selected.has(status)"
[class.disabled]="disabled">
<a role="menuitem" tabindex="-1" [attr.data-value]="status" (click)="!disabled && filter?.toggle(status)">
<label style="font-weight: normal;">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this fix! I don't see any inline styles in any of the cht-core/webapp/src/ts/* files - can you please move this change to the appropriate file in cht-core/webapp/src/css/*?

Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the font-weight: normal style from inline HTML to the label block in webapp/src/css/sidebar-filter.less as requested.

<input
type="radio"
name="overdue-filter"
[value]="status"
[checked]="filter?.selected.has(status)"
[disabled]="disabled"
(change)="toggle(status)"
/>
{{ 'tasks.sidebar.filter.overdue.' + status | translate }}
</a>
</label>
</li>
</ul>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ export class OverdueFilterComponent {
if (this.disabled) {
return;
}

this.filter.clear();
}

toggle(status: string) {
if (this.filter.selected.has(status)) {
this.filter.clear();
} else {
this.filter.clear();
this.filter.selected.add(status);
this.filter.apply();
}
}

countSelected() {
return this.filter?.countSelected();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
</mat-expansion-panel>
</mat-accordion>
</div>

<div class="sidebar-footer">
<button type="button" class="btn btn-primary" (click)="toggleSidebarFilter()">
{{ 'tasks.sidebar.filter.submit' | translate }}
</button>
</div>

</div>
</section>

Expand All @@ -88,4 +95,4 @@
<span>{{ numSelected | translate }}</span>
<span class="fa fa-times" (click)="clearFilters(filters); $event.stopPropagation();"></span>
</div>
</ng-template>
</ng-template>