1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

show all query types in form component

This commit is contained in:
Martin McKeaveney 2021-02-24 11:57:53 +00:00
parent 03512da423
commit d0b7cf71e3
3 changed files with 6 additions and 5 deletions

View file

@ -20,6 +20,7 @@
export let value = {}
export let otherSources
export let showAllQueries
$: tables = $backendUiStore.tables.map(m => ({
label: m.name,
@ -36,8 +37,8 @@
return [...acc, ...viewsArr]
}, [])
$: queries = $backendUiStore.queries
.filter(query => query.queryVerb === "read" || query.readable)
.map(query => ({
.filter(query => showAllQueries || (query.queryVerb === "read" || query.readable))
.map(query => ({
label: query.name,
name: query.name,
tableId: query._id,

View file

@ -4,4 +4,4 @@
const otherSources = [{ name: "Custom", label: "Custom" }]
</script>
<DatasourceSelect on:change {...$$props} {otherSources} />
<DatasourceSelect on:change {...$$props} showAllQueries={true} {otherSources} />

View file

@ -66,8 +66,8 @@
"non-existing-app-name",
"App with same name already exists. Please try another app name.",
value =>
!existingAppNames.some(appName =>
new RegExp(appName, "ig").test(value)
!existingAppNames.some(
appName => appName.toLowerCase() === value.toLowerCase()
)
)