Skip to content
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 bulk image downloads from client side #907

Merged
merged 20 commits into from
Jan 4, 2023

Conversation

dodumosu
Copy link
Collaborator

@dodumosu dodumosu commented Oct 4, 2022

this pull request attempts to solve nditech/apollo-issues#181 by adding an extra menu item to the export dropdown on the submission list view

@dodumosu dodumosu requested a review from takinbo October 4, 2022 13:10
Copy link
Collaborator

@takinbo takinbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a small status dialog at the bottom left similar to the design we were looking to implement for background task updates on each import page showing the status of the download so a user is not left wondering what is happening when a download is occurring.

apollo/frontend/templates/frontend/submission_list.html Outdated Show resolved Hide resolved
apollo/frontend/templates/frontend/submission_list.html Outdated Show resolved Hide resolved
apollo/frontend/templates/frontend/submission_list.html Outdated Show resolved Hide resolved
@dodumosu dodumosu force-pushed the bulk-image-download branch from 6b69680 to d5d72cb Compare November 29, 2022 15:05
@takinbo
Copy link
Collaborator

takinbo commented Dec 5, 2022

Screenshot from 2022-12-05 16-09-29

Can you change the icon next to the Download label to use the primary color as well?

Also, if the number of images is less than the chunk size, the dialog seems to be stuck with this displaying.

@takinbo
Copy link
Collaborator

takinbo commented Dec 5, 2022

Correction: the notification remains on screen and is stuck at the point display if there are NO images to be downloaded

@takinbo
Copy link
Collaborator

takinbo commented Dec 6, 2022

Two new issues:

  1. There should be some modal dialog explaining that the current selection has no images to download if there are none or it's also fine if you download an empty archive but having the application "do nothing" when you click the images export button gives the impression that it is not working.
  2. I get this error when I try to export images from a form that has submissions with images (might be as a result of an image replacement?)
[2022-12-06 05:00:28,475] ERROR in app: Exception on /api/submissions/image_manifest [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2284, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1807, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1710, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1805, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1791, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask_login/utils.py", line 261, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_apispec/annotations.py", line 118, in wrapped
    return wrapper(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_apispec/wrapper.py", line 32, in __call__
    response = self.call_view(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_apispec/wrapper.py", line 54, in call_view
    return self.func(*args, **kwargs)
  File "/app/apollo/submissions/api/views.py", line 469, in get_image_manifest
    } for attachment in query]
  File "/app/apollo/submissions/api/views.py", line 469, in <listcomp>
    } for attachment in query]
  File "/app/apollo/submissions/api/views.py", line 437, in _generate_filename
    associated_tag = image_fields.get(attachment.uuid.hex).get('tag')
AttributeError: 'NoneType' object has no attribute 'get'
172.25.0.1 - - [06/Dec/2022 05:00:28] "POST /api/submissions/image_manifest HTTP/1.1" 500 -

@takinbo
Copy link
Collaborator

takinbo commented Dec 6, 2022

While you're fixing this, can we change the toast title to "Download Progress"?

Copy link
Collaborator

@takinbo takinbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@takinbo takinbo merged commit 0a17439 into nditech:develop Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants