Commit Graph

17582 Commits

Author SHA1 Message Date
Kris
8b5dec4607
UX: mobile topic list fixes follow-up to 0e371d4 (#14959) 2021-11-15 21:07:32 -05:00
Martin Brennan
f61783a218
FIX: Emoji uploader not using data.name on uppy upload (#14958)
When uploading emoji with the new uppy upload mixin, we were
not sending the name of the emoji in the payload, or more
accurately uppy was already using the file name as the name
value and we were not overriding it from data. This commit
changes the behaviour for single files uploaded via the uppy
upload mixin, by merging the file's meta object with this.data
from the parent component.
2021-11-16 11:14:06 +10:00
Jarek Radosz
f4d1fe18f8
DEV: Don't use $.isEmptyObject() (#14953) 2021-11-15 23:17:56 +01:00
Jordan Vidrine
0e371d4c6d
SYNTAX: Use classes instead of html element targeting (#14890)
* SYNTAX: Use classes instead of html element targeting
2021-11-15 14:49:45 -06:00
David Taylor
389a3ce389
DEV: Add basic theme support to the mini_profiler badge (#14952) 2021-11-15 18:39:11 +00:00
Robin Ward
5c43b8a572 DEV: Retry installation of ember exam
Let's try installing it by including it in dependencies AND dev
dependencies so it works in every environment.
2021-11-15 10:30:56 -05:00
Jarek Radosz
2bd2d0d474
FIX: A screen-track/appEvents regression in #14929 (#14943) 2021-11-15 15:04:49 +01:00
Jarek Radosz
67e38e81f7
DEV: Remove unnecessary test setup calls (#14940)
`setURLContainer()` and `setDefaultOwner()` are already called in an application initializer at the beginning of each test.
2021-11-15 13:46:09 +01:00
Jarek Radosz
985d079e47
DEV: Clean up sniff-capabilities (#14938)
Drop jQuery, remove unused caps (`canPasteImages` and `highRes`), enable `canVibrate` for Firefox (per the old comment), and other minor changes.
2021-11-15 13:41:55 +01:00
Arpit Jalan
8c4896f660
FIX: composer education message for group mentions were broken (#14937)
Composer education message for group mentions were broken because the
count parameter is a string instead of a number.
2021-11-15 17:12:06 +05:30
Jarek Radosz
fc3a6e57e3
DEV: Drop support for removing all appEvent listeners (#14936)
Also removes "appEventsCache". (and reduces the reported test memory usage by ~33%)

There's no longer any need to remove appEvent listeners in application-instance initializers' `teardown`, as app instances are recreated before each test (in both legacy and ember cli envs)
2021-11-15 12:31:05 +01:00
Jarek Radosz
f0d963faad
DEV: Use @bind instead of repeated .bind(this) (#14931)
Fixes some cases where event listeners weren't correctly removed. Also fixes a dependency tracking bug in user-private-messages
2021-11-15 10:07:53 +01:00
Jarek Radosz
9c9ad22626
DEV: Fix qunit/assert-args (#14932)
Just a couple of invalid assertions.
2021-11-15 04:30:42 +01:00
Jarek Radosz
b1c72282c9
DEV: Delete an old appEvents.off call (#14930)
There's no `composer:resize` anymore.
2021-11-15 02:38:10 +01:00
Jarek Radosz
a817ee9f7c
DEV: Update caniuse-lite (#14926)
The repeated notices in the console were tiring…

```
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
```
2021-11-15 01:18:11 +01:00
Jarek Radosz
047432735e
DEV: Don't create AppEvents instance in Eyeline (#14928)
Use `Evented` from `@ember/object/evented` instead.
2021-11-15 00:44:07 +01:00
Jarek Radosz
25251d4d00
DEV: Don't set appEvents on app, group injections (#14929) 2021-11-15 00:42:49 +01:00
Jarek Radosz
9711caf7ea
DEV: Fix a computed property overwrite (#14927)
There's a `category` computed property that already does what this piece of code did.
2021-11-15 00:39:20 +01:00
Vinoth Kannan
2b848213f7
FIX: set null to group if groupAttrs param is not available. (#14795)
Because of this bug "all groups" option in the group selector dropdown was not selectable on the user directory page.
2021-11-14 19:53:50 +05:30
Jarek Radosz
4f14e012a7
DEV: Replace $.extend with Object.assign (#14921) 2021-11-14 10:59:22 +01:00
Jarek Radosz
4938381b78
DEV: Fix a computed-property.override warning (#14922)
Regressed in #14307
2021-11-14 10:59:05 +01:00
Jarek Radosz
827b6c99ae
DEV: Fix a call-after-destroy issue (#14923)
Intersection observer callback can be called after the component gets destroyed:

```
Assertion Failed: calling set on destroyed object: <@ember/component:ember6019>.docked = false
    at assert (ember:37774:17)
    at _set2 (ember:17304:46)
    at Class.set (ember:29529:29)
    at Class._intersectionHandler (discourse/app/components/topic-progress:135:16)
    at Backburner._run (ember:56389:25)
    at Backburner._join (ember:56365:21)
    at Backburner.join (ember:56082:19)
    at join (ember:42874:28)
    at IntersectionObserver.eval (ember:42978:19)
```
2021-11-14 10:58:37 +01:00
Jarek Radosz
140ef0ebe7
DEV: Increase Chrome memory limit (#14918)
"Fixes" the build
2021-11-13 15:32:16 +01:00
Jarek Radosz
f414d5eace
DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
Jarek Radosz
bdd2c888b0
DEV: Avoid using globals (#14909) 2021-11-13 13:10:13 +01:00
Jarek Radosz
cb3cb96149
DEV: Fix Chrome flags (#14914)
```
Error: illegal value for flag --max_semi_space_size
```
2021-11-13 12:37:07 +01:00
Jarek Radosz
7ea2bf52cc
DEV: Fix hljs.highlightBlock deprecation (#14908) 2021-11-12 20:20:47 +01:00
Jarek Radosz
9ca93f57cc
DEV: Remove jQuery global usage where possible (#14905) 2021-11-12 19:23:20 +01:00
Jarek Radosz
97aa56bdc3
FIX: Prevent PreloadStore from calling the finder when value is falsy (#14899) 2021-11-12 17:45:06 +01:00
Joffrey JAFFEUX
79f49dfb7a
DEV: reduces jquery usage in composer-editor (#14903) 2021-11-12 16:40:10 +01:00
Bianca Nenciu
32a174d883
FIX: Use Map instead of Object for caching (#14887)
Objects have default properties, such as "constructor" that can cause
issues when using similar texts as keys.
2021-11-12 15:18:07 +02:00
Joffrey JAFFEUX
904d509cce
FIX: ensures minimum tags logic is correct and shared (#14723)
Also fixes a bug where select-kit was not updating noneItem in multi-selects.
2021-11-12 14:04:48 +01:00
Joffrey JAFFEUX
362c47ce6a
DEV: adds a new topic footer dropdown api (#14747)
This api allows to add a dropdown at the bottom of a topic, note that this API is mobile only for now.

Also included in the commit:
- various doc fixes
- adding tests for both buttons and dropdowns APIs
- uses thrown instead of @ember/error to ensure execution is halted when incorrect parameters are given
2021-11-12 10:21:34 +01:00
Martin Brennan
2371da9f25
Revert "Add support for Ember Exam" (#14895)
This reverts commit d1dec23a93.

It was causing issues with internal builds.
2021-11-12 10:31:57 +10:00
Robin Ward
d1dec23a93 Add support for Ember Exam
This allows us to partition and load balance tests, if we like.
2021-11-11 16:15:50 -05:00
Alan Guo Xiang Tan
095255c8ec
FIX: Topic queryParams are removed from history state when scrolling. (#14881)
* Also fixed a bug where the queryParams are not removed when toggling
  between filters.
2021-11-11 16:10:00 +08:00
Martin Brennan
729043633e
DEV: Add missing IDs to uppy upload components (#14880) 2021-11-11 15:38:39 +10:00
Martin Brennan
e4350bb966
FEATURE: Direct S3 multipart uploads for backups (#14736)
This PR introduces a new `enable_experimental_backup_uploads` site setting (default false and hidden), which when enabled alongside `enable_direct_s3_uploads` will allow for direct S3 multipart uploads of backup .tar.gz files.

To make multipart external uploads work with both the S3BackupStore and the S3Store, I've had to move several methods out of S3Store and into S3Helper, including:

* presigned_url
* create_multipart
* abort_multipart
* complete_multipart
* presign_multipart_part
* list_multipart_parts

Then, S3Store and S3BackupStore either delegate directly to S3Helper or have their own special methods to call S3Helper for these methods. FileStore.temporary_upload_path has also removed its dependence on upload_path, and can now be used interchangeably between the stores. A similar change was made in the frontend as well, moving the multipart related JS code out of ComposerUppyUpload and into a mixin of its own, so it can also be used by UppyUploadMixin.

Some changes to ExternalUploadManager had to be made here as well. The backup direct uploads do not need an Upload record made for them in the database, so they can be moved to their final S3 resting place when completing the multipart upload.

This changeset is not perfect; it introduces some special cases in UploadController to handle backups that was previously in BackupController, because UploadController is where the multipart routes are located. A subsequent pull request will pull these routes into a module or some other sharing pattern, along with hooks, so the backup controller and the upload controller (and any future controllers that may need them) can include these routes in a nicer way.
2021-11-11 08:25:31 +10:00
Rafael dos Santos Silva
d4e35f50c2
PERF: Update like count in visible posts without an extra GET per like (#14869)
PERF: Update like count in visible posts without an extra GET per like

Currently when a user is reading a topic and some post in it receive a
like from another user, the Ember app will be notified via MessageBus
and issue a GET to `/posts/{id}` to get the new like count. This worked
fine for us until today, but it can easily create a self-inflicted DDoS
when a topic with a large number of visitors gets a large number of
likes, since we will issue `visitors * likes` GET requests requests.

This patch optimizes this flow, by sending the new like count down in
the MessageBus notification, removing any need for the extra request.

It shouldn't cause any drift on the count because we send down the full
count instead of the difference too.

Possible follow-ups could include handling like removal.
2021-11-10 13:22:26 -03:00
Bianca Nenciu
3791fbd919
FEATURE: Add read-only scope to API keys (#14856)
This commit adds a global read-only scope that can be used to create
new API keys.
2021-11-10 17:48:00 +02:00
Martin Brennan
23b7b42acd
DEV: Bump eslint-config-discourse (#14868)
Changes for 4f7aba06c0

Also fixes all of the object-shorthand violations in our JS code.
2021-11-10 09:31:41 +10:00
jbrw
a8c63ddb54
FIX: Call _clearFlash() when displaying a modal (#14848)
`d-modal-body.js` was setting the text of a `modal-alert` element to `""`, but not removing any classes on that element. Changing this to call `_clearFlash()` ensures that a variety of styling classes are also removed from the element, which prevents empty alert elements being included on any subsequent modals that are displayed.

Several other controllers have also been modified to change the class of the error from `alert-error` to `error. The `alert-` is unnecessary, as it is added by `_flash(msg)` within `d-modal-body.js`.
2021-11-09 17:51:50 -05:00
Kris
a87216f1f3
A11Y: set modal widths with EMs; improves scaling (#14863) 2021-11-09 14:56:05 -05:00
Penar Musaraj
3becc55833
FIX: Disable scroll events while on full screen (#14864) 2021-11-09 14:29:05 -05:00
Penar Musaraj
ce91bf0775
Revert "FIX: Composer height issue in Safari on iOS 15 (#14282)" (#14847)
This reverts commit 0dab1634b0.
2021-11-09 13:10:07 -05:00
Kris
cb997be513
UX: fix share/notify modal styles (#14861) 2021-11-09 12:44:01 -05:00
Robin Ward
769d53ff09 FIX: In Ember CLI some plugin tests were referring to the wrong container 2021-11-09 12:06:05 -05:00
Jordan Vidrine
520a0cfa2b
"A11Y: Add prefers reduced motion" (#14859) 2021-11-09 10:24:31 -06:00
Bianca Nenciu
b203e316ac
FEATURE: Add pagination to API keys page (#14777) 2021-11-09 12:18:23 +02:00
Bianca Nenciu
42f65b4c48
FIX: Show perma-delete in menu without refresh (#14740)
It needed a page refresh because the post was not updated on the client
side.
2021-11-09 11:50:45 +02:00