Commit 2f64a17d authored by Alexandre Delanoë's avatar Alexandre Delanoë

[NgramsTable] Buttons if selectAll

parent 06edcc5f
...@@ -134,6 +134,7 @@ tableContainer :: { path :: R.State PageParams ...@@ -134,6 +134,7 @@ tableContainer :: { path :: R.State PageParams
, ngramsSelection :: Set NgramsTerm , ngramsSelection :: Set NgramsTerm
, ngramsTable :: NgramsTable , ngramsTable :: NgramsTable
, tabNgramType :: CTabNgramType , tabNgramType :: CTabNgramType
, ngramsSelectAll :: Boolean
} }
-> Record T.TableContainerProps -> R.Element -> Record T.TableContainerProps -> R.Element
tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
...@@ -143,6 +144,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath ...@@ -143,6 +144,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
, ngramsSelection , ngramsSelection
, ngramsTable: ngramsTableCache , ngramsTable: ngramsTableCache
, tabNgramType , tabNgramType
, ngramsSelectAll
} props = } props =
H.div {className: "container-fluid"} H.div {className: "container-fluid"}
[ H.div {className: "jumbotron1"} [ H.div {className: "jumbotron1"}
...@@ -213,7 +215,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath ...@@ -213,7 +215,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
[ H.thead {className: "tableHeader"} [props.tableHead] [ H.thead {className: "tableHeader"} [props.tableHead]
, H.tbody {} props.tableBody]] , H.tbody {} props.tableBody]]
, H.li {className: " list-group-item"} , if ngramsSelectAll then H.li {className: " list-group-item"}
[ H.button { className: "btn btn-primary" [ H.button { className: "btn btn-primary"
, on: {click: const $ setSelection GraphTerm } , on: {click: const $ setSelection GraphTerm }
} }
...@@ -223,6 +225,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath ...@@ -223,6 +225,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
} }
[ H.text "Stop" ] [ H.text "Stop" ]
] ]
else H.div {}[]
] ]
] ]
] ]
...@@ -348,7 +351,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render ...@@ -348,7 +351,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
wrapColElts (T.ColumnName "Select") = const [R2.buff selected] wrapColElts (T.ColumnName "Select") = const [R2.buff selected]
wrapColElts (T.ColumnName "Score") = (_ <> [H.text ("(" <> show scoreType <> ")")]) wrapColElts (T.ColumnName "Score") = (_ <> [H.text ("(" <> show scoreType <> ")")])
wrapColElts _ = identity wrapColElts _ = identity
container = tableContainer {path, dispatch, ngramsParent, ngramsChildren, ngramsSelection, ngramsTable, tabNgramType} container = tableContainer {path, dispatch, ngramsParent, ngramsChildren, ngramsSelection, ngramsTable, tabNgramType, ngramsSelectAll}
setParams f = setPath $ \p@{params: ps} -> p {params = f ps} setParams f = setPath $ \p@{params: ps} -> p {params = f ps}
ngramsTable = applyNgramsTablePatch ngramsTablePatch initTable ngramsTable = applyNgramsTablePatch ngramsTablePatch initTable
orderWith = orderWith =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment