From 27be43204c4df1e0217ebeabc98df0f90340c93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Buchowski?= Date: Thu, 20 Apr 2023 19:55:55 +0200 Subject: [PATCH] Rollback cloud options groups (#6331) * rollback cloud options groups; fix ide rendering regression * fix new dashboard option description * pr changes * improve authentication description --- .../lib/content-config/src/config.json | 21 +++++++------------ app/ide-desktop/lib/content/src/index.ts | 11 ++++++---- .../src/authentication/src/index.tsx | 10 +++++++-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/ide-desktop/lib/content-config/src/config.json b/app/ide-desktop/lib/content-config/src/config.json index f1f2b90e4e..891b9cd3f8 100644 --- a/app/ide-desktop/lib/content-config/src/config.json +++ b/app/ide-desktop/lib/content-config/src/config.json @@ -1,5 +1,9 @@ { "options": { + "authentication": { + "value": false, + "description": "Determines whether user authentication is enabled. This option is always true when executed in the cloud." + }, "dataCollection": { "value": true, "description": "Determines whether anonymous usage data is to be collected.", @@ -115,6 +119,10 @@ "value": false, "description": "Show Vector Editor widget on nodes.", "primary": false + }, + "newDashboard": { + "value": false, + "description": "Determines whether the new dashboard with cloud integration is enabled." } } }, @@ -143,19 +151,6 @@ "primary": false } } - }, - "cloud": { - "description": "Options related to cloud authentication, project storage, and project execution.", - "options": { - "authentication": { - "value": false, - "description": "Determines whether user authentication is enabled. This option is disregarded if the application is executed in the cloud." - }, - "dashboard": { - "value": false, - "description": "Determines whether the dashboard (containing the directory listing) is enabled. This option is disregarded if the application is executed in the cloud." - } - } } } } diff --git a/app/ide-desktop/lib/content/src/index.ts b/app/ide-desktop/lib/content/src/index.ts index 459ca4211d..e1d0145b27 100644 --- a/app/ide-desktop/lib/content/src/index.ts +++ b/app/ide-desktop/lib/content/src/index.ts @@ -156,8 +156,8 @@ class Main { displayDeprecatedVersionDialog() } else { if ( - (contentConfig.OPTIONS.groups.cloud.options.authentication.value || - contentConfig.OPTIONS.groups.cloud.options.dashboard.value) && + (contentConfig.OPTIONS.options.authentication.value || + contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value) && contentConfig.OPTIONS.groups.startup.options.entry.value === contentConfig.OPTIONS.groups.startup.options.entry.default ) { @@ -182,7 +182,9 @@ class Main { * where it will be called only once. */ let appInstanceRan = false const onAuthenticated = () => { - if (!contentConfig.OPTIONS.groups.cloud.options.dashboard.value) { + if ( + !contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value + ) { hideAuth() if (!appInstanceRan) { appInstanceRan = true @@ -194,7 +196,8 @@ class Main { logger, platform, projectManager: projectManager.ProjectManager.default(), - showDashboard: contentConfig.OPTIONS.groups.cloud.options.dashboard.value, + showDashboard: + contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value, onAuthenticated, }) } else { diff --git a/app/ide-desktop/lib/dashboard/src/authentication/src/index.tsx b/app/ide-desktop/lib/dashboard/src/authentication/src/index.tsx index ebcbece8dd..ae802a6a50 100644 --- a/app/ide-desktop/lib/dashboard/src/authentication/src/index.tsx +++ b/app/ide-desktop/lib/dashboard/src/authentication/src/index.tsx @@ -43,8 +43,14 @@ export function run(props: app.AppProps) { if (root == null) { logger.error(`Could not find root element with ID '${ROOT_ELEMENT_ID}'.`) } else { - // This element is re-added by the `Ide` component. - document.getElementById(IDE_ELEMENT_ID)?.remove() + // FIXME: https://github.com/enso-org/cloud-v2/issues/386 + // Temporary workaround on hiding the Enso root element preventing it from + // rendering next to authentication templates. We are uncovering this once the + // authentication library sets the user session. + const ide = document.getElementById(IDE_ELEMENT_ID) + if (ide != null) { + ide.style.display = 'none' + } reactDOM.createRoot(root).render() } }