mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix rename bug
This commit is contained in:
parent
e583a983f6
commit
555192969b
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:visible="!!node"
|
||||
:visible="!!node || renaming"
|
||||
:before-close="close"
|
||||
:show-close="false"
|
||||
custom-class="data-display-wrapper"
|
||||
|
@ -48,6 +48,11 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers).extend({
|
|||
NodeSettings,
|
||||
RunData,
|
||||
},
|
||||
props: {
|
||||
renaming: {
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
settingsEventBus: new Vue(),
|
||||
|
|
|
@ -370,7 +370,6 @@ export default mixins(
|
|||
};
|
||||
this.$emit('valueChanged', sendData);
|
||||
|
||||
this.$store.commit('setActiveNode', newValue);
|
||||
} else if (parameterData.name.startsWith('parameters.')) {
|
||||
// A node parameter changed
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
></node>
|
||||
</div>
|
||||
</div>
|
||||
<DataDisplay @valueChanged="valueChanged"/>
|
||||
<DataDisplay :renaming="renamingActive" @valueChanged="valueChanged"/>
|
||||
<div v-if="!createNodeActive && !isReadOnly" class="node-creator-button" :title="$locale.baseText('nodeView.addNode')" @click="() => openNodeCreator('add_node_button')">
|
||||
<n8n-icon-button size="xlarge" icon="plus" />
|
||||
</div>
|
||||
|
@ -348,6 +348,7 @@ export default mixins(
|
|||
pullConnActiveNodeName: null as string | null,
|
||||
pullConnActive: false,
|
||||
dropPrevented: false,
|
||||
renamingActive: false,
|
||||
};
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
@ -2244,6 +2245,13 @@ export default mixins(
|
|||
if (currentName === newName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeNodeName = this.activeNode && this.activeNode.name;
|
||||
const isActive = activeNodeName === currentName;
|
||||
if (isActive) {
|
||||
this.renamingActive = true;
|
||||
}
|
||||
|
||||
// Check if node-name is unique else find one that is
|
||||
newName = this.getUniqueNodeName({
|
||||
originalName: newName,
|
||||
|
@ -2271,6 +2279,11 @@ export default mixins(
|
|||
// Make sure that the node is selected again
|
||||
this.deselectAllNodes();
|
||||
this.nodeSelectedByName(newName);
|
||||
|
||||
if (isActive) {
|
||||
this.$store.commit('setActiveNode', newName);
|
||||
this.renamingActive = false;
|
||||
}
|
||||
},
|
||||
deleteEveryEndpoint () {
|
||||
// Check as it does not exist on first load
|
||||
|
|
Loading…
Reference in a new issue