Fix preview scripts with wrong tag (#7999)
This commit is contained in:
@@ -142,6 +142,8 @@
|
||||
rawAppRunnableKey?: string | undefined
|
||||
// Used to provide typed queries in TypeScript when detecting assets
|
||||
preparedAssetsSqlQueries?: InferAssetsSqlQueryDetails[] | undefined
|
||||
// To execute preview scripts with the right worker group
|
||||
customTag?: string
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -171,7 +173,8 @@
|
||||
moduleId = undefined,
|
||||
enablePreprocessorSnippet = false,
|
||||
rawAppRunnableKey = undefined,
|
||||
preparedAssetsSqlQueries
|
||||
preparedAssetsSqlQueries,
|
||||
customTag
|
||||
}: Props = $props()
|
||||
|
||||
$effect.pre(() => {
|
||||
@@ -595,7 +598,8 @@
|
||||
lang === 'graphql' ? 'graphql' : (scriptLang ?? ''),
|
||||
resourcePath,
|
||||
$workspaceStore,
|
||||
(e) => console.error(`error getting ${lang} (${scriptLang}) db schema`, e)
|
||||
(e) => console.error(`error getting ${lang} (${scriptLang}) db schema`, e),
|
||||
{ customTag }
|
||||
)
|
||||
}
|
||||
dbSchema = $dbSchemas[resourcePath]
|
||||
|
||||
@@ -1415,6 +1415,7 @@
|
||||
{args}
|
||||
{enablePreprocessorSnippet}
|
||||
preparedAssetsSqlQueries={preparedSqlQueries.current}
|
||||
customTag={tag}
|
||||
/>
|
||||
<DiffEditor
|
||||
className="h-full"
|
||||
|
||||
@@ -402,6 +402,7 @@ export async function getDbSchemas(
|
||||
errorCallback: (message: string) => void,
|
||||
options: {
|
||||
useLegacyScripts?: boolean // To avoid breaking app policies
|
||||
customTag?: string
|
||||
} = {}
|
||||
): Promise<DBSchema | undefined> {
|
||||
let scripts = options.useLegacyScripts ? legacyScripts : scriptsV2
|
||||
@@ -416,6 +417,7 @@ export async function getDbSchemas(
|
||||
requestBody: {
|
||||
language: sqlScript.lang as Preview['language'],
|
||||
content: sqlScript.code,
|
||||
tag: options.customTag,
|
||||
args: {
|
||||
[sqlScript.argName]: resourcePath.startsWith('datatable://')
|
||||
? resourcePath
|
||||
|
||||
@@ -895,6 +895,7 @@
|
||||
key={`flow-inline-${$workspaceStore}-${$pathStore}-${flowModule.id}`}
|
||||
moduleId={flowModule.id}
|
||||
preparedAssetsSqlQueries={preparedSqlQueries.current}
|
||||
customTag={flowModule.value.tag}
|
||||
/>
|
||||
</div>
|
||||
</Pane>
|
||||
@@ -957,6 +958,7 @@
|
||||
key={`flow-inline-${$workspaceStore}-${$pathStore}-${flowModule.id}`}
|
||||
moduleId={flowModule.id}
|
||||
preparedAssetsSqlQueries={preparedSqlQueries.current}
|
||||
customTag={flowModule.value.tag}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user