From 1885a3e275f1d04a6cc71721beee89ae5190a0ea Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 22 Apr 2022 12:22:21 +0100 Subject: [PATCH] Refactored the screen wizard to separate out the role selection. Design and layout updates to address feedback --- packages/builder/cypress/support/commands.js | 4 +- .../NavigationPanel/DatasourceModal.svelte | 186 +++++++++--------- .../NavigationPanel/NewScreenModal.svelte | 40 ++-- .../NavigationPanel/ScreenDetailsModal.svelte | 20 +- .../NavigationPanel/ScreenWizard.svelte | 94 ++++++++- 5 files changed, 208 insertions(+), 136 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index f3b0418120..7549270af4 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -288,7 +288,7 @@ Cypress.Commands.add("createScreen", (screenName, route, accessLevelLabel) => { cy.get("[aria-label=AddCircle]").click() cy.get(".spectrum-Modal").within(() => { cy.get(".item").contains("Blank").click() - cy.get(".spectrum-Button").contains("Add screens").click({ force: true }) + cy.get(".spectrum-Button").contains("Continue").click({ force: true }) cy.wait(500) }) cy.get(".spectrum-Dialog-grid").within(() => { @@ -311,7 +311,7 @@ Cypress.Commands.add("navigateToAutogeneratedModal", () => { cy.get("[aria-label=AddCircle]").click() cy.get(".spectrum-Modal").within(() => { cy.get(".item").contains("Autogenerated Screens").click() - cy.get(".spectrum-Button").contains("Add screens").click({ force: true }) + cy.get(".spectrum-Button").contains("Continue").click({ force: true }) cy.wait(500) }) }) diff --git a/packages/builder/src/components/design/NavigationPanel/DatasourceModal.svelte b/packages/builder/src/components/design/NavigationPanel/DatasourceModal.svelte index 16854caa1e..17a8556831 100644 --- a/packages/builder/src/components/design/NavigationPanel/DatasourceModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/DatasourceModal.svelte @@ -1,24 +1,17 @@ @@ -55,22 +52,9 @@ disabled={!screenAccessRole || !screenUrl || routeError || !touched} > - { + analytics.captureEvent(Events.SCREEN.CREATE_ROLE_UPDATED, { + screenAccessRole, + }) + }} + label="Access" + getOptionLabel={role => role.name} + getOptionValue={role => role._id} + getOptionColor={role => role.color} + options={$roles} + /> + + + newScreenModal.show()} + initialUrl={blankScreenUrl} />