From 75fc53fa422d3fd82897e3b06ed23f6cdede9666 Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Wed, 10 Nov 2021 17:47:49 +0100 Subject: [PATCH] fix(config): fix subscription config for routing --- .../organization-spaces-list/OrganizationSpacesList.vue | 4 ++-- src/config/subscription.js | 7 ++++--- src/router/index.js | 5 ++--- src/views/dashboard/Dashboard.vue | 4 ++-- src/views/project-board/ProjectBoard.vue | 4 ++-- src/views/space-board/SpaceBoard.vue | 4 ++-- src/views/user-spaces/UserSpaces.vue | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/specific/organizations/organizations-manager/organization-spaces-list/OrganizationSpacesList.vue b/src/components/specific/organizations/organizations-manager/organization-spaces-list/OrganizationSpacesList.vue index 05f06c214..8f361d60e 100644 --- a/src/components/specific/organizations/organizations-manager/organization-spaces-list/OrganizationSpacesList.vue +++ b/src/components/specific/organizations/organizations-manager/organization-spaces-list/OrganizationSpacesList.vue @@ -48,7 +48,7 @@ import { computed, inject } from "vue"; import { useRouter } from "vue-router"; import { useListFilter } from "@/composables/list-filter.js"; -import { IS_SUBCRIPTION_ENABLED } from "@/config/subscription.js"; +import { IS_SUBSCRIPTION_ENABLED } from "@/config/subscription.js"; import routeNames from "@/router/route-names.js"; import { useOrganizations } from "@/state/organizations.js"; // Components @@ -81,7 +81,7 @@ export default { return { // References displayedSpaces, - isSubscriptionEnabled: IS_SUBCRIPTION_ENABLED, + isSubscriptionEnabled: IS_SUBSCRIPTION_ENABLED, localState, searchText, // Methods diff --git a/src/config/subscription.js b/src/config/subscription.js index d01f5ad18..2d8929530 100644 --- a/src/config/subscription.js +++ b/src/config/subscription.js @@ -1,12 +1,13 @@ -const IS_SUBCRIPTION_ENABLED = - process.env.VUE_APP_SUBSCRIPTION_ENABLED === "true"; +const SUBSCRIPTION_ENABLED = process.env.VUE_APP_SUBSCRIPTION_ENABLED; const FREE_PLAN_STORAGE = process.env.VUE_APP_FREE_PLAN_STORAGE; const PRO_PLAN_ID = process.env.VUE_APP_PRO_PLAN_ID; const PRO_PLAN_STORAGE = process.env.VUE_APP_PRO_PLAN_STORAGE; const DATAPACK_PLAN_ID = process.env.VUE_APP_DATAPACK_PLAN_ID; +const IS_SUBSCRIPTION_ENABLED = SUBSCRIPTION_ENABLED === "true"; + export { - IS_SUBCRIPTION_ENABLED, + IS_SUBSCRIPTION_ENABLED, FREE_PLAN_STORAGE, PRO_PLAN_ID, PRO_PLAN_STORAGE, diff --git a/src/router/index.js b/src/router/index.js index f79783004..48954c782 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,4 +1,5 @@ import { createRouter, createWebHistory } from "vue-router"; +import { IS_SUBSCRIPTION_ENABLED } from "@/config/subscription.js"; import routeNames from "./route-names.js"; import legacyRoutes from "./legacy.js"; import subscriptionRoutes from "./subscription.js"; @@ -113,9 +114,7 @@ const routes = [ } }, // Add subscription routes if enabled - ...(process.env.VUE_APP_SUBSCRIPTION_ENABLED === "true" - ? subscriptionRoutes - : []), + ...(IS_SUBSCRIPTION_ENABLED ? subscriptionRoutes : []), // Add legacy routes for retro-compatibility ...legacyRoutes, { diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index 1ff6a6796..9bb371dbf 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -66,7 +66,7 @@