diff --git a/packages/auth/src/constants.js b/packages/auth/src/constants.js
index 8ca05066c..230c80b60 100644
--- a/packages/auth/src/constants.js
+++ b/packages/auth/src/constants.js
@@ -14,3 +14,10 @@ exports.GlobalRoles = {
BUILDER: "builder",
GROUP_MANAGER: "group_manager",
}
+
+exports.Configs = {
+ SETTINGS: "settings",
+ ACCOUNT: "account",
+ SMTP: "smtp",
+ GOOGLE: "google",
+}
diff --git a/packages/builder/src/builderStore/store/hosting.js b/packages/builder/src/builderStore/store/hosting.js
index f180d4157..fb174c266 100644
--- a/packages/builder/src/builderStore/store/hosting.js
+++ b/packages/builder/src/builderStore/store/hosting.js
@@ -2,7 +2,6 @@ import { writable } from "svelte/store"
import api, { get } from "../api"
const INITIAL_HOSTING_UI_STATE = {
- hostingInfo: {},
appUrl: "",
deployedApps: {},
deployedAppNames: [],
@@ -13,28 +12,12 @@ export const getHostingStore = () => {
const store = writable({ ...INITIAL_HOSTING_UI_STATE })
store.actions = {
fetch: async () => {
- const responses = await Promise.all([
- api.get("/api/hosting/"),
- api.get("/api/hosting/urls"),
- ])
- const [info, urls] = await Promise.all(responses.map(resp => resp.json()))
+ const response = await api.get("/api/hosting/urls")
+ const urls = await response.json()
store.update(state => {
- state.hostingInfo = info
state.appUrl = urls.app
return state
})
- return info
- },
- save: async hostingInfo => {
- const response = await api.post("/api/hosting", hostingInfo)
- const revision = (await response.json()).rev
- store.update(state => {
- state.hostingInfo = {
- ...hostingInfo,
- _rev: revision,
- }
- return state
- })
},
fetchDeployedApps: async () => {
let deployments = await (await get("/api/hosting/apps")).json()
diff --git a/packages/builder/src/components/deploy/DeploymentHistory.svelte b/packages/builder/src/components/deploy/DeploymentHistory.svelte
index fd098235b..dc90acf43 100644
--- a/packages/builder/src/components/deploy/DeploymentHistory.svelte
+++ b/packages/builder/src/components/deploy/DeploymentHistory.svelte
@@ -36,8 +36,7 @@
let errorReason
let poll
let deployments = []
- let urlComponent =
- $hostingStore.hostingInfo.type === "self" ? $store.url : `/${appId}`
+ let urlComponent = $store.url || `/${appId}`
let deploymentUrl = `${$hostingStore.appUrl}${urlComponent}`
const formatDate = (date, format) =>
diff --git a/packages/builder/src/components/settings/tabs/General.svelte b/packages/builder/src/components/settings/tabs/General.svelte
index d5829f9e7..4a8d24ed5 100644
--- a/packages/builder/src/components/settings/tabs/General.svelte
+++ b/packages/builder/src/components/settings/tabs/General.svelte
@@ -49,27 +49,22 @@
onMount(async () => {
const nameError = "Your application must have a name.",
urlError = "Your application must have a URL."
- let hostingInfo = await hostingStore.actions.fetch()
- if (hostingInfo.type === "self") {
- await hostingStore.actions.fetchDeployedApps()
- const existingAppNames = get(hostingStore).deployedAppNames
- const existingAppUrls = get(hostingStore).deployedAppUrls
- const nameIdx = existingAppNames.indexOf(get(store).name)
- const urlIdx = existingAppUrls.indexOf(get(store).url)
- if (nameIdx !== -1) {
- existingAppNames.splice(nameIdx, 1)
- }
- if (urlIdx !== -1) {
- existingAppUrls.splice(urlIdx, 1)
- }
- nameValidation = {
- name: string().required(nameError).notOneOf(existingAppNames),
- }
- urlValidation = {
- url: string().required(urlError).notOneOf(existingAppUrls),
- }
- } else {
- nameValidation = { name: string().required(nameError) }
+ await hostingStore.actions.fetchDeployedApps()
+ const existingAppNames = get(hostingStore).deployedAppNames
+ const existingAppUrls = get(hostingStore).deployedAppUrls
+ const nameIdx = existingAppNames.indexOf(get(store).name)
+ const urlIdx = existingAppUrls.indexOf(get(store).url)
+ if (nameIdx !== -1) {
+ existingAppNames.splice(nameIdx, 1)
+ }
+ if (urlIdx !== -1) {
+ existingAppUrls.splice(urlIdx, 1)
+ }
+ nameValidation = {
+ name: string().required(nameError).notOneOf(existingAppNames),
+ }
+ urlValidation = {
+ url: string().required(urlError).notOneOf(existingAppUrls),
}
})
@@ -81,14 +76,12 @@
error={nameError}
label="App Name"
/>
- {#if $hostingStore.hostingInfo.type === "self"}
- updateApplication({ url: e.detail })}
- value={$store.url}
- error={urlError}
- label="App URL"
- />
- {/if}
+ updateApplication({ url: e.detail })}
+ value={$store.url}
+ error={urlError}
+ label="App URL"
+ />