From 5c10a2cc84ce9f8b0194e5693fcf7a2c1a9541b6 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 25 Jul 2024 11:51:04 -0500 Subject: [PATCH] Add "Create" new history button to histories grid --- client/src/components/Grid/GridHistory.vue | 19 +++++++++++++++---- client/src/components/Grid/GridPage.vue | 3 ++- .../src/components/Grid/configs/histories.ts | 11 ++++++++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/client/src/components/Grid/GridHistory.vue b/client/src/components/Grid/GridHistory.vue index 76229f380ea8..8c2de2194a11 100644 --- a/client/src/components/Grid/GridHistory.vue +++ b/client/src/components/Grid/GridHistory.vue @@ -1,11 +1,13 @@ @@ -32,7 +33,7 @@ const props = withDefaults(defineProps(), {
- Create Page + Create
diff --git a/client/src/components/Grid/configs/histories.ts b/client/src/components/Grid/configs/histories.ts index 2c34d2b5a7e3..38d91185a78c 100644 --- a/client/src/components/Grid/configs/histories.ts +++ b/client/src/components/Grid/configs/histories.ts @@ -6,6 +6,7 @@ import { faSignature, faTrash, faTrashRestore, + faUpload, faUsers, } from "@fortawesome/free-solid-svg-icons"; import { useEventBus } from "@vueuse/core"; @@ -52,8 +53,16 @@ async function getData(offset: number, limit: number, search: string, sort_by: s */ const actions: ActionArray = [ { - title: "Import New History", + title: "Create", icon: faPlus, + handler: () => { + const historyStore = useHistoryStore(); + historyStore.createNewHistory(); + }, + }, + { + title: "Import", + icon: faUpload, handler: () => { emit("/histories/import"); },