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:
Ricardo Espinoza
2023-06-05 13:39:04 -04:00
committed by GitHub
parent 3b1a2f88b8
commit dc58340eee
7 changed files with 8 additions and 44 deletions

View File

@@ -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}`;
}