From 56e533581cf8bb795ac88e62656cc35d373c62ff Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala <60499540+chiragchhatrala@users.noreply.github.com> Date: Fri, 22 Dec 2023 20:15:53 +0530 Subject: [PATCH] migrate-to-nuxt-useappconfig (#263) * migrate-to-nuxt-useappconfig * defineAppConfig --------- Co-authored-by: Forms Dev --- client/app.config.ts | 7 +++++++ client/components/global/Navbar.vue | 2 +- client/components/global/NotionPage.vue | 4 ++-- .../forms/components/form-components/FormNotifications.vue | 2 +- .../components/pages/forms/create/CreateFormBaseModal.vue | 2 +- client/composables/useConfig.js | 2 -- client/pages/index.vue | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 client/app.config.ts delete mode 100644 client/composables/useConfig.js diff --git a/client/app.config.ts b/client/app.config.ts new file mode 100644 index 0000000..a859256 --- /dev/null +++ b/client/app.config.ts @@ -0,0 +1,7 @@ +// https://nuxt.com/docs/guide/directory-structure/app-config + +import opnformConfig from "~/opnform.config.js"; + +export default defineAppConfig({ + ...opnformConfig +}) \ No newline at end of file diff --git a/client/components/global/Navbar.vue b/client/components/global/Navbar.vue index 6853527..d7fa9a4 100644 --- a/client/components/global/Navbar.vue +++ b/client/components/global/Navbar.vue @@ -152,7 +152,7 @@ export default { appStore: useAppStore(), formsStore: useFormsStore(), workspacesStore: useWorkspacesStore(), - config: useConfig(), + config: useAppConfig(), user: computed(() => authStore.user), isIframe: useIsIframe(), } diff --git a/client/components/global/NotionPage.vue b/client/components/global/NotionPage.vue index e88eb5a..74b768c 100644 --- a/client/components/global/NotionPage.vue +++ b/client/components/global/NotionPage.vue @@ -16,11 +16,11 @@ export default { }, async setup(props) { - const apiUrl = useConfig().notion.worker + const apiUrl = useAppConfig().notion.worker const {data} = await useFetch(`${apiUrl}/page/${props.pageId}`) return { - apiUrl: useConfig().notion.worker, + apiUrl: useAppConfig().notion.worker, blockMap: data, } } diff --git a/client/components/open/forms/components/form-components/FormNotifications.vue b/client/components/open/forms/components/form-components/FormNotifications.vue index c38d735..a57e785 100644 --- a/client/components/open/forms/components/form-components/FormNotifications.vue +++ b/client/components/open/forms/components/form-components/FormNotifications.vue @@ -56,7 +56,7 @@ export default { }, computed: { - zapierUrl: () => useConfig().links.zapier_integration + zapierUrl: () => useAppConfig().links.zapier_integration }, watch: { diff --git a/client/components/pages/forms/create/CreateFormBaseModal.vue b/client/components/pages/forms/create/CreateFormBaseModal.vue index c6ddc91..cfa33b8 100644 --- a/client/components/pages/forms/create/CreateFormBaseModal.vue +++ b/client/components/pages/forms/create/CreateFormBaseModal.vue @@ -108,7 +108,7 @@ export default { computed: { aiFeaturesEnabled () { - return useConfig().ai_features_enabled + return useAppConfig().ai_features_enabled } }, diff --git a/client/composables/useConfig.js b/client/composables/useConfig.js deleted file mode 100644 index 751243f..0000000 --- a/client/composables/useConfig.js +++ /dev/null @@ -1,2 +0,0 @@ -import opnformConfig from "~/opnform.config.js"; -export const useConfig = () => opnformConfig diff --git a/client/pages/index.vue b/client/pages/index.vue index bd25de4..85b69d0 100644 --- a/client/pages/index.vue +++ b/client/pages/index.vue @@ -203,7 +203,7 @@ export default { const authStore = useAuthStore() return { authenticated: computed(() => authStore.check), - config: useConfig() + config: useAppConfig() } },