diff --git a/app/gui/view/documentation/src/lib.rs b/app/gui/view/documentation/src/lib.rs index cec832c739ed..33799f27acc2 100644 --- a/app/gui/view/documentation/src/lib.rs +++ b/app/gui/view/documentation/src/lib.rs @@ -17,29 +17,27 @@ //! //! [`Tailwind CSS`]: https://tailwindcss.com/ +#![recursion_limit = "1024"] // === Features === #![feature(drain_filter)] #![feature(option_result_contains)] // === Standard Linter Configuration === #![deny(non_ascii_idents)] +#![warn(unsafe_code)] #![allow(clippy::bool_to_int_with_if)] #![allow(clippy::let_and_return)] +// === Non-Standard Linter Configuration === #![warn(missing_copy_implementations)] #![warn(missing_debug_implementations)] #![warn(missing_docs)] #![warn(trivial_casts)] #![warn(trivial_numeric_casts)] -#![warn(unsafe_code)] #![warn(unused_import_braces)] #![warn(unused_qualifications)] -#![recursion_limit = "1024"] use ensogl::prelude::*; use ensogl::system::web::traits::*; -use graph_editor::component::visualization; -use ide_view_graph_editor as graph_editor; - use enso_frp as frp; use enso_suggestion_database::documentation_ir::EntryDocumentation; use ensogl::animation::physics::inertia::Spring; @@ -55,16 +53,18 @@ use ensogl::Animation; use ensogl_component::shadow; use ensogl_derive_theme::FromTheme; use ensogl_hardcoded_theme::application::component_browser::documentation as theme; +use graph_editor::component::visualization; +use ide_view_graph_editor as graph_editor; use web::HtmlElement; use web::JsCast; -pub mod html; - // ============== // === Export === // ============== +pub mod html; + pub use visualization::container::overlay; diff --git a/build/base/src/fs.rs b/build/base/src/fs.rs index d8c8dd7a2c0f..7b2c4c72ebee 100644 --- a/build/base/src/fs.rs +++ b/build/base/src/fs.rs @@ -25,6 +25,14 @@ pub fn write(path: impl AsRef, contents: impl AsRef<[u8]>) -> Result { wrappers::write(&path, &contents) } +/// Read the file file, deserializing JSON text into the data. +#[context("Failed to deserialize JSON from path: {}", path.as_ref().display())] +pub fn read_json(path: impl AsRef) -> Result { + let contents = read_to_string(&path)?; + serde_json::from_str(&contents) + .with_context(|| format!("Failed to parse JSON from {}", path.as_ref().display())) +} + /// Serialize the data to JSON text and write it to the file. /// /// See [`write()`]. diff --git a/build/build/paths.yaml b/build/build/paths.yaml index 8a03d70e9991..e0e64699f9ac 100644 --- a/build/build/paths.yaml +++ b/build/build/paths.yaml @@ -18,6 +18,9 @@ lib/: client/: content/: + content-config/: + src/: + config.json: icons/: project-manager/: build/: diff --git a/build/build/src/project/gui.rs b/build/build/src/project/gui.rs index 5945e31222c0..911fda4d939e 100644 --- a/build/build/src/project/gui.rs +++ b/build/build/src/project/gui.rs @@ -85,6 +85,28 @@ impl IsWatcher for Watcher { } } +/// Override the default value of `newDashboard` in `config.json` to `true`. +/// +/// This is a temporary workaround. We want to enable the new dashboard by default in the CI-built +/// IDE, but we don't want to enable it by default in the IDE built locally by developers. +pub fn override_default_for_authentication( + path: &crate::paths::generated::RepoRootAppIdeDesktopLibContentConfigSrcConfigJson, +) -> Result { + let json_path = ["groups", "featurePreview", "options", "newDashboard", "value"]; + let mut json = ide_ci::fs::read_json::(path)?; + let mut current = + json.as_object_mut().ok_or_else(|| anyhow!("Failed to find object in {:?}", path))?; + for key in &json_path[..json_path.len() - 1] { + current = current + .get_mut(*key) + .with_context(|| format!("Failed to find {key:?} in {path:?}"))? + .as_object_mut() + .with_context(|| format!("Failed to find object at {key:?} in {path:?}"))?; + } + current.insert(json_path.last().unwrap().to_string(), serde_json::Value::Bool(true)); + ide_ci::fs::write_json(path, &json)?; + Ok(()) +} #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Gui; @@ -109,6 +131,15 @@ impl IsTarget for Gui { ) -> BoxFuture<'static, Result> { let WithDestination { inner, destination } = job; async move { + // TODO: [mwu] + // This is a temporary workaround until https://github.com/enso-org/enso/issues/6662 + // is resolved. + if ide_ci::actions::workflow::is_in_env() { + let path = &context.repo_root.app.ide_desktop.lib.content_config.src.config_json; + warn!("Overriding default for authentication in {}", path.display()); + override_default_for_authentication(path)?; + } + let ide = ide_desktop_from_context(&context); let wasm = Wasm.get(context, inner.wasm); let content_env = diff --git a/lib/rust/ensogl/component/spinner/src/lib.rs b/lib/rust/ensogl/component/spinner/src/lib.rs index 6b3e7c3678fc..8777ad9a7362 100644 --- a/lib/rust/ensogl/component/spinner/src/lib.rs +++ b/lib/rust/ensogl/component/spinner/src/lib.rs @@ -1,6 +1,12 @@ //! An animated spinner component that can be used to indicate that a process //! is running. +// === Standard Linter Configuration === +#![deny(non_ascii_idents)] +#![warn(unsafe_code)] +#![allow(clippy::bool_to_int_with_if)] +#![allow(clippy::let_and_return)] + use ensogl_core::display::shape::*; use ensogl_core::prelude::*;