From aa8cbcef23b20c31eb08a4f869db266a2a8bdc99 Mon Sep 17 00:00:00 2001
From: Shubhranshu Sanjeev
Date: Thu, 2 May 2024 11:19:40 +0530
Subject: [PATCH] chore: formatted code with leptosfmt and rustfmt
---
.../src/api/context/handlers.rs | 2 +-
.../src/api/default_config/handlers.rs | 2 +-
crates/frontend/src/components/alert/mod.rs | 2 +-
.../default_config_form.rs | 222 ++++++++-------
.../dimension_form/dimension_form.rs | 267 +++++++++---------
.../frontend/src/components/drawer/drawer.rs | 5 +-
.../src/components/experiment/experiment.rs | 3 +-
.../components/function_form/function_form.rs | 7 +-
.../src/components/function_form/utils.rs | 2 +-
crates/frontend/src/components/mod.rs | 2 +-
.../components/override_form/override_form.rs | 13 +-
crates/frontend/src/components/toast/mod.rs | 15 +-
crates/frontend/src/hoc/layout/layout.rs | 2 +-
.../src/pages/Dimensions/Dimensions.rs | 51 ++--
.../pages/default_config/default_config.rs | 239 +++++++++-------
.../pages/experiment_list/experiment_list.rs | 11 +-
.../frontend/src/pages/function/function.rs | 15 +-
.../src/pages/function/function_list.rs | 9 +-
crates/service_utils/src/helpers.rs | 2 +-
19 files changed, 485 insertions(+), 386 deletions(-)
diff --git a/crates/context_aware_config/src/api/context/handlers.rs b/crates/context_aware_config/src/api/context/handlers.rs
index 439339d2..331693cd 100644
--- a/crates/context_aware_config/src/api/context/handlers.rs
+++ b/crates/context_aware_config/src/api/context/handlers.rs
@@ -523,4 +523,4 @@ async fn bulk_operations(
Ok(()) // Commit the transaction
})?;
Ok(Json(response))
-}
\ No newline at end of file
+}
diff --git a/crates/context_aware_config/src/api/default_config/handlers.rs b/crates/context_aware_config/src/api/default_config/handlers.rs
index c435f955..4591493c 100644
--- a/crates/context_aware_config/src/api/default_config/handlers.rs
+++ b/crates/context_aware_config/src/api/default_config/handlers.rs
@@ -181,4 +181,4 @@ async fn get(db_conn: DbConnection) -> superposition::Result = default_configs.get_results(&mut conn)?;
Ok(Json(result))
-}
\ No newline at end of file
+}
diff --git a/crates/frontend/src/components/alert/mod.rs b/crates/frontend/src/components/alert/mod.rs
index 6b00f6fd..ac81b8c9 100644
--- a/crates/frontend/src/components/alert/mod.rs
+++ b/crates/frontend/src/components/alert/mod.rs
@@ -66,4 +66,4 @@ pub fn alert(alert: Alert) -> impl IntoView {
{alert.text}
}
-}
\ No newline at end of file
+}
diff --git a/crates/frontend/src/components/default_config_form/default_config_form.rs b/crates/frontend/src/components/default_config_form/default_config_form.rs
index feef3a6e..393783e3 100644
--- a/crates/frontend/src/components/default_config_form/default_config_form.rs
+++ b/crates/frontend/src/components/default_config_form/default_config_form.rs
@@ -181,72 +181,79 @@ where
-
@@ -275,7 +282,8 @@ where
-
}
diff --git a/crates/frontend/src/pages/default_config/default_config.rs b/crates/frontend/src/pages/default_config/default_config.rs
index 58d1ba31..1b7d3685 100644
--- a/crates/frontend/src/pages/default_config/default_config.rs
+++ b/crates/frontend/src/pages/default_config/default_config.rs
@@ -148,7 +148,12 @@ pub fn default_config() -> impl IntoView {
if is_folder {
view! { {"-"} }.into_view()
} else {
- view! { {edit_icon} }.into_view()
+ view! {
+
+ {edit_icon}
+
+ }
+ .into_view()
}
};
@@ -158,17 +163,22 @@ pub fn default_config() -> impl IntoView {
let is_folder = key_name.contains(".");
if is_folder && enable_grouping.get() {
- view! {
- {label}
- }
- .into_view()
+ }
+ >
+
+ {label}
+
+ }
+ .into_view()
} else {
view! { {key_name} }.into_view()
}
@@ -195,12 +205,16 @@ pub fn default_config() -> impl IntoView {
"Loading (Suspense Fallback)..."
}
}>
- {
- move || {
- let prefix = key_prefix.get();
- if let Some(selected_config_data) = selected_config.get() {
- view! {
-
+
+ {move || {
+ let prefix = key_prefix.get();
+ if let Some(selected_config_data) = selected_config.get() {
+ view! {
+
impl IntoView {
close_drawer("default_config_drawer");
}
/>
-
- }
- } else {
- view! {
-
-
+ }
+ } else {
+ view! {
+
+
-
- }
+ }
+ />
+
+
}
}
- }
- {
- move || {
- let default_config = default_config_resource.get().unwrap_or(vec![]);
- let table_rows = default_config
- .into_iter()
- .map(|config| {
- let mut ele_map = json!(config).as_object().unwrap().to_owned();
- ele_map
- .insert(
- "created_at".to_string(),
- json!(config.created_at.format("%v").to_string()),
- );
- ele_map
- })
- .collect::>>();
-
- let mut filtered_rows = table_rows.clone();
- if enable_grouping.get() {
- let empty_map = Map::new();
- let cols = filtered_rows.get(0).unwrap_or(&empty_map).keys().map(|key| key.as_str()).collect();
- filtered_rows = modify_rows(filtered_rows.clone(), key_prefix.get(), cols);
- }
-
- let total_default_config_keys = filtered_rows.len().to_string();
-
- view! {
-
-
-
-
-
-
-
-
-
}
- }
+ }}
+
}
@@ -303,27 +339,38 @@ where
let last_index = bread_crums.len() - 1;
view! {
- {
- bread_crums.iter().enumerate().map(|(index, ele)| {
- let value = ele.value.clone();
- let is_link = ele.is_link.clone();
- let handler = folder_click_handler.clone();
- view! {
-
-
- {ele.key.clone()}
-
-
- {if index < last_index {">"} else {""}}
-
-
- }
- }).collect_view()
- }
+
+ {bread_crums
+ .iter()
+ .enumerate()
+ .map(|(index, ele)| {
+ let value = ele.value.clone();
+ let is_link = ele.is_link.clone();
+ let handler = folder_click_handler.clone();
+ view! {
+
+
+
+ {ele.key.clone()}
+
+ {if index < last_index { ">" } else { "" }}
+
+ }
+ })
+ .collect_view()}
+
}
}
diff --git a/crates/frontend/src/pages/experiment_list/experiment_list.rs b/crates/frontend/src/pages/experiment_list/experiment_list.rs
index 4af09fd6..80175966 100644
--- a/crates/frontend/src/pages/experiment_list/experiment_list.rs
+++ b/crates/frontend/src/pages/experiment_list/experiment_list.rs
@@ -224,9 +224,14 @@ pub fn experiment_list() -> impl IntoView {
.default_config;
let _ = reset_exp_form.get();
view! {
-
+
+
impl IntoView {
});
};
view! {
-
@@ -256,6 +255,7 @@ pub fn function_page() -> impl IntoView {
test_mode_ws.set(false);
}
>
+
Cancel
@@ -271,6 +271,7 @@ pub fn function_page() -> impl IntoView {
editor_mode_ws.set(true);
}
>
+
Cancel
@@ -306,6 +307,7 @@ pub fn function_page() -> impl IntoView {
publish_error_ws.set("".to_string())
}
>
+
Edit
@@ -318,6 +320,7 @@ pub fn function_page() -> impl IntoView {
publish_error_ws.set("".to_string())
}
>
+
Test
@@ -342,7 +345,6 @@ pub fn function_page() -> impl IntoView {
&& (test_mode_rs.get() == false);
let fun_clone = function_data.clone();
let fun_clone_ = function_data.clone();
-
let pub_code = fun_clone
.published_code
.clone()
@@ -428,6 +430,7 @@ pub fn function_page() -> impl IntoView {
editor_mode_ws.set(true)
}
/>
+
@@ -490,13 +493,7 @@ pub fn function_page() -> impl IntoView {
}
.into_view()
}
- None => {
- view! {
-
-
Error fetching function
- }
- .into_view()
- }
+ None => view! {
Error fetching function
}.into_view(),
}
}}
diff --git a/crates/frontend/src/pages/function/function_list.rs b/crates/frontend/src/pages/function/function_list.rs
index 24ec320e..aff5a290 100644
--- a/crates/frontend/src/pages/function/function_list.rs
+++ b/crates/frontend/src/pages/function/function_list.rs
@@ -104,7 +104,6 @@ pub fn function_list() -> impl IntoView {
.collect::
>>()
.to_owned();
view! {
-
impl IntoView {
/>
}
}
- None => {
- view! {
-
- Loading....
- }
- .into_view()
- }
+ None => view! { Loading....
}.into_view(),
}
}}
diff --git a/crates/service_utils/src/helpers.rs b/crates/service_utils/src/helpers.rs
index c012e645..c489d823 100644
--- a/crates/service_utils/src/helpers.rs
+++ b/crates/service_utils/src/helpers.rs
@@ -325,4 +325,4 @@ pub fn validation_err_to_str(errors: Vec) -> Vec {
}
}
}).collect()
-}
\ No newline at end of file
+}