feat(editor): Change upgrade CTA on community editions (no-changelog) (#6317)
* Change upgrade CTA on community editions * upgrade CTA event * Send source as ref in when redirecting * fix tests * import correcty telemetryfunction * aja * remove useUpgradeLink composable * remove composable from index.ts * Add goToUpgrade to usage view
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user