update button labels for triggers

This commit is contained in:
Mutasem 2022-04-06 09:16:08 +02:00
parent f783eb35d4
commit 98d64f1c11
2 changed files with 31 additions and 1 deletions

View file

@ -2,12 +2,14 @@
<n8n-button <n8n-button
:title="$locale.baseText('node.execute.hint', { interpolate: { nodeName } })" :title="$locale.baseText('node.execute.hint', { interpolate: { nodeName } })"
:loading="workflowRunning" :loading="workflowRunning"
:label="workflowRunning? $locale.baseText('node.execute.executing') : $locale.baseText('node.execute.executeNode')" :label="label"
@click="onClick" @click="onClick"
/> />
</template> </template>
<script lang="ts"> <script lang="ts">
import { INodeUi } from '@/Interface';
import { INodeTypeDescription } from 'n8n-workflow';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
import { workflowRun } from './mixins/workflowRun'; import { workflowRun } from './mixins/workflowRun';
@ -20,9 +22,35 @@ export default mixins(
}, },
}, },
computed: { computed: {
node (): INodeUi {
return this.$store.getters.getNodeByName(this.nodeName);
},
nodeType (): INodeTypeDescription | null {
if (this.node) {
return this.$store.getters.nodeType(this.node.type, this.node.typeVersion);
}
return null;
},
workflowRunning (): boolean { workflowRunning (): boolean {
return this.$store.getters.isActionActive('workflowRunning'); return this.$store.getters.isActionActive('workflowRunning');
}, },
isTriggerNode (): boolean {
return !!(this.nodeType && this.nodeType.group.includes('trigger'));
},
isPollingTypeNode (): boolean {
return !!(this.nodeType && this.nodeType.polling);
},
label(): string {
if (this.isPollingTypeNode) {
return this.$locale.baseText('node.execute.fetchEvent');
}
if (this.isTriggerNode) {
return this.$locale.baseText('node.execute.listenForEvent');
}
return this.$locale.baseText('node.execute.executeNode');
},
}, },
methods: { methods: {
onClick() { onClick() {

View file

@ -1142,6 +1142,8 @@
"node.execute.hint": "Executes this {nodeName} node after executing any previous nodes that have not yet returned data", "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.executeNode": "Execute node",
"node.execute.executing": "Executing", "node.execute.executing": "Executing",
"node.execute.fetchEvent": "Fetch Event",
"node.execute.listenForEvent": "Listen For Event",
"node.output": "Output", "node.output": "Output",
"node.output.runNodeHint": "Execute this node to output data", "node.output.runNodeHint": "Execute this node to output data",
"node.output.executing": "Executing node...", "node.output.executing": "Executing node...",