Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Data source context was not reset after a data source creation",
"issue_origin": "github",
"issue_number": null,
"domain": "builder",
"bullet_points": [],
"created_at": "2026-03-04"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Resolved an issue which caused AI field formulas to appear twice in the UI.",
"issue_origin": "github",
"issue_number": null,
"domain": "database",
"bullet_points": [],
"created_at": "2026-03-18"
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
type="primary"
size="large"
@click="next()"
>Next</Button
>
{{ $t('action.next') }}
</Button>
<template v-else-if="index >= fields.length - 1">
<Editable
ref="submitText"
Expand Down
3 changes: 2 additions & 1 deletion web-frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"download": "Download",
"copyToClipboard": "Copy to clipboard",
"reset": "Reset",
"hide": "Hide"
"hide": "Hide",
"next": "Next"
},
"adminType": {
"settings": "Settings",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Modal ref="modal" wide v-on="$attrs">
<Modal ref="modal" wide v-on="$attrs" @show="onShow">
<h2 class="box__title">
{{
create
Expand All @@ -19,7 +19,7 @@
:data-source="dataSource"
:builder="builder"
:page="dataSourcePage"
:default-values="dataSource"
:default-values="currentDefaultValues"
:integrations="integrations"
:create="create"
:application-context-additions="{
Expand Down Expand Up @@ -77,18 +77,18 @@ export default {
props: {
dataSourceId: { type: Number, required: false, default: null },
},
emits: ['updated'],
emits: ['updated', 'data-source-created'],
data() {
return {
loading: false,
actualDataSourceId: this.dataSourceId,
changed: false,
currentDefaultValues: {},
}
},
computed: {
submitIsDisabled() {
return (
this.loading || !this.changed || this.$refs.dataSourceForm?.v$.$anyError
this.loading || !this.changed || this.$refs.dataSourceForm.v$.$anyError
)
},
dataSources() {
Expand All @@ -108,7 +108,7 @@ export default {
return [...this.dataSources, ...this.sharedDataSources]
},
create() {
return !this.actualDataSourceId
return !this.dataSourceId
},
isShared() {
return !this.create && this.dataSource?.page_id === this.sharedPage.id
Expand All @@ -117,9 +117,7 @@ export default {
if (this.create) {
return undefined
}
return this.allDataSources.find(
({ id }) => id === this.actualDataSourceId
)
return this.allDataSources.find(({ id }) => id === this.dataSourceId)
},
integrations() {
return this.$store.getters['integration/getIntegrations'](this.builder)
Expand All @@ -143,14 +141,22 @@ export default {
]
},
},
watch: {
dataSource(newValue) {
this.currentDefaultValues = { ...this.dataSource }
},
},
methods: {
...mapActions({
actionFetchIntegrations: 'integration/fetch',
actionCreateDataSource: 'dataSource/create',
actionUpdateDataSource: 'dataSource/update',
}),
onShow() {
this.currentDefaultValues = { ...this.dataSource }
},
onValuesChanged(values) {
if (!this.actualDataSourceId) {
if (!this.dataSourceId) {
this.changed = true
return
}
Expand All @@ -159,6 +165,10 @@ export default {
)

if (differences.length) {
this.currentDefaultValues = {
...this.currentDefaultValues,
...Object.fromEntries(differences),
}
this.changed = true
}
},
Expand All @@ -172,7 +182,7 @@ export default {
page: this.currentPage,
values,
})
this.actualDataSourceId = createdDataSource.id
this.$emit('data-source-created', createdDataSource)
} else {
const differences = Object.fromEntries(
Object.entries(values).filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
</div>
</template>
<DataSourceCreateEditModal
:key="currentDataSourceId"
ref="dataSourceCreateEditModal"
:data-source-id="currentDataSourceId"
@data-source-created="currentDataSourceId = $event.id"
@hidden="onHide"
/>
</Context>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export default {
hoveredFunctionNode: null,
isHandlingModeChange: false,
intersectionObserver: null,
isEditorInitialized: false,
}
},
computed: {
Expand Down Expand Up @@ -348,6 +349,11 @@ export default {
},

mode(newMode, oldMode) {
// In Vue 3, watchers can fire during the initial render cycle before
// mounted() completes. Skip if editor hasn't been initialized yet.
if (!this.isEditorInitialized) {
return
}
// Skip automatic recreation if we're handling it manually in handleModeChange
if (this.isHandlingModeChange) {
return
Expand Down Expand Up @@ -437,6 +443,7 @@ export default {
}),
},
})
this.isEditorInitialized = true
},
recreateEditor(formula = null) {
const currentFormula =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default {
)
},
databases() {
return this.selectedIntegration?.context_data.databases || []
return this.selectedIntegration?.context_data?.databases || []
},
},
watch: {
Expand Down
Loading