Browse Source
Merge pull request #1173 from Budibase/martin-bugfixes
Martin bugfixes
gh-pages
Martin McKeaveney
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
21 additions and
4 deletions
-
packages/builder/src/components/design/PropertiesPanel/PropertyControls/DatasourceSelect.svelte
-
packages/builder/src/components/design/PropertiesPanel/PropertyControls/SchemaSelect.svelte
-
packages/builder/src/components/start/CreateAppModal.svelte
|
|
|
@ -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, |
|
|
|
|
|
|
|
@ -4,4 +4,4 @@ |
|
|
|
const otherSources = [{ name: "Custom", label: "Custom" }] |
|
|
|
</script> |
|
|
|
|
|
|
|
<DatasourceSelect on:change {...$$props} {otherSources} /> |
|
|
|
<DatasourceSelect on:change {...$$props} showAllQueries={true} {otherSources} /> |
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<script> |
|
|
|
import { writable, get as svelteGet } from "svelte/store" |
|
|
|
import { notifier } from "builderStore/store/notifications" |
|
|
|
import { |
|
|
|
store, |
|
|
|
automationStore, |
|
|
|
@ -61,7 +62,15 @@ |
|
|
|
const existingAppNames = svelteGet(hostingStore).deployedAppNames |
|
|
|
infoValidation.applicationName = string() |
|
|
|
.required("Your application must have a name.") |
|
|
|
.notOneOf(existingAppNames) |
|
|
|
.test( |
|
|
|
"non-existing-app-name", |
|
|
|
"App with same name already exists. Please try another app name.", |
|
|
|
value => |
|
|
|
!existingAppNames.some( |
|
|
|
appName => appName.toLowerCase() === value.toLowerCase() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
steps = [buildStep(Info), buildStep(User)] |
|
|
|
validationSchemas = [infoValidation, userValidation] |
|
|
|
} |
|
|
|
@ -120,6 +129,11 @@ |
|
|
|
template, |
|
|
|
}) |
|
|
|
const appJson = await appResp.json() |
|
|
|
|
|
|
|
if (!appResp.ok) { |
|
|
|
throw new Error(appJson.message) |
|
|
|
} |
|
|
|
|
|
|
|
analytics.captureEvent("App Created", { |
|
|
|
name: $createAppStore.values.applicationName, |
|
|
|
appId: appJson._id, |
|
|
|
@ -150,6 +164,8 @@ |
|
|
|
$goto(`/${appJson._id}`) |
|
|
|
} catch (error) { |
|
|
|
console.error(error) |
|
|
|
notifier.danger(error) |
|
|
|
submitting = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|