From 4fd2b05137118c22ab55e23b966e7f1d370e975f Mon Sep 17 00:00:00 2001 From: Kevin Martinez Date: Thu, 7 Dec 2023 13:33:11 -0400 Subject: [PATCH 1/3] Fix shelving pages --- src/components/FormModel.vue | 8 +- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Shelving/Card/ShelvingCard.vue | 9 +- src/pages/Shelving/Card/ShelvingForm.vue | 148 ++++++++++++-------- src/pages/Shelving/Card/ShelvingSummary.vue | 115 ++++++++------- src/pages/Shelving/ShelvingBasicData.vue | 38 ----- src/pages/Shelving/ShelvingCreate.vue | 69 --------- src/pages/Shelving/ShelvingList.vue | 2 +- src/router/modules/shelving.js | 4 +- 10 files changed, 164 insertions(+), 231 deletions(-) delete mode 100644 src/pages/Shelving/ShelvingBasicData.vue delete mode 100644 src/pages/Shelving/ShelvingCreate.vue diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 986358930..453b3ffe1 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -84,7 +84,7 @@ onUnmounted(() => { const isLoading = ref(false); // Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas const hasChanges = ref(!$props.observeFormChanges); -const originalData = ref(); +const originalData = ref({...$props.formInitialData}); const formData = computed(() => state.get($props.model)); const formUrl = computed(() => $props.url); @@ -141,7 +141,9 @@ function reset() { originalData.value = JSON.parse(JSON.stringify(originalData.value)); emit('onFetch', state.get($props.model)); - hasChanges.value = false; + if ($props.observeFormChanges) { + hasChanges.value = false; + } } // eslint-disable-next-line vue/no-dupe-keys @@ -166,7 +168,7 @@ watch(formUrl, async () => { }); diff --git a/src/pages/Shelving/Card/ShelvingForm.vue b/src/pages/Shelving/Card/ShelvingForm.vue index d919a05ba..e30ac1939 100644 --- a/src/pages/Shelving/Card/ShelvingForm.vue +++ b/src/pages/Shelving/Card/ShelvingForm.vue @@ -1,30 +1,23 @@ diff --git a/src/pages/Shelving/Card/ShelvingSummary.vue b/src/pages/Shelving/Card/ShelvingSummary.vue index 492c9bba2..f1f914385 100644 --- a/src/pages/Shelving/Card/ShelvingSummary.vue +++ b/src/pages/Shelving/Card/ShelvingSummary.vue @@ -1,11 +1,11 @@