From 8a65772bdd3f3414ee8cb2e016cfbb66cb284a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Mon, 17 Jul 2023 17:19:43 +0200 Subject: [PATCH] Update record list UI/UX --- .../components/Common/RecordListFilter.vue | 12 ++- .../components/PageBlocks/RecordListBase.vue | 90 ++++++++----------- 2 files changed, 46 insertions(+), 56 deletions(-) diff --git a/client/web/compose/src/components/Common/RecordListFilter.vue b/client/web/compose/src/components/Common/RecordListFilter.vue index c719c700f..0f4376e1a 100644 --- a/client/web/compose/src/components/Common/RecordListFilter.vue +++ b/client/web/compose/src/components/Common/RecordListFilter.vue @@ -4,11 +4,15 @@ :id="popoverTarget" :title="$t('recordList.filter.title')" :variant="variant" - :class="[inFilter ? 'text-primary' : 'text-secondary', buttonClass]" + class="d-flex align-items-center text-secondary d-print-none border-0 px-1 h-100" + :class="buttonClass" :style="buttonStyle" @click.stop > - + -
+
{{ field.label }}
-
- - + - - - - - -
+ + + + + +
@@ -1167,12 +1155,12 @@ export default { } }, - sorterStyle ({ key }, dir) { + isSortedBy ({ key }, dir) { const { sort = '' } = this.filter const sortedFields = (sort.includes(',') ? sort.split(',') : [sort]) - const isSorted = sortedFields.map(v => v.trim()).some(value => { + return sortedFields.map(v => v.trim()).some(value => { let valueDir = 'ASC' if (value.includes(' ')) { @@ -1182,8 +1170,6 @@ export default { return valueDir === dir && value === key }) - - return isSorted ? { color: 'black' } : {} }, handleShowDeleted () { @@ -1597,7 +1583,7 @@ export default { // Filter's out deleted records when filter.deleted is 2, and undeleted records when filter.deleted is 0 this.showingDeletedRecords ? this.filter.deleted = 2 : this.filter.deleted = 0 - await this.$ComposeAPI.recordList({ ...this.filter, moduleID, namespaceID, query, ...paginationOptions }) + return this.$ComposeAPI.recordList({ ...this.filter, moduleID, namespaceID, query, ...paginationOptions }) .then(({ set, filter }) => { const records = set.map(r => new compose.Record(r, this.recordListModule))