do not make query execution a requirement
This commit is contained in:
parent
536c2c317c
commit
ba17e0bc9c
|
@ -33,7 +33,7 @@
|
|||
{ label: "Datetime", value: "DATETIME" },
|
||||
]
|
||||
|
||||
$: datasource = $datasources.list.find(ds => ds._id === query.datasourceId)
|
||||
$: datasource = $datasources.list.find(ds => ds._id === query.datasourceId)
|
||||
$: query.schema = fields.reduce(
|
||||
(acc, next) => ({
|
||||
...acc,
|
||||
|
@ -48,6 +48,8 @@
|
|||
$: integrationInfo = $integrations[datasourceType]
|
||||
$: queryConfig = integrationInfo?.query
|
||||
$: shouldShowQueryConfig = queryConfig && query.queryVerb
|
||||
$: readQuery = query.queryVerb === "read" || query.readable
|
||||
$: queryInvalid = !query.name || (readQuery && data.length === 0)
|
||||
|
||||
function newField() {
|
||||
fields = [...fields, {}]
|
||||
|
@ -152,7 +154,7 @@
|
|||
<ButtonGroup>
|
||||
<Button
|
||||
cta
|
||||
disabled={data.length === 0 || !query.name}
|
||||
disabled={queryInvalid}
|
||||
on:click={saveQuery}
|
||||
>
|
||||
Save Query
|
||||
|
|
|
@ -60,7 +60,7 @@ exports.save = async function (ctx) {
|
|||
ctx.message = `Query ${query.name} saved successfully.`
|
||||
}
|
||||
|
||||
async function enrichQueryFields(fields, parameters) {
|
||||
async function enrichQueryFields(fields, parameters = {}) {
|
||||
const enrichedQuery = {}
|
||||
|
||||
// enrich the fields with dynamic parameters
|
||||
|
|
Loading…
Reference in New Issue