diff --git a/packages/editor-ui/src/composables/index.ts b/packages/editor-ui/src/composables/index.ts index 2f6dcea98e..6f2ac9255f 100644 --- a/packages/editor-ui/src/composables/index.ts +++ b/packages/editor-ui/src/composables/index.ts @@ -11,5 +11,4 @@ export * from './useMessage'; export * from './useTelemetry'; export * from './useTitleChange'; export * from './useToast'; -export * from './useUpgradeLink'; export * from './useNodeSpecificationValues'; diff --git a/packages/editor-ui/src/composables/useUpgradeLink.ts b/packages/editor-ui/src/composables/useUpgradeLink.ts deleted file mode 100644 index 5908e241ba..0000000000 --- a/packages/editor-ui/src/composables/useUpgradeLink.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { BaseTextKey } from '@/plugins/i18n'; -import { useUIStore, useUsageStore } from '@/stores'; -import { useI18n } from './useI18n'; -import { computed } from 'vue'; - -export function useUpgradeLink(queryParams = { default: '', desktop: '' }) { - const uiStore = useUIStore(); - const usageStore = useUsageStore(); - const { i18n } = useI18n(); - - const upgradeLinkUrl = computed(() => { - const linkUrlTranslationKey = uiStore.contextBasedTranslationKeys.upgradeLinkUrl as BaseTextKey; - let url = i18n.baseText(linkUrlTranslationKey); - - if (linkUrlTranslationKey.endsWith('.upgradeLinkUrl')) { - url = `${usageStore.viewPlansUrl}${queryParams.default}`; - } else if (linkUrlTranslationKey.endsWith('.desktop')) { - url = `${url}${queryParams.desktop}`; - } - - return url; - }); - - return { upgradeLinkUrl }; -} diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index f1340f84c2..3f1f3560a9 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1789,7 +1789,7 @@ "contextual.communityNodes.unavailable.description.desktop": "Community nodes feature is unavailable on desktop. Please choose one of our available self-hosting plans.", "contextual.communityNodes.unavailable.button.desktop": "View plans", - "contextual.upgradeLinkUrl": "https://subscription.n8n.io/", + "contextual.upgradeLinkUrl": "https://n8n.io/pricing/", "contextual.upgradeLinkUrl.cloud": "https://app.n8n.cloud/account/change-plan", "contextual.upgradeLinkUrl.desktop": "https://n8n.io/pricing/?utm_source=n8n-internal&utm_medium=desktop", diff --git a/packages/editor-ui/src/stores/__tests__/ui.test.ts b/packages/editor-ui/src/stores/__tests__/ui.test.ts index d238783ecd..59be0c810c 100644 --- a/packages/editor-ui/src/stores/__tests__/ui.test.ts +++ b/packages/editor-ui/src/stores/__tests__/ui.test.ts @@ -15,16 +15,8 @@ describe('UI store', () => { }); test.each([ - [ - 'default', - 'production', - 'https://subscription.n8n.io?instanceid=123abc&version=0.223.0&source=test_source', - ], - [ - 'default', - 'development', - 'https://staging-subscription.n8n.io?instanceid=123abc&version=0.223.0&source=test_source', - ], + ['default', 'production', 'https://n8n.io/pricing/?ref=test_source'], + ['default', 'development', 'https://n8n.io/pricing/?ref=test_source'], [ 'desktop_win', 'production', diff --git a/packages/editor-ui/src/stores/ui.store.ts b/packages/editor-ui/src/stores/ui.store.ts index 1723f32355..9b4e5bfe9d 100644 --- a/packages/editor-ui/src/stores/ui.store.ts +++ b/packages/editor-ui/src/stores/ui.store.ts @@ -322,13 +322,12 @@ export const useUIStore = defineStore(STORES.UI, { }, upgradeLinkUrl() { return (source: string, utm_campaign: string): string => { - const usageStore = useUsageStore(); const linkUrlTranslationKey = this.contextBasedTranslationKeys .upgradeLinkUrl as BaseTextKey; let linkUrl = locale.baseText(linkUrlTranslationKey); if (linkUrlTranslationKey.endsWith('.upgradeLinkUrl')) { - linkUrl = `${usageStore.viewPlansUrl}&source=${source}`; + linkUrl = `${linkUrl}?ref=${source}`; } else if (linkUrlTranslationKey.endsWith('.desktop')) { linkUrl = `${linkUrl}&utm_campaign=${utm_campaign || source}`; } diff --git a/packages/editor-ui/src/views/SettingsUsageAndPlan.vue b/packages/editor-ui/src/views/SettingsUsageAndPlan.vue index a350f6cf24..9e23492804 100644 --- a/packages/editor-ui/src/views/SettingsUsageAndPlan.vue +++ b/packages/editor-ui/src/views/SettingsUsageAndPlan.vue @@ -6,11 +6,13 @@ import type { UsageTelemetry } from '@/stores/usage.store'; import { useUsageStore } from '@/stores/usage.store'; import { telemetry } from '@/plugins/telemetry'; import { i18n as locale } from '@/plugins/i18n'; +import { useUIStore } from '@/stores'; import { N8N_PRICING_PAGE_URL } from '@/constants'; const usageStore = useUsageStore(); const route = useRoute(); const router = useRouter(); +const uiStore = useUIStore(); const queryParamCallback = ref( `callback=${encodeURIComponent(`${window.location.origin}${window.location.pathname}`)}`, @@ -104,6 +106,7 @@ const onAddActivationKey = () => { }; const onViewPlans = () => { + uiStore.goToUpgrade('usage_page', 'open'); sendUsageTelemetry('view_plans'); }; diff --git a/packages/editor-ui/src/views/VariablesView.vue b/packages/editor-ui/src/views/VariablesView.vue index 5a05df2aeb..f400002b96 100644 --- a/packages/editor-ui/src/views/VariablesView.vue +++ b/packages/editor-ui/src/views/VariablesView.vue @@ -7,7 +7,7 @@ import { useUsersStore, useVersionControlStore, } from '@/stores'; -import { useI18n, useTelemetry, useToast, useUpgradeLink, useMessage } from '@/composables'; +import { useI18n, useTelemetry, useToast, useMessage } from '@/composables'; import ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue'; import VariablesRow from '@/components/VariablesRow.vue'; @@ -78,10 +78,6 @@ const datatableColumns = computed(() => [ ]); const contextBasedTranslationKeys = computed(() => uiStore.contextBasedTranslationKeys); -const { upgradeLinkUrl } = useUpgradeLink({ - default: '&source=variables', - desktop: '&utm_campaign=upgrade-variables', -}); const newlyAddedVariableIds = ref([]);