feat(editor): add readonly state for nodes (#4299)

* fix(editor): add types to Node.vue component props

* fix(editor): some cleanup in NodeView

* fix(editor): fix some boolean usage

* feat(editor): check foreign credentials

* fix(editor): passing readOnly to inputs

* fix(editor): add types to component and solve property mutation

* fix(editor): add types to component and solve property mutation

* fix(editor): component property type

* fix(editor): component property type

* fix(editor): default prop values

* fix(editor): fix FixedCollectionParameter.vue
This commit is contained in:
Csaba Tuncsik
2022-10-24 20:17:25 +02:00
committed by GitHub
parent 1f4eaeb3ae
commit 408bd96815
23 changed files with 369 additions and 219 deletions

View File

@@ -54,7 +54,7 @@
:linkedRuns="linked"
:currentNodeName="inputNodeName"
:sessionId="sessionId"
:readOnly="readOnly"
:readOnly="readOnly || hasForeignCredential"
@linkRun="onLinkRunToInput"
@unlinkRun="() => onUnlinkRun('input')"
@runChange="onRunInputIndexChange"
@@ -71,7 +71,7 @@
:runIndex="outputRun"
:linkedRuns="linked"
:sessionId="sessionId"
:isReadOnly="readOnly"
:isReadOnly="readOnly || hasForeignCredential"
@linkRun="onLinkRunToOutput"
@unlinkRun="() => onUnlinkRun('output')"
@runChange="onRunOutputIndexChange"
@@ -86,6 +86,7 @@
:dragging="isDragging"
:sessionId="sessionId"
:nodeType="activeNodeType"
:isReadOnly="readOnly || hasForeignCredential"
@valueChanged="valueChanged"
@execute="onNodeExecute"
@activate="onWorkflowActivate"
@@ -114,7 +115,7 @@ import {
Workflow,
jsonParse,
} from 'n8n-workflow';
import { IExecutionResponse, INodeUi, IUpdateInformation, TargetItem } from '../Interface';
import { IExecutionResponse, INodeUi, IUpdateInformation, TargetItem } from '@/Interface';
import { externalHooks } from '@/components/mixins/externalHooks';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
@@ -136,7 +137,7 @@ import {
} from '@/constants';
import { workflowActivate } from './mixins/workflowActivate';
import { pinData } from "@/components/mixins/pinData";
import { dataPinningEventBus } from '../event-bus/data-pinning-event-bus';
import { dataPinningEventBus } from '@/event-bus/data-pinning-event-bus';
export default mixins(
externalHooks,
@@ -174,6 +175,7 @@ export default mixins(
pinDataDiscoveryTooltipVisible: false,
avgInputRowHeight: 0,
avgOutputRowHeight: 0,
hasForeignCredential: false,
};
},
mounted() {
@@ -360,6 +362,8 @@ export default mixins(
nodeSubtitle: this.getNodeSubtitle(node, this.activeNodeType, this.getCurrentWorkflow()),
});
this.checkForeignCredentials();
setTimeout(() => {
if (this.activeNode) {
const outogingConnections = this.$store.getters.outgoingConnectionsByNodeName(
@@ -603,6 +607,10 @@ export default mixins(
input_node_type: this.inputNode ? this.inputNode.type : '',
});
},
checkForeignCredentials() {
const issues = this.getNodeCredentialIssues(this.activeNode);
this.hasForeignCredential = !!issues?.credentials?.foreign;
},
},
});
</script>