From 0301415b8703ee8f13a0b413d314531da35bf9aa Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 15 May 2024 10:41:25 -0400 Subject: [PATCH] Revise buttons in ConfigTemplates, fill out remove functionality. --- .../ConfigTemplates/InstanceDropdown.vue | 31 +++++++++---------- .../Instances/InstanceDropdown.vue | 14 ++++++++- .../FileSources/Instances/ManageIndex.vue | 6 +++- .../FileSources/Instances/services.ts | 8 +++++ .../Grid/GridElements/GridOperations.vue | 2 +- .../Instances/InstanceDropdown.vue | 6 +++- .../ObjectStore/Instances/ManageIndex.vue | 6 +++- 7 files changed, 51 insertions(+), 22 deletions(-) diff --git a/client/src/components/ConfigTemplates/InstanceDropdown.vue b/client/src/components/ConfigTemplates/InstanceDropdown.vue index 80c60134495f..3314f58300e8 100644 --- a/client/src/components/ConfigTemplates/InstanceDropdown.vue +++ b/client/src/components/ConfigTemplates/InstanceDropdown.vue @@ -2,7 +2,6 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faArrowUp, faCaretDown, faEdit, faTrash } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; -import { BLink } from "bootstrap-vue"; import { useRouter } from "vue-router/composables"; interface Props { @@ -15,8 +14,6 @@ interface Props { library.add(faArrowUp, faCaretDown, faEdit, faTrash); -const title = ""; - const router = useRouter(); defineProps(); @@ -28,18 +25,18 @@ const emit = defineEmits<{ diff --git a/client/src/components/FileSources/Instances/InstanceDropdown.vue b/client/src/components/FileSources/Instances/InstanceDropdown.vue index f71e3fd23022..75b93ec5329e 100644 --- a/client/src/components/FileSources/Instances/InstanceDropdown.vue +++ b/client/src/components/FileSources/Instances/InstanceDropdown.vue @@ -4,6 +4,8 @@ import { computed } from "vue"; import type { UserFileSourceModel } from "@/api/fileSources"; import { useFileSourceTemplatesStore } from "@/stores/fileSourceTemplatesStore"; +import { hide } from "./services"; + import InstanceDropdown from "@/components/ConfigTemplates/InstanceDropdown.vue"; const fileSourceTemplatesStore = useFileSourceTemplatesStore(); @@ -18,6 +20,15 @@ const routeUpgrade = computed(() => `/file_source_instances/${props.fileSource.i const isUpgradable = computed(() => fileSourceTemplatesStore.canUpgrade(props.fileSource.template_id, props.fileSource.template_version) ); + +async function onRemove() { + await hide(props.fileSource); + emit("entryRemoved"); +} + +const emit = defineEmits<{ + (e: "entryRemoved"): void; +}>(); diff --git a/client/src/components/FileSources/Instances/ManageIndex.vue b/client/src/components/FileSources/Instances/ManageIndex.vue index 60e4b671bf31..dfb965275826 100644 --- a/client/src/components/FileSources/Instances/ManageIndex.vue +++ b/client/src/components/FileSources/Instances/ManageIndex.vue @@ -24,6 +24,10 @@ const fields = [NAME_FIELD, DESCRIPTION_FIELD, TYPE_FIELD, TEMPLATE_FIELD]; const items = computed(() => fileSourceInstancesStore.getInstances); const loading = computed(() => fileSourceInstancesStore.loading); fileSourceInstancesStore.fetchInstances(); + +function reload() { + fileSourceInstancesStore.fetchInstances(); +}