Skip to content

Commit

Permalink
✨ Updating automatic credentials position logic (removing `getParamet…
Browse files Browse the repository at this point in the history
…erResolveOrder`call and fixing input spacing).
  • Loading branch information
MiloradFilipovic committed Jun 7, 2022
1 parent 0210773 commit 657e100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/editor-ui/src/components/NodeCredentials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ export default mixins(
<style lang="scss" module>
.container {
margin-top: var(--spacing-xs);
& > div:not(:first-child) {
margin-top: var(--spacing-xs);
}
}
.warning {
Expand Down
11 changes: 1 addition & 10 deletions packages/editor-ui/src/components/ParameterInputList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@
import {
INodeParameters,
INodeProperties,
INodeTypeDescription,
NodeHelpers,
NodeParameterValue,
} from 'n8n-workflow';
Expand Down Expand Up @@ -131,21 +129,14 @@ export default mixins(
node (): INodeUi {
return this.$store.getters.activeNode;
},
nodeType () : INodeTypeDescription {
return this.$store.getters.nodeType(this.node.type, this.node.typeVersion);
},
indexToShowSlotAt (): number {
let index = 0;
const paramDependencies = NodeHelpers.getParamterDependencies(this.nodeType.properties);
const paramOrder = NodeHelpers.getParamterResolveOrder(this.nodeType.properties, paramDependencies);
// Make sure credentials slot always appears below the last authentication field
this.filteredParameters.forEach((prop, propIndex) => {
if (prop.name.toLowerCase().endsWith('authentication')) {
index = paramOrder[propIndex] + 1;
index = propIndex + 1;
}
});
return index < this.filteredParameters.length ?
index : this.filteredParameters.length - 1;
},
Expand Down

0 comments on commit 657e100

Please sign in to comment.