diff --git a/packages/builder/cypress/integration/screens.spec.js b/packages/builder/cypress/integration/screens.spec.js index f78d7266e8..6df8af3602 100644 --- a/packages/builder/cypress/integration/screens.spec.js +++ b/packages/builder/cypress/integration/screens.spec.js @@ -7,17 +7,7 @@ context('Screen Tests', () => { cy.navigateToFrontend() }) - it('Should successful create a screen', () => { + it('Should successfully create a screen', () => { cy.createScreen("test Screen", "/test") }) - - it('Should rename a screen', () => { - cy.get(".components-pane").within(() => { - cy.contains("Settings").click() - cy.get("input[name=_instanceName]").clear().type("About Us").blur() - }) - cy.get('.nav-items-container').within(() => { - cy.contains("About Us").should('exist') - }) - }) }) \ No newline at end of file diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index f82ff30827..15564083ba 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -166,6 +166,6 @@ Cypress.Commands.add("createScreen", (screenName, route) => { cy.contains("Create Screen").click() }) cy.get(".nav-items-container").within(() => { - cy.contains(screenName).should("exist") + cy.contains(route).should("exist") }) }) diff --git a/packages/builder/src/components/userInterface/ComponentNavigationTree/PathTree.svelte b/packages/builder/src/components/userInterface/ComponentNavigationTree/PathTree.svelte index d9f86b44cd..a06f120de5 100644 --- a/packages/builder/src/components/userInterface/ComponentNavigationTree/PathTree.svelte +++ b/packages/builder/src/components/userInterface/ComponentNavigationTree/PathTree.svelte @@ -36,7 +36,7 @@ indentLevel={indent || 1} selected={$store.currentPreviewItem._id === screenId} opened={$store.currentPreviewItem._id === screenId} - text={url === "/" ? "Home" : url} + text={url === '/' ? 'Home' : url} withArrow={route.subpaths} on:click={() => changeScreen(screenId)}> diff --git a/packages/builder/src/components/userInterface/NewScreenModal.svelte b/packages/builder/src/components/userInterface/NewScreenModal.svelte index ebee601838..293f623fe7 100644 --- a/packages/builder/src/components/userInterface/NewScreenModal.svelte +++ b/packages/builder/src/components/userInterface/NewScreenModal.svelte @@ -76,6 +76,7 @@ if (createLink) { await store.actions.components.links.save(route, name) } + await store.actions.routing.fetch() if (templateIndex !== undefined) { const template = templates[templateIndex] diff --git a/packages/client/src/render/screenRouter.js b/packages/client/src/render/screenRouter.js index d214fa8f21..2c934b7337 100644 --- a/packages/client/src/render/screenRouter.js +++ b/packages/client/src/render/screenRouter.js @@ -43,7 +43,9 @@ export const screenRouter = ({ screens, onScreenSelected, window }) => { return sanitize(url) } - const routes = screens.map(screen => makeRootedPath(screen?.routing.route)) + const routes = screens.map(screen => + makeRootedPath(screen.routing ? screen.routing.route : null) + ) let fallback = routes.findIndex(([p]) => p === makeRootedPath("*")) if (fallback < 0) fallback = 0