From 15228f03337d8f39e058c00a8ad7f3296b14b89b Mon Sep 17 00:00:00 2001 From: yelinz Date: Wed, 21 Jun 2023 13:51:05 +0200 Subject: [PATCH] fix(ember): uniform filter order for work item and case --- .../ui/components/case-filters/template.hbs | 116 +++++------ .../components/work-item-filters/template.hbs | 180 +++++++++--------- ember/app/utils/filters-component.js | 5 + 3 files changed, 154 insertions(+), 147 deletions(-) diff --git a/ember/app/ui/components/case-filters/template.hbs b/ember/app/ui/components/case-filters/template.hbs index 300155216..81e326cf8 100644 --- a/ember/app/ui/components/case-filters/template.hbs +++ b/ember/app/ui/components/case-filters/template.hbs @@ -28,65 +28,65 @@ @resetFilters={{@resetFilters}} class="uk-width-auto" > - - - - {{#if (can "filter access case")}} - +
+ - {{/if}} - - - - + + {{#if (can "filter access case")}} + + {{/if}} + +
+
+ + + +
diff --git a/ember/app/ui/components/work-item-filters/template.hbs b/ember/app/ui/components/work-item-filters/template.hbs index f8575f757..6b0608c58 100644 --- a/ember/app/ui/components/work-item-filters/template.hbs +++ b/ember/app/ui/components/work-item-filters/template.hbs @@ -26,11 +26,6 @@ @invertedIcon={{@invertedFilters.taskTypes}} @onChange={{perform @updateFilter "taskTypes"}} /> - + - - - - - - - - - - - + +
+ + + +
+
+ + + + +
+
+ + + +
diff --git a/ember/app/utils/filters-component.js b/ember/app/utils/filters-component.js index af8e66e7d..5b552c835 100644 --- a/ember/app/utils/filters-component.js +++ b/ember/app/utils/filters-component.js @@ -41,6 +41,11 @@ export default class FiltersComponent extends Component { } const question = this.questionOptions.value.filterBy("slug", slug)[0]; + + if (!question) { + return []; + } + const options = question[question.__typename].edges; return options.map((edge) => ({