Commit Graph

25812 Commits

Author SHA1 Message Date
Jarek Radosz
043e0dcad7
DEV: Don't try to load admin locales in tests (#14917)
It always fails with:

```
Failed to load resource: the server responded with a status of 403 (Forbidden), url: http://localhost:60099/extra-locales/admin?v=[…]
```
2021-11-13 15:31:55 +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
Daniel Waterworth
4724f3cbf7
DEV: Remove deprecated method (#14902) 2021-11-12 09:07:44 -06:00
Daniel Waterworth
e7c0bbb9c0
DEV: Let's always give a drop_from param to deprecate (#14901)
So that we know when deprecations can be removed in the future.
2021-11-12 08:52:59 -06: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
Jarek Radosz
61d14a7694
DEV: Fix 3N+1 query in /admin/customize/themes (#14876) 2021-11-11 18:11:23 +01:00
Roman Rizzi
a3814b1e56
FIX: Display top posts from private categories if the user has access. (#14878)
Users viewing the top topics from the categories page should see those belonging to a private category if they have access to it.
2021-11-11 13:35:03 -03: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
Martin Brennan
6a68bd4825
DEV: Limit list multipart parts to 1 (#14853)
We are only using list_multipart_parts right now in the
uploads controller for multipart uploads to check if the
upload exists; thus we don't need up to 1000 parts.

Also adding a note for future explorers that list_multipart_parts
only gets 1000 parts max, and adding params for max parts
and starting parts.
2021-11-10 08:01:28 +10: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
David Taylor
5ac10e2e79
DEV: Update DiscourseConnect nonce errors to be more descriptive (#14858) 2021-11-09 17:39:05 +00: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
Natalie Tay
911f9b180a
FIX: Remove xlink:href to favour href due to deprecation (#14854)
Based on docs here https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use#attributes,
the xlink:href attribute is deprecated and we should probably move away from it soon.
2021-11-09 17:49:37 +08:00
Vinoth Kannan
d549022afb
FIX: use correct attribute method to get post id from dataset. (#14845)
Because of this bug, the post details were not included in the PMs which are initiated from the user cards in posts.
This reverts commit e3e0d025ea.
2021-11-09 12:24:50 +05:30
Natalie Tay
0b495e9ad4
FEATURE: Allow users to edit alt text from the image preview in the editor (#14480) 2021-11-09 14:34:09 +08:00
Jarek Radosz
34c955b5ec
DEV: Skip a test instead of commenting it out (#14836)
Fixes `qunit/no-commented-tests`
2021-11-08 21:13:58 +01:00
Penar Musaraj
e90f506bf8
FIX: Keep topic context when redirecting to full search (#14846) 2021-11-08 15:07:02 -05:00
Bianca Nenciu
7fb693c8f6
FIX: Generate valid heading ids (#14840) 2021-11-08 20:44:46 +02:00
Penar Musaraj
9ddb3a9ca6
FIX: Restore animation for like action on mobile (#14844)
Regressed in 89a2cec7be
2021-11-08 13:21:16 -05:00
Penar Musaraj
e0ced68eec
FIX: Persist notifications in OS X (#14843)
We were previously triggering the close event, which in OSX meant that
notifications would disappear from Notification Center.
2021-11-08 13:04:43 -05:00
Jarek Radosz
d162229758
DEV: Replace equal() with strictEqual() (#14827) 2021-11-08 10:26:28 +01:00
Krzysztof Kotlarek
8b93da9fe0
FIX: rename action_code_href to action_code_path (#14834)
Small actions should use path instead of absolute url. getURL function is necessary to insert a potential subfolder prefix.
2021-11-08 14:32:17 +11:00
Jarek Radosz
e6245bd603
DEV: Remove hints of jshint (#14828) 2021-11-08 09:12:37 +08:00
Joe
641f49748d
Revert "prevent auto-scroll when focus is set inside header panels" (#14829)
This reverts commit f444e3e3f7.
2021-11-08 09:11:26 +08:00
Martin Brennan
9a72a0945f
FIX: Ensure CORS rules exist for S3 using rake task (#14802)
This commit introduces a new s3:ensure_cors_rules rake task
that is run as a prerequisite to s3:upload_assets. This rake
task calls out to the S3CorsRulesets class to ensure that
the 3 relevant sets of CORS rules are applied, depending on
site settings:

* assets
* direct S3 backups
* direct S3 uploads

This works for both Global S3 settings and Database S3 settings
(the latter set directly via SiteSetting).

As it is, only one rule can be applied, which is generally
the assets rule as it is called first. This commit changes
the ensure_cors! method to be able to apply new rules as
well as the existing ones.

This commit also slightly changes the existing rules to cover
direct S3 uploads via uppy, especially multipart, which requires
some more headers.
2021-11-08 09:16:38 +10:00
Martin Brennan
18dc2c5040
FEATURE: Use uppy for tags uploader (#14821)
No other caveats or fixes.
2021-11-08 08:18:09 +10:00
Krzysztof Kotlarek
fe8087e523
FEATURE: small action post accepts href (#14816)
Optionally add href to small action.
It can be used by discourse-assign to link to correct post from translation
2021-11-08 08:24:44 +11:00
Joe
f444e3e3f7 prevent auto-scroll when focus is set inside header panels 2021-11-05 12:09:31 -04:00