Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollback cloud options groups #6331

Merged
merged 5 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 disregarded if the application is 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