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
25 changes: 25 additions & 0 deletions backend/src/baserow/contrib/integrations/ai/integration_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from baserow.contrib.integrations.ai.models import AIIntegration
from baserow.core.integrations.registries import IntegrationType
from baserow.core.integrations.types import IntegrationDict
from baserow.core.models import Application


class AIIntegrationType(IntegrationType):
Expand Down Expand Up @@ -98,6 +99,30 @@ def is_provider_overridden(

return provider_type in integration.ai_settings

def import_serialized(
self,
application: Application,
serialized_values: Dict[str, Any],
id_mapping: Dict,
files_zip=None,
storage=None,
cache=None,
) -> AIIntegration:
if cache is None:
cache = {}

# AI settings are sensitive data, the serialized data will set it `None`.
serialized_values["ai_settings"] = serialized_values["ai_settings"] or {}

return super().import_serialized(
application,
serialized_values,
id_mapping,
files_zip=files_zip,
storage=storage,
cache=cache,
)

def export_serialized(
self,
instance: AIIntegration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,34 @@ def test_ai_integration_export_serialized_exclude_sensitive(data_fixture):
def test_ai_integration_import_serialized(data_fixture):
user = data_fixture.create_user()
application = data_fixture.create_builder_application(user=user)

integration_type = AIIntegrationType()
integration = IntegrationService().create_integration(
user,
integration_type,
application=application,
ai_settings={
"openai": {
"api_key": "sk-secret123",
"models": ["gpt-4"],
}
},
)

serialized_data = {
"id": 1,
"type": "ai",
"ai_settings": {}, # Empty on import (will inherit from workspace)
}
serialized = json.loads(
json.dumps(
integration_type.export_serialized(
integration,
import_export_config=ImportExportConfig(
include_permission_data=False,
reduce_disk_space_usage=False,
exclude_sensitive_data=True,
),
)
)
)

imported_integration = integration_type.import_serialized(
application, serialized_data, {}, lambda x, d: x
application, serialized, {}, lambda x, d: x
)

assert imported_integration.ai_settings == {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Resolved a bug in the AI integration which prevented workspaces from being exported and then imported correctly.",
"issue_origin": "github",
"issue_number": null,
"domain": "core",
"bullet_points": [],
"created_at": "2026-02-19"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:monday-first="true"
:use-utc="true"
:model-value="dateObject"
:language="$i18n.locale"
:language="datePickerLanguage"
:disabled-dates="disableDates"
class="datepicker"
@update:model-value="
Expand All @@ -52,8 +52,7 @@ import {
getDateMomentFormat,
getDateHumanReadableFormat,
} from '@baserow/modules/database/utils/date'
// TODO MIG
//import { en, fr } from 'vuejs3-datepicker'
import { useDatePickerLanguage } from '@baserow/modules/core/composables/useDatePickerLanguage'

export default {
name: 'DateFilter',
Expand All @@ -77,7 +76,7 @@ export default {
},
},
setup() {
return { v$: useVuelidate({ $lazy: true }) }
return { v$: useVuelidate({ $lazy: true }), ...useDatePickerLanguage() }
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion web-frontend/modules/core/components/sidebar/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
></component>
<template v-if="showAdmin">
<div class="sidebar__head">
<a href="#" class="sidebar__back" @click="setShowAdmin(false)">
<a class="sidebar__back" @click="setShowAdmin(false)">
<i class="sidebar__back-icon iconoir-nav-arrow-left"></i>
</a>
<div v-show="!collapsed" class="sidebar__title">
Expand Down
38 changes: 38 additions & 0 deletions web-frontend/modules/core/composables/useDatePickerLanguage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'

// Maps Baserow i18n locale codes to vuejs3-datepicker language keys.
// The datepicker uses non-standard keys for some languages (e.g. 'kr' for Korean, 'vn' for Vietnamese).
// Source: https://github.com/shubhadip/vuejs3-datepicker/blob/master/src/components/datepicker/locale/index.ts
const LOCALE_TO_DATEPICKER = {
ar: 'ar',
af: 'af',
bg: 'bg',
cs: 'cs',
de: 'de',
en: 'en',
es: 'es',
fr: 'fr',
hi: 'hi',
id: 'id',
it: 'it',
ja: 'ja',
ko: 'kr', // datepicker uses 'kr' for Korean
nl: 'nl',
pl: 'pl',
pt: 'pt',
pt_BR: 'pt', // no Brazilian variant, falls back to Portuguese
pt_PT: 'pt', // no Portugal variant, falls back to Portuguese
ru: 'ru',
tr: 'tr',
vi: 'vn', // datepicker uses 'vn' for Vietnamese
zh_TW: 'zh_TW',
}

export function useDatePickerLanguage() {
const { locale } = useI18n()
const datePickerLanguage = computed(
() => LOCALE_TO_DATEPICKER[locale.value] ?? 'en'
)
return { datePickerLanguage }
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
:monday-first="true"
:use-utc="true"
:model-value="pickerDate"
:language="$i18n.locale"
:language="datePickerLanguage"
class="datepicker"
@update:model-value="chooseDate(field, $event)"
/>
Expand Down Expand Up @@ -80,10 +80,14 @@ import TimeSelectContext from '@baserow/modules/core/components/TimeSelectContex
import rowEditField from '@baserow/modules/database/mixins/rowEditField'
import rowEditFieldInput from '@baserow/modules/database/mixins/rowEditFieldInput'
import dateField from '@baserow/modules/database/mixins/dateField'
import { useDatePickerLanguage } from '@baserow/modules/core/composables/useDatePickerLanguage'

export default {
components: { TimeSelectContext },
mixins: [rowEditField, rowEditFieldInput, dateField],
setup() {
return useDatePickerLanguage()
},
methods: {
focus(...args) {
this.select()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
this.reload()
},
async reload() {
if (this.values.content === '') {
if (!this.values.content) {
this.resetImporterState()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:monday-first="true"
:use-utc="true"
:model-value="dateObject"
:language="$i18n.locale"
:language="datePickerLanguage"
class="datepicker"
@updated:model-value="chooseDate($event)"
></date-picker>
Expand All @@ -42,22 +42,18 @@ import {
getDateHumanReadableFormat,
} from '@baserow/modules/database/utils/date'
import filterTypeDateInput from '@baserow/modules/database/mixins/filterTypeDateInput'
import { en, fr } from 'vuejs-datepicker/dist/locale'
import { useDatePickerLanguage } from '@baserow/modules/core/composables/useDatePickerLanguage'

export default {
name: 'ViewFilterTypeDate',
mixins: [filterTypeDateInput],
setup() {
return { v$: useVuelidate({ $lazy: true }) }
return { v$: useVuelidate({ $lazy: true }), ...useDatePickerLanguage() }
},
data() {
return {
dateString: '',
dateObject: '',
datePickerLang: {
en,
fr,
},
}
},
mounted() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
:monday-first="true"
:use-utc="true"
:model-value="dateObject"
:language="$i18n.locale"
:language="datePickerLanguage"
class="datepicker"
@update:model-value="chooseDate($event)"
></date-picker>
Expand All @@ -82,11 +82,17 @@ import {
} from '@baserow/modules/database/utils/date'
// TODO MIG import { en, fr } from 'vuejs-datepicker/dist/locale'
import filterTypeMultiStepDateInput from '@baserow/modules/database/mixins/filterTypeMultiStepDateInput'
import { useDatePickerLanguage } from '@baserow/modules/core/composables/useDatePickerLanguage'

export default {
name: 'ViewFilterTypeMultiStepDate',
mixins: [filterTypeMultiStepDateInput],
setup: filterTypeMultiStepDateInput.setup,
setup(...args) {
return {
...(filterTypeMultiStepDateInput.setup?.(...args) ?? {}),
...useDatePickerLanguage(),
}
},
data() {
return {
value: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
:monday-first="true"
:use-utc="true"
:model-value="pickerDate"
:language="$i18n.locale"
:language="datePickerLanguage"
class="datepicker"
@update:model-value="chooseDate(field, $event)"
@selected="preventNextUnselect = true"
Expand Down Expand Up @@ -80,11 +80,15 @@ import { isElement } from '@baserow/modules/core/utils/dom'
import gridField from '@baserow/modules/database/mixins/gridField'
import gridFieldInput from '@baserow/modules/database/mixins/gridFieldInput'
import dateField from '@baserow/modules/database/mixins/dateField'
import { useDatePickerLanguage } from '@baserow/modules/core/composables/useDatePickerLanguage'
// TODO MIG import { en, fr } from 'vuejs-datepicker/dist/locale'

export default {
components: { TimeSelectContext },
mixins: [gridField, gridFieldInput, dateField],
setup() {
return useDatePickerLanguage()
},
data() {
return {
preventNextUnselect: false,
Expand Down
1 change: 1 addition & 0 deletions web-frontend/modules/database/viewTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,7 @@ export class FormViewType extends ViewType {
condition_type: 'AND',
conditions: [],
field_component: 'default',
allowed_select_options: [],
},
},
{ root: true }
Expand Down
Loading