Skip to content

Commit

Permalink
Merge pull request #8035 from stopfstedt/5621_no_nuns_no_nuns_none
Browse files Browse the repository at this point in the history
don't show the reports table if there are no reports.
  • Loading branch information
dartajax authored Aug 5, 2024
2 parents d45be75 + 20da3e1 commit 5a01621
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
16 changes: 9 additions & 7 deletions packages/frontend/app/components/reports/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@
{{else}}
<div class="list">
{{#if (and this.subjectReportObjects this.subjectReportObjects.isResolved)}}
<Reports::Table
@decoratedReports={{this.filteredReports}}
@query={{@titleFilter}}
@sortBy={{@sortReportsBy}}
@setSortBy={{@setSortReportsBy}}
@remove={{perform this.removeReport}}
/>
{{#if this.reportsCount}}
<Reports::Table
@decoratedReports={{this.filteredReports}}
@query={{@titleFilter}}
@sortBy={{@sortReportsBy}}
@setSortBy={{@setSortReportsBy}}
@remove={{perform this.removeReport}}
/>
{{/if}}
{{else}}
<Reports::ListLoading @count={{this.reportsCount}} />
{{/if}}
Expand Down
8 changes: 1 addition & 7 deletions packages/frontend/app/components/reports/table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
</td>
</tr>
{{/if}}
{{else}}
<tr data-test-empty-list>
<td>
{{if @query (t "general.noResultsFound") (t "general.none")}}
</td>
</tr>
{{/each}}
</tbody>
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module('Integration | Component | reports/list', function (hooks) {
@titleFilter=""
@changeTitleFilter={{(noop)}}
/>`);
assert.ok(component.table.emptyListRow.isVisible);
assert.notOk(component.table.isVisible);
a11yAudit(this.element);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module('Integration | Component | reports/root', function (hooks) {
@titleFilter=""
@changeTitleFilter={{(noop)}}
/>`);
assert.ok(component.list.table.emptyListRow.isVisible);
assert.notOk(component.list.table.isVisible);
a11yAudit(this.element);
});

Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/tests/pages/components/reports/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import tableRow from './table-row';
const definition = {
scope: '[data-test-reports-table]',
reports: collection('[data-test-reports-table-row]', tableRow),
emptyListRow: {
scope: '[data-test-empty-list]',
},
sortByTitle: clickable('button', { scope: '[data-test-reports-headings] th:nth-of-type(1)' }),
confirmRemoval: clickable('[data-test-reports] .confirm-removal button.remove'),
isSortedByTitleAscending: hasClass(
Expand Down

0 comments on commit 5a01621

Please sign in to comment.