Skip to content

Commit

Permalink
fix: move dynamic options hint to tooltip
Browse files Browse the repository at this point in the history
Closes #305
  • Loading branch information
Skaiir committed Oct 11, 2023
1 parent a8e1bb4 commit 5345997
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,10 @@ export default function InputKeyValuesSourceEntry(props) {
id
} = props;

const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';

const description = <div>
Define which input property to populate the values from.
<br /><br />The input property may be an array of simple values or alternatively follow this schema:
<pre><code>{schema}</code></pre>
</div>;

return [
{
id: id + '-key',
component: InputValuesKey,
label: 'Input values key',
description,
isEdited: isTextFieldEntryEdited,
editField,
field,
Expand All @@ -36,15 +26,20 @@ function InputValuesKey(props) {
const {
editField,
field,
id,
label,
description
id
} = props;

const debounce = useService('debounce');

const path = VALUES_SOURCES_PATHS[VALUES_SOURCES.INPUT];

const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';

const tooltip = <div>
The input property may be an array of simple values or alternatively follow this schema:
<pre><code>{schema}</code></pre>
</div>;

const getValue = () => get(field, path, '');

const setValue = (value, error) => {
Expand All @@ -69,11 +64,12 @@ function InputValuesKey(props) {

return TextFieldEntry({
debounce,
description,
description: 'Define which input property to populate the values from',
tooltip,
element: field,
getValue,
id,
label,
label: 'Input values key',
setValue,
validate
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function ValuesExpressionEntry(props) {
{
id: id + '-expression',
component: ValuesExpression,
label: 'Values expression',
isEdited: isFeelEntryEdited,
editField,
field
Expand All @@ -38,9 +37,8 @@ function ValuesExpression(props) {

const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';

const description = <div>
Define an expression to populate the options from.
<br /><br />The expression may result in an array of simple values or alternatively follow this schema:
const tooltip = <div>
The expression may result in an array of simple values or alternatively follow this schema:
<pre><code>{schema}</code></pre>
</div>;

Expand All @@ -50,7 +48,8 @@ function ValuesExpression(props) {

return FeelEntry({
debounce,
description,
description: 'Define an expression to populate the options from.',
tooltip,
element: field,
feel: 'required',
getValue,
Expand Down

0 comments on commit 5345997

Please sign in to comment.