-
Notifications
You must be signed in to change notification settings - Fork 82
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
#123 delete all button on report listing screen #181
base: master
Are you sure you want to change the base?
Conversation
try: | ||
get_serializer().delete_all_for_report_name(report_name) | ||
get_all_result_keys(get_serializer(), limit=DEFAULT_RESULT_LIMIT, force_reload=True) | ||
return jsonify({"status": "ok"}), 200 |
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 needs some enhancement - exposing the JSON to the end user is a bit too low-level
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've set this up to redirect to the front page.
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.
Looks promising! A couple things:
- I think the serialiser implementation of
delete_all_for_report_name()
wasn't committed? We should at least have an abstract method. - Needs some tests - consider adding to some of our new frontend testing as well :)
- Add to CHANGELOG.md please
e.preventDefault(); | ||
var confirmed = confirm('Are you sure you wish to delete all reports?'); | ||
if (confirmed) { | ||
window.location.href = this.getAttribute('data-href'); |
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 could take a long time - do we want to display a spinner or even a status update to the user?
:return: A JSON which contains "status" which will either be "ok" or "error". | ||
""" | ||
try: | ||
get_serializer().delete_all_for_report_name(report_name) |
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.
Where is this implemented?
|
||
|
||
@run_report_bp.route("/delete_all_reports/<path:report_name>", methods=["GET", "POST"]) | ||
def delete_all_reports(report_name): |
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.
Needs a test please
Manually run this report | ||
</a> | ||
<button class="ui button red" id="deleteAllReportsButton" data-href="/delete_all_reports/{{ report_name }}"> | ||
Delete all reports | ||
</button> |
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.
Ideally we could add a Jest test for this as well please
Fixes #123