Commit Graph

39225 Commits

Author SHA1 Message Date
Robin Ward df8ae6891c REFACTOR: Remove constants from `text` helper 2020-08-25 09:16:32 -04:00
Robin Ward 4063cab8c2 REFACTOR: Missed `container`s in `DiscourseURL` 2020-08-25 09:16:32 -04:00
Robin Ward 02e8d84e30 REFACTOR: Remove `Discourse` constant from `showModal` 2020-08-25 09:16:32 -04:00
Robin Ward 98e5e1cd53 REFACTOR: Remove container from `DiscourseURL` 2020-08-25 09:16:32 -04:00
Robin Ward dae8b9bcfb FIX: Remove container from utilities 2020-08-25 09:16:32 -04:00
Robin Ward 89d766d089 REFACTOR: Remove container from safari-hacks 2020-08-25 09:16:32 -04:00
Robin Ward c7c3fd4209 REFACTOR: Remove container from pwa-utils 2020-08-25 09:16:32 -04:00
Robin Ward ebc0298ea0 REFACTOR: Remove `Discourse.authenticationComplete` 2020-08-25 09:16:32 -04:00
Robin Ward 20e1233f89 REFACTOR: Remove container from raw template helper 2020-08-25 09:16:32 -04:00
Robin Ward e08545cf99 Add a pull request template to remind people to add tests. 2020-08-25 09:03:38 -04:00
Discourse Translator Bot d495464ead Update translations 2020-08-25 13:02:37 +00:00
Gerhard Schlager dac0e5b3cc
Merge pull request #10519 from gschlager/get-url
Fixes for getURL() in subfolders and basePath in translations
2020-08-25 11:42:50 +02:00
Jarek Radosz e66f95de3a
FIX: DEV: Lock-on improvements (#10448)
* DEV: Don't listen for deprecated events

https://developer.mozilla.org/en-US/docs/Web/API/Element/DOMMouseScroll_event

https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event

* DEV: Listen only on the `body` element

* DEV: clearLock after a while if target is missing

* DEV: Bind the callback

* FIX: Use `requestAnimationFrame`

Prevents content jumps
2020-08-25 11:42:00 +02:00
Gerhard Schlager 6c09fd4289 DEV: Remove unused code and translations 2020-08-25 11:41:19 +02:00
Jarek Radosz d684d5fba4
DEV: Don't lint core files when target == plugins (#10259)
* DEV: Don't lint core files when target == plugins
* Prettier the plugin/*.js files
* Update eslintignore/prettierignore
* Add eslint-plugin-ember and eslint-plugin-node
* Properly lint all js files in all plugins
* LINT: run prettier on test/*.js files
* DEV: Run prettier checks on test/*.js files
* ESLint plugins' assets/javascripts and test/javascripts directories only
2020-08-25 11:40:40 +02:00
Gerhard Schlager 10e6e8d307
Use quotes instead of grave accent 2020-08-25 11:39:11 +02:00
Joe 66aa94c515
UX: Timeline should jump to the bottom of the post in single-post topics (#10503) 2020-08-25 16:22:07 +08:00
siriwatknp 80b92cf469 test: 💍 add test for thai tag 2020-08-25 16:12:26 +08:00
siriwatknp 1a2800ad07 fix: 🐛 category & tag search regex to support thai character 2020-08-25 16:12:26 +08:00
Guo Xiang Tan f08d440ea0
DEV: Disable migration advisory locks in dev and test environment.
There is a bug in Rails that leaks an idle PG session which will prevent
the dropping of the database.
2020-08-25 14:20:58 +08:00
dependabot-preview[bot] 5d7055779a Build(deps): Bump sidekiq from 6.0.7 to 6.1.1
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.0.7 to 6.1.1.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.0.7...v6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 11:19:41 +08:00
Kris a92a6b7b10 UX: Minor layout fixes and improved consistency on theme admin 2020-08-24 22:51:58 -04:00
Mark VanLandingham cef51b3489
DEV: Remove hasBlock from user-info component (#10415) 2020-08-24 21:44:01 -05:00
Guo Xiang Tan 9c997ae117
Revert "DEV: allow plugins to send extra silenced message params"
This reverts commit c3aeb442d7.

Broken specs so helping Jeff to revert first.
2020-08-25 09:57:57 +08:00
Jeff Wong c3aeb442d7 DEV: allow plugins to send extra silenced message params
allows plugins to send extra custom message params so that they can
include things such as silence reason and message_body if desired
2020-08-24 18:34:18 -07:00
Guo Xiang Tan 9354ee35d2
DEV: Ensure test resets to original constant.
Also simplifies the test to reduce amount of test setup done.
2020-08-25 09:24:59 +08:00
Krzysztof Kotlarek 7b6f8517bf
FIX: limit number of users addable to group at once (#10510)
When someone wants to add > 1000 users at once they will hit a timeout.
Therefore, we should introduce limit and inform the user when limit is exceeded.
2020-08-25 08:55:21 +10:00
Neil Lalonde ed30f49315
FIX: duplicate categories and tags allowed in inputs where they shouldn't be allowed
blocklist was renamed to blockedCategories/Tags
2020-08-24 17:37:04 -04:00
Neil Lalonde 52217099ed
FIX: group categories inputs not filled sometimes
If you land on the group > manage > categories page or reload it,
the fields will all be blank when there should be categories.
2020-08-24 17:15:37 -04:00
Rachel Carvalho 812e0d6b5e
FIX: improve Vanilla importing (#10478)
* ensure emails don't have spaces
* import banned users as suspended for 1k yrs
* upgrade users to TL2 if they have comments
* topic: import views, closed and pinned info
* import messages
* encode vanilla usernames for permalinks. Vanilla usernames can contain spaces and special characters.
* parse Vanilla's new rich body format
2020-08-24 16:19:57 -04:00
Gerhard Schlager 1959745c2c FIX: Current title wasn't visible when assigning badge title 2020-08-24 21:39:44 +02:00
dependabot-preview[bot] 52be3c131d
Build(deps): Bump redis-namespace from 1.7.0 to 1.8.0 (#10498)
Bumps [redis-namespace](https://github.com/resque/redis-namespace) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/resque/redis-namespace/releases)
- [Changelog](https://github.com/resque/redis-namespace/blob/master/CHANGELOG.md)
- [Commits](https://github.com/resque/redis-namespace/compare/v1.7.0...v1.8.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-24 12:45:07 -04:00
dependabot-preview[bot] fc0f462cf7
Build(deps): Bump oj from 3.10.9 to 3.10.12 (#10495)
Bumps [oj](https://github.com/ohler55/oj) from 3.10.9 to 3.10.12.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.10.9...v3.10.12)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-24 12:34:58 -04:00
Roman Rizzi dd13304b81
FEATURE: More API scopes (#10493) 2020-08-24 12:15:08 -03:00
Joffrey JAFFEUX b6dd3eca9a
FIX: ensures diversity code is not applied multiple times (#10517) 2020-08-24 16:10:47 +02:00
Joffrey JAFFEUX 265d8bc1d7
FIX: close picker on emoji selection when on mobile device (#10516) 2020-08-24 15:04:44 +02:00
Joffrey JAFFEUX c3364b3a6b
UX: improves picker on automatic dark themes (#10515) 2020-08-24 15:04:11 +02:00
Joffrey JAFFEUX 226be994da
REFACTOR: rewrite the emoji-picker (#10464)
The emoji-picker is a specific piece of code as it has very strong performance requirements which are almost not found anywhere else in the app, as a result it was using various hacks to make it work decently even on old browsers.

Following our drop of Internet Explorer, and various new features in Ember and recent browsers we can now take advantage of this to reduce the amount of code needed, this rewrite most importantly does the following:
- use loading="lazy" preventing the full list of emojis to be loaded on opening
- uses InterserctionObserver to find the active section
- limits the use of native event listentes only for hover/click emojis (for performance reason we track click on the whole emoji area and delegate events), everything else is using ember events
- uses popper to position the emoji picker
- no jquery code
2020-08-24 14:20:51 +02:00
David Taylor 9debfed060
FIX: Add cache-busting parameter to ace-editor javascript
Long-term we should consider adding the file hash to javascript URLs, so that the URL changes whenever the file changes
2020-08-24 12:29:46 +01:00
David Taylor ac80109705
DEV: Improve user card styling extensibility (#10508)
- Add a metadata-row class
- Remove wrapper tags from user-card-after-metadata and user-card-before-badges outlets
- Correct max-height for mobile card
2020-08-24 11:02:40 +01:00
David Taylor 629ee5494d
FEATURE: Allow plugins to register parameter-based API routes (#10505)
Example usage:

```
add_api_parameter_route(
  method: :get,
  route: "users#bookmarks",
  format: :ics
)
```
2020-08-24 10:24:52 +01:00
Joffrey JAFFEUX 23b823dd3a
FIX: removes us_pacific-new from the list of available timezones (#10514) 2020-08-24 11:04:46 +02:00
Martin Brennan e8a842ab8c
FIX: Stop category logo + background being marked secure (#10513)
Meta topic: https://meta.discourse.org/t/secure-media-uploads-breaks-category-logos/161693

Category backgrounds and logos are public uploads and should not be marked as secure.

I also discovered that a lot of the UploadSecurity specs for public types were returning false positives; this has been fixed.
2020-08-24 17:12:28 +10:00
Guo Xiang Tan 05174df5c0
FIX: Restrict `personal_messages:` advanced search filter to admin.
The filter noops if an incorrect username is passed. This filter is not
exposed as part of the UI but is only used when an admin transitions
from a search within a user's personal messages to the full page search.

Follow-up to 4b30799054.
2020-08-24 13:53:48 +08:00
Guo Xiang Tan c6ceda8c4e
PERF: Avoid extra subquery when searching within PMs for normal user.
Note the following query being generated where the filter for a user's
private messages is executed twice.

```sql
SELECT "posts"."id", "posts"."user_id", "posts"."topic_id", "posts"."post_number", "posts"."raw", "posts"."cooked", "posts"."created_at", "posts"."updated_at", "posts"."reply_to_post_number", "posts"."reply_count", "posts"."quote_count", "posts"."deleted_at", "posts"."off_topic_count", "posts"."like_count", "posts"."incoming_link_count", "posts"."bookmark_count", "posts"."score", "posts"."reads", "posts"."post_type", "posts"."sort_order", "posts"."last_editor_id", "posts"."hidden", "posts"."hidden_reason_id", "posts"."notify_moderators_count", "posts"."spam_count", "posts"."illegal_count", "posts"."inappropriate_count", "posts"."last_version_at", "posts"."user_deleted", "posts"."reply_to_user_id", "posts"."percent_rank", "posts"."notify_user_count", "posts"."like_score", "posts"."deleted_by_id", "posts"."edit_reason", "posts"."word_count", "posts"."version", "posts"."cook_method", "posts"."wiki", "posts"."baked_at", "posts"."baked_version", "posts"."hidden_at", "posts"."self_edits", "posts"."reply_quoted", "posts"."via_email", "posts"."raw_email", "posts"."public_version", "posts"."action_code", "posts"."locked_by_id", "posts"."image_upload_id", (TS_RANK_CD(
  post_search_data.search_data,
  TO_TSQUERY('english', '''test'':*ABCD'),
  0|32
)
 * (
  CASE categories.search_priority
  WHEN 2
  THEN 0.6
  WHEN 3
  THEN 0.8
  WHEN 4
  THEN 1.2
  WHEN 5
  THEN 1.4
  ELSE
    CASE WHEN topics.closed
    THEN 0.9
    ELSE 1
    END
  END
)
) rank, topics.bumped_at topic_bumped_at FROM "posts" INNER JOIN "post_search_data" ON "post_search_data"."post_id" = "posts"."id" INNER JOIN "topics" ON "topics"."id" = "posts"."topic_id" AND ("topics"."deleted_at" IS NULL) LEFT JOIN categories ON categories.id = topics.category_id WHERE ("posts"."deleted_at" IS NULL) AND "posts"."post_type" IN (1, 2, 3) AND (topics.visible) AND (topics.archetype = 'private_message' AND post_search_data.private_message) AND (posts.topic_id IN (SELECT topic_id
FROM topic_allowed_users
WHERE user_id = 99999
UNION ALL
SELECT tg.topic_id
FROM topic_allowed_groups tg
JOIN group_users gu ON gu.user_id = 99999 AND gu.group_id = tg.group_id
)) AND (post_search_data.search_data @@ TO_TSQUERY('english', '''test'':*ABCD')) AND (posts.topic_id IN (SELECT topic_id
FROM topic_allowed_users
WHERE user_id = 99999
UNION ALL
SELECT tg.topic_id
FROM topic_allowed_groups tg
JOIN group_users gu ON gu.user_id = 99999 AND gu.group_id = tg.group_id
)) AND ((categories.id IS NULL) OR (NOT categories.read_restricted) OR (categories.id IN (999999))) ORDER BY rank DESC, topic_bumped_at DESC
```
2020-08-24 13:49:43 +08:00
Guo Xiang Tan 2f043dc89a
Fix lint. 2020-08-24 12:38:46 +08:00
Guo Xiang Tan 4b30799054
FIX: Correct `personal_messages:<username>` advanced search filter.
Renamed from `private_messages` to `personal_messages` without
deprecation because the `private_messages` advanced search filter never
worked in the first place when it was implemented.
2020-08-24 11:54:30 +08:00
Martin Brennan 9022e4516f
FIX: Remove unnecessary audio/video parent element load (#10511)
Meta report: https://meta.discourse.org/t/sending-many-requests-for-video-audio-upload-while-editing-post/161487

When typing in the composer we are sending a lot of unnecessary load() requests for the video/audio elements. This line was added months ago before we improved previewing/video thumbnails, which have improved things, so it is no longer required. After removing this line everything still works and no more additional requests are sent.
2020-08-24 13:18:38 +10:00
Vinoth Kannan 62f4fc728d UX: lowercase tag name before checking it with topic title.
Tag names can contain uppercase letters if `force_lowercase_tags` site setting disabled.
2020-08-23 21:09:51 +05:30
Vinoth Kannan 66976baefa DEV: skip using `br` tag in header widget rendering.
562180dd9a
2020-08-22 13:38:37 +05:30