Render header strings

This commit is contained in:
Iván Ovejero
2021-11-18 11:32:13 +01:00
parent f1eef04ad2
commit 99963b04a5
25 changed files with 467 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
<template >
<template>
<span class="static-text-wrapper">
<span v-show="!editActive" :title="$baseText('displayWithChange.clickToChange')">
<span class="static-text" @mousedown="startEdit">{{currentValue}}</span>
@@ -33,6 +33,15 @@ export default mixins(genericHelpers).extend({
return path.split('.').reduce((acc, part) => acc && acc[part], obj);
};
if (this.keyName === 'name' && this.node.type.startsWith('n8n-nodes-base.')) {
const shortNodeType = this.node.type.replace('n8n-nodes-base.', '');
return this.$headerText({
key: `headers.${shortNodeType}.displayName`,
fallback: getDescendantProp(this.node, this.keyName),
});
}
return getDescendantProp(this.node, this.keyName);
},
},