From f9dacd0a74cd7af3c5644b9b8392315bd4533c15 Mon Sep 17 00:00:00 2001 From: Favour Olayinka Date: Wed, 29 May 2024 10:00:27 +0100 Subject: [PATCH] B8e23 submission list UI fixes (#426) * fix password reset bug * fix vSwitch component, column toggle, table ordering --- client/components/forms/components/VSwitch.vue | 2 +- .../open/forms/components/FormSubmissions.vue | 7 +++---- client/components/open/tables/OpenTable.vue | 11 ++++++++--- client/pages/password/reset/[token].vue | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/client/components/forms/components/VSwitch.vue b/client/components/forms/components/VSwitch.vue index 0a0ba4c8..8a7c3ea1 100644 --- a/client/components/forms/components/VSwitch.vue +++ b/client/components/forms/components/VSwitch.vue @@ -23,7 +23,7 @@ import { defineEmits, defineProps } from "vue" const props = defineProps({ modelValue: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, - color: { type: String, default: null }, + color: { type: String, default: '#3B82F6' }, }) const emit = defineEmits(["update:modelValue"]) diff --git a/client/components/open/forms/components/FormSubmissions.vue b/client/components/open/forms/components/FormSubmissions.vue index ac76d640..0963f52d 100644 --- a/client/components/open/forms/components/FormSubmissions.vue +++ b/client/components/open/forms/components/FormSubmissions.vue @@ -254,22 +254,21 @@ export default { }, initFormStructure() { // check if form properties already has a created_at column - this.properties = this.candidatesProperties if (!this.properties.find((property) => { if (property.id === 'created_at') { return true } })) { // Add a "created at" column - this.properties.push({ + this.candidatesProperties.push({ name: 'Created at', id: 'created_at', type: 'date', width: 140 }) } + this.properties = this.candidatesProperties this.removed_properties = (this.form.removed_properties) ? clonedeep(this.form.removed_properties) : [] - // Get display columns from local storage const tmpColumns = window.localStorage.getItem('display-columns-formid-' + this.form.id) if (tmpColumns !== null && tmpColumns) { @@ -312,7 +311,7 @@ export default { onChangeDisplayColumns() { if (!import.meta.client) return window.localStorage.setItem('display-columns-formid-' + this.form.id, JSON.stringify(this.displayColumns)) - this.properties = clonedeep(this.form.properties).concat(this.removed_properties).filter((field) => { + this.properties = clonedeep(this.candidatesProperties).concat(this.removed_properties).filter((field) => { return this.displayColumns[field.id] === true }) }, diff --git a/client/components/open/tables/OpenTable.vue b/client/components/open/tables/OpenTable.vue index d2e18301..c152ee49 100644 --- a/client/components/open/tables/OpenTable.vue +++ b/client/components/open/tables/OpenTable.vue @@ -41,7 +41,7 @@ new Date(b.created_at) - new Date(a.created_at)); + } + }, + mounted() { this.internalColumns = clonedeep(this.columns) const parent = this.scrollParent ?? document.getElementById("table-page") @@ -235,7 +241,6 @@ export default { this.onStructureChange() this.handleScroll() }, - beforeUnmount() { const parent = this.scrollParent ?? document.getElementById("table-page") if (parent) { diff --git a/client/pages/password/reset/[token].vue b/client/pages/password/reset/[token].vue index 838fcd81..3b1ff4aa 100644 --- a/client/pages/password/reset/[token].vue +++ b/client/pages/password/reset/[token].vue @@ -84,8 +84,8 @@ export default { methods: { async reset() { - const { data } = await this.form.post("/password/reset") - + + const data = await this.form.post("/password/reset") this.status = data.status this.form.reset()