Commit Graph

42626 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan
94fe5d9bf7 DEV: Disable Ember CLI tests on Github.
Tests are consistently failing on Github so we're disabling it for now.
2021-08-16 13:24:21 +08:00
Martin Brennan
f438cb8e65
Revert "DEV: Remove an unnecessary join in TopicTrackingState.report." (#14054)
This reverts commit 06ee0e5a51.
2021-08-16 13:54:34 +10:00
Martin Brennan
d7390f48c7
FIX: Clean up upload events properly in composer (#14052)
I was storing the wrong object as the event listener
reference for the paste and mobile upload button click
events so they were not being cleaned properly on element
destruction.

Also renamed `uploadButton` to the more descriptive
`mobileUploadButton`.
2021-08-16 12:59:27 +10:00
Alan Guo Xiang Tan
06ee0e5a51 DEV: Remove an unnecessary join in TopicTrackingState.report. 2021-08-16 10:55:44 +08:00
awesomerobot
b801319fb8 UX: add a title to the user filter input 2021-08-16 10:53:05 +08:00
dependabot[bot]
7d69ea1596 Build(deps-dev): Bump parallel_tests from 3.7.0 to 3.7.1
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/grosser/parallel_tests/releases)
- [Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grosser/parallel_tests/compare/v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: parallel_tests
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 10:52:47 +08:00
dependabot[bot]
c3a3a2ed24 Build(deps-dev): Bump rspec-rails from 5.0.1 to 5.0.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v5.0.1...v5.0.2)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 10:52:32 +08:00
Martin Brennan
f9e877dbff
FIX: Composer Processing/Uploading status not clearing on cancel and trash (#14050)
When the composer reply is cancelled and the draft is trashed,
the isUploading and isProcessing statuses were not being reset,
so when the composer was opened again the Uploading... or
Processing... message still showed even when the uploads had
been cancelled correctly.

The regular composer-upload mixin suffered the same problem
as the uppy one, where the Processing/Uploading message was not
reset when a reply was cancelled and the draft destroyed.
2021-08-16 09:55:55 +10:00
Discourse Translator Bot
0e53769f71
Update translations (#13994) 2021-08-14 10:18:05 +02:00
Kris
2c282a5a47
Replace README logo with PNG (#14044) 2021-08-13 14:23:49 -04:00
Kris
104e0ad8b2
Github doesn't like inline SVGs in the README (#14043) 2021-08-13 13:26:20 -04:00
Kris
785ee18fd6
UX: README logo SVG that supports dark mode (#14042) 2021-08-13 13:06:08 -04:00
Rafael dos Santos Silva
b136375582
FEATURE: Rate limit exceptions via ENV (#14033)
Allow admins to configure exceptions to our Rails rate limiter.

Configuration happens in the environment variables, and work with both
IPs and CIDR blocks.

Example:

```
env:
  DISCOURSE_MAX_REQS_PER_IP_EXCEPTIONS: >-
    14.15.16.32/27
    216.148.1.2
```
2021-08-13 12:00:23 -03:00
Jordan Vidrine
621892ea30
UX: Add margin to share input (#14041) 2021-08-13 09:28:45 -05:00
Blake Erickson
b35695e411
DEV: Fix some openapi spec issues (#14037)
- Remove duplicate paths
- Remove query param listed in the path
2021-08-13 04:22:15 -06:00
Vinoth Kannan
c75500b871
DEV: decrease webhook timeout and move to 'low' priority queue. (#14038)
Previously, webhooks has 60 seconds default timeout of Excon and were added in the 'default' queue.
2021-08-13 10:41:02 +05:30
Martin Brennan
6597a2f7dd
FIX: Paste event not propagating from composer using Uppy (#14040)
When I added the paste event for files in the composer to
send to Uppy, I inadvertently called event.preventDefault()
if the pasted data was text. I removed that now, and I only
return early if the user cannot upload, and if there are no
files on the clipboard nothing happens.
2021-08-13 14:09:59 +10:00
Alan Guo Xiang Tan
0198ffd2b1 DEV: Remove unused code from TopicTrackingState.
`TopicTrackingState` contains only class methods so `attr_accessor` has
no meaning for the class. Probably stale code from a long time ago.
2021-08-13 08:35:37 +08:00
Martin Brennan
b626373b31
FEATURE: First pass of using uppy in the composer (#13935)
Adds uppy upload functionality behind a
enable_experimental_composer_uploader site setting (default false,
and hidden).

When enabled this site setting will make the composer-editor-uppy
component be used within composer.hbs, which in turn points to
a ComposerUploadUppy mixin which overrides the relevant
functions from ComposerUpload. This uppy uploader has parity
with all the features of jQuery file uploader in the original
composer-editor, including:

progress tracking
error handling
number of files validation
pasting files
dragging and dropping files
updating upload placeholders
upload markdown resolvers
processing actions (the only one we have so far is the media optimization
worker by falco, this works)
cancelling uploads
For now all uploads still go via the /uploads.json endpoint, direct
S3 support will be added later.

Also included in this PR are some changes to the media optimization
service, to support uppy's different file data structures, and also
to make the promise tracking and resolving more robust. Currently
it uses the file name to track promises, we can switch to something
more unique later if needed.

Does not include custom upload handlers, that will come
in a later PR, it is a tricky problem to handle.

Also, this new functionality will not be used in encrypted PMs because
encrypted PM uploads rely on custom upload handlers.
2021-08-13 09:14:34 +10:00
dependabot[bot]
b5485e2b05
Build(deps-dev): Bump mock_redis from 0.28.0 to 0.29.0 (#14034)
Bumps [mock_redis](https://github.com/sds/mock_redis) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/sds/mock_redis/releases)
- [Changelog](https://github.com/sds/mock_redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sds/mock_redis/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: mock_redis
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 00:52:28 +02:00
dependabot[bot]
59282ca235
Build(deps): Bump rubocop from 1.18.4 to 1.19.0 (#14036)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.4 to 1.19.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.4...v1.19.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 00:51:55 +02:00
Andrei Prigorshnev
bbc565c929
FEATURE: Show the incomming topics banner on the Unseen view (#14032) 2021-08-12 23:59:23 +04:00
Jordan Vidrine
45c9bbc112
UX: Add data-topic-id to featured topic items (#14031) 2021-08-12 14:32:33 -05:00
Jordan Vidrine
4602e14cac
FIX: Button alignment on messages (#14029)
* FIX: Button alignment on messages
2021-08-12 14:00:32 -05:00
Roman Rizzi
54ad0ecc72
DEV: Deprecate unused route instead of removing it. (#14030)
We'll no longer use this route, so we'll return a 301 with the new URL just in case someone is still using it.
2021-08-12 15:54:14 -03:00
Blake Erickson
65f6d46045
DEV: Fix several type issues with the api docs (#14016)
`nullable` is no longer a valid type, and types also can't be an empty
string, so just bringing a number of issues with types in compliance
with the openapi spec.
2021-08-12 12:25:17 -06:00
Roman Rizzi
29bb79de37
FIX: Query the items in the queue to calculate a user's flagged post count. (#14028)
When a staff member clicks on a user's number of flagged posts, we redirect them to the review queue, so it makes sense to count the number of items there to calculate the count.

We used to look at post action items to calculate this number, which doesn't match the number of items in the queue if old flags exist.
2021-08-12 14:20:46 -03:00
Rafael dos Santos Silva
b2e4c91818
DEV: Allow removing local assets after s3 sync (#14013) 2021-08-12 14:20:05 -03:00
Andrei Prigorshnev
1656b7ed01
DEV: Make db_timestamp_mover work with tables with unique constraints (#14027)
Some tables in the database have constraints on columns with dates. Because of them, the script for moving timestamps can fail from time to time. This PR makes the script work with such tables.

In general, in PostgreSQL it is not always possible to defer constraint checks to the transaction commit (Primary Keys and Unique Constraints can be deferred, but them should be declared as DEFERRABLE to make it possible. Indices created with CREATE UNIQUE INDEX can't be deferred at all).

Since we can't defer constraint checks, I've made it work using a little hack. For example, if we need to move all timestamps by one day, the script will move timestamps by 1000 years and one day, and then return timestamps back by 1000 years. The script use this hack only for columns that have unique constraints.
2021-08-12 19:24:21 +04:00
Chema Balsas
d27d7c8cca FIX: Unescapes hash section with present to account for url-encoded chars
Sections with unreserverd characters will appear url-encoded and need to
be unescaped before using it.

Wikipedia generates 2 different spans in this case in the same page, one
with an id resulting of replacing the % symbols with . and the other with
the decoded version of the string. For example, for /wiki/foo#A%C3%A1A it
will generate:

<span id="A.C3.A1A"></span>
<span id="AáA">AáA</span>

Unescaping the `m_url_hash_name` should work in all cases to target the
proper section span.
2021-08-12 10:43:50 -04:00
Chema Balsas
745b99edbf TEST: Adds test for urls with url-encoded section hash 2021-08-12 10:43:50 -04:00
Chema Balsas
6b8ee4d5ef TEST: Adds test for urls with section hash 2021-08-12 10:43:50 -04:00
Vinoth Kannan
cd9262b7d3
DEV: minor improvements in the vanilla import script. (#14026)
We're parsing the post raw based on the record format now.
2021-08-12 15:07:44 +05:30
Alan Guo Xiang Tan
aed65ec16d SECURITY: User's read state for topic is leaked to unauthorized clients.
A user's read state for a topic such as the last read post number and the notification level is exposed.
2021-08-12 12:16:45 +08:00
Alan Guo Xiang Tan
9a60c83535 FIX: TopicTrackingState.report not including unread for staff posts.
Follow-up to e15c86e8c5
2021-08-12 11:10:49 +08:00
Alan Guo Xiang Tan
2fb17b7b17 DEV: Remove code that is not being used.
Code was added in e15c86e8c5 but it isn't
necessary anymore.

Follow-up to e15c86e8c5
2021-08-12 07:56:38 +08:00
dependabot[bot]
16ff3ea2f1 Build(deps): Bump discourse-fonts from 0.0.8 to 0.0.9
Bumps [discourse-fonts](https://github.com/discourse/discourse-fonts) from 0.0.8 to 0.0.9.
- [Release notes](https://github.com/discourse/discourse-fonts/releases)
- [Commits](https://github.com/discourse/discourse-fonts/compare/v0.0.8...v0.0.9)

---
updated-dependencies:
- dependency-name: discourse-fonts
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 07:55:40 +08:00
dependabot[bot]
67f93c60eb Build(deps): Bump loofah from 2.11.0 to 2.12.0
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.11.0...v2.12.0)

---
updated-dependencies:
- dependency-name: loofah
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 07:55:18 +08:00
Martin Brennan
814aa64a5d
FIX: Notification menu broken on older browsers (#14019)
replaceAll is not available in all versions of Chrome/Firefox/Edge
that we support, so we need to use replace instead
2021-08-12 09:54:15 +10:00
jbrw
20a6bad87e
FIX: Category group moderators can read flagged post meta_topics (#14014)
When a post is flagged with the reason of 'Something Else' a brief message can be added by the user which subsequently creates a `meta_topic` private message. The group `moderators` is automatically added to this topic.

If category group moderation is enabled, and the post belongs to a category with a reviewable group, that group should also be added to the meta_topic.

Note: This extends the `notify_moderators` logic, and will add the reviewable group to the meta_topic, regardless of the settings of that group.
2021-08-11 18:11:22 -04:00
Roman Rizzi
630d485f0f
DEV: Remove unused server-side route. (#14011)
We no longer use this route. When a staff member wants to see a user flagged posts, we redirect them to the review queue.
2021-08-11 17:29:19 -03:00
Blake Erickson
1799944a04
DEV: Specify the latest openapi spec version (#14012)
The latest openapi spec version is v3.1.0

 https://spec.openapis.org/oas/v3.1.0

Specifying the latest version will allow our openapi spec linter to use
this version and allow use to use the new type format that allows for
specifying a type as "null", which we need because sometimes our api
responses include null values instead of a "string", "integer", or
"object" type.

See: https://stackoverflow.com/a/48114322/588458
2021-08-11 12:38:02 -06:00
Blake Erickson
ce015f5b75
DEV: Fix api docs tagging format (#14010)
When specifying multiple tags they should be separate strings, not a
single string.
2021-08-11 11:00:48 -06:00
Kris
f848f6cbb6
UX: Fix mobile PM nav for regular users (#14007) 2021-08-11 12:47:03 -04:00
David Taylor
b3c1cb6df6
DEV: Add caret_position.js to ember-cli build (#14009)
This is used when positioning autocompletes in the composer, and elsewhere
2021-08-11 16:42:04 +01:00
Mark VanLandingham
3119b881aa
DEV: Define --footer-nav-height css var (#14008) 2021-08-11 10:29:16 -05:00
David Taylor
70f8fdbe45
FEATURE: Allow linking an existing account from invite acceptance (#13998)
The invite acceptance page is an alternative signup flow, so it makes sense to include the new 'link' functionality there as well.

Followup to 7dc8f8b794
2021-08-11 10:26:37 +01:00
Arpit Jalan
e9b2415e7d
UX: show flair help text for private member visibility only (#14005) 2021-08-11 16:23:58 +10:00
Alan Guo Xiang Tan
e157925308 DEV: Remove unused attributes when publishing read/new. 2021-08-11 11:12:23 +08:00
Rafael dos Santos Silva
8e45fdfbb1
DEV: Log duration of ember-cli asset build (#13980) 2021-08-10 23:43:08 -03:00