mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
feat(editor): limit when to show mapping tooltip (#3976)
* limit when to show mapping tooltip * refactor tooltip pos * update tooltip pos * update var name
This commit is contained in:
parent
b2c674591c
commit
8fc9f07f39
|
@ -53,7 +53,7 @@
|
||||||
[$style.draggingHeader]: isDragging,
|
[$style.draggingHeader]: isDragging,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<span>{{ column || ' ' }}</span>
|
<span>
|
||||||
<n8n-tooltip
|
<n8n-tooltip
|
||||||
v-if="mappingEnabled"
|
v-if="mappingEnabled"
|
||||||
placement="bottom-start"
|
placement="bottom-start"
|
||||||
|
@ -61,23 +61,24 @@
|
||||||
:value="i === 0 && showHintWithDelay"
|
:value="i === 0 && showHintWithDelay"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="focusedMappableInput"
|
|
||||||
slot="content"
|
slot="content"
|
||||||
v-html="
|
v-html="
|
||||||
$locale.baseText('dataMapping.tableHint', {
|
$locale.baseText(
|
||||||
|
focusedMappableInput
|
||||||
|
? 'dataMapping.tableHint'
|
||||||
|
: 'dataMapping.dragColumnToFieldHint',
|
||||||
|
{
|
||||||
interpolate: { name: focusedMappableInput },
|
interpolate: { name: focusedMappableInput },
|
||||||
})
|
},
|
||||||
|
)
|
||||||
"
|
"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<span>{{ column || ' ' }}</span>
|
||||||
v-else
|
</n8n-tooltip>
|
||||||
slot="content"
|
</span>
|
||||||
v-html="$locale.baseText('dataMapping.dragColumnToFieldHint')"
|
|
||||||
></div>
|
|
||||||
<div :class="$style.dragButton">
|
<div :class="$style.dragButton">
|
||||||
<font-awesome-icon icon="grip-vertical" />
|
<font-awesome-icon icon="grip-vertical" />
|
||||||
</div>
|
</div>
|
||||||
</n8n-tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Draggable>
|
</Draggable>
|
||||||
|
@ -199,9 +200,18 @@ export default mixins(externalHooks).extend({
|
||||||
draggedColumn: false,
|
draggedColumn: false,
|
||||||
draggingPath: null as null | string,
|
draggingPath: null as null | string,
|
||||||
hoveringPath: null as null | string,
|
hoveringPath: null as null | string,
|
||||||
|
mappingHintVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.showMappingHint) {
|
||||||
|
this.mappingHintVisible = true;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.mappingHintVisible = false;
|
||||||
|
}, 6000);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.showMappingHint && this.showHint) {
|
if (this.showMappingHint && this.showHint) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showHintWithDelay = this.showHint;
|
this.showHintWithDelay = this.showHint;
|
||||||
|
@ -228,7 +238,7 @@ export default mixins(externalHooks).extend({
|
||||||
showHint(): boolean {
|
showHint(): boolean {
|
||||||
return (
|
return (
|
||||||
!this.draggedColumn &&
|
!this.draggedColumn &&
|
||||||
(this.showMappingHint ||
|
((this.showMappingHint && this.mappingHintVisible) ||
|
||||||
(!!this.focusedMappableInput &&
|
(!!this.focusedMappableInput &&
|
||||||
window.localStorage.getItem(LOCAL_STORAGE_MAPPING_FLAG) !== 'true'))
|
window.localStorage.getItem(LOCAL_STORAGE_MAPPING_FLAG) !== 'true'))
|
||||||
);
|
);
|
||||||
|
@ -409,7 +419,10 @@ export default mixins(externalHooks).extend({
|
||||||
// Remove key so that we know that it got added
|
// Remove key so that we know that it got added
|
||||||
leftEntryColumns.splice(leftEntryColumns.indexOf(key), 1);
|
leftEntryColumns.splice(leftEntryColumns.indexOf(key), 1);
|
||||||
|
|
||||||
hasJson[key] = hasJson[key] || (typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) || false;
|
hasJson[key] =
|
||||||
|
hasJson[key] ||
|
||||||
|
(typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) ||
|
||||||
|
false;
|
||||||
} else {
|
} else {
|
||||||
// Entry does not have key so add null
|
// Entry does not have key so add null
|
||||||
entryRows.push(null);
|
entryRows.push(null);
|
||||||
|
@ -422,7 +435,10 @@ export default mixins(externalHooks).extend({
|
||||||
tableColumns.push(key);
|
tableColumns.push(key);
|
||||||
// Add the value
|
// Add the value
|
||||||
entryRows.push(entry[key]);
|
entryRows.push(entry[key]);
|
||||||
hasJson[key] = hasJson[key] || (typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) || false;
|
hasJson[key] =
|
||||||
|
hasJson[key] ||
|
||||||
|
(typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) ||
|
||||||
|
false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add the data of the entry
|
// Add the data of the entry
|
||||||
|
|
Loading…
Reference in a new issue