Skip to content

Commit

Permalink
fix(editor): Add correct add variable button message when no variable…
Browse files Browse the repository at this point in the history
…s created (no-changelog) (#6028)

fix: add correct add variable button message when no variables created
  • Loading branch information
alexgrozav authored and netroy committed Apr 20, 2023
1 parent e9f8cfe commit 67f6934
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@
"variables.heading": "Variables",
"variables.add": "Add Variable",
"variables.add.unavailable": "Upgrade plan to keep using variables",
"variables.add.unavailable.empty": "Upgrade plan to start using variables",
"variables.add.onlyOwnerCanCreate": "Only owner can create variables",
"variables.empty.heading": "{name}, let's set up a variable",
"variables.empty.heading.userNotSetup": "Set up a variable",
Expand Down
4 changes: 3 additions & 1 deletion packages/editor-ui/src/views/VariablesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ function displayName(resource: EnvironmentVariable) {
</n8n-button>
</div>
<template #content>
<span v-if="!isFeatureEnabled">{{ i18n.baseText('variables.add.unavailable') }}</span>
<span v-if="!isFeatureEnabled">{{
i18n.baseText(`variables.add.unavailable${allVariables.length === 0 ? '.empty' : ''}`)
}}</span>
<span v-else>{{ i18n.baseText('variables.add.onlyOwnerCanCreate') }}</span>
</template>
</n8n-tooltip>
Expand Down

0 comments on commit 67f6934

Please sign in to comment.