31 Commits

Author SHA1 Message Date
dandds
0517bd1b0a Fix task order uploads.
Task order uploads and downloads were broken. Uploads were broken
because file content was eing read in as plaintext every time, resulting
in encoding issues. I updated the bundle to use the newer Azure JS SDK.
We can now use a method for uploading browser files directly without
having to read their content. This required a few small internal changes
to the upload component, since the response structure is different.

I also removed the `downloadUrl` method from the JS uploader since it
was not being used.

Downloads were broken because the method that generates the download
link was not updated to use the BlobSasPermissions class from the
updated Azure Python SDK.
2020-02-03 09:56:02 -05:00
leigh-mil
dff9924c95 Make file size limit configurable 2020-01-31 11:59:07 -05:00
dandds
5213657b0f Additional validation and escaping for file names.
This adds additional front and backend validations for task order file
names. We are now restricting file names to a whitelist regex of
[A-Za-z0-9\-_ \.] for simplicity.

Note:
On the frontend, the filename string must have at least one character.
This is not true in the backend validation; because of the way the
entire task order form is validated, requiring input would break the
business logic currently implemented.
2020-01-15 09:17:03 -05:00
leigh-mil
2f5ad6b38b Move event emitter before async function call so it will hopefully trigger the change event on the parent component earlier.
Update this.changed inside if statement because it should only be updated if the file is successfully uploaded.
2019-12-02 14:37:40 -05:00
leigh-mil
04b9250ea1 Create emitter function for field-change event 2019-11-19 14:49:11 -05:00
leigh-mil
c94570f83e Update TO form and nested components to emit directly to parent components instead of emitting from the root component 2019-11-14 16:46:35 -05:00
richard-dds
83ca303e1f Disable attachmentInput when file is attached (with tests this time) 2019-08-30 16:13:59 -04:00
richard-dds
518376a1d6 Simplify hasInitialData 2019-08-29 16:08:55 -04:00
richard-dds
b26cd3ffae Allow user to download a previously uploaded pdf 2019-08-29 16:00:25 -04:00
richard-dds
e8234dcf34 Allow user to download files on TO upload page 2019-08-29 11:28:49 -04:00
richard-dds
b7fbe9d2ac Use underscores in urls 2019-08-29 11:10:05 -04:00
richard-dds
11c1c37d7f Remove unnecessary macro and Vue props 2019-08-28 15:56:55 -04:00
richard-dds
67a4bb602d Require portfolio id in upload-token
It's necessary for the authz decorator
2019-08-28 15:56:55 -04:00
richard-dds
85ba61b97b Formatting 2019-08-28 15:06:20 -04:00
richard-dds
de090a319b Pass objectName into upload constructor 2019-08-28 15:06:20 -04:00
richard-dds
27e0e16707 Require auth on upload-token 2019-08-28 15:06:20 -04:00
richard-dds
7d1dfa1d0e Get presigned upload token via ajax request 2019-08-28 15:06:13 -04:00
richard-dds
9b7186c94f Formatting 2019-08-16 13:49:50 -04:00
richard-dds
db73a12e95 Limit size of uploaded files 2019-08-16 13:30:03 -04:00
richard-dds
7f477ec034 Fix "request entity too large" when uploading TO PDF
Do this by setting disabled="true" on the file input element after
selecting the file, and re-enabling it if the file is removed. This
prevents the file from actually being sent to the server, since we're
not using it there anyway.
2019-08-15 14:47:19 -04:00
richard-dds
330c9ef365 Correctly set and unset uploadError 2019-08-13 14:08:53 -04:00
richard-dds
3ecb2cf84f Update copy for file upload failure 2019-08-13 10:51:09 -04:00
richard-dds
8d7c4672b0 Display file upload errors in form 2019-08-13 10:51:09 -04:00
richard-dds
f5c8424b46 Wire up FE uploads to TO form 2019-08-05 14:58:10 -04:00
richard-dds
8eba9a097d Add CSP file uploads 2019-08-05 14:58:10 -04:00
leigh-mil
56bc9dd4e5 update components to emit valid on field-change and use in TO form 2019-06-17 12:45:55 -04:00
leigh-mil
5be4efb9d9 Reimplement SaveButton disabled until input change 2019-06-14 11:11:24 -04:00
dandds
0e89a55c07 Display and overwrite task order uploads correctly.
- Populate the POSTed form with additional data from the existing TO
  model. This way the pdf attachment has to be explicitly overwritten.
- Adjust the frontend so that if there is an existing PDF, it only sends
  a file input back if the user removes the existing PDF.
2019-06-11 09:58:32 -04:00
dandds
159360692f Improve task order upload validation handling.
- Display validation errors.
- Rerender validated form data correctly.
- Clear error state correctly.
2019-06-06 13:57:07 -04:00
dandds
fb430e76e9 Basic frontend uploader component 2019-06-06 13:57:07 -04:00
Montana
eaa5c93922 Create upload macro 2019-02-07 13:21:31 -05:00