Skip to content

Commit 6f409a7

Browse files
authored
Improve the Local Baserow action form experience (baserow#4340)
* Working on improving the Local Baserow field mappings so that they clarify what data type they expect. We now also show the field's description, if it's set. * Removing the example, it was from a previous idea. * Re-adding the stylelint comment.
1 parent f541204 commit 6f409a7

File tree

7 files changed

+51
-21
lines changed

7 files changed

+51
-21
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "feature",
3+
"message": "Improved the Local Baserow action fields so that they inform users about what data type they expect to receive.",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "integration",
7+
"bullet_points": [],
8+
"created_at": "2025-11-26"
9+
}

web-frontend/modules/core/assets/scss/components/formula_input_field.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
}
4141

4242
/* stylelint-disable-next-line selector-class-pattern */
43-
.ProseMirror div.is-editor-empty:first-child::before {
44-
content: attr(data-placeholder);
43+
.formula-input-field--formula-empty .ProseMirror div:first-child::before {
44+
content: var(--formula-placeholder);
4545
float: left;
4646
color: $palette-neutral-500;
4747
pointer-events: none;

web-frontend/modules/core/components/FormGroup.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default {
116116
default: null,
117117
},
118118
/**
119-
* Wether the label should be displayed as a small label.
119+
* Whether the label should be displayed as a small label.
120120
*/
121121
smallLabel: {
122122
type: Boolean,
@@ -149,7 +149,7 @@ export default {
149149
default: false,
150150
},
151151
/**
152-
* Whether the label is required. (if false that will diplay an 'optional' label)
152+
* Whether the label is required. (if false that will display an 'optional' label)
153153
*/
154154
required: {
155155
type: Boolean,

web-frontend/modules/core/components/formula/FormulaInputField.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
role="textbox"
1010
:class="classes"
1111
:editor="editor"
12+
:style="{ '--formula-placeholder': `'${placeholder}'` }"
1213
@data-node-clicked="dataNodeClicked"
1314
/>
1415
</div>
@@ -39,7 +40,6 @@
3940

4041
<script>
4142
import { Editor, EditorContent, Node } from '@tiptap/vue-2'
42-
import { Placeholder } from '@tiptap/extension-placeholder'
4343
import { Document } from '@tiptap/extension-document'
4444
import { Text } from '@tiptap/extension-text'
4545
import { History } from '@tiptap/extension-history'
@@ -175,6 +175,11 @@ export default {
175175
}
176176
},
177177
computed: {
178+
isFormulaEmpty() {
179+
if (!this.editor) return true
180+
const formula = this.toFormula(this.wrapperContent)
181+
return !formula || formula.length === 0
182+
},
178183
classes() {
179184
return {
180185
'form-input--disabled': this.disabled,
@@ -183,13 +188,9 @@ export default {
183188
!this.disabled && !this.readOnly && this.isFocused,
184189
'formula-input-field--disabled': this.disabled,
185190
'formula-input-field--error': this.isFormulaInvalid,
191+
'formula-input-field--formula-empty': this.isFormulaEmpty,
186192
}
187193
},
188-
placeHolderExt() {
189-
return Placeholder.configure({
190-
placeholder: this.placeholder,
191-
})
192-
},
193194
formulaComponents() {
194195
return Object.values(this.$registry.getAll('runtimeFormulaFunction'))
195196
.map((type) => type.formulaComponent)
@@ -283,7 +284,6 @@ export default {
283284
ArrowKeyNavigationExtension,
284285
SmartDeletionExtension,
285286
ZWSManagementExtension,
286-
this.placeHolderExt,
287287
History.configure({
288288
depth: 100,
289289
}),

web-frontend/modules/database/fieldTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,7 +3659,7 @@ export class SingleSelectFieldType extends SelectOptionBaseFieldType {
36593659
}
36603660

36613661
getDocsDataType() {
3662-
return 'integer or string'
3662+
return 'number'
36633663
}
36643664

36653665
getDocsDescription(field) {
@@ -4956,7 +4956,7 @@ export class PasswordFieldType extends FieldType {
49564956
}
49574957

49584958
getDocsDataType(field) {
4959-
return 'bool'
4959+
return 'boolean'
49604960
}
49614961

49624962
getDocsDescription(field) {

web-frontend/modules/integrations/localBaserow/components/services/FieldMappingForm.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<template>
22
<div v-if="mapping?.enabled">
3-
<FormGroup small-label :label="field.name" required class="margin-bottom-2">
3+
<FormGroup
4+
small-label
5+
:label="field.name"
6+
:help-icon-tooltip="field.description"
7+
required
8+
class="margin-bottom-2"
9+
>
410
<InViewport>
511
<InjectedFormulaInput
612
:key="`${field.id} ${mapping.enabled}`"
713
v-model="fieldValue"
814
:disabled="!mapping.enabled"
9-
:placeholder="
10-
$t('localBaserowUpsertRowServiceForm.fieldMappingPlaceholder')
11-
"
15+
:placeholder="placeholderForType"
1216
/>
1317
<template #placeholder>
1418
<div class="field-mapping-form__placeholder" />
@@ -66,6 +70,9 @@ export default {
6670
}
6771
},
6872
computed: {
73+
fieldType() {
74+
return this.$registry.get('field', this.field.type)
75+
},
6976
fieldValue: {
7077
get() {
7178
return this.localValue
@@ -81,6 +88,14 @@ export default {
8188
}, 500)
8289
},
8390
},
91+
placeholderForType() {
92+
const expectedType = this.fieldType.getDocsDataType(this.field)
93+
const capitalizedType =
94+
expectedType.charAt(0).toUpperCase() + expectedType.slice(1)
95+
return this.$t(
96+
`localBaserowUpsertRowServiceForm.fieldMappingPlaceholder${capitalizedType}`
97+
)
98+
},
8499
},
85100
watch: {
86101
'mapping.value'(newValue) {

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"localBaserowGetRowForm": {
120120
"rowFieldLabel": "Row ID",
121121
"invalidFormula": "The formula is invalid",
122-
"rowFieldPlaceHolder": "Select a row ID",
122+
"rowFieldPlaceHolder": "Choose a single row ID",
123123
"rowFieldHelpText": "Leave this value empty to return the first row.",
124124
"searchFieldPlaceHolder": "Enter a search term...",
125125
"noTableChosenForFiltering": "Choose a table to begin using data source filters.",
@@ -277,7 +277,7 @@
277277
"branchesDescription": "Branches allow you to only execute nodes when a condition is met. Branches are executed left to right until a condition is met, otherwise the default branch will be executed. ",
278278
"branchLabel": "Label",
279279
"branchConditionLabel": "Condition",
280-
"branchConditionPlaceholder": "Enter condition...",
280+
"branchConditionPlaceholder": "If true, we follow this branch.",
281281
"addEdge": "Add branch",
282282
"edgeDefaultName": "Branch",
283283
"noLabel": "No label",
@@ -313,10 +313,16 @@
313313
"localBaserowServiceForm": {
314314
"integrationDropdownLabel": "Integration",
315315
"rowIdLabel": "Row ID",
316-
"rowIdPlaceholder": "Select a row ID"
316+
"rowIdPlaceholder": "Choose a single row ID"
317317
},
318318
"localBaserowUpsertRowServiceForm": {
319-
"fieldMappingPlaceholder": "Choose a field value",
319+
"fieldMappingPlaceholderArray": "Choose an array value, e.g [42]",
320+
"fieldMappingPlaceholderString": "Choose a string value, e.g. \\'baserow\\'",
321+
"fieldMappingPlaceholderNumber": "Choose a number value, e.g. 42",
322+
"fieldMappingPlaceholderBoolean": "Choose a boolean value, e.g. true",
323+
"fieldMappingPlaceholderDate": "Choose a date value, e.g. 2025-07-25",
324+
"fieldMappingPlaceholderDecimal": "Choose a decimal value, e.g. 3.14",
325+
"fieldMappingPlaceholderDuration": "Choose a duration value, e.g. 1:23:40",
320326
"noTableSelectedMessage": "Choose a table to begin configuring your fields.",
321327
"noWritableFields": "This table does not contain any writable fields."
322328
}

0 commit comments

Comments
 (0)