feat(editor): Improve new canvas discovery design by specifying ALPHA version (no-changelog) (#11373)

This commit is contained in:
Alex Grozav 2024-10-23 17:08:27 +03:00 committed by GitHub
parent 066aa48baa
commit 197a1264d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 4 deletions

View file

@ -118,7 +118,9 @@ defineExpose({ open, close });
{{ item.label }}
</span>
<span v-if="item.badge">
<N8nBadge theme="primary" size="xsmall">{{ item.badge }}</N8nBadge>
<N8nBadge theme="primary" size="xsmall" v-bind="item.badgeProps">
{{ item.badge }}
</N8nBadge>
</span>
<N8nKeyboardShortcut
v-if="item.shortcut"

View file

@ -4,6 +4,7 @@ export interface ActionDropdownItem {
id: string;
label: string;
badge?: string;
badgeProps?: Record<string, unknown>;
icon?: string;
divided?: boolean;
disabled?: boolean;

View file

@ -189,9 +189,18 @@ const workflowMenuItems = computed<ActionDropdownItem[]>(() => {
actions.push({
id: WORKFLOW_MENU_ACTIONS.SWITCH_NODE_VIEW_VERSION,
...(nodeViewSwitcherDiscovered.value || nodeViewVersion.value === '2'
...(nodeViewVersion.value === '2'
? {}
: { badge: locale.baseText('menuActions.badge.new') }),
: nodeViewSwitcherDiscovered.value
? {
badge: locale.baseText('menuActions.badge.alpha'),
badgeProps: {
theme: 'tertiary',
},
}
: {
badge: locale.baseText('menuActions.badge.new'),
}),
label:
nodeViewVersion.value === '2'
? locale.baseText('menuActions.switchToOldNodeViewVersion')
@ -735,7 +744,7 @@ function showCreateWorkflowSuccessToast(id?: string) {
data-test-id="workflow-import-input"
@change="handleFileImport()"
/>
<N8nTooltip dismissible :visible="isNodeViewDiscoveryTooltipVisible">
<N8nTooltip :visible="isNodeViewDiscoveryTooltipVisible">
<N8nActionDropdown
:items="workflowMenuItems"
data-test-id="workflow-menu"
@ -743,6 +752,9 @@ function showCreateWorkflowSuccessToast(id?: string) {
@visible-change="onWorkflowMenuOpen"
/>
<template #content>
<div class="mb-4xs">
<N8nBadge>{{ $locale.baseText('menuActions.badge.alpha') }}</N8nBadge>
</div>
{{ $locale.baseText('menuActions.nodeViewDiscovery.tooltip') }}
<N8nIcon
:class="$style.closeNodeViewDiscovery"

View file

@ -908,6 +908,7 @@
"menuActions.switchToNewNodeViewVersion": "Switch to new canvas",
"menuActions.switchToOldNodeViewVersion": "Switch to old canvas",
"menuActions.badge.new": "NEW",
"menuActions.badge.alpha": "ALPHA",
"menuActions.nodeViewDiscovery.tooltip": "Try our new, more performant canvas",
"multipleParameter.addItem": "Add item",
"multipleParameter.currentlyNoItemsExist": "Currently no items exist",