Skip to content

Commit

Permalink
⚡ Detect position automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed May 3, 2022
1 parent aedbbe5 commit cacd43f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
4 changes: 0 additions & 4 deletions packages/editor-ui/src/components/NodeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
:parameters="parametersNoneSetting"
:hideDelete="true"
:nodeValues="nodeValues" path="parameters" @valueChanged="valueChanged"
:showCredentialsAfter="showCredentialsAfter"
>
<node-credentials
:node="node"
Expand Down Expand Up @@ -161,9 +160,6 @@ export default mixins(
return this.nodeType.properties;
},
showCredentialsAfter (): boolean {
return this.node.type === HTTP_REQUEST_NODE_TYPE && this.node.typeVersion === 2;
},
},
props: {
eventBus: {
Expand Down
26 changes: 12 additions & 14 deletions packages/editor-ui/src/components/ParameterInputList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<div class="parameter-input-list-wrapper" :class="{ 'has-reordered-credentials-input': showCredentialsAfter }">
<slot />
<div v-for="parameter in filteredParameters" :key="parameter.name" :class="{indent}">
<div class="parameter-input-list-wrapper">
<div v-for="(parameter, index) in filteredParameters" :key="parameter.name" :class="{indent}">
<slot v-if="indexToShowSlotAt === index" />

<div
v-if="multipleValues(parameter) === true && parameter.type !== 'fixedCollection'"
class="parameter-item"
Expand Down Expand Up @@ -103,6 +104,7 @@ import ParameterInputFull from '@/components/ParameterInputFull.vue';
import { get, set } from 'lodash';
import mixins from 'vue-typed-mixins';
import { HTTP_REQUEST_NODE_TYPE } from '@/constants';
export default mixins(
genericHelpers,
Expand All @@ -120,7 +122,6 @@ export default mixins(
'path', // string
'hideDelete', // boolean
'indent',
'showCredentialsAfter', // boolean
],
computed: {
filteredParameters (): INodeProperties[] {
Expand All @@ -132,6 +133,13 @@ export default mixins(
node (): INodeUi {
return this.$store.getters.activeNode;
},
indexToShowSlotAt (): number {
if (this.node.type === HTTP_REQUEST_NODE_TYPE && this.node.typeVersion === 2) {
return 2;
}
return 0;
},
},
methods: {
multipleValues (parameter: INodeProperties): boolean {
Expand Down Expand Up @@ -268,16 +276,6 @@ export default mixins(
flex-direction: column;
padding-top: var(--spacing-xs);
&.has-reordered-credentials-input {
.node-credentials + div {
order: -2;
}
.node-credentials + div + div {
order: -1;
}
}
.delete-option {
display: none;
position: absolute;
Expand Down

0 comments on commit cacd43f

Please sign in to comment.