web: add select all/partial/none for search table
This commit is contained in:
@@ -277,6 +277,24 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
||||
Msg::ShowThreadResult(bad) => {
|
||||
error!("show_thread_query error: {bad:#?}");
|
||||
}
|
||||
Msg::SelectionSetNone => {
|
||||
if let Context::SearchResult {
|
||||
selected_threads, ..
|
||||
} = &mut model.context
|
||||
{
|
||||
*selected_threads = HashSet::new();
|
||||
}
|
||||
}
|
||||
Msg::SelectionSetAll => {
|
||||
if let Context::SearchResult {
|
||||
results,
|
||||
selected_threads,
|
||||
..
|
||||
} = &mut model.context
|
||||
{
|
||||
*selected_threads = results.iter().map(|node| node.thread.clone()).collect();
|
||||
}
|
||||
}
|
||||
Msg::SelectionMarkAsRead => {
|
||||
if let Context::SearchResult {
|
||||
selected_threads, ..
|
||||
@@ -423,6 +441,8 @@ pub enum Msg {
|
||||
Result<graphql_client::Response<graphql::show_thread_query::ResponseData>, gloo_net::Error>,
|
||||
),
|
||||
|
||||
SelectionSetNone,
|
||||
SelectionSetAll,
|
||||
SelectionMarkAsRead,
|
||||
SelectionMarkAsUnread,
|
||||
SelectionAddThread(String),
|
||||
|
||||
Reference in New Issue
Block a user