1
0
Fork 0
mirror of synced 2024-08-19 03:51:29 +12:00

Merge pull request #10551 from Budibase/fix-app-onboarding

Fix multiple issues with first app onboarding
This commit is contained in:
Andrew Kingston 2023-05-11 18:25:22 +01:00 committed by GitHub
commit 732a051252

View file

@ -107,8 +107,9 @@
useSampleData, useSampleData,
isGoogle, isGoogle,
}) => { }) => {
let app
try { try {
const app = await createApp(useSampleData) app = await createApp(useSampleData)
let datasource let datasource
if (datasourceConfig) { if (datasourceConfig) {
@ -134,6 +135,17 @@
console.log(e) console.log(e)
creationLoading = false creationLoading = false
notifications.error("There was a problem creating your app") notifications.error("There was a problem creating your app")
// Reset the store so that we don't send up stale headers
store.actions.reset()
// If we successfully created an app, delete it again so that we
// can try again once the error has been corrected.
// This also ensures onboarding can't be skipped by entering invalid
// data credentials.
if (app?.appId) {
await API.deleteApp(app.appId)
}
} }
} }
</script> </script>
@ -146,7 +158,8 @@
/> />
</Modal> </Modal>
<SplitPage> <div class="full-width">
<SplitPage>
{#if stage === "name"} {#if stage === "name"}
<NamePanel bind:name bind:url onNext={() => (stage = "data")} /> <NamePanel bind:name bind:url onNext={() => (stage = "data")} />
{:else if googleComplete} {:else if googleComplete}
@ -163,7 +176,9 @@
{:else if stage === "data"} {:else if stage === "data"}
<DataPanel onBack={() => (stage = "name")}> <DataPanel onBack={() => (stage = "name")}>
<div class="dataButton"> <div class="dataButton">
<FancyButton on:click={() => handleCreateApp({ useSampleData: true })}> <FancyButton
on:click={() => handleCreateApp({ useSampleData: true })}
>
<div class="dataButtonContent"> <div class="dataButtonContent">
<div class="dataButtonIcon"> <div class="dataButtonIcon">
<img <img
@ -217,9 +232,13 @@
<div slot="right"> <div slot="right">
<ExampleApp {name} showData={stage !== "name"} /> <ExampleApp {name} showData={stage !== "name"} />
</div> </div>
</SplitPage> </SplitPage>
</div>
<style> <style>
.full-width {
width: 100%;
}
.centered { .centered {
display: flex; display: flex;
justify-content: center; justify-content: center;