From d301ea48a9011ef5eb66b8a8ab892ece00c74145 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 May 2021 13:05:58 +0100 Subject: [PATCH 1/9] Removing all login/logout functionality from apps. --- .../EventsEditor/actions/LogIn.svelte | 40 ------------- .../EventsEditor/actions/LogOut.svelte | 14 ----- .../EventsEditor/actions/index.js | 10 ---- .../server/src/api/controllers/application.js | 9 +-- packages/server/src/constants/screens.js | 58 ------------------- .../standard-components/src/Navigation.svelte | 10 ---- 6 files changed, 1 insertion(+), 140 deletions(-) delete mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogIn.svelte delete mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogOut.svelte diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogIn.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogIn.svelte deleted file mode 100644 index d64fd1e654..0000000000 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogIn.svelte +++ /dev/null @@ -1,40 +0,0 @@ - - -
- - (parameters.email = value.detail)} - {bindings} - /> - - (parameters.password = value.detail)} - {bindings} - /> -
- - diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogOut.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogOut.svelte deleted file mode 100644 index 8782127243..0000000000 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/LogOut.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -
- This action doesn't require any additional settings. -
- - diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js index 4700ea5c8f..e851bdb4be 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js @@ -4,8 +4,6 @@ import DeleteRow from "./DeleteRow.svelte" import ExecuteQuery from "./ExecuteQuery.svelte" import TriggerAutomation from "./TriggerAutomation.svelte" import ValidateForm from "./ValidateForm.svelte" -import LogIn from "./LogIn.svelte" -import LogOut from "./LogOut.svelte" // defines what actions are available, when adding a new one // the component is the setup panel for the action @@ -37,12 +35,4 @@ export default [ name: "Validate Form", component: ValidateForm, }, - { - name: "Log In", - component: LogIn, - }, - { - name: "Log Out", - component: LogOut, - }, ] diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index 2956e45b11..1300619879 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -22,10 +22,7 @@ const { } = require("../../db/utils") const { BUILTIN_ROLE_IDS, AccessController } = require("@budibase/auth/roles") const { BASE_LAYOUTS } = require("../../constants/layouts") -const { - createHomeScreen, - createLoginScreen, -} = require("../../constants/screens") +const { createHomeScreen } = require("../../constants/screens") const { cloneDeep } = require("lodash/fp") const { processObject } = require("@budibase/string-templates") const { getAllApps } = require("../../utilities") @@ -260,9 +257,5 @@ const createEmptyAppPackage = async (ctx, app) => { homeScreen._id = generateScreenID() screensAndLayouts.push(homeScreen) - const loginScreen = createLoginScreen(app) - loginScreen._id = generateScreenID() - screensAndLayouts.push(loginScreen) - await db.bulkDocs(screensAndLayouts) } diff --git a/packages/server/src/constants/screens.js b/packages/server/src/constants/screens.js index 55f493c362..eb9dc8f702 100644 --- a/packages/server/src/constants/screens.js +++ b/packages/server/src/constants/screens.js @@ -1,6 +1,5 @@ const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") const { BASE_LAYOUT_PROP_IDS } = require("./layouts") -const { LOGO_URL } = require("../constants") exports.createHomeScreen = () => ({ description: "", @@ -49,60 +48,3 @@ exports.createHomeScreen = () => ({ }, name: "home-screen", }) - -exports.createLoginScreen = app => ({ - description: "", - url: "", - layoutId: BASE_LAYOUT_PROP_IDS.PUBLIC, - props: { - _instanceName: "LoginScreenContainer", - _id: "5beb4c7b-3c8b-49b2-b8b3-d447dc76dda7", - _component: "@budibase/standard-components/container", - _styles: { - normal: { - flex: "1 1 auto", - display: "flex", - "flex-direction": "column", - "justify-content": "center", - "align-items": "center", - }, - hover: {}, - active: {}, - selected: {}, - }, - _transition: "fade", - type: "div", - _children: [ - { - _id: "781e497e-2e7c-11eb-adc1-0242ac120002", - _component: "@budibase/standard-components/login", - _styles: { - normal: { - padding: "64px", - background: "rgba(255, 255, 255, 0.4)", - "border-radius": "0.5rem", - "margin-top": "0px", - "box-shadow": - "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)", - "font-size": "16px", - "font-family": "Inter", - flex: "0 1 auto", - }, - hover: {}, - active: {}, - selected: {}, - }, - logo: LOGO_URL, - title: `Log in to ${app.name}`, - buttonText: "Log In", - _children: [], - _instanceName: "Login", - }, - ], - }, - routing: { - route: "/", - roleId: BUILTIN_ROLE_IDS.PUBLIC, - }, - name: "login-screen", -}) diff --git a/packages/standard-components/src/Navigation.svelte b/packages/standard-components/src/Navigation.svelte index 2062a9d982..b0f043b75c 100644 --- a/packages/standard-components/src/Navigation.svelte +++ b/packages/standard-components/src/Navigation.svelte @@ -5,13 +5,6 @@ const component = getContext("component") export let logoUrl - - const logOut = async () => { - if ($builderStore.inBuilder) { - return - } - await authStore.actions.logOut() - }