From c951ecec25334c1dc6bb19f70b086f2c26a25de1 Mon Sep 17 00:00:00 2001 From: Mutasem Date: Wed, 30 Mar 2022 06:40:42 +0200 Subject: [PATCH] fix branch naming; type issues --- packages/editor-ui/src/components/RunData.vue | 18 ++++++++++++------ .../editor-ui/src/plugins/i18n/locales/en.json | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index ccc356d525..51ed48c3c8 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -4,7 +4,7 @@
- {{ $locale.baseText('runData.output') }} + {{ $locale.baseText('node.output') }} { const defaults = [ { label: this.$locale.baseText('runData.json'), value: 'json'}, { label: this.$locale.baseText('runData.table'), value: 'table'}, @@ -405,15 +405,21 @@ export default mixins( return this.getBinaryData(this.workflowRunData, this.node.name, this.runIndex, this.outputIndex); }, - branches (): {value: number, label: string }[] { + branches (): Array<{value: number, label: string }> { function capitalize(name: string) { - return name.charAt(0).toLocaleUpperCase() + name.slice(1);; + return name.charAt(0).toLocaleUpperCase() + name.slice(1); } - const branches: {value: number, label: string }[] = []; + const branches: Array<{value: number, label: string }> = []; for (let i = 0; i <= this.maxOutputIndex; i++) { const itemsCount = this.getDataCount(this.runIndex, i); const items = this.$locale.baseText(itemsCount === 1 ? 'node.output.item': 'node.output.items'); - const outputName = capitalize(`${this.getOutputName(i)} ${this.$locale.baseText('node.output.branch')}`); + let outputName = this.getOutputName(i); + if (`${outputName}` === `${i}`) { + outputName = `${this.$locale.baseText('node.output')} ${outputName}`; + } + else { + outputName = capitalize(`${this.getOutputName(i)} ${this.$locale.baseText('node.output.branch')}`); + } branches.push({ label: itemsCount ? `${outputName} (${itemsCount} ${items})` : outputName, value: i, diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 2365d04901..5e80028752 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1147,6 +1147,7 @@ "node.execute.hint": "Executes this {nodeName} node after executing any previous nodes that have not yet returned data", "node.execute.executeNode": "Execute node", "node.execute.executing": "Executing", + "node.output": "Output", "node.output.runNodeHint": "Execute this node to output data", "node.output.executing": "Executing node...", "node.output.noOutputData.title": "No output data returned",