mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Fix shortcut issue on save buttons (#9309)
This commit is contained in:
parent
cf441e0294
commit
e74c14ffbe
|
@ -623,6 +623,8 @@ function goToUpgrade() {
|
|||
type="primary"
|
||||
:saved="!uiStore.stateIsDirty && !isNewWorkflow"
|
||||
:disabled="isWorkflowSaving || readOnly"
|
||||
with-shortcut
|
||||
:shortcut-tooltip="$locale.baseText('saveWorkflowButton.hint')"
|
||||
data-test-id="workflow-save-button"
|
||||
@click="onSaveButtonClick"
|
||||
/>
|
||||
|
|
|
@ -1,20 +1,30 @@
|
|||
<template>
|
||||
<span :class="$style.container" data-test-id="save-button">
|
||||
<span v-if="saved" :class="$style.saved">{{ $locale.baseText('saveButton.saved') }}</span>
|
||||
<KeyboardShortcutTooltip
|
||||
v-else
|
||||
:label="$locale.baseText('saveButton.hint')"
|
||||
:shortcut="{ keys: ['s'], metaKey: true }"
|
||||
placement="bottom"
|
||||
>
|
||||
<template v-else>
|
||||
<KeyboardShortcutTooltip
|
||||
v-if="withShortcut"
|
||||
:label="shortcutTooltipLabel"
|
||||
:shortcut="{ keys: ['s'], metaKey: true }"
|
||||
placement="bottom"
|
||||
>
|
||||
<n8n-button
|
||||
:label="saveButtonLabel"
|
||||
:loading="isSaving"
|
||||
:disabled="disabled"
|
||||
:class="$style.button"
|
||||
:type="type"
|
||||
/>
|
||||
</KeyboardShortcutTooltip>
|
||||
<n8n-button
|
||||
v-else
|
||||
:label="saveButtonLabel"
|
||||
:loading="isSaving"
|
||||
:disabled="disabled"
|
||||
:class="$style.button"
|
||||
:type="type"
|
||||
/>
|
||||
</KeyboardShortcutTooltip>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
|
@ -50,6 +60,13 @@ export default defineComponent({
|
|||
type: String,
|
||||
default: 'primary',
|
||||
},
|
||||
withShortcut: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
shortcutTooltip: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
saveButtonLabel() {
|
||||
|
@ -57,6 +74,9 @@ export default defineComponent({
|
|||
? this.$locale.baseText('saveButton.saving')
|
||||
: this.$locale.baseText('saveButton.save');
|
||||
},
|
||||
shortcutTooltipLabel() {
|
||||
return this.shortcutTooltip ?? this.$locale.baseText('saveButton.save');
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1455,7 +1455,7 @@
|
|||
"runData.aiContentBlock.tokens.completion": "Completion:",
|
||||
"saveButton.save": "@:_reusableBaseText.save",
|
||||
"saveButton.saved": "Saved",
|
||||
"saveButton.hint": "Save workflow",
|
||||
"saveWorkflowButton.hint": "Save workflow",
|
||||
"saveButton.saving": "Saving",
|
||||
"settings": "Settings",
|
||||
"settings.communityNodes": "Community nodes",
|
||||
|
|
Loading…
Reference in a new issue