Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8n 4040 data mapping #3708

Merged
merged 121 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 118 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
05eb246
commit package lock
mutdmour Jul 5, 2022
28895b9
refactor param options out
mutdmour Jul 5, 2022
01b1543
use action toggle
mutdmour Jul 5, 2022
b5b7f6e
handle click on toggle
mutdmour Jul 5, 2022
fde5cd1
update color toggle
mutdmour Jul 5, 2022
cfeb147
fix toggle
mutdmour Jul 5, 2022
ae55b07
show options
mutdmour Jul 5, 2022
baeadc1
update expression color
mutdmour Jul 5, 2022
1f88ca1
update pointer
mutdmour Jul 5, 2022
2e4a9c1
fix readonly
mutdmour Jul 6, 2022
932eb24
fix readonly
mutdmour Jul 6, 2022
b3de84a
fix expression spacing
mutdmour Jul 6, 2022
ed076fe
refactor input label
mutdmour Jul 6, 2022
d76fa35
show icon for headers
mutdmour Jul 6, 2022
779a7f4
center icon
mutdmour Jul 6, 2022
5f76d00
fix multi params
mutdmour Jul 6, 2022
ea92a19
add credential options
mutdmour Jul 6, 2022
5e0d213
increase spacing
mutdmour Jul 6, 2022
029f148
update expression view
mutdmour Jul 7, 2022
2faa9e3
update transition
mutdmour Jul 7, 2022
f69f5af
update el padding
mutdmour Jul 7, 2022
70baabf
rename side to options
mutdmour Jul 7, 2022
c282e9a
fix label overflow
mutdmour Jul 7, 2022
e8554f9
fix bug with unnessary lines
mutdmour Jul 7, 2022
c129f2f
add overlay
mutdmour Jul 7, 2022
473b1d2
fix bug affecting other pages
mutdmour Jul 7, 2022
dbaf649
clean up spacing
mutdmour Jul 8, 2022
95d0db9
rename
mutdmour Jul 8, 2022
3a0552f
update icon size
mutdmour Jul 8, 2022
f4af078
fix toggle in users
mutdmour Jul 8, 2022
65c9236
clean up func
mutdmour Jul 8, 2022
aa0c358
clean up css
mutdmour Jul 8, 2022
f16ea23
use css var
mutdmour Jul 8, 2022
1cbd3ad
fix overlay bug
mutdmour Jul 8, 2022
0706675
clean up input
mutdmour Jul 8, 2022
d77b7a2
clean up input
mutdmour Jul 8, 2022
d110584
clean up unnessary css
mutdmour Jul 8, 2022
1c6a581
revert
mutdmour Jul 8, 2022
5abcd92
update quotes
mutdmour Jul 8, 2022
3f9a239
rename method
mutdmour Jul 8, 2022
6d8b002
remove console errors
mutdmour Jul 8, 2022
8797542
refactor data table
mutdmour Jul 8, 2022
1951f38
add drag button
mutdmour Jul 8, 2022
514fde4
make hoverable cells
mutdmour Jul 8, 2022
718f769
add drag hint
mutdmour Jul 8, 2022
d6922d5
disabel for output panel
mutdmour Jul 8, 2022
b0d950d
add drag
mutdmour Jul 8, 2022
7b3b2ff
disable for readonly
mutdmour Jul 8, 2022
da00c0a
Add dragging
mutdmour Jul 8, 2022
055bb03
add draggable pill
mutdmour Jul 8, 2022
dac04b4
add mapping targets
mutdmour Jul 8, 2022
f5bd1c4
remove font color
mutdmour Jul 8, 2022
61ec66e
Transferable
mutdmour Jul 8, 2022
8d2087f
fix linting issue
mutdmour Jul 11, 2022
8ec1adf
teleport component
mutdmour Jul 11, 2022
df9db74
fix line
mutdmour Jul 11, 2022
76604f8
disable for readonly
mutdmour Jul 11, 2022
067c774
fix position of data pill
mutdmour Jul 11, 2022
c8c9384
fix position of data pill
mutdmour Jul 11, 2022
26d3749
ignore import
mutdmour Jul 12, 2022
40bc75a
add droppable state
mutdmour Jul 12, 2022
55195f0
remove draggable key
mutdmour Jul 12, 2022
c27ad47
update bg color
mutdmour Jul 12, 2022
98f1660
add value drop
mutdmour Jul 12, 2022
d3c1dd3
use direct input
mutdmour Jul 12, 2022
19ca826
remove transition
mutdmour Jul 12, 2022
2f7c566
add animation
mutdmour Jul 13, 2022
8746d58
shorten name
mutdmour Jul 13, 2022
ff59104
handle empty value
mutdmour Jul 13, 2022
2f81625
fix switch bug
mutdmour Jul 13, 2022
abe7734
fix up animation
mutdmour Jul 13, 2022
ec23441
add notification
mutdmour Jul 13, 2022
1432217
add hint
mutdmour Jul 13, 2022
aa3a6ae
add tooltip
mutdmour Jul 13, 2022
890d780
show draggable hintm
mutdmour Jul 13, 2022
2ebb47c
fix multiple expre
mutdmour Jul 13, 2022
47d171f
merge in master
mutdmour Jul 13, 2022
4417ecb
merge master
mutdmour Jul 13, 2022
8437ff1
Merge branch 'n8n-4024-param-inputs' of github.com:n8n-io/n8n into N8…
mutdmour Jul 13, 2022
8886de8
fix hoverable
mutdmour Jul 13, 2022
58b029b
keep options on focus
mutdmour Jul 13, 2022
8b81fc8
increase timeouts
mutdmour Jul 13, 2022
cecf5f5
Merge pull request #3676 from n8n-io/n8n-4024-param-inputs
mutdmour Jul 14, 2022
1679500
handle ocnflict
mutdmour Jul 14, 2022
641ebce
Merge pull request #3706 from n8n-io/N8N-4026-data-mapping
mutdmour Jul 14, 2022
f1c537f
fix bug in set node
mutdmour Jul 14, 2022
a7734a4
add transition on hover out
mutdmour Jul 14, 2022
5d594fa
fix tooltip onboarding bug
mutdmour Jul 14, 2022
f7a826a
only update expression if changes
mutdmour Jul 14, 2022
fe2f26e
add open delay
mutdmour Jul 14, 2022
19fd49e
fix header highlight issue
mutdmour Jul 14, 2022
2b204a5
merge in master
mutdmour Jul 18, 2022
7ad4204
update text
mutdmour Jul 18, 2022
cd85610
dont show tooltip always
mutdmour Jul 18, 2022
2edb4bf
update docs url
mutdmour Jul 18, 2022
8a35ff8
update ee border
mutdmour Jul 18, 2022
0972dd4
add sticky behav
mutdmour Jul 18, 2022
05149d0
hide error highlight if dropping
mutdmour Jul 18, 2022
672b858
switch out grip icon
mutdmour Jul 18, 2022
d0f0906
increase timeout
mutdmour Jul 18, 2022
739c9c1
add delay
mutdmour Jul 18, 2022
8089faa
show hint on execprev
mutdmour Jul 18, 2022
89fd698
add telemetry event
mutdmour Jul 18, 2022
73b1d83
add telemetry event
mutdmour Jul 18, 2022
5038d7b
add telemetry event
mutdmour Jul 18, 2022
969cd9a
fire event on hint showing
mutdmour Jul 18, 2022
bf5dbb4
fix telemetry event
mutdmour Jul 18, 2022
f7784af
add path
mutdmour Jul 18, 2022
d1a96b7
fix drag hint issue
mutdmour Jul 18, 2022
c5ee0a1
decrease bottom margin
mutdmour Jul 19, 2022
38d618c
update mapping keys
mutdmour Jul 19, 2022
76428a8
remove file
mutdmour Jul 19, 2022
12ac7a9
hide overflow
mutdmour Jul 19, 2022
83ee658
sort params
mutdmour Jul 19, 2022
0797676
add space
mutdmour Jul 19, 2022
3fd0f93
prevent scrolling
mutdmour Jul 19, 2022
ad51e7e
remove dropshadow
mutdmour Jul 19, 2022
4cee048
force cursor
mutdmour Jul 19, 2022
d6e44f9
address some comments
mutdmour Jul 20, 2022
30bf1a8
add thead tbody
mutdmour Jul 20, 2022
3b70fda
add size opt
mutdmour Jul 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export default {
argTypes: {
placement: {
type: 'select',
options: ['top', 'bottom'],
options: ['top', 'top-start', 'top-end', 'bottom', 'bottom-end'],
},
size: {
type: 'select',
options: ['mini', 'small', 'medium'],
},
},
parameters: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<template>
<span :class="$style.container">
<el-dropdown :placement="placement" trigger="click" @command="onCommand">
<span :class="$style.button">
<el-dropdown :placement="placement" :size="size" trigger="click" @command="onCommand" @visible-change="onVisibleChange">
<span :class="{[$style.button]: true, [$style[theme]]: !!theme}">
<component :is="$options.components.N8nIcon"
icon="ellipsis-v"
:size="iconSize"
/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="action in actions"
:key="action.value"
:command="action.value"
:disabled="action.disabled"
>
{{action.label}}
</el-dropdown-item>
Expand Down Expand Up @@ -42,12 +44,30 @@ export default {
type: String,
default: 'bottom',
validator: (value: string): boolean =>
['top', 'bottom'].includes(value),
['top', 'top-end', 'top-start', 'bottom', 'bottom-end', 'bottom-start'].includes(value),
},
size: {
mutdmour marked this conversation as resolved.
Show resolved Hide resolved
type: String,
default: 'medium',
validator: (value: string): boolean =>
['mini', 'small', 'medium'].includes(value),
},
iconSize: {
type: String,
},
theme: {
type: String,
default: 'default',
validator: (value: string): boolean =>
['default', 'dark'].includes(value),
},
},
methods: {
onCommand(value: string) {
this.$emit('action', value) ;
this.$emit('action', value);
},
onVisibleChange(value: boolean) {
this.$emit('visible-change', value);
},
},
};
Expand All @@ -62,6 +82,18 @@ export default {
cursor: pointer;
padding: var(--spacing-4xs);
border-radius: var(--border-radius-base);

&:hover {
color: var(--color-primary);
cursor: pointer;
}

&:focus {
color: var(--color-primary);
}
}

.dark {
color: var(--color-text-dark);

&:focus {
Expand Down
153 changes: 92 additions & 61 deletions packages/design-system/src/components/N8nInputLabel/InputLabel.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<template functional>
<div :class="{[$style.inputLabelContainer]: !props.labelHoverableOnly}">
<div :class="$options.methods.getLabelClass(props, $style)">
<component v-if="props.label" :is="$options.components.N8nText" :bold="props.bold" :size="props.size" :compact="!props.underline">
{{ props.label }}
<component :is="$options.components.N8nText" color="primary" :bold="props.bold" :size="props.size" v-if="props.required">*</component>
</component>
<span :class="[$style.infoIcon, props.showTooltip ? $style.showIcon: $style.hiddenIcon]" v-if="props.tooltipText">
<component :is="$options.components.N8nTooltip" placement="top" :popper-class="$style.tooltipPopper">
<component :is="$options.components.N8nIcon" icon="question-circle" size="small" />
<div slot="content" v-html="$options.methods.addTargetBlank(props.tooltipText)"></div>
</component>
<template>
<div :class="$style.container">
<div :class="{
[this.$style.label]: !!this.label,
[this.$style.underline]: this.underline,
[this.$style[this.size]]: true,
}">
<div :class="$style.title" v-if="label">
<n8n-text :bold="bold" :size="size" :compact="!underline">
{{ label }}
<n8n-text color="primary" :bold="bold" :size="size" v-if="required">*</n8n-text>
</n8n-text>
</div>
<span :class="[$style.infoIcon, showTooltip ? $style.visible: $style.hidden]" v-if="tooltipText && label">
<n8n-tooltip placement="top" :popper-class="$style.tooltipPopper">
<n8n-icon icon="question-circle" size="small" />
<div slot="content" v-html="addTargetBlank(tooltipText)"></div>
</n8n-tooltip>
</span>
<div v-if="$slots.options && label" :class="{[$style.overlay]: true, [$style.visible]: showOptions}"><div></div></div>
<div v-if="$slots.options" :class="{[$style.options]: true, [$style.visible]: showOptions}">
<slot name="options"></slot>
</div>
</div>
<slot></slot>
</div>
Expand Down Expand Up @@ -56,89 +66,109 @@ export default {
showTooltip: {
type: Boolean,
},
labelHoverableOnly: {
showOptions: {
type: Boolean,
default: false,
},
},
methods: {
addTargetBlank,
getLabelClass(props: {label: string, size: string, underline: boolean}, $style: any) {
if (!props.label) {
return '';
}

const classes = [];
if (props.underline) {
classes.push($style[`label-${props.size}-underline`]);
}
else {
classes.push($style[`label-${props.size}`]);
}

if (props.labelHoverableOnly) {
classes.push($style.inputLabel);
}

return classes;
},
},
};
</script>

<style lang="scss" module>
.inputLabelContainer:hover {
> div > .infoIcon {
display: inline-block;
.container {
display: flex;
flex-direction: column;
}

.container:hover,.inputLabel:hover {
.infoIcon {
opacity: 1;
}

.options {
opacity: 1;
transition: opacity 100ms ease-in; // transition on hover in
}

.overlay {
opacity: 1;
transition: opacity 100ms ease-in; // transition on hover in
}
}

.inputLabel:hover {
> .infoIcon {
display: inline-block;
.title {
display: flex;
align-items: center;
min-width: 0;

> * {
white-space: nowrap;
}
}

.infoIcon {
display: flex;
align-items: center;
color: var(--color-text-light);
padding-left: var(--spacing-4xs);
background-color: var(--color-background-xlight);
z-index: 1;
}

.showIcon {
display: inline-block;
}
.options {
opacity: 0;
background-color: var(--color-background-xlight);
transition: opacity 250ms cubic-bezier(.98,-0.06,.49,-0.2); // transition on hover out

.hiddenIcon {
display: none;
> * {
float: right;
}
}

.label {
* {
margin-right: var(--spacing-5xs);
.overlay {
position: relative;
flex-grow: 1;
opacity: 0;
transition: opacity 250ms cubic-bezier(.98,-0.06,.49,-0.2); // transition on hover out

> div {
position: absolute;
width: 60px;
height: 19px;
top: 0;
right: 0;
z-index: 0;

background: linear-gradient(270deg, var(--color-foreground-xlight) 72.19%, rgba(255, 255, 255, 0) 107.45%);
}
}

.label-small {
composes: label;
margin-bottom: var(--spacing-4xs);
.hidden {
opacity: 0;
}

.label-medium {
composes: label;
margin-bottom: var(--spacing-2xs);
.visible {
opacity: 1;
}

.underline {
border-bottom: var(--border-base);
.label {
display: flex;
overflow-x: hidden;
overflow-y: clip;
}

.small {
margin-bottom: var(--spacing-5xs);
}

.label-small-underline {
composes: label-small;
composes: underline;
.medium {
margin-bottom: var(--spacing-2xs);
}

.label-medium-underline {
composes: label-medium;
composes: underline;
.underline {
border-bottom: var(--border-base);
}

.tooltipPopper {
Expand All @@ -148,4 +178,5 @@ export default {
margin-left: var(--spacing-s);
}
}

</style>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<label role="radio" tabindex="-1" :class="$style.container" aria-checked="true">
<label role="radio" tabindex="-1" :class="{[$style.container]: true, [$style.hoverable]: !this.disabled}" aria-checked="true">
<input type="radio" tabindex="-1" autocomplete="off" :class="$style.input" :value="value">
<div :class="{[$style.button]: true, [$style.active]: active}" @click="$emit('click')">{{ label }}</div>
<div :class="{[$style.button]: true, [$style.active]: active, [$style[size]]: true, [$style.disabled]: disabled}" @click="$emit('click')">{{ label }}</div>
</label>
</template>

Expand All @@ -21,6 +21,15 @@ export default {
type: Boolean,
default: false,
},
size: {
type: String,
default: 'medium',
validator: (value: string): boolean =>
['small', 'medium'].includes(value),
},
disabled: {
type: Boolean,
},
},
};
</script>
Expand All @@ -30,11 +39,11 @@ export default {
display: inline-block;
outline: 0;
position: relative;
}

&:hover {
.button:not(.active) {
color: var(--color-primary);
}
.hoverable:hover {
.button:not(.active) {
color: var(--color-primary);
}
}

Expand All @@ -47,16 +56,29 @@ export default {

.button {
border-radius: 0;
padding: 0 var(--spacing-xs);
display: flex;
align-items: center;
height: 26px;
font-size: var(--font-size-2xs);
border-radius: var(--border-radius-base);
font-weight: var(--font-weight-bold);
color: var(--color-text-base);
cursor: pointer;
transition: background-color 0.2s ease;
cursor: pointer;
}

.disabled {
cursor: not-allowed;
}

.medium {
height: 26px;
font-size: var(--font-size-2xs);
padding: 0 var(--spacing-xs);
}

.small {
font-size: var(--font-size-3xs);
height: 15px;
padding: 0 var(--spacing-4xs);
}

.active {
Expand Down
Loading