From da4d3032bec9c0cb7996d94601bdbf0a0e6c938d Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 21 Apr 2025 11:46:19 +0530 Subject: [PATCH 1/2] fix: mark data tab form dirty by watching field updates --- .../src/components/Activities/DataFields.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Activities/DataFields.vue b/frontend/src/components/Activities/DataFields.vue index 25feb8e3..e73fb891 100644 --- a/frontend/src/components/Activities/DataFields.vue +++ b/frontend/src/components/Activities/DataFields.vue @@ -64,7 +64,7 @@ import LoadingIndicator from '@/components/Icons/LoadingIndicator.vue' import { createToast } from '@/utils' import { usersStore } from '@/stores/users' import { isMobileView } from '@/composables/settings' -import { ref } from 'vue' +import { ref, watch } from 'vue' const props = defineProps({ doctype: { @@ -114,4 +114,20 @@ const tabs = createResource({ function saveChanges() { data.save.submit() } + +watch( + () => data.doc, + (newValue, oldValue) => { + if (!oldValue) return + if (newValue && oldValue) { + const isDirty = + JSON.stringify(newValue) !== JSON.stringify(data.originalDoc) + data.isDirty = isDirty + if (isDirty) { + data.save.loading = false + } + } + }, + { deep: true }, +) From 84e773eab95c6310bca814442b5c9a018352fb69 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 21 Apr 2025 11:46:42 +0530 Subject: [PATCH 2/2] fix: do not show error page while loading --- frontend/src/pages/Deal.vue | 6 +++++- frontend/src/pages/Lead.vue | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index eb844696..428997c9 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -267,7 +267,11 @@ - + - +