-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
bdec621
to
335619d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ip1981)
iml-gui/crate/src/page/stratagem/report.rs, line 45 at r1 (raw file):
SortBy(table::SortBy<SortField>), DeleteReport(String), ReportDeleted(fetch::ResponseDataResult<Response<stratagem::list_reports::Resp>>),
Why get a whole list_reports::Resp
when a single report gets deleted?
iml-gui/crate/src/page/stratagem/report.rs, line 148 at r1 (raw file):
Msg::ReportDeleted(x) => { match x { Ok(Response::Data(_)) => {}
Maybe this should contain names or ids of deleted reports so we can directly purge them from the model?
It's a typo :) |
335619d
to
7839bad
Compare
Actually, it does not need to return anything but success/failure, because we already know what we delete. |
Maybe I should try server-side sorting. |
This should also allow the report to be downloaded if the user clicks the report name. Reports can be downloaded at |
Also, size should be in a human-readable form. |
Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
7839bad
to
9345be1
Compare
We can succeed in deleting one report and not the other (I/O error for example). |
|
||
pub fn view(model: &Model, session: Option<&Session>) -> Node<Msg> { | ||
if model.rows.is_empty() { | ||
return empty![]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since reports are currently the only thing in here, it would be nice to present a message like no reports found, or something to that effect.
} | ||
Msg::DeleteReport(filename) => { | ||
if let Ok(true) = window().confirm_with_message(&format!("Delete {}?", filename)) { | ||
let query = stratagem::delete_report::build(filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, it would be nice to optimistically delete the report from the model here.
Signed-off-by: Igor Pashev pashev.igor@gmail.com
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)