mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 08:37:26 +00:00
fix(nc-gui): show create base with ai modal based on query params
This commit is contained in:
@@ -5,6 +5,11 @@ interface Props {
|
||||
dialogShow: boolean
|
||||
aiMode: boolean | null
|
||||
workspaceId?: string
|
||||
isCreateNewActionMenu?: boolean
|
||||
initialValue?: {
|
||||
basePrompt: string
|
||||
baseName: string
|
||||
}
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {})
|
||||
@@ -30,6 +35,8 @@ const { $e } = useNuxtApp()
|
||||
|
||||
const { clone } = useUndoRedo()
|
||||
|
||||
const { isWorkspaceLoading } = storeToRefs(useWorkspace())
|
||||
|
||||
const { aiIntegrationAvailable, aiError, aiLoading, createSchema, predictSchema } = useNocoAi()
|
||||
|
||||
const callFunction = ref<string | null>(null)
|
||||
@@ -94,7 +101,7 @@ const defaultAiFormState = {
|
||||
|
||||
const oldAiFormState = ref<typeof defaultAiFormState | null>(null)
|
||||
|
||||
const aiFormState = ref(defaultAiFormState)
|
||||
const aiFormState = ref({ ...defaultAiFormState, prompt: props.initialValue?.basePrompt ?? '' })
|
||||
|
||||
const isOldPromptChanged = computed(() => {
|
||||
return (
|
||||
@@ -331,6 +338,16 @@ onMounted(() => {
|
||||
aiPromptInputRef.value?.focus()
|
||||
}, 5)
|
||||
|
||||
if (props.initialValue?.basePrompt) {
|
||||
until(() => !isWorkspaceLoading.value)
|
||||
.toBeTruthy()
|
||||
.then(() => {
|
||||
if (!aiIntegrationAvailable.value) return
|
||||
|
||||
onPredictSchema()
|
||||
})
|
||||
}
|
||||
|
||||
until(() => leftPaneContentRef.value)
|
||||
.toBeTruthy()
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user