Skip to content

Commit

Permalink
Fix/responses suggestions filter fine tune (#4356)
Browse files Browse the repository at this point in the history
- [x] Bold answered categories
- [x] Sort tooltip
- [x] Disable next pagination button  

closes #4351
  • Loading branch information
damianpumar committed Nov 29, 2023
1 parent 933f96a commit 5f96959
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
class="pagination__button"
ref="nextButton"
@click="onClickNext"
:disabled="isLastPage"
:title="
$platform.isMac
? $t('shortcuts.pagination.go_to_next_record_mac')
Expand Down Expand Up @@ -52,10 +53,13 @@ export default {
},
},
computed: {
// TODO: Move to PageCriteria to support those computed
isFirstPage() {
return this.currentPage === 1;
},
// TODO: Do PageCriteria to support this
isLastPage() {
return this.currentPage === this.items;
},
totalPages() {
return Math.ceil(this.items / this.itemsPerPage);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<BaseButton
@on-click="selectCategory(category)"
class="category__item"
:class="category.isAnswered ? 'category__item--selected' : null"
:disabled="!category.canFilter"
>
<span v-if="!!category.title" v-text="category.title" />
Expand Down Expand Up @@ -77,6 +78,9 @@ export default {
justify-content: space-between;
border-radius: $border-radius;
font-weight: 400;
&--selected {
font-weight: 600;
}
span {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<li
v-for="category in getCategoriesByGroup(group)"
:key="category.name"
:title="category.tooltip"
>
<BaseButton
:disabled="!category.canSort"
Expand Down
8 changes: 8 additions & 0 deletions frontend/v1/domain/entities/sort/SortList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ abstract class Sort {
get canSort(): boolean {
return true;
}

get tooltip() {
return this.title;
}
}

class MetadataSort extends Sort {
Expand Down Expand Up @@ -66,6 +70,10 @@ class SuggestionScoreSort extends Sort {
get title() {
return this.question.name;
}

get tooltip() {
return this.question.title;
}
}

class RecordSort extends Sort {
Expand Down

0 comments on commit 5f96959

Please sign in to comment.