From 5dc767823532ace90aa627639e066e601fdfbb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Tue, 8 Oct 2024 13:23:20 +0200 Subject: [PATCH] Fix displaying checkboxes in record list filter UX --- .../web/compose/src/components/ModuleFields/Editor/Bool.vue | 2 +- .../web/compose/src/components/ModuleFields/Editor/base.vue | 4 ---- lib/vue/src/components/input/CInputRole.vue | 6 +++--- lib/vue/src/components/input/CInputSelect.vue | 4 +++- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/client/web/compose/src/components/ModuleFields/Editor/Bool.vue b/client/web/compose/src/components/ModuleFields/Editor/Bool.vue index 3b7dcc181..396f6a6e2 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/Bool.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/Bool.vue @@ -49,7 +49,7 @@
{{ description }} diff --git a/client/web/compose/src/components/ModuleFields/Editor/base.vue b/client/web/compose/src/components/ModuleFields/Editor/base.vue index 038eea038..ec3e7a1be 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/base.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/base.vue @@ -111,10 +111,6 @@ export default { }, label () { - if (this.valueOnly) { - return '' - } - return this.field.label || this.field.name }, diff --git a/lib/vue/src/components/input/CInputRole.vue b/lib/vue/src/components/input/CInputRole.vue index 60a5128a5..bc45cc48c 100644 --- a/lib/vue/src/components/input/CInputRole.vue +++ b/lib/vue/src/components/input/CInputRole.vue @@ -72,18 +72,18 @@ export default { }, mounted () { - this.fetchRoles() + this.fetchRoles(this.preselect) }, methods: { - fetchRoles () { + fetchRoles (preselect = false) { this.loading = true return this.$SystemAPI.roleList({ query: this.filter, limit: 20 }) .then(({ set }) => { this.roles = set.filter(this.visible) - if (this.preselect && (!this.value || !this.value.length)) { + if (preselect && (!this.value || !this.value.length)) { this.updateValue(this.roles[0]) } }).finally(() => { diff --git a/lib/vue/src/components/input/CInputSelect.vue b/lib/vue/src/components/input/CInputSelect.vue index c5f8b1ed7..e2ddc6183 100644 --- a/lib/vue/src/components/input/CInputSelect.vue +++ b/lib/vue/src/components/input/CInputSelect.vue @@ -234,12 +234,14 @@ export default { margin: 0; } - &:not(.vs--open) .vs__selected + .vs__search { + &:not(.vs--open):not(.vs--loading) .vs__selected + .vs__search { // force this to not use any space // we still need it to be rendered for the focus width: 0; margin: 0; border: none; + padding: 0; + height: 0; } .vs__dropdown-toggle {