From 024bd01bf9663151d7961fdf4dab6e18ad2aba6e Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 23 Nov 2021 20:14:28 +0000 Subject: [PATCH 1/2] some autoscreen ux fixes --- .../NavigationPanel/NewScreenModal.svelte | 129 +++++++++++------- .../NavigationPanel/ScreenDetailsModal.svelte | 15 +- .../NavigationPanel/ScreenWizard.svelte | 35 +++-- 3 files changed, 123 insertions(+), 56 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index e7c9ef6ff2..1483517c20 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -1,13 +1,20 @@ - (autoSelected ? save() : chooseModal(1))} - disabled={!selectedScreens.length} - size="L" -> - Please select the screens you would like to add to your application. - Autogenerated screens come with CRUD functionality. + (autoSelected ? save() : chooseModal(1))} + disabled={!selectedScreens.length} + size="L" > - - - Blank screen -
x.id.includes(blankScreen))} - on:click={() => - toggleScreenSelection(templates.find(t => t.id === blankScreen))} - class:disabled={autoSelected} + Please select the screens you would like to add to your application. + Autogenerated screens come with CRUD functionality. -
- Blank -
-
- {#if selectedScreens.find(x => x.id === blankScreen)} - - {/if} -
-
- Autogenerated Screens - {#each $tables.list.filter(table => table._id !== "ta_users") as table} + + Blank screen
x.name.includes(table.name))} - on:click={() => toggleScreenSelection(table)} class="item" + class:selected={selectedScreens.find(x => x.id.includes(blankScreen))} + on:click={() => + toggleScreenSelection(templates.find(t => t.id === blankScreen))} + class:disabled={autoSelected} > -
- {table.name} +
+
Blank
- {#if selectedScreens.find(x => x.name.includes(table.name))} - + {#if selectedScreens.find(x => x.id === blankScreen)} +
+ +
{/if}
- {/each} - - + Autogenerated Screens + + {#each $tables.list.filter(table => table._id !== "ta_users") as table} +
+ x.name.includes(table.name) + )} + on:click={() => toggleScreenSelection(table)} + class="item" + > +
+
{table.name}
+
+
+ {#if selectedScreens.find(x => x.name.includes(table.name))} +
+ +
+ {/if} +
+
+ {/each} + +
+ {#if showProgressCircle} + + {/if} +
+ +
diff --git a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte index 7018bc2ed4..a86f0c2d75 100644 --- a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte @@ -12,34 +12,39 @@ let screenName = "" let url = "" let selectedScreens = [] - let roleId = $selectedAccessRole || "BASIC" - + let showProgressCircle = false let routeError let createdScreens = [] - $: { - selectedScreens?.forEach(screen => { - createdScreens = [...createdScreens, screen.create()] - }) + + const createScreens = async () => { + for (let screen of selectedScreens) { + let test = screen.create() + createdScreens.push(test) + } } const save = async () => { + showProgressCircle = true + await createScreens() for (let screen of createdScreens) { await saveScreens(screen) } await store.actions.routing.fetch() selectedScreens = [] + createdScreens = [] screenName = "" url = "" + showProgressCircle = false } const saveScreens = async draftScreen => { let existingScreenCount = $store.screens.filter( s => s.props._instanceName == draftScreen.props._instanceName ).length - if (existingScreenCount > 0) { let oldUrlArr = draftScreen.routing.route.split("/") + console.log(oldUrlArr) oldUrlArr[1] = `${oldUrlArr[1]}-${existingScreenCount + 1}` draftScreen.routing.route = oldUrlArr.join("/") } @@ -86,6 +91,7 @@ selectedScreens = [] screenName = "" url = "" + createdScreens = [] }) export const showModal = () => { @@ -109,9 +115,20 @@ - + - + From 23b6a204f6f32e5f829d6d25b64d9cb48a6165cf Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 24 Nov 2021 11:53:56 +0000 Subject: [PATCH 2/2] unneeded log --- .../src/components/design/NavigationPanel/ScreenWizard.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte index a86f0c2d75..62843ccc91 100644 --- a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte @@ -44,7 +44,6 @@ ).length if (existingScreenCount > 0) { let oldUrlArr = draftScreen.routing.route.split("/") - console.log(oldUrlArr) oldUrlArr[1] = `${oldUrlArr[1]}-${existingScreenCount + 1}` draftScreen.routing.route = oldUrlArr.join("/") }