Commit Graph

18480 Commits

Author SHA1 Message Date
Jarek Radosz 39f45c701c
DEV: Mark inline styles as safe (#17093)
Fixes many Ember deprecation warnings like:

```
WARNING: Binding style attributes may introduce cross-site scripting vulnerabilities; please ensure that values being bound are properly escaped. For more information, including how to disable this warning, see https://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes. Style affected: "border-color: #33B0B0; --category-color: #33B0B0;"
```
2022-06-15 01:31:21 +02:00
Jarek Radosz 348b6e848f
FIX: NavItem and Composer prop overriding was broken (#17092) 2022-06-14 21:16:33 +02:00
Alan Guo Xiang Tan 4a240f6c90
DEV: First pass at messages section experimental sidebar (#17084) 2022-06-14 15:56:20 +08:00
Alan Guo Xiang Tan e7e23e8d9c
FIX: Remove tags from experimental sidebar on notification level changed (#17083)
As part of this commit, a bug where updating a tag's notification level on the server side does not update the state of the user's tag notification levels on the client side is fixed too.
2022-06-14 15:39:56 +08:00
Jarek Radosz 77632d2d36
DEV: Explicitly allow NavItem customization (#17061)
Allow overriding NavItem's title and displayName. Fixes multiple instances of `computed-property.override` warnings in plugins.
2022-06-13 12:46:04 +02:00
Jarek Radosz 8d0c2cd4f8
DEV: Allow disabling composer submit (#17062)
…without overriding the computed property. Will fix warnings in discourse-perspective-api plugin.
2022-06-13 12:45:47 +02:00
Alan Guo Xiang Tan e9a77e7f19
FEATURE: Add new/unread counts to tags section links exp sidebar (#17057) 2022-06-13 14:54:01 +08:00
Alan Guo Xiang Tan 95fa4c5d52
DEV: Ensure topic-tracking-state state change callbacks are cleaned up (#17069) 2022-06-13 14:53:02 +08:00
Alan Guo Xiang Tan 94c3bbc2d1
DEV: Centralize user updates to a single MessageBus channel. (#17058)
Introduces an interface to publish user updates on the server side and
helps to reduce the growing number of subscriptions on the client side.
2022-06-13 14:27:43 +08:00
Jarek Radosz e245839c3c
DEV: Remove old deprecations (#14906) 2022-06-12 21:28:20 +02:00
Jeff Wong d7d9c10c1d FIX: display translated fallback as the group name for custom emoji groups 2022-06-10 11:10:05 -10:00
Jeff Wong 9a656e18e9 DEV: add translation fallback option for i18n
Allow for a default translation string to be returned when a translation cannot
be found.

Useful in contexts where there is a known fallback, such as custom emoji group
strings.
2022-06-10 11:10:05 -10:00
Joffrey JAFFEUX 532935043c
FIX: allows image to be displayed at the right size 2022-06-10 16:28:58 +02:00
Alan Guo Xiang Tan ced9a5ee6d
FEATURE: First pass tags section for experimental sidebar. (#17048)
Counts for the section links will be added in a follow up commit.
2022-06-10 09:49:36 +08:00
David Taylor 75d9c16156
DEV: Remove jquery from textarea-manipulation, improve undo handling (#17050)
This commit removes many uses of `this._$textarea`, and also switches us to use `document.execCommand("insertText")` for the majority of manipulations. This means that the browser undo history will be preserved when doing things like pasting rich html, using bold/italic shortcuts, etc.

These manipulations are already extensively tested. This commit extends a few of the tests to verify the undo behavior.

There are still a few cases (e.g. replacing upload placeholders with true URLs) where we don't necessarily want to bring the composer into focus. In those cases, the old history-breaking behavior remains for now.
2022-06-10 10:42:50 +10:00
David Taylor c054a47d9a
DEV: Add escapeRegExp util (#17051)
This was re-implemented in a number of places - it makes more sense as a utility function.
2022-06-10 10:37:54 +10:00
Isaac Janzen 3ebfde5ea2
DEV: Remove jquery from create-account modal (#16983) 2022-06-09 14:59:33 -05:00
Isaac Janzen 9cd165d6b4
DEV: Add deprecation notice to discourse-common/utils/decorators (#17052) 2022-06-09 13:07:58 -05:00
Penar Musaraj 3f569f1185
A11Y: Add keyboard support for do-not-disturb modal (#17043) 2022-06-09 11:05:01 -04:00
Alan Guo Xiang Tan 946f8a65fd
FEATURE: Display new/unread count for tracked categories in exp sidebar (#17046) 2022-06-09 13:43:17 +08:00
Alan Guo Xiang Tan cd8c97debc
FEATURE: Add section links to categories section to exp sidebar (#17035)
This commit adds a section link to the categories section for each
category that is tracked by the user in the experimental sidebar.
2022-06-09 11:14:01 +08:00
Alan Guo Xiang Tan 03f674070a
DEV: Remove flaky acceptance test (#17045)
The test was un-skipped in 6f25f17360 but
has since been flaky again. Removing the test completely as it has
resulted in more pain for us than the value the test provides.
2022-06-09 09:56:05 +08:00
tshenry 7fc11327b7
COPY: Use main instead of master for theme installation modal (#17044)
GitHub now uses main as the default branch so it makes sense to update the placeholder in the theme installation modal to use main instead of master.
2022-06-08 11:32:54 -07:00
Penar Musaraj fd2dbdccdc
A11Y: Keyboard access for `/u` table headings (#17041) 2022-06-08 13:54:31 -04:00
Isaac Janzen de1153286d
DEV: Remove reply_as_new_topic from PM composer actions (#17023) 2022-06-07 11:06:42 -05:00
Penar Musaraj 86ab82f057
UX: Remove limit for emoji search in composer (#17014) 2022-06-07 12:00:52 -04:00
Penar Musaraj 4be67ef9a7
UX: Larger images in mobile emoji picker (#17013) 2022-06-07 12:00:09 -04:00
David Taylor 5238f6788c
FEATURE: Allow hotlinked media to be blocked (#16940)
This commit introduces a new site setting: `block_hotlinked_media`. When enabled, all attempts to hotlink media (images, videos, and audio) will fail, and be replaced with a linked placeholder. Exceptions to the rule can be added via `block_hotlinked_media_exceptions`.

`download_remote_image_to_local` can be used alongside this feature. In that case, hotlinked images will be blocked immediately when the post is created, but will then be replaced with the downloaded version a few seconds later.

This implementation is purely server-side, and does not impact the composer preview.

Technically, there are two stages to this feature:

1. `PrettyText.sanitize_hotlinked_media` is called during `PrettyText.cook`, and whenever new images are introduced by Onebox. It will iterate over all src/srcset attributes in the post HTML and check if they're allowed. If not, the attributes will be removed and replaced with a `data-blocked-hotlinked-src(set)` attribute

2. In the `CookedPostProcessor`, we iterate over all `data-blocked-hotlinked-src(set)` attributes and check whether we have a downloaded version of the media. If yes, we update the src to use the downloaded version. If not, the entire media element is replaced with a placeholder. The placeholder is labelled 'external media', and is a link to the offsite media.
2022-06-07 15:23:04 +01:00
Joe 98671445a7
UX: hide select-kits when the parent element is outside the viewport
If the select-kit header is not in the viewport (scrolled out of view), popper adds a data-popper-reference-hidden attribute.

This PR adds the recommended styles to "hide" the select-kit body when that happens. See

https://popper.js.org/docs/v2/modifiers/hide/
2022-06-07 16:57:10 +08:00
Alan Guo Xiang Tan 7da074d591
DEV: Implement "My Posts" section link for experimental sidebar (#17008) 2022-06-07 10:52:54 +08:00
Isaac Janzen 49415de3fa
DEV: Remove reply_as_private_message from composer (#16979)
* Remove 'New Message' option from composer dropdown
* Update Acceptance Tests
2022-06-06 15:10:34 -05:00
Jarek Radosz 79f5a7750c
DEV: Remove unused wizard code (#17016)
`theme-preview` component and `colorsId`/`fontId` usage.
2022-06-06 21:01:47 +02:00
Jarek Radosz 54e42b124a
FIX: Restore automatic style preview in wizard (#17015)
Updating the homepage/style preview regressed in #16994.
2022-06-06 21:01:34 +02:00
Joe 5109ea0cf1
UX: don't tether popper to the viewport if reference is out of the viewport (#17012)
followup to 

https://github.com/discourse/discourse/pull/16504

Internal

`/t/64811`

public

`/t/228953`
2022-06-06 22:20:29 +08:00
Penar Musaraj 370df7ccb4
DEV: Dejquerify marking FAQ as read (#17001) 2022-06-06 08:27:10 -04:00
Penar Musaraj 210d9c2b8f
DEV: De-jQuerify is-element-in-viewport (#17000) 2022-06-06 08:26:49 -04:00
Joffrey JAFFEUX 42683d4874
FIX: ensures composer is not pre-filled with none/all tags (#16998) 2022-06-05 16:58:38 +02:00
Jarek Radosz 8a58ce6578
DEV: Use `@action` decorator in wizard (#16996) 2022-06-04 19:19:49 +02:00
Jarek Radosz f4b9d4e285
FIX: Don't throw errors on wizard dropdowns (#16994) 2022-06-04 18:04:00 +02:00
Joffrey JAFFEUX 17227e9e53
DEV: under specific conditions (like tests) presenceState can be null (#16990) 2022-06-03 20:59:30 +02:00
Isaac Janzen f8d2da2fa0
DEV: Remove jquery from invite-panel (#16989) 2022-06-03 11:30:44 -05:00
Alan Guo Xiang Tan 3b3f60218e
DEV: Display new/unread count for tracked link in sidebar (#16957) 2022-06-03 15:48:35 +08:00
Martin Brennan f94682e2c4
FIX: Do not use SVGs for twitter:image metadata (#16973)
Twitter does not allow SVGs to be used for twitter:image
metadata (see https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup)
so we should fall back to the site logo if the image option
provided to `crawlable_meta_data` or SiteSetting.site_twitter_summary_large_image_url
is an SVG, and do not add the meta tag for twitter:image at all
if the site logo is an SVG.
2022-06-03 09:02:57 +10:00
Isaac Janzen f5e4df1b0e
DEV: Remove jquery from themes list (#16980) 2022-06-02 16:01:24 -05:00
Isaac Janzen 91f00ecf5a
DEV: Remove jquery from group list (#16981) 2022-06-02 16:01:07 -05:00
Vinoth Kannan 951b3016a4
FIX: keep composer draft when go back and forth between PM and New Topic. (#16978)
Previously, draft get destroyed accidentally when we switch to PM with the below steps
1. Click “New Topic”
2. Type in the body
3. Switch to “New Message”
4. Click “cancel”
2022-06-02 23:36:34 +05:30
Kris 8e75f8c371
DEV: quick-access-panel setting for viewAllLabel (#16977) 2022-06-02 10:13:41 -04:00
Andrei Prigorshnev 0bbbd8371e
DEV: emoji picker - make it possible to choose picker's placement and add a dedicated class for an anchor (#16969) 2022-06-01 22:24:23 +04:00
Kris e579e9e61c
DEV: add class name to nav-bar nav items (#16968) 2022-06-01 14:18:47 -04:00
Vinoth Kannan cd0f912159
FIX: Make f query param sticky when navigating between nav items (#16714)
Also, hides categories navigation link when f query param is present.
2022-06-01 16:13:15 +08:00