From a91b89b7c2076137da3ed460250c439d1fe2ab10 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 24 Mar 2020 16:17:10 +0000 Subject: [PATCH] user creation --- packages/builder/src/common/CodeArea.svelte | 11 +---- .../src/database/ModelDataTable/api.js | 6 +++ .../ModelDataTable/modals/CreateUser.svelte | 45 ++++++++++++++----- packages/builder/src/nav/BackendNav.svelte | 5 ++- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/packages/builder/src/common/CodeArea.svelte b/packages/builder/src/common/CodeArea.svelte index 97de1002c2..a58fc12240 100644 --- a/packages/builder/src/common/CodeArea.svelte +++ b/packages/builder/src/common/CodeArea.svelte @@ -11,20 +11,11 @@ padding: 10px; margin-top: 5px; margin-bottom: 10px; - background: var(--primary100); + background: var(--secondary80); color: var(--white); font-family: "Courier New", Courier, monospace; width: 95%; height: 100px; border-radius: 5px; } - - span { - margin-left: 5px; - } - - .header { - display: flex; - align-items: center; - } diff --git a/packages/builder/src/database/ModelDataTable/api.js b/packages/builder/src/database/ModelDataTable/api.js index 278c8eda33..dd4243fe6f 100644 --- a/packages/builder/src/database/ModelDataTable/api.js +++ b/packages/builder/src/database/ModelDataTable/api.js @@ -1,6 +1,12 @@ import api from "../../builderStore/api" import { getNewRecord, getNewInstance } from "../../common/core" +export async function createUser(user, { appname, instanceId }) { + const CREATE_USER_URL = `/_builder/instance/${appname}/${instanceId}/api/createUser` + const response = await api.post(CREATE_USER_URL, user) + return await response.json() +} + export async function createDatabase(appname, instanceName) { const CREATE_DATABASE_URL = `/_builder/instance/_master/0/api/record/` const database = getNewInstance(appname, instanceName) diff --git a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte index d6f027125d..ef79221900 100644 --- a/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte +++ b/packages/builder/src/database/ModelDataTable/modals/CreateUser.svelte @@ -1,30 +1,51 @@ -
- User Name - +
+ + + + + +
Cancel - - Save - + Save
-
+