Skip to content

Commit

Permalink
Rollback cloud options groups (#6331)
Browse files Browse the repository at this point in the history
* rollback cloud options groups; fix ide rendering regression

* fix new dashboard option description

* pr changes

* improve authentication description
  • Loading branch information
PabloBuchu authored Apr 20, 2023
1 parent 74c0718 commit 27be432
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
21 changes: 8 additions & 13 deletions app/ide-desktop/lib/content-config/src/config.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -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."
}
}
}
}
}
11 changes: 7 additions & 4 deletions app/ide-desktop/lib/content/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand All @@ -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
Expand All @@ -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 {
Expand Down
10 changes: 8 additions & 2 deletions app/ide-desktop/lib/dashboard/src/authentication/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<App {...props} />)
}
}
Expand Down

0 comments on commit 27be432

Please sign in to comment.