Skip to content

Commit

Permalink
fix: resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhranshuSanjeev authored and Datron committed Sep 6, 2024
1 parent 40a9b84 commit f6519ef
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 26 deletions.
21 changes: 8 additions & 13 deletions crates/frontend/src/components/condition_pills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ pub fn condition_expression(
"condition_expression component must be used inside condition_collapse_provider",
);

let classes = Signal::derive(move || {
if expand_rs.get() {
("condition-item", "condition-value")
} else {
("condition-item-collapsed", "condition-value-collapsed")
}
});

create_effect(move |_| {
if let ConditionId(Some(c_id)) = condition_id_rs.get() {
if !c_id.contains(&list_id) {
Expand All @@ -61,7 +53,11 @@ pub fn condition_expression(

view! {
{move || {
let (list_item_class, value_class) = classes.get();
let (list_item_class, value_class) = if expand_rs.get() {
("condition-item", "condition-value")
} else {
("condition-item-collapsed", "condition-value-collapsed")
};
let Condition { left_operand: dimension, operator, right_operand: value } = condition
.get_value();
view! {
Expand Down Expand Up @@ -135,7 +131,8 @@ pub fn condition(

view! {
<div class=outer_div_class>
<ol id=id.clone()>
<ol id=id
.clone()>
{conditions
.get_value()
.into_iter()
Expand All @@ -147,9 +144,7 @@ pub fn condition(
.collect::<Vec<_>>()}
</ol>
<Show when=move || grouped_view>
<span class="and">
"and"
</span>
<span class="and">"and"</span>
</Show>
</div>
}
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/components/context_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub fn context_card(
class="xl:w-[400px] h-fit"
/>
<Table
cell_style="min-w-48 font-mono".to_string()
cell_class="min-w-48 font-mono".to_string()
rows=override_table_rows
key_column="id".to_string()
columns=table_columns
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/components/experiment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ where
let (rows, columns) = gen_variant_table(&exp.variants).unwrap();
view! {
<Table
cell_style="min-w-48 font-mono".to_string()
cell_class="min-w-48 font-mono".to_string()
rows=rows
key_column="overrides".to_string()
columns=columns
Expand Down
12 changes: 6 additions & 6 deletions crates/frontend/src/components/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ pub fn table(
key_column: String,
columns: Vec<Column>,
rows: Vec<Map<String, Value>>,
#[prop(into, default = String::new())] cell_style: String,
#[prop(into, default = String::new())] style: String,
#[prop(into, default = String::new())] head_style: String,
#[prop(into, default = String::new())] class: String,
#[prop(into, default = String::new())] cell_class: String,
#[prop(into, default = String::new())] head_class: String,
#[prop(default = TablePaginationProps::default())] pagination: TablePaginationProps,
) -> impl IntoView {
let pagination_props = StoredValue::new(pagination);
let container_style = format!("{} overflow-x-auto", style);
let container_style = format!("{} overflow-x-auto", class);
view! {
<div class=container_style>
<table class="table table-zebra">
<thead class=head_style>
<thead class=head_class>
<tr>
<th></th>

Expand Down Expand Up @@ -84,7 +84,7 @@ pub fn table(
row.get(cname).unwrap_or(&Value::String("".to_string())),
);
view! {
<td class=cell_style
<td class=cell_class
.to_string()>{(column.formatter)(&value, row)}</td>
}
})
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/pages/custom_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub fn types_page() -> impl IntoView {
</div>
</div>
<Table
cell_style="".to_string()
cell_class="".to_string()
rows=data
key_column="id".to_string()
columns=table_columns.get()
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/pages/default_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pub fn default_config() -> impl IntoView {
</div>
</div>
<Table
cell_style="min-w-48 font-mono".to_string()
cell_class="min-w-48 font-mono".to_string()
rows=filtered_rows
key_column="id".to_string()
columns=table_columns.get()
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/pages/dimensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub fn dimensions() -> impl IntoView {
</DrawerBtn>
</div>
<Table
cell_style="min-w-48 font-mono".to_string()
cell_class="min-w-48 font-mono".to_string()
rows=table_rows
key_column="id".to_string()
columns=table_columns.get()
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/pages/experiment_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub fn experiment_list() -> impl IntoView {
};
view! {
<Table
cell_style="min-w-48 font-mono".to_string()
cell_class="min-w-48 font-mono".to_string()
rows=data
key_column="id".to_string()
columns=table_columns.get()
Expand Down
2 changes: 1 addition & 1 deletion crates/frontend/src/pages/function/function_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn function_list() -> impl IntoView {
};
view! {
<Table
cell_style="".to_string()
cell_class="".to_string()
rows=data
key_column="id".to_string()
columns=table_columns.get()
Expand Down

0 comments on commit f6519ef

Please sign in to comment.