Loading client/src/components/Common/Webhook.vue +2 −1 Original line number Diff line number Diff line <script setup lang="ts"> import { onMounted, ref } from "vue"; import { appendScriptStyle } from "@/utils/utils"; import { loadWebhooks, pickWebhook } from "@/utils/webhooks"; import { onMounted, ref } from "vue"; interface Props { type: string; Loading client/src/components/Masthead/Masthead.test.js +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import { setupMockConfig } from "tests/jest/mockConfig"; import { useUserStore } from "@/stores/userStore"; import { loadWebhookMenuItems } from "./_webhooks"; import { loadMastheadWebhooks } from "./_webhooks"; import Masthead from "./Masthead.vue"; Loading Loading @@ -38,7 +38,7 @@ describe("Masthead.vue", () => { }); } loadWebhookMenuItems.mockImplementation(stubLoadWebhooks); loadMastheadWebhooks.mockImplementation(stubLoadWebhooks); beforeEach(async () => { localVue = getLocalVue(); Loading client/src/components/Masthead/Masthead.vue +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import { useRouter } from "vue-router/composables"; import { useConfig } from "@/composables/config"; import { useUserStore } from "@/stores/userStore"; import { loadWebhookMenuItems } from "./_webhooks"; import { loadMastheadWebhooks } from "./_webhooks"; import MastheadDropdown from "./MastheadDropdown"; import MastheadItem from "./MastheadItem"; import QuotaMeter from "./QuotaMeter"; Loading Loading @@ -72,7 +72,7 @@ function onWindowToggle() { } onMounted(() => { loadWebhookMenuItems(extensionTabs.value); loadMastheadWebhooks(extensionTabs.value); }); </script> Loading client/src/components/Masthead/_webhooks.js +19 −23 Original line number Diff line number Diff line import Utils from "utils/utils"; import Webhooks from "utils/webhooks"; import { appendScriptStyle } from "utils/utils"; import { loadWebhooks } from "utils/webhooks"; export function loadWebhookMenuItems(items) { Webhooks.load({ type: "masthead", callback: function (webhooks) { export async function loadMastheadWebhooks(items) { const webhooks = loadWebhooks("masthead"); webhooks.forEach((webhook) => { if (webhook.activate) { const obj = { Loading @@ -18,9 +16,7 @@ export function loadWebhookMenuItems(items) { }; items.push(obj); // Append masthead script and styles to Galaxy main Utils.appendScriptStyle(webhook); appendScriptStyle(webhook); } }); }, }); } client/src/components/Tool/Buttons/ToolOptionsButton.vue +19 −19 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { faCaretDown, faDownload, faExternalLinkAlt, faLink } from "@fortawesome import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import ToolSourceMenuItem from "components/Tool/ToolSourceMenuItem"; import { storeToRefs } from "pinia"; import Webhooks from "utils/webhooks"; import { loadWebhooks } from "utils/webhooks"; import { computed, ref } from "vue"; import { useUserStore } from "@/stores/userStore"; Loading Loading @@ -37,24 +37,6 @@ const props = defineProps({ const webhookDetails = ref([]); Webhooks.load({ type: "tool-menu", callback: (webhooks) => { webhooks.forEach((webhook) => { if (webhook.activate && webhook.config.function) { webhookDetails.value.push({ icon: `fa ${webhook.config.icon}`, title: webhook.config.title, onclick: () => { const func = new Function("options", webhook.config.function); func(props.options); }, }); } }); }, }); const showDownload = computed(() => currentUser.value?.is_admin); const showLink = computed(() => Boolean(props.sharableUrl)); Loading @@ -73,6 +55,24 @@ function onDownload() { function onLink() { openLink(props.sharableUrl); } async function loadToolMenuWebhooks() { const webhooks = await loadWebhooks("tool-menu"); webhooks.forEach((webhook) => { if (webhook.activate && webhook.config.function) { webhookDetails.value.push({ icon: `fa ${webhook.config.icon}`, title: webhook.config.title, onclick: () => { const func = new Function("options", webhook.config.function); func(props.options); }, }); } }); } loadToolMenuWebhooks(); </script> <template> Loading Loading
client/src/components/Common/Webhook.vue +2 −1 Original line number Diff line number Diff line <script setup lang="ts"> import { onMounted, ref } from "vue"; import { appendScriptStyle } from "@/utils/utils"; import { loadWebhooks, pickWebhook } from "@/utils/webhooks"; import { onMounted, ref } from "vue"; interface Props { type: string; Loading
client/src/components/Masthead/Masthead.test.js +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import { setupMockConfig } from "tests/jest/mockConfig"; import { useUserStore } from "@/stores/userStore"; import { loadWebhookMenuItems } from "./_webhooks"; import { loadMastheadWebhooks } from "./_webhooks"; import Masthead from "./Masthead.vue"; Loading Loading @@ -38,7 +38,7 @@ describe("Masthead.vue", () => { }); } loadWebhookMenuItems.mockImplementation(stubLoadWebhooks); loadMastheadWebhooks.mockImplementation(stubLoadWebhooks); beforeEach(async () => { localVue = getLocalVue(); Loading
client/src/components/Masthead/Masthead.vue +2 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import { useRouter } from "vue-router/composables"; import { useConfig } from "@/composables/config"; import { useUserStore } from "@/stores/userStore"; import { loadWebhookMenuItems } from "./_webhooks"; import { loadMastheadWebhooks } from "./_webhooks"; import MastheadDropdown from "./MastheadDropdown"; import MastheadItem from "./MastheadItem"; import QuotaMeter from "./QuotaMeter"; Loading Loading @@ -72,7 +72,7 @@ function onWindowToggle() { } onMounted(() => { loadWebhookMenuItems(extensionTabs.value); loadMastheadWebhooks(extensionTabs.value); }); </script> Loading
client/src/components/Masthead/_webhooks.js +19 −23 Original line number Diff line number Diff line import Utils from "utils/utils"; import Webhooks from "utils/webhooks"; import { appendScriptStyle } from "utils/utils"; import { loadWebhooks } from "utils/webhooks"; export function loadWebhookMenuItems(items) { Webhooks.load({ type: "masthead", callback: function (webhooks) { export async function loadMastheadWebhooks(items) { const webhooks = loadWebhooks("masthead"); webhooks.forEach((webhook) => { if (webhook.activate) { const obj = { Loading @@ -18,9 +16,7 @@ export function loadWebhookMenuItems(items) { }; items.push(obj); // Append masthead script and styles to Galaxy main Utils.appendScriptStyle(webhook); appendScriptStyle(webhook); } }); }, }); }
client/src/components/Tool/Buttons/ToolOptionsButton.vue +19 −19 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { faCaretDown, faDownload, faExternalLinkAlt, faLink } from "@fortawesome import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import ToolSourceMenuItem from "components/Tool/ToolSourceMenuItem"; import { storeToRefs } from "pinia"; import Webhooks from "utils/webhooks"; import { loadWebhooks } from "utils/webhooks"; import { computed, ref } from "vue"; import { useUserStore } from "@/stores/userStore"; Loading Loading @@ -37,24 +37,6 @@ const props = defineProps({ const webhookDetails = ref([]); Webhooks.load({ type: "tool-menu", callback: (webhooks) => { webhooks.forEach((webhook) => { if (webhook.activate && webhook.config.function) { webhookDetails.value.push({ icon: `fa ${webhook.config.icon}`, title: webhook.config.title, onclick: () => { const func = new Function("options", webhook.config.function); func(props.options); }, }); } }); }, }); const showDownload = computed(() => currentUser.value?.is_admin); const showLink = computed(() => Boolean(props.sharableUrl)); Loading @@ -73,6 +55,24 @@ function onDownload() { function onLink() { openLink(props.sharableUrl); } async function loadToolMenuWebhooks() { const webhooks = await loadWebhooks("tool-menu"); webhooks.forEach((webhook) => { if (webhook.activate && webhook.config.function) { webhookDetails.value.push({ icon: `fa ${webhook.config.icon}`, title: webhook.config.title, onclick: () => { const func = new Function("options", webhook.config.function); func(props.options); }, }); } }); } loadToolMenuWebhooks(); </script> <template> Loading