From ca64079450d45d6a539e4f8cdfd5acb498d75e3c Mon Sep 17 00:00:00 2001 From: Peinan Wang Date: Mon, 19 Aug 2024 08:32:04 -0700 Subject: [PATCH 1/3] Todo Section - Dialogs --- src/components/bcros/dialog/Index.vue | 5 +- src/components/bcros/todo/Item.vue | 126 +++++++++++++++++- src/components/bcros/todo/List.vue | 38 ++++++ .../bcros/todo/dialog/CancelPaymentError.vue | 46 +++++++ .../bcros/todo/dialog/DeleteError.vue | 57 ++++++++ src/interfaces/todo-i.ts | 3 +- src/stores/todo.ts | 9 +- src/utils/todo/action-functions.ts | 113 ---------------- src/utils/todo/task-filing/button-loader.ts | 8 +- 9 files changed, 281 insertions(+), 124 deletions(-) create mode 100644 src/components/bcros/todo/dialog/CancelPaymentError.vue create mode 100644 src/components/bcros/todo/dialog/DeleteError.vue diff --git a/src/components/bcros/dialog/Index.vue b/src/components/bcros/dialog/Index.vue index ecea9544..9a49454e 100644 --- a/src/components/bcros/dialog/Index.vue +++ b/src/components/bcros/dialog/Index.vue @@ -2,7 +2,7 @@
@@ -33,7 +33,7 @@
-
+
@@ -50,6 +50,7 @@ import { DialogButton, DialogContent } from './slot-templates' const props = defineProps<{ + name?: string, attach?: string, display: boolean, options?: DialogOptionsI diff --git a/src/components/bcros/todo/Item.vue b/src/components/bcros/todo/Item.vue index 7f7ef0e8..4f3ee663 100644 --- a/src/components/bcros/todo/Item.vue +++ b/src/components/bcros/todo/Item.vue @@ -1,9 +1,15 @@
+
+const todosStore = useBcrosTodos() + const prop = defineProps({ todos: { type: Array, required: true } }) +const authorizeAffiliationError = ref(todosStore.authorizeAffiliationsErrors.length > 0) +const loadAffiliationInvitationError = ref(todosStore.loadAffiliationsError.length > 0) + +const authorizeAffiliationErrorOptions: DialogOptionsI = { + title: 'Error updating affiliation invitation.', + text: 'An error happened while updating affiliation invitation.', + textExtra: ['Please try again later.'], + hideClose: true, + buttons: [{ text: 'Ok', slotId: 'ok', color: 'primary', onClickClose: true }] +} + +const loadAffiliationInvitationErrorOptions: DialogOptionsI = { + title: 'Error fetching affiliation invitation.', + text: 'An error happened while fetching affiliation invitation.', + textExtra: ['Please try again later.'], + hideClose: true, + buttons: [{ text: 'Ok', slotId: 'ok', color: 'primary', onClickClose: true }] +} + const isExpandedInternal: Ref = ref([]) const isExpanded = computed({ @@ -28,9 +49,26 @@ const expand = (index: number, expanded: boolean) => {