fix(editor): Make node title non-editable in executions view (#5046)

🐛 Fix node title non-editable in executions
This commit is contained in:
Iván Ovejero 2022-12-29 12:23:10 +01:00 committed by GitHub
parent d9b98fc8be
commit 2f40a7f98a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
<template> <template>
<span :class="$style.container" data-test-id="node-title-container" @click="onEdit"> <span :class="$style.container" data-test-id="node-title-container" @click="onEdit">
<span :class="$style.iconWrapper"><NodeIcon :nodeType="nodeType" :size="18" /></span> <span :class="$style.iconWrapper"><NodeIcon :nodeType="nodeType" :size="18" /></span>
<n8n-popover placement="right" width="200" :value="editName" :disabled="readOnly"> <n8n-popover placement="right" width="200" :value="editName" :disabled="!editable">
<div <div
:class="$style.editContainer" :class="$style.editContainer"
@keydown.enter="onRename" @keydown.enter="onRename"
@ -28,10 +28,10 @@
</div> </div>
</div> </div>
<template #reference> <template #reference>
<div class="ph-no-capture" :class="{ [$style.title]: true, [$style.hoverable]: !readOnly }"> <div class="ph-no-capture" :class="{ [$style.title]: true, [$style.hoverable]: editable }">
{{ value }} {{ value }}
<div :class="$style.editIconContainer"> <div :class="$style.editIconContainer">
<font-awesome-icon :class="$style.editIcon" icon="pencil-alt" v-if="!readOnly" /> <font-awesome-icon :class="$style.editIcon" icon="pencil-alt" v-if="editable" />
</div> </div>
</div> </div>
</template> </template>
@ -60,6 +60,11 @@ export default Vue.extend({
newName: '', newName: '',
}; };
}, },
computed: {
editable(): boolean {
return !this.readOnly && window === window.parent;
},
},
methods: { methods: {
onEdit() { onEdit() {
this.newName = this.value; this.newName = this.value;