diff --git a/packages/bbui/src/Form/Search.svelte b/packages/bbui/src/Form/Search.svelte
index b5a6c17b4a..25dd98306b 100644
--- a/packages/bbui/src/Form/Search.svelte
+++ b/packages/bbui/src/Form/Search.svelte
@@ -9,6 +9,7 @@
export let placeholder = null
export let disabled = false
export let updateOnChange = true
+ export let quiet = false
const dispatch = createEventDispatcher()
const onChange = e => {
@@ -23,6 +24,7 @@
{disabled}
{value}
{placeholder}
+ {quiet}
on:change={onChange}
on:click
on:input
diff --git a/packages/builder/cypress/integration/renameAnApplication.spec.js b/packages/builder/cypress/integration/renameAnApplication.spec.js
index 95a152c017..a954faee95 100644
--- a/packages/builder/cypress/integration/renameAnApplication.spec.js
+++ b/packages/builder/cypress/integration/renameAnApplication.spec.js
@@ -10,7 +10,7 @@ it("should rename an unpublished application", () => {
cy.get(".home-logo").click()
renameApp(appRename)
cy.searchForApplication(appRename)
- cy.get(".appGrid").find(".wrapper").should("have.length", 1)
+ cy.get(".appTable").find(".title").should("have.length", 1)
cy.deleteApp(appRename)
})
@@ -29,7 +29,7 @@ xit("Should rename a published application", () => {
cy.get(".home-logo").click()
renameApp(appRename, true)
cy.searchForApplication(appRename)
- cy.get(".appGrid").find(".wrapper").should("have.length", 1)
+ cy.get(".appTable").find(".title").should("have.length", 1)
})
it("Should try to rename an application to have no name", () => {
@@ -38,7 +38,7 @@ it("Should try to rename an application to have no name", () => {
// Close modal and confirm name has not been changed
cy.get(".spectrum-Dialog-grid").contains("Cancel").click()
cy.searchForApplication("Cypress Tests")
- cy.get(".appGrid").find(".wrapper").should("have.length", 1)
+ cy.get(".appTable").find(".title").should("have.length", 1)
})
xit("Should create two applications with the same name", () => {
@@ -64,7 +64,7 @@ it("should validate application names", () => {
cy.get(".home-logo").click()
renameApp(numberName)
cy.searchForApplication(numberName)
- cy.get(".appGrid").find(".wrapper").should("have.length", 1)
+ cy.get(".appTable").find(".title").should("have.length", 1)
renameApp(specialCharName)
cy.get(".error").should("have.text", "App name must be letters, numbers and spaces only")
})
@@ -74,14 +74,14 @@ it("should validate application names", () => {
.its("body")
.then(val => {
if (val.length > 0) {
- cy.get(".title > :nth-child(3) > .spectrum-Icon").click()
+ cy.get(".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon").click()
// Check for when an app is published
if (published == true){
// Should not have Edit as option, will unpublish app
cy.should("not.have.value", "Edit")
cy.get(".spectrum-Menu").contains("Unpublish").click()
cy.get(".spectrum-Dialog-grid").contains("Unpublish app").click()
- cy.get(".title > :nth-child(3) > .spectrum-Icon").click()
+ cy.get(".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon").click()
}
cy.contains("Edit").click()
cy.get(".spectrum-Modal")
diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js
index 0870ceac7a..e67057344a 100644
--- a/packages/builder/cypress/support/commands.js
+++ b/packages/builder/cypress/support/commands.js
@@ -50,7 +50,9 @@ Cypress.Commands.add("deleteApp", appName => {
.its("body")
.then(val => {
if (val.length > 0) {
- cy.get(".title > :nth-child(3) > .spectrum-Icon").click()
+ cy.get(
+ ".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon"
+ ).click()
cy.contains("Delete").click()
cy.get(".spectrum-Modal").within(() => {
cy.get("input").type(appName)
diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte
index a80722733e..7466d3717d 100644
--- a/packages/builder/src/components/start/AppRow.svelte
+++ b/packages/builder/src/components/start/AppRow.svelte
@@ -1,5 +1,4 @@
-
-
editApp(app)}>
-
- {app.name}
-
+
+
+
+
+
editApp(app)}>
+
+ {app.name}
+
+
@@ -62,6 +66,7 @@
disabled={app.lockedOther}
on:click={() => editApp(app)}
size="S"
+ quiet
secondary>Open
@@ -86,15 +91,11 @@
{/if}
+
diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte
index 75df17e532..178588f608 100644
--- a/packages/builder/src/components/start/CreateAppModal.svelte
+++ b/packages/builder/src/components/start/CreateAppModal.svelte
@@ -1,13 +1,7 @@
- {#await templatesPromise}
-
-
-
- {:then templates}
- {#if templates?.length > 0}
- Select a template below, or start from scratch.
- {:else}
- Start your app from scratch below.
- {/if}
-
- {#each templates as template}
-
onSelect(template)}>
-
-
-
-
{template.name}
-
{template?.category?.toUpperCase()}
-
- {/each}
-
- {:catch err}
- {err}
- {/await}
onSelect(null)}>
diff --git a/packages/builder/src/stores/portal/apps.js b/packages/builder/src/stores/portal/apps.js
index 48a917534f..de944c057d 100644
--- a/packages/builder/src/stores/portal/apps.js
+++ b/packages/builder/src/stores/portal/apps.js
@@ -65,16 +65,17 @@ export function createAppStore() {
}
}
- async function update(appId, name) {
- const response = await api.put(`/api/applications/${appId}`, { name })
+ async function update(appId, value) {
+ console.log({ value })
+ const response = await api.put(`/api/applications/${appId}`, { ...value })
if (response.status === 200) {
store.update(state => {
const updatedAppIndex = state.findIndex(
app => app.instance._id === appId
)
if (updatedAppIndex !== -1) {
- const updatedApp = state[updatedAppIndex]
- updatedApp.name = name
+ let updatedApp = state[updatedAppIndex]
+ updatedApp = { ...updatedApp, ...value }
state.apps = state.splice(updatedAppIndex, 1, updatedApp)
}
return state
diff --git a/packages/builder/src/stores/portal/index.js b/packages/builder/src/stores/portal/index.js
index e2736cfa58..a5d33b3b15 100644
--- a/packages/builder/src/stores/portal/index.js
+++ b/packages/builder/src/stores/portal/index.js
@@ -5,3 +5,4 @@ export { apps } from "./apps"
export { email } from "./email"
export { auth } from "./auth"
export { oidc } from "./oidc"
+export { templates } from "./templates"
diff --git a/packages/builder/src/stores/portal/templates.js b/packages/builder/src/stores/portal/templates.js
new file mode 100644
index 0000000000..b82ecd70e2
--- /dev/null
+++ b/packages/builder/src/stores/portal/templates.js
@@ -0,0 +1,19 @@
+import { writable } from "svelte/store"
+import api from "builderStore/api"
+
+export function templatesStore() {
+ const { subscribe, set } = writable([])
+
+ async function load() {
+ const response = await api.get("/api/templates?type=app")
+ const json = await response.json()
+ set(json)
+ }
+
+ return {
+ subscribe,
+ load,
+ }
+}
+
+export const templates = templatesStore()