Skip to content

Commit d8dbeab

Browse files
committed
Fix drag/drop bugs
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 4bd2917 commit d8dbeab

31 files changed

+284
-92
lines changed

rust/perspective-viewer/src/rust/components/column_dropdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn ColumnDropDownView(props: &ColumnDropDownViewProps) -> Html {
246246
<span>{ col }</span>
247247
},
248248
InPlaceColumn::Expression(col) => html! {
249-
<span id="add-expression">{ col.name.clone() }</span>
249+
<span id="add-expression"><span class="icon" />{ col.name.clone() }</span>
250250
},
251251
};
252252

rust/perspective-viewer/src/rust/components/column_selector.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub struct ColumnSelectorProps {
6262
pub selected_column: Option<ColumnLocator>,
6363

6464
/// Value props threaded from root's `SessionProps` / `RendererProps`.
65-
pub has_table: bool,
65+
pub has_table: Option<TableLoadState>,
6666
pub named_column_count: usize,
6767
pub view_config: PtrEqRc<ViewConfig>,
6868
pub drag_column: Option<String>,
@@ -285,7 +285,7 @@ impl Component for ColumnSelector {
285285
move |_| dragdrop.notify_drag_end()
286286
});
287287

288-
let mut active_classes = classes!();
288+
let mut active_classes = classes!("scrollable");
289289
if ctx.props().drag_column.is_some() {
290290
active_classes.push("dragdrop-highlight");
291291
};
@@ -491,6 +491,7 @@ impl Component for ColumnSelector {
491491
<ScrollPanel
492492
id="sub-columns"
493493
key="__sub_columns__"
494+
class={classes!("scrollable")}
494495
on_resize={&ctx.props().on_resize}
495496
on_dimensions_reset={&self.on_reset}
496497
children={inactive_children}

rust/perspective-viewer/src/rust/components/column_selector/active_column.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl Component for ActiveColumn {
330330
}))
331331
};
332332

333-
let ondragend = &ctx.props().ondragend.reform(|_| tracing::error!("dragend"));
333+
let ondragend = &ctx.props().ondragend.reform(|_| ());
334334
let ondragstart = ctx.link().callback({
335335
let event_name = name.to_owned();
336336
let dragdrop = ctx.props().dragdrop.clone();
@@ -375,6 +375,7 @@ impl Component for ActiveColumn {
375375
{ondragend}
376376
>
377377
<div class="column-selector-column-border">
378+
<span class="drag-handle icon" />
378379
<TypeIcon ty={col_type} />
379380
if ctx.props().is_aggregated {
380381
<AggregateSelector

rust/perspective-viewer/src/rust/components/column_selector/add_expression_button.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub fn AddExpressionButton(p: &AddExpressionButtonProps) -> Html {
5858

5959
html! {
6060
<div id="add-expression" data-index="-1" {class} {onmouseover} {onmouseout} {onmousedown}>
61+
<span class="icon" />
6162
<span id="add-expression-button" />
6263
</div>
6364
}

rust/perspective-viewer/src/rust/components/column_selector/config_selector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ impl Component for ConfigSelector {
615615
<Select<GroupRollupMode>
616616
id="group_rollup_mode_selector"
617617
wrapper_class="group_rollup_wrapper"
618+
is_autosize=true
618619
values={Rc::new(
619620
group_rollups
620621
.iter()

rust/perspective-viewer/src/rust/components/column_selector/expr_edit_button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ pub fn ExprEditButton(p: &ExprEditButtonProps) -> Html {
5454
"expression-edit-button"
5555
};
5656

57-
html! { <span {onmousedown} {class} /> }
57+
html! { <span {onmousedown} {class}><span class="icon" /></span> }
5858
}

rust/perspective-viewer/src/rust/components/column_selector/filter_column.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ impl Component for FilterColumn {
350350
>
351351
<LocalStyle href={css!("filter-item")} />
352352
<div class="pivot-column-border">
353+
<span class="drag-handle icon" />
353354
// <TypeIcon ty={ColumnType::String} />
354355
<TypeIcon ty={final_col_type} />
355356
<span class="column_name">{ filter.column().to_owned() }</span>

rust/perspective-viewer/src/rust/components/column_selector/inactive_column.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ impl Component for InactiveColumn {
171171
{ondragend}
172172
>
173173
<div class="column-selector-column-border">
174+
<span class="drag-handle icon" />
174175
<TypeIcon ty={col_type} />
175176
<span class="column_name">{ ctx.props().name.clone() }</span>
176177
<span class="column-selector--spacer" />

rust/perspective-viewer/src/rust/components/column_selector/pivot_column.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impl Component for PivotColumn {
9999
ondragend={dragend}
100100
>
101101
<div class="pivot-column-border">
102+
<span class="drag-handle icon" />
102103
<TypeIcon ty={col_type} />
103104
<span class="column_name">{ ctx.props().column.clone() }</span>
104105
</div>

rust/perspective-viewer/src/rust/components/column_selector/sort_column.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl Component for SortColumn {
132132
ondragend={dragend}
133133
>
134134
<div class="pivot-column-border">
135+
<span class="drag-handle icon" />
135136
<TypeIcon ty={col_type} />
136137
// <TypeIcon ty={ColumnType::String} />
137138
<span class="column_name">{ ctx.props().sort.0.to_owned() }</span>

0 commit comments

Comments
 (0)