-
Notifications
You must be signed in to change notification settings - Fork 2
fix: switch to POST for executing jobs #324
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
Conversation
🚀 Deployed on https://pr-324--dhis2-scheduler.netlify.app |
d519f17
to
83ee1a7
Compare
83ee1a7
to
6b4f7d4
Compare
I'll assign this to @Mohammer5 as well as he's there tomorrow and I'm not. I'm happy to finish reviewing this next week if there's no rush, otherwise feel free to tackle this beforehand. The broad lines look good to me at a glance. |
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 we should either prevent the modal from being closed while loading to ensure that a potential error can be shown to the user or show the error in an alert (which would be my preference as it'd be consistent with other apps)
I think my recommendation would be this pattern: #325. I know it's verbose, but to me it seems wrong that we recommend from one lib to not set the query during runtime, and then in other areas implement workarounds to set the query during runtime. The engine was meant as an escape hatch so to me it seems like the stable solution in the meantime. Not ideal, but I think the semantics make more sense than us trying to subvert the recommended pattern from one of our other libs. Couple of things that would probably be good to tackle later (seems out of scope for this PR):
|
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 thing that I found will be deferred, I'll approve this issue
I'm still wondering about the question I asked wrt. the choice for useState (see review note above). Also, I think we can remove the mocking from tests that don't click the 'run job' button (like in #325). After that's addressed this should be good to go as far as I'm concerned as well. |
I'll implement that 👍
Since it seems like there's a strong possiblity that resource parameterisation might be implemented in |
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 it seems like there's a strong possiblity that resource parameterisation might be implemented in app-runtime this week, I'm happy to keep this PR open until then.
I'm good with this being merged with the useState based fix.
Only thing I think I'd do is remove the mocking from tests that don't need it. And setting the useState directly (i.e. with an object). If you want to be completely robust I can imagine that you'd want the dynamic query to respond to changes in the id prop, though practically speaking I don't think that's necessary as the app doesn't do that atm.
Feel free to merge if you're happy with the PR 👍, looks good to me!
## [99.9.10](v99.9.9...v99.9.10) (2021-11-23) ### Bug Fixes * switch to POST for executing jobs ([#324](#324)) ([c062ffa](c062ffa))
🎉 This PR is included in version 99.9.10 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes https://jira.dhis2.org/browse/DHIS2-12156
The HTTP method for the
jobConfigurations/:id/execute
endpoint has switched fromGET
toPOST
.The
RunJobModal
component has been updated to usePOST
.