FEATURE: Change all core to use uppy-image-uploader (PR #14428)

Instead of using image-uploader, which relies on the old UploadMixin, we can now use the uppy-image-uploader which uses the new UppyUploadMixin which is stable enough and supports both regular XHR uploads and direct S3 uploads, controlled by a site setting (default to XHR).

At some point it may make sense to rename uppy-image-uploader back to image-uploader, once we have gone through plugins etc. and given a bit of deprecation time period.

This commit also introduces queryParams to lib/url.js, which is a drop-in replacement for $.param to generate a queryString from a JS object literal. A later PR will make changes to more places in core and plugins to use this.

GitHub

The site-settings-image-uploader solely existed to pass for_site_setting=true to the queryString for image uploads for site settings. This is replaced by passing the queryParams object into uppy-image-uploader

Do we still need the site setting on the server side? If not, we’ll need to drop it from the database.

Hmm I wonder if we should have a consistent ID story for the uploaders.

  1. category-background-upload
  2. group-flair-uploader
  3. profile-background

The IDs are named very differently between components.

So I can get all this analyzed and a forensictest ran and it is all legit

On Tue, Sep 28, 2021 at 3:21 AM Alan Guo Xiang Tan @.***> wrote:

@.**** commented on this pull request.

In app/assets/javascripts/discourse/app/templates/components/group-flair-inputs.hbs https://github.com/discourse/discourse/pull/14428#discussion_r717293800:

   imageUrl=flairImageUrl
   onUploadDone=(action "setFlairImage")
   onUploadDeleted=(action "removeFlairImage")
   type="group_flair"
  •  id="group-flair-uploader"
    

Hmm I wonder if we should have a consistent ID story for the uploaders.

  1. category-background-upload
  2. group-flair-uploader
  3. profile-background

The IDs are named very differently between components.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/discourse/discourse/pull/14428#pullrequestreview-765059523, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVCKBVCPNMTNYCCTJSTWQ3UEFUI5ANCNFSM5ESXZY4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.