feat(editor): Show parameter hint on multilines (#5014)

Single/multi line for hints.
This commit is contained in:
Giulio Andreini 2023-02-27 07:25:57 +01:00 committed by GitHub
parent 40a934bbb4
commit 1942fd8232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -1,12 +1,15 @@
<template>
<n8n-text size="small" color="text-base" tag="div" v-if="hint">
<div v-if="!renderHTML" :class="{ [$style.hint]: true, [$style.highlight]: highlight }">
<div
v-if="!renderHTML"
:class="{ [$style.singleline]: singleLine, [$style.highlight]: highlight }"
>
{{ hint }}
</div>
<div
v-else
ref="hint"
:class="{ [$style.hint]: true, [$style.highlight]: highlight }"
:class="{ [$style.singleline]: singleLine, [$style.highlight]: highlight }"
v-html="sanitizeHtml(hint)"
></div>
</n8n-text>
@ -25,6 +28,9 @@ export default Vue.extend({
highlight: {
type: Boolean,
},
singleLine: {
type: Boolean,
},
renderHTML: {
type: Boolean,
default: false,
@ -42,12 +48,11 @@ export default Vue.extend({
</script>
<style lang="scss" module>
.hint {
.singleline {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.highlight {
color: var(--color-secondary);
}

View file

@ -29,6 +29,7 @@
data-test-id="parameter-expression-preview"
:highlight="!!(expressionOutput && targetItem)"
:hint="expressionOutput"
:singleLine="true"
/>
<input-hint
v-else-if="parameterHint"