File tree Expand file tree Collapse file tree
rust/perspective-viewer/src/rust/components/column_selector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -514,6 +514,7 @@ impl Component for ConfigSelector {
514514 html_nested! {
515515 <PivotColumn
516516 dragdrop={ & ctx. props( ) . dragdrop }
517+ session={ & ctx. props( ) . session }
517518 action={ DragTarget :: GroupBy }
518519 column={ group_by. clone( ) } >
519520 </PivotColumn >
@@ -540,6 +541,7 @@ impl Component for ConfigSelector {
540541 html_nested! {
541542 <PivotColumn
542543 dragdrop={ & ctx. props( ) . dragdrop }
544+ session={ & ctx. props( ) . session }
543545 action={ DragTarget :: SplitBy }
544546 column={ split_by. clone( ) } >
545547 </PivotColumn >
Original file line number Diff line number Diff line change @@ -458,6 +458,8 @@ impl Component for FilterColumn {
458458 }
459459 . unwrap_or_default ( ) ;
460460
461+ let final_col_type = col_type. expect ( "Unknown column" ) ;
462+
461463 html ! {
462464 <div
463465 class="pivot-column-draggable"
@@ -467,7 +469,8 @@ impl Component for FilterColumn {
467469 >
468470 <LocalStyle href={ css!( "filter-item" ) } />
469471 <div class="pivot-column-border" >
470- <TypeIcon ty={ ColumnType :: String } />
472+ // <TypeIcon ty={ColumnType::String} />
473+ <TypeIcon ty={ final_col_type} />
471474 <span class="column_name" >{ filter. column( ) . to_owned( ) } </span>
472475 <FilterOpSelector
473476 class="filterop-selector"
Original file line number Diff line number Diff line change 1010// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
1111// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212
13- use perspective_client:: ColumnType ;
13+ // use perspective_client::ColumnType;
1414use web_sys:: * ;
1515use yew:: prelude:: * ;
1616
1717use crate :: components:: containers:: dragdrop_list:: * ;
1818use crate :: components:: type_icon:: TypeIcon ;
1919use crate :: dragdrop:: * ;
20+ use crate :: session:: * ;
2021
2122pub struct PivotColumn { }
2223
2324#[ derive( Properties ) ]
2425pub struct PivotColumnProps {
26+ pub session : Session ,
2527 pub column : String ,
2628 pub dragdrop : DragDrop ,
2729 pub action : DragTarget ,
@@ -61,6 +63,13 @@ impl Component for PivotColumn {
6163 move |_event| dragdrop. notify_drag_end ( )
6264 } ) ;
6365
66+ let col_type = ctx
67+ . props ( )
68+ . session
69+ . metadata ( )
70+ . get_column_table_type ( & ctx. props ( ) . column )
71+ . expect ( "Unknown column" ) ;
72+
6473 html ! {
6574 <div
6675 class="pivot-column-draggable"
@@ -69,7 +78,8 @@ impl Component for PivotColumn {
6978 ondragend={ dragend}
7079 >
7180 <div class="pivot-column-border" >
72- <TypeIcon ty={ ColumnType :: String } />
81+ <TypeIcon ty={ col_type} />
82+ // <TypeIcon ty={ColumnType::String} />
7383 <span class="column_name" >{ ctx. props( ) . column. clone( ) } </span>
7484 </div>
7585 </div>
Original file line number Diff line number Diff line change 1111// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212
1313use perspective_client:: config:: * ;
14- use perspective_client:: ColumnType ;
14+ // use perspective_client::ColumnType;
1515use web_sys:: * ;
1616use yew:: prelude:: * ;
1717
@@ -101,6 +101,13 @@ impl Component for SortColumn {
101101 move |_event| dragdrop. notify_drag_end ( )
102102 } ) ;
103103
104+ let col_type = ctx
105+ . props ( )
106+ . session
107+ . metadata ( )
108+ . get_column_table_type ( & ctx. props ( ) . sort . 0 . to_owned ( ) )
109+ . expect ( "Unknown column" ) ;
110+
104111 html ! {
105112 <div
106113 class="pivot-column-draggable"
@@ -109,7 +116,8 @@ impl Component for SortColumn {
109116 ondragend={ dragend}
110117 >
111118 <div class="pivot-column-border" >
112- <TypeIcon ty={ ColumnType :: String } />
119+ <TypeIcon ty={ col_type} />
120+ // <TypeIcon ty={ColumnType::String} />
113121 <span class="column_name" >{ ctx. props( ) . sort. 0 . to_owned( ) } </span>
114122 <span
115123 class={ format!( "sort-icon {}" , ctx. props( ) . sort. 1 ) }
You can’t perform that action at this time.
0 commit comments