-
Notifications
You must be signed in to change notification settings - Fork 38
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 submission withdrawal workflow #3298
base: main
Are you sure you want to change the base?
Conversation
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.
Overall approach ok but implementation needs work.
hypha/apply/funds/templates/funds/applicationsubmission_detail.html
Outdated
Show resolved
Hide resolved
hypha/apply/funds/workflow.py
Outdated
}, | ||
'display': _('Need screening'), | ||
'public': _('Application Received'), | ||
'stage': RequestExt, | ||
'permissions': default_permissions, | ||
'permissions': applicant_edit_permissions, |
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 withdraw permissions should be separate from edit permissions.
We do not allow applicants to edit submissions that are in review for obvious reasons.
But if we allow an applicant to withdraw an application they should be able to do that in any state up until the submission is approved/declined.
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.
In progress.
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 f4ae001 resolves this, let me know what you think.
Thanks for the feedback! Patches incoming |
Based on Review in #3298, the decision was made that an applicant can withdraw at any time, without edit permissions, and edit permissions should not be to applicants for their own submissions.
0861d24
to
6f8d05d
Compare
Ok! I believe I've made the correct updates. I did testing on all the different workflows, but I'm not as familiar with some of the ones we don't use with ARDC, so there may be edge cases I'm not aware of. Especially the Concept/Proposal, which I believe I did in line with the spirit of those workflows. |
Based on Review in #3298, the decision was made that an applicant can withdraw at any time, without edit permissions, and edit permissions should not be to applicants for their own submissions.
6f8d05d
to
5d0405e
Compare
4fa0e41
to
1d7b829
Compare
@frjo What would we need to do to get this one in? I was about to make an issue and PR but found this existing one. |
@bickelj Rebase of current main and address the issues above. I think it makes perfect sense to allow applicants to withdraw an application. If this should be the default or optional I'm not sure but make it optional for now. |
cacfc93
to
f63f0b2
Compare
@frjo I think this is ready for testing again. |
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.
Nice work! Some questions around implementation details.
Good improvement of Hypha.
hypha/apply/funds/views.py
Outdated
@@ -1579,6 +1583,45 @@ def form_valid(self, form): | |||
return super().form_valid(form) | |||
|
|||
|
|||
class SubmissionWithdrawView(SingleObjectTemplateResponseMixin, BaseDetailView): |
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.
Add
@method_decorator(login_required, name="dispatch")
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 the SingleObjectTemplateResponseMixin
needed?
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 suppose I could try without once the other issues are resolved.
5b656bb
to
a41caec
Compare
@bickelj I rebased of main and added some permission fixes that seems to work. (I hope it doesn't mess it up for you.) Please try it out and see how it behaves. |
@frjo Thank you for making the change, it didn't mess anything up for me! It looks great! From a user perspective, applicants cannot withdraw right after submitting the application as expected. If I add From a programmer perspective, the |
a41caec
to
2b72a80
Compare
I have added Unsure of adding it to other places. Can we put this on test and see what people think of it? |
@frjo Sure, yes, sorry for the delay! |
@frjo While looking at |
Created this #4090 |
@frjo Do you think this one can be in the next release? |
afd1ef6
to
709f218
Compare
I just rebased the PR. It will go to test late this week or next week. So probably the release after the next one. |
This only affects about enabling them, not whether they are in the system. That means that if the configuration is changed over the lifetime of a system, things that were withdrawn when it was enabled retain that status. Issue #3296
This creates a single withdrawn status for each workflow, living at the end (next to accepted/rejected), and adds transistions for all the different workflow types. Issue #3296
This affected different calculating pages, like the open round percentage completions. Issue #3296
Withdrawn status needs to be added to a mapping, apparently :) Issue #3296
Removed a redeclared variable and reformatted. Issue #3296
Add distinct withdrawal permissions within stages of workflows. By default, let the applicant withdraw at any stage. On the submission page, display the Withdraw button assuming the setting `ENABLE_SUBMISSION_WITHDRAWAL` is true and the withdrawal permissions are met. Issue #3296
Add a heroicon to "Withdraw" button and style it similar to "Delete". Issue #3296
The permissions on the `*withdraw` items should be `no_permissions`. After a submission is withdrawn, nothing further should happen to it. When `perform_transition` is called in the View, that function will already check for valid transitions and raise an exception if needed. So do not bother looking into the transitions, instead look directly for the withdraw action. And expect exactly one of those, otherwise raise an exception with details of expectations. Issue #3296
709f218
to
42d5918
Compare
"display": _("Withdraw"), | ||
"permissions": {UserPermissions.APPLICANT}, | ||
"method": "withdraw", | ||
}, |
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.
The previous was more concise. What is the advantage of this repetition?
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.
To give the applicant permission to perform the action.
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 could have sworn I tested with applicants but I guess you mean in the context of putting the permissions in a single place rather than multiple places.
hypha/apply/funds/workflow.py
Outdated
@@ -204,7 +204,7 @@ def make_permissions(edit=None, review=None, view=None, withdraw=None): | |||
reviewer_can, | |||
partner_can, | |||
], | |||
"withdraw": withdraw or [applicant_can], |
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 where I was thinking it avoided the repetition but is that incorrect? Perhaps it was the former 1753 in the view that was duplicative/incorrect before?
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 meant to say "Line 1753 in the view."
Fixes #3296
What it says on the tin. When applicants have edit permissions (requires a change to workflow.py, see #3297), they can withdraw applications that have been submitted. This adds that as a new status for submissions.