Skip to content

Commit

Permalink
📚 Adding comments on parameter hiding logic
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Dec 30, 2022
1 parent b42037d commit 64c8773
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/editor-ui/src/components/ParameterInputList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default mixins(workflowHelpers).extend({
if (
!KEEP_AUTH_IN_NDV_FOR_NODES.includes(this.node?.type || '') &&
(parameter.name === (this.mainNodeAuthField?.name || '') ||
isAuthRelatedParameter(this.nodeAuthFields, parameter))
this.shouldHideAuthRelatedParameter(parameter))
) {
return false;
}
Expand Down Expand Up @@ -364,6 +364,12 @@ export default mixins(workflowHelpers).extend({
isNodeAuthField(name: string): boolean {
return this.nodeAuthFields.find((field) => field.name === name) !== undefined;
},
shouldHideAuthRelatedParameter(parameter: INodeProperties): boolean {
// TODO: For now, hide all fields that are used in authentication fields displayOptions
// Ideally, we should check if any non-auth field depends on it before hiding it but
// since there is no such case, omitting it to avoid additional computation
return isAuthRelatedParameter(this.nodeAuthFields, parameter);
},
},
watch: {
filteredParameterNames(newValue, oldValue) {
Expand Down

0 comments on commit 64c8773

Please sign in to comment.