-
Notifications
You must be signed in to change notification settings - Fork 14
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
Detects the unsaved changes in the already confirmed steps. #537
Conversation
additional modifications: - changing visibility with display, for the codes. In this way, no extra blank space is allocated if a code is not visible. using the visibility attribute for the layout allocates it even if the code is hidden
…nput_structure. This is needed to allow a dynamic display of the codes in step 3, if something is changed in step 2.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #537 +/- ##
==========================================
+ Coverage 79.07% 79.36% +0.28%
==========================================
Files 47 47
Lines 3211 3251 +40
==========================================
+ Hits 2539 2580 +41
+ Misses 672 671 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Adding dynamic visualization of codes
After a discussion with @unkcpz , we decided to make the following changes:
We also agreed that in the submit step, updating the blocker_message inside the @unkcpz Please have another check. |
if change["new"]: | ||
fmt_list = "\n".join((f"<li>{item}</li>" for item in sorted(change["new"]))) | ||
"""Observe the submission blockers and update the message area.""" | ||
blockers = self.internal_submission_blockers + self.external_submission_blockers |
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.
- Is that possible that blockers are
None
then you cannot use+
. - The
change
is not used, please use_
in as argment.
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.
Thanks for the suggestion. I change it to _change
. The blockers are always list
, I think we don't need to check None
here.
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.
If the variable is not used usually we use _
in widget callback.
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.
Thanks @superstar54, some more requests. Should be all fine then, I'll give it a through test then.
@unkcpz Thanks for your review. I made the changes as you suggested. Please test it. |
src/aiidalab_qe/app/main.py
Outdated
|
||
def _observe_selected_index(self, change): | ||
"""Check unsaved change in the step when leaving the step.""" | ||
with self.submit_step.hold_sync(): |
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 think this is not needed, only at very end the submit_step
is updated.
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.
Thanks! Looks good.
In #537 we introduce a mechanism that when the structure setup step or configure setup step is modified without confirmation, the submission step will be blocked. When loading finished calculations from the workflow selection bar, since setup steps are not confirmed, the user has to go back to previous steps to confirm which is not ideal. This PR make it automatically confirm the setup steps when the workflows are loaded from workflow selection dropdown.
In the discussion with @unkcpz and @mikibonacci , we proposed a solution to handle the situation where the user edits the already confirmed steps.
This PR detects the unsaved changes in the already confirmed steps. If there are any unsaved changes, it will block the submit step and show the blocker messages there.
The technique details:
selected_index
of the_wizard_app_widget
, and comparing the related values (confirmed_structure
in the step1, andconfiguration_parameters
in step 2)._submission_blockers
is added in the app and linked to the_app_submission_blockers
in the submit step.