Rollback cloud options groups (#6331)

* rollback cloud options groups; fix ide rendering regression

* fix new dashboard option description

* pr changes

* improve authentication description
This commit is contained in:
Paweł Buchowski 2023-04-20 19:55:55 +02:00 committed by GitHub
parent 74c0718604
commit 27be43204c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 19 deletions

View File

@ -1,5 +1,9 @@
{ {
"options": { "options": {
"authentication": {
"value": false,
"description": "Determines whether user authentication is enabled. This option is always true when executed in the cloud."
},
"dataCollection": { "dataCollection": {
"value": true, "value": true,
"description": "Determines whether anonymous usage data is to be collected.", "description": "Determines whether anonymous usage data is to be collected.",
@ -115,6 +119,10 @@
"value": false, "value": false,
"description": "Show Vector Editor widget on nodes.", "description": "Show Vector Editor widget on nodes.",
"primary": false "primary": false
},
"newDashboard": {
"value": false,
"description": "Determines whether the new dashboard with cloud integration is enabled."
} }
} }
}, },
@ -143,19 +151,6 @@
"primary": false "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."
}
}
} }
} }
} }

View File

@ -156,8 +156,8 @@ class Main {
displayDeprecatedVersionDialog() displayDeprecatedVersionDialog()
} else { } else {
if ( if (
(contentConfig.OPTIONS.groups.cloud.options.authentication.value || (contentConfig.OPTIONS.options.authentication.value ||
contentConfig.OPTIONS.groups.cloud.options.dashboard.value) && contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value) &&
contentConfig.OPTIONS.groups.startup.options.entry.value === contentConfig.OPTIONS.groups.startup.options.entry.value ===
contentConfig.OPTIONS.groups.startup.options.entry.default contentConfig.OPTIONS.groups.startup.options.entry.default
) { ) {
@ -182,7 +182,9 @@ class Main {
* where it will be called only once. */ * where it will be called only once. */
let appInstanceRan = false let appInstanceRan = false
const onAuthenticated = () => { const onAuthenticated = () => {
if (!contentConfig.OPTIONS.groups.cloud.options.dashboard.value) { if (
!contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value
) {
hideAuth() hideAuth()
if (!appInstanceRan) { if (!appInstanceRan) {
appInstanceRan = true appInstanceRan = true
@ -194,7 +196,8 @@ class Main {
logger, logger,
platform, platform,
projectManager: projectManager.ProjectManager.default(), projectManager: projectManager.ProjectManager.default(),
showDashboard: contentConfig.OPTIONS.groups.cloud.options.dashboard.value, showDashboard:
contentConfig.OPTIONS.groups.featurePreview.options.newDashboard.value,
onAuthenticated, onAuthenticated,
}) })
} else { } else {

View File

@ -43,8 +43,14 @@ export function run(props: app.AppProps) {
if (root == null) { if (root == null) {
logger.error(`Could not find root element with ID '${ROOT_ELEMENT_ID}'.`) logger.error(`Could not find root element with ID '${ROOT_ELEMENT_ID}'.`)
} else { } else {
// This element is re-added by the `Ide` component. // FIXME: https://github.com/enso-org/cloud-v2/issues/386
document.getElementById(IDE_ELEMENT_ID)?.remove() // 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(<App {...props} />) reactDOM.createRoot(root).render(<App {...props} />)
} }
} }