New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add warning dialog in LGV before returning to import form to prevent accidentally losing the current view #1774
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1774 +/- ##
==========================================
- Coverage 58.70% 58.65% -0.06%
==========================================
Files 456 457 +1
Lines 21170 21191 +21
Branches 5011 5017 +6
==========================================
+ Hits 12428 12429 +1
- Misses 8433 8452 +19
- Partials 309 310 +1
Continue to review full report at Codecov.
|
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.
this is ok to merge, just a couple of suggestions for possible improvements
onClick={() => { | ||
model.setDisplayedRegions([]) | ||
// it is necessary to run these after setting displayed regions | ||
// empty or else model.offsetPx gets set to infinity and breaks | ||
// mobx-state-tree snapshot | ||
model.scrollTo(0) | ||
model.zoomTo(10) | ||
handleClose() | ||
}} |
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.
might be a good idea to move this code into a new action in the model in order to keep the react code focused just on presentation
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.
Created this as the "clearView" action
@@ -439,6 +442,10 @@ export function stateModelFactory(pluginManager: PluginManager) { | |||
}, | |||
})) | |||
.actions(self => ({ | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
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.
any way we could reduce the number of instances of any
?
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.
I did a couple changes where I manually tell the dialog that it receives an object with a clearView function. It's not really possible to type the ReturnToImportFormDialog as receiving a full LGV prop I believe without making it any here
b367191
to
d517701
Compare
Currently there is a "return to import form" helper on the linear genome view, however if it is used accidentally you can lose your current view
This adds a dialog prompt to check if you are sure
It creates a model state for tracking whether a dialog is open