Skip to content

Commit 2a6d92e

Browse files
jrmipicklepete
andauthored
Improve formula example display (baserow#4215)
* Improve formula display * Move 'Example' to a localised string. --------- Co-authored-by: peter_baserow <peter@baserow.io>
1 parent 6a1d587 commit 2a6d92e

File tree

3 files changed

+318
-55
lines changed

3 files changed

+318
-55
lines changed

web-frontend/modules/core/components/nodeExplorer/NodeHelpTooltip.vue

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,24 @@
1818
{{ node.description }}
1919
</p>
2020

21-
<div v-if="node.example" class="node-help-tooltip__example">
22-
<div class="node-help-tooltip__example-code">
23-
<FormulaInputField
24-
:value="node.example"
25-
:read-only="true"
26-
:nodes-hierarchy="nodesHierarchy"
27-
mode="advanced"
28-
/>
29-
</div>
30-
</div>
21+
<FormGroup
22+
v-if="node.example"
23+
class="node-help-tooltip__example"
24+
:label="$t('nodeHelpTooltip.exampleLabel')"
25+
small-label
26+
required
27+
:helper-text="
28+
$t('nodeHelpTooltip.result', { result: node.example.result })
29+
"
30+
>
31+
<FormulaInputField
32+
class="node-help-tooltip__example-code"
33+
:value="node.example.formula"
34+
:read-only="true"
35+
:nodes-hierarchy="nodesHierarchy"
36+
mode="advanced"
37+
/>
38+
</FormGroup>
3139
</div>
3240
</div>
3341
</Context>

web-frontend/modules/core/locales/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,10 @@
10751075
"notAllowedTitle": "2FA not enabled",
10761076
"notAllowedDescription": "Adding 2FA is only possible to password-based accounts."
10771077
},
1078+
"nodeHelpTooltip": {
1079+
"exampleLabel": "Example",
1080+
"result": "Result: {result}"
1081+
},
10781082
"enableWithQRCode": {
10791083
"scanQRCode": "Scan QR code",
10801084
"scanQRCodeDescription": "Scan the code with an app like Google Authenticator, Authy or Microsoft Authenticator.",

0 commit comments

Comments
 (0)