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

Refactor current file upload code into React setup for resource creation #6

Closed
6 of 7 tasks
rufuspollock opened this issue Aug 5, 2020 · 3 comments
Closed
6 of 7 tasks
Assignees

Comments

@rufuspollock
Copy link
Member

rufuspollock commented Aug 5, 2020

Integrate the ckan3-js-sdk with this code and refactor so that we can upload a single file to the storage.

Acceptance

  • I can upload a file to (azure) storage using the react app by dragging and dropping a file or selecting it
  • success/completion (or failure) is reported in some basic manner
  • (?) There is a test for this (? using mocks) and cypress (?)

Tasks

  • require SDK in datapub
  • check and provide the configuration necessary to authenticate in ckan-authz ~rufus not sure what this means
  • refactor react code and make it work with the SDK uploading one file to the storage
  • show the request response to the user
@mariorodeghiero
Copy link
Contributor

  • check and provide the configuration necessary to authenticate in ckan-authz

@rufuspollock I add a fetch to authenticate and get JWT token form authz into the core react code using a proxy in package.json because using the SDK I got a CORS error. Maybe we need to check with @shevron if he has any idea.

Next steps:

  • Get the token and use the SDK to upload.

Result ok:

Screenshot from 2020-08-07 22-34-38

mariorodeghiero added a commit that referenced this issue Aug 11, 2020
- fix the upload flow using the SDK to upload file to the storage
- install enzime to the project
- add select file test
@mariorodeghiero
Copy link
Contributor

@rufuspollock Now all flow is working, I refactored the code and I add one more test to test the select file using jest+enzime.
Tomorrow I will add the fail/success message.

@mariorodeghiero
Copy link
Contributor

FIXED. See the items below.

  • I can upload a file to (azure) storage using the react app by dragging and dropping a file or selecting it
  • success/completion (or failure) is reported in some basic manner

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

No branches or pull requests

2 participants