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

Move dropzone.js to npm/webpack #10645

Merged
merged 1 commit into from
Mar 7, 2020
Merged

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Mar 6, 2020

  • unvendor dropzone and upgrade it from 4.2.0 to 5.7.0
  • make csrf available on window.config

I noticed one bug already present on master while testing which is when 1 attachment is present, comment is edited and another one is added, it won't save correctly.

This PR should not introduce any regressions.

@silverwind silverwind force-pushed the dropzone-npm branch 2 times, most recently from c79df90 to 9a35e6f Compare March 6, 2020 21:28
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 7, 2020
@zeripath zeripath added the topic/ui Change the appearance of the Gitea UI label Mar 7, 2020
@zeripath zeripath added this to the 1.12.0 milestone Mar 7, 2020
@silverwind
Copy link
Member Author

I think this upgrade allows us to remove jquery-migrate. I will investigate separately.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 7, 2020
@zeripath
Copy link
Contributor

zeripath commented Mar 7, 2020

We also need to look at making dropzone less difficult to configure - there are repeated user complaints about not being allowed to upload jars, zips etc.

@silverwind
Copy link
Member Author

silverwind commented Mar 7, 2020

there are repeated user complaints about not being allowed to upload jars, zips etc.

This is because we have this opinionated default:

; One or more allowed types, e.g. image/jpeg|image/png
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip

I think we should allow everything by default. It should not be our decision.

Additionally, mime types are a bad abstraction because different browsers send different mime types for the same file extension. File extentions would be much better as they are guaranteed to be the same across browsers. dropzone already allows file extensions, but I think the backend might not.

@silverwind
Copy link
Member Author

Will do a few more refactors, don't land yet.

@codecov-io
Copy link

Codecov Report

Merging #10645 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10645      +/-   ##
==========================================
- Coverage   43.61%    43.6%   -0.01%     
==========================================
  Files         588      588              
  Lines       82488    82485       -3     
==========================================
- Hits        35975    35967       -8     
- Misses      42052    42056       +4     
- Partials     4461     4462       +1
Impacted Files Coverage Δ
routers/repo/editor.go 26.14% <ø> (+0.04%) ⬆️
routers/repo/issue.go 37.87% <ø> (-0.05%) ⬇️
routers/repo/attachment.go 47.05% <ø> (-0.52%) ⬇️
modules/indexer/stats/db.go 50% <0%> (-9.38%) ⬇️
modules/queue/workerpool.go 56.93% <0%> (-1.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a528189...349afdd. Read the comment docs.

- unvendor dropzone and upgrade it from 4.2.0 to 5.7.0
- make `csrf` available on window.config
@silverwind
Copy link
Member Author

Refactors removed, they require more work. Should be good to land.

@zeripath zeripath merged commit 9d3e69e into go-gitea:master Mar 7, 2020
@silverwind silverwind deleted the dropzone-npm branch March 8, 2020 08:07
silverwind added a commit to silverwind/gitea that referenced this pull request Jun 22, 2020
Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: go-gitea#10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: go-gitea#12022
Fixes: go-gitea#11906
techknowlogick pushed a commit that referenced this pull request Jun 24, 2020
Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: #10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: #12022
Fixes: #11906

Co-authored-by: Lunny Xiao <[email protected]>
silverwind added a commit to silverwind/gitea that referenced this pull request Jun 24, 2020
Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: go-gitea#10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: go-gitea#12022
Fixes: go-gitea#11906

Co-authored-by: Lunny Xiao <[email protected]>
techknowlogick pushed a commit that referenced this pull request Jun 24, 2020
Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: #10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: #12022
Fixes: #11906

Co-authored-by: Lunny Xiao <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: go-gitea#10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: go-gitea#12022
Fixes: go-gitea#11906

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants