Commit Graph

27230 Commits

Author SHA1 Message Date
Kris
4df683f88d
UX: Remove experimental sidebar notification text (#17290) 2022-06-30 14:15:39 -04:00
Rafael dos Santos Silva
f130ec35d9
FEATURE: Use full post width for Vimeo embeds (#17289) 2022-06-30 13:08:24 -03:00
Joe
49905a4e6c
DEV: Use performance timings to as a baseline for the splash take 2 (#17284)
We previously relied on CSS animation-delay for the splash. This means that we can get inconsistent results based on device/network conditions.

This PR moves us to a more consistent timing based on {request time + 2 seconds}

Internal topic: /t/65378/65
2022-06-30 21:22:00 +08:00
Jarek Radosz
7343cb9f73
DEV: Convert {{cook-text}} to angle-brackets (#17287) 2022-06-30 14:03:27 +02:00
Jarek Radosz
16ea7ab248
DEV: Run angle-brackets codemod (#17286)
Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
2022-06-30 12:30:50 +02:00
Joe
c86c709998
UX: Reduces splash animation delay (#17282)
This PR cuts down the delay before the splash screen is visible.
2022-06-30 17:19:39 +08:00
Alan Guo Xiang Tan
3a6e87ca4f
FEATURE: Store sidebar section display state in local storage (#17281)
Tests have been intentionally left out as it is hard to test interaction that relies on local storage.
It also isn't the end of the world if the feature regresses.
2022-06-30 15:56:46 +08:00
Alan Guo Xiang Tan
3266350e80
FEATURE: Decouple category/tag presence in sidebar from notifi level (#17273) 2022-06-30 14:54:20 +08:00
Krzysztof Kotlarek
09932738e5
FEATURE: whispers available for groups (#17170)
Before, whispers were only available for staff members.

Config has been changed to allow to configure privileged groups with access to whispers. Post migration was added to move from the old setting into the new one.

I considered having a boolean column `whisperer` on user model similar to `admin/moderator` for performance reason. Finally, I decided to keep looking for groups as queries are only done for current user and didn't notice any N+1 queries.
2022-06-30 10:18:12 +10:00
Kris
f44eb13236
FIX: add clearfix back for admin contents (#17278) 2022-06-29 10:17:01 -04:00
Joffrey JAFFEUX
657256a099
Revert "DEV: Use performance.timing as a baseline for the splash (#17275)" (#17276)
This reverts commit 6146da5eb7.
2022-06-29 18:34:37 +08:00
Joe
6146da5eb7
DEV: Use performance.timing as a baseline for the splash (#17275)
* update styles

* remove unused code

* use request time as a baseline
2022-06-29 20:01:46 +10:00
Sam
6ecfdc8f55
FIX: keep unique post checks separate for PMs vs topics (#17272)
This allows for people to use PMs for drafting and then post them on topics.

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2022-06-29 15:35:07 +10:00
Alan Guo Xiang Tan
644e05cd4d
DEV: Rename variable in TagSectionLink JavaScript class (#17274)
Tag is vague and is mostly used in our code base to represent a Tag
ember object.
2022-06-29 13:18:30 +08:00
Kris
f0005401b7
UX: core adjustments and styles for the experimental sidebar (#17271) 2022-06-29 10:49:01 +08:00
Gerhard Schlager
2d6ef232a7
FIX: Markdown handling failed on empty attribute value (#17199)
Seems to only be a problem when a markdown.it rule inserts links without a attribute value. There's no test, because it's not reproducible with the markdown rules in core.
2022-06-28 21:27:15 +02:00
Jarek Radosz
809f3d37cd
DEV: Update qunit-dom (#17265) 2022-06-28 21:22:17 +02:00
Jarek Radosz
302fab07a3
DEV: Update jsdom (#17264) 2022-06-28 21:22:06 +02:00
Jarek Radosz
bfeee1b803
DEV: Update sinon (#17266) 2022-06-28 21:21:51 +02:00
Jarek Radosz
16f22e3c36
DEV: Add --forward-host option to bin/ember-cli (#17244)
This allows to e.g. test multisite setup in a local dev environment. Also fixes some minor proxy issues.
2022-06-28 21:20:14 +02:00
Jarek Radosz
39a025c7af
DEV: Allow newer versions of node (#17261)
It should now properly work with 18.x, so we should start moving into direction of it being the default.
2022-06-28 20:52:31 +02:00
Alan Guo Xiang Tan
836b5300fc
DEV: Move sidebar utility class to body tag (#17259) 2022-06-28 11:32:06 -04:00
Jarek Radosz
4821d44c3c
DEV: Update webpack (#17262) 2022-06-28 14:39:09 +02:00
Chapoi
a832c94527
UX: update color on arrow tippy box (#17263) 2022-06-28 13:25:40 +02:00
Sérgio Saquetim
5840fb5c62
UX: Update topics stats automatically (#17135)
Updates automatically data on the stats section of the topic.

It will update automatically the following information: likes, replies and last reply (timestamp and user)
2022-06-27 18:21:05 -03:00
Rafael dos Santos Silva
f56c44d1c7
FEATURE: Validate tags in WatchedWords (#17254)
* FEATURE: Validate tags in WatchedWords

We didn't validate watched words automatic tagging, so it was possible
for an admin to created watched words with an empty tag list which would
result in an exception when users tried to create a new topic that
matched the misconfigured watched word.

Bug report: https://meta.discourse.org/t/lib-topic-creator-fails-when-the-word-math-appears-in-the-topic-title-or-text/231018?u=falco
2022-06-27 16:16:33 -03:00
Jarek Radosz
94e59ad9b6
DEV: Update html-entities (#17250) 2022-06-27 18:40:58 +02:00
Jarek Radosz
f8691d12e1
DEV: Update ember-cli-app-version (#17253) 2022-06-27 18:13:56 +02:00
Jarek Radosz
f505221a9c
DEV: Update ember-cli-terser (#17252) 2022-06-27 18:13:46 +02:00
Jarek Radosz
1344e7d62c
DEV: Update js-yaml (#17249) 2022-06-27 18:13:29 +02:00
Jarek Radosz
6a2ea012c7
DEV: Update @glimmer/tracking (#17248) 2022-06-27 18:13:04 +02:00
jbrw
9874fe3fb3
FIX: Improve mixcloud oneboxing (#17237)
- Sets `https://www.mixcloud.com` as a `requires_iframe_origins` to allow the iframe content to be displayed
- Attempts to render something approximating the Mixcloud content in the preview pane of the Composer, rather than just displaying a large version of the artwork associated with the link
2022-06-27 08:32:24 +10:00
Joe
526115f11a
FIX: Defer removing the splash screen until the window load event fires take 3 (#17238)
We currently remove the splash screen once Discourse starts booting.

This can be an issue on very slow devices, which can take up to 6 seconds. This PR ensures that we don't remove the splash until the browser has finished parsing all of the site's assets. It won't impact fast devices.

Internal topic /t/65378/60
2022-06-25 12:59:16 +08:00
Kris
305c4750df
UX: allow more mobile topic elements to be tapped (#17234) 2022-06-24 15:55:52 -04:00
Jarek Radosz
c672144c14
DEV: Fix flaky tests caused by timezone updates (#17232)
Hopefully fixes flakes like:

```
not ok 1123 Chrome 102.0 - [undefined ms] - Global error: Uncaught Error: Unhandled request in test environment: /forum/u/eviltrout.json (PUT) at http://localhost:7357/assets/vendor.js, line 38378
 While executing test: Unit | Utility | click-track: routes to absolute internal urls
    ---
        browser log: |
            {"type":"error","text":"Unhandled request in test environment: /forum/u/eviltrout.json (PUT)"}
            {"type":"error","text":"Uncaught Error: Unhandled request in test environment: /forum/u/eviltrout.json (PUT) at http://localhost:7357/assets/vendor.js, line 38378\n","testContext":{"id":1123,"name":"Unit | Utility | click-track: routes to absolute internal urls","items":[],"state":"executing"}}
    ...
```
2022-06-24 19:19:11 +02:00
Jarek Radosz
9669794f85
DEV: Remove more legacy ember code (#17218)
Also fixes flaky d-editor tests
2022-06-24 18:56:08 +02:00
Joe
f73796b258
FIX: Skip the window load event for now (#17231) 2022-06-24 19:23:33 +08:00
Joe
529c5e343d
FIX: Defer removing the splash screen until the window load event fires take 2 (#17230)
There's an obscure bug where really slow devices end up removing the splash screen before they're finished parsing all of the Discourse assets.

This PR won't impact fast devices but should hopefully prevent the premature removal of the splash on super slow devices.
2022-06-24 17:39:26 +08:00
Joe
e993a23a54
FIX: Remove splash screen in no-js view take 2 (#17229)
We use javascript to remove the splash screen when the site boots up. If the user has js disabled, they get stuck on the splash screen.

If the user has js disabled. We don't show the splash screen at all.
2022-06-24 17:38:42 +08:00
Jarek Radosz
bd85c15acb
DEV: Update broccoli-babel-transpiler (#17221)
Fixes concurrent addon build lockups.
2022-06-24 10:48:05 +02:00
Joe
07cb8e5300
FIX: Reverts #17225 & #17223 (#17228)
* Revert "FIX: Defer removing the splash screen until the window load event fires (#17225)"

This reverts commit 6a61e855b3.

* Revert "FIX: Remove splash screen in no-js view (#17223)"

This reverts commit 5257cae1b8.
2022-06-24 15:59:27 +10:00
Alan Guo Xiang Tan
7d41e980c9
FIX: Uninitialized class variable error in sidekiq (#17227)
Follow-up to 4199ada1ce
2022-06-24 14:17:39 +10:00
Martin Brennan
3f5e19c62a
FIX: Typo in log_thread (#17226)
Follow up to 4199ada1ce
2022-06-24 12:12:30 +08:00
Joe
6a61e855b3
FIX: Defer removing the splash screen until the window load event fires (#17225)
There's an obscure bug where really slow devices end up removing the splash screen before they're finished parsing all of the Discourse assets.

This PR won't impact fast devices but should hopefully prevent the premature removal of the splash on super slow devices.
2022-06-24 11:27:41 +08:00
Alan Guo Xiang Tan
7b2ad1b931
UX: Truncate long category names in sidebar (#17203) 2022-06-24 10:28:35 +08:00
Alan Guo Xiang Tan
4199ada1ce
DEV: Ensure Sidekiq logging thread is always running (#17211) 2022-06-24 10:28:18 +08:00
Jarek Radosz
d1d6868325
DEV: Update xss.js (#17216)
* DEV: Update xss.js

* Fix our hack
2022-06-24 10:28:05 +08:00
Joe
5257cae1b8
FIX: Remove splash screen in no-js view (#17223)
We use javascript to remove the splash screen when the site boots up. If the user has js disabled, they get stuck on the splash screen.

If the user has js disabled. We don't show the splash screen at all.
2022-06-24 09:25:10 +08:00
Jarek Radosz
f27dddd405
DEV: Make addons buildable on their own (#17205) 2022-06-23 22:19:54 +02:00
Jarek Radosz
20e34b5da6
DEV: Stabilize watched words order (#17215)
Fixes a flaky spec:

```
  1) WordWatcher.word_matcher_regexp format of the result regexp is correct when watched_words_regular_expressions = true
     Failure/Error: expect(regexp.inspect).to eq("/(#{word1})|(#{word2})/i")

       expected: "/(word35)|(word36)/i"
            got: "/(word36)|(word35)/i"

       (compared using ==)
     # ./spec/services/word_watcher_spec.rb:19:in `block (4 levels) in <main>'
```
2022-06-23 15:38:12 +02:00
Jarek Radosz
16550537d0
DEV: Drop ember-maybe-import-regenerator (#17195)
I believe it's no longer needed on the browsers we support
2022-06-23 15:20:10 +02:00
Jarek Radosz
3cb67fcb6c
DEV: Update ember-cli-htmlbars (#17194) 2022-06-23 14:36:50 +02:00
Jarek Radosz
56d3bd5bdd
DEV: Update @glimmer/component (#17197) 2022-06-23 13:35:42 +02:00
Joe
293323af38
UX: Splash screen v1 improvements (#17214)
This commit does six things

* changes the animation for the splash screen. To a more subtle animation.
* defers displaying the splash by 1.5 seconds
* defers displaying the splash "loading" text by 2.5 seconds
* defers removing the splash until all Discourse initializers have run
* fixes a display issue in Firefox
* Inlines the SVG as a base64 and inlines the required CSS.

The encoded SVG is hard coded for now, but we will use a helper to generate that based on the file after some testing.
2022-06-23 14:07:04 +08:00
Martin Brennan
a176b57be0
FIX: Use bookmarkable pattern for bookmark cleanup (#17202)
We have a `cleanup!` class method on bookmarks that deletes
bookmarks X days after their related record (post/topic) are
deleted. This commit changes this method to use the
registered_bookmarkables for this instead, and each bookmarkable
type can delete related bookmarks in their own way.
2022-06-23 14:09:39 +10:00
Sérgio Saquetim
b546e09dd9
FIX: In [DELETE] /admin/user/:id.json, parse boolean block_* parameter correctly (#17201)
When calling the API to delete a user:

```
curl -X DELETE "https://discourse.example.com/admin/users/159.json" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: ***" \
-H "Api-Username: ***" \
-F "delete_posts=true" \
-F "block_email=false" \
-F "block_urls=false" \
-F "block_ip=false"
```

Setting the parameters `block_email`, `block_urls` and `block_ip`explicitly to `false` did not work because the values weren't being parsed to boolean.
2022-06-22 18:20:41 -03:00
Kris
6f32d605ba
UX: improve group page grid sizes (#17208) 2022-06-22 17:14:22 -04:00
Rafael dos Santos Silva
a0f3ec7b13
FIX: darkMode availiability detection was broken (#17207)
This regressed on 2f66eb5 where CSS was moved from the HTML document
head to the body.

Bug report at https://meta.discourse.org/t/-/230656?u=falco
2022-06-22 14:32:13 -03:00
Joffrey JAFFEUX
684bc821be
DEV: allows category-badge helper to display a link (#17206) 2022-06-22 18:36:49 +02:00
Andrei Prigorshnev
278752fa87
Change the background color of the user status bubble (#17204) 2022-06-22 19:40:21 +04:00
Andrei Prigorshnev
033f72c65f
FEATURE: user status emoji (#17025) 2022-06-22 18:15:33 +04:00
Alan Guo Xiang Tan
0b8e6adabe
FEATURE: New/unread messages count in experimental sidebar (#17117)
* FEATURE: Expand messages filter links when viewing private messages.

* FEATURE: New/unread messages count in experimental sidebar
2022-06-22 11:01:37 +08:00
Jarek Radosz
b09cce6897
DEV: Update ember-source-channel-url (#17196) 2022-06-22 00:12:43 +02:00
Jarek Radosz
06feeed187
DEV: Update @ember/optional-features (#17193) 2022-06-22 00:12:33 +02:00
Jarek Radosz
216663effa
DEV: Update ember-cli-dependency-checker (#17192) 2022-06-22 00:12:24 +02:00
Jarek Radosz
b50056a9f3
DEV: Update ember-cli-inject-live-reload (#17191) 2022-06-22 00:12:15 +02:00
Jarek Radosz
1e522b0ee7
DEV: Update ember-buffered-proxy (#17190) 2022-06-22 00:12:04 +02:00
Jarek Radosz
0421a14319
DEV: Actually debounce functions in tests (#16213) 2022-06-21 23:34:04 +02:00
Joe
e82a2ce9ae
UX: Introduces a splash screen behind a hidden site setting (#17094)
This PR introduces a new hidden site setting that allows admins to display a splash screen while site assets load.

The splash screen can be enabled via the `splash_screen` hidden site setting.

This is what the splash screen currently looks like

5ceb72f085.mp4

Once site assets load, the splash screen is automatically removed.

To control the loading text that shows in the splash screen, you can change the preloader_text translation string in admin > customize > text
2022-06-22 04:35:46 +08:00
Jarek Radosz
624c684d51
DEV: Transpile all plugin js by default (#17175)
Goodbye `# transpile_js: true`? 🙂
2022-06-21 22:07:10 +02:00
Jarek Radosz
9cb9d1105e
DEV: Update ember-auto-import (#17176) 2022-06-21 22:06:41 +02:00
Isaac Janzen
7fd38f4933
DEV: Remove isLegacyEmber (#17181) 2022-06-21 15:01:03 -05:00
Isaac Janzen
41028a84ef
DEV: add deprecation notice to isLegacyEmber (#17186) 2022-06-21 14:08:12 -05:00
Roman Rizzi
e0ba35350e
FEATURE: Custom unsubscribe options (#17090)
With this change, plugins can create custom unsubscribe keys, extend the unsubscribe view with custom preferences, and decide how they are updated.
2022-06-21 15:49:47 -03:00
Vinoth Kannan
deee3c6f02
DEV: drop unused column flair_url from groups table. (#17179)
It's already included in the `ignored_columns` list in the group model. 03ffb0bf27/app/models/group.rb (L9)

Also, removed the `MigrateGroupFlairImages` onceoff job and spec.
2022-06-22 00:15:05 +05:30
Isaac Janzen
b59e3b0b7c
DEV: Remove isLegacyEmber() from tests (#17184) 2022-06-21 13:37:29 -05:00
Arpit Jalan
59f0815c9d
FIX: tag groups were not visible to allowed group members (#17183)
https://meta.discourse.org/t/tags-in-tag-groups-not-visible-to-assigned-user-group/230025/
2022-06-21 23:40:54 +05:30
David Taylor
fdb289164f
FIX: Remove leftover uses of ember_jquery (#17178)
On the password_reset error screen, it was totally unused

On the show_confirm_new_email screen, we can load the `vendor` bundle instead. Eventually we should move all this logic into the Ember app
2022-06-21 14:26:52 +01:00
Jarek Radosz
def39b2d58
DEV: Update @babel/core (#17163) 2022-06-21 12:48:44 +02:00
David Taylor
47a7b4cad0
DEV: Use path instead of absolute URL for theme test links (#17172)
In development, this avoids the surprising switch from ember-cli to rails
2022-06-21 11:32:46 +01:00
Alan Guo Xiang Tan
115859964d SECURITY: Validate email constraints when trying to redeem an invite
In certain situations, a logged in user can redeem an invite with an email that
either doesn't match the invite's email or does not adhere to the email domain
restriction of an invite link. The impact of this flaw is aggrevated
when the invite has been configured to add the user that accepts the
invite into restricted groups.
2022-06-21 11:32:27 +01:00
Joe
03ffb0bf27
FIX: Defer scripts on theme-tests route (#17171)
Small follow-up to #17063. That PR broke the theme tests route locally.

This PR fixes that.
2022-06-21 12:44:31 +08:00
Martin Brennan
54a518b21d
FIX: Quoting local dates bbcode regeneration (#17141)
This commit allows quoting of discourse-local-date elements
and converts the quoted tags back into bbcode so that the
rendered quote will also render the discourse-local-date HTML.
This works on single dates as well as date ranges, and supports
all of the options used by discourse-local-date.

This also necessitated adding addTextDecorateCallback to the
to-markdown core lib (similar to addBlockDecorateCallback and
addTagDecorateCallback) to transform the text nodes between
date ranges to remove the -> in the final quote.

c.f. https://meta.discourse.org/t/quotes-that-contain-date-time/101999
2022-06-21 10:07:21 +10:00
David Taylor
d5743c0326
DEV: Add a discourse-booted performance mark (#17162)
This is useful when analysing performance in developer tools, and can also be used for analytics plugins
2022-06-20 19:39:39 +01:00
Jarek Radosz
011a16cb8a
DEV: Rename translatedtitle to translatedTitle (#17160) 2022-06-20 12:28:05 -06:00
Jarek Radosz
36c2284dea
DEV: Fix typos "formated" -> "formatted" (#17156)
(nothing in all-the* relies on these)
2022-06-20 20:02:05 +02:00
Jarek Radosz
c9d3c45ba9
DEV: Remove obsolete parts of our custom loader (#17157) 2022-06-20 18:40:25 +02:00
Jarek Radosz
2c1fc28d00
DEV: Remove ember-cli flags from the backend (#17147)
…and other auxiliary code

* Restore `QUNIT_EMBER_CLI` flag warning
* Add `ALLOW_EMBER_CLI_PROXY_BYPASS`
2022-06-20 16:33:05 +02:00
David Taylor
1b4692039e DEV: Remove legacy JS manifests and vendored scripts
Now that we've switched to Ember CLI, these things are no longer used.

- These sprockets manifests are superceded by the assets generated by ember cli
- These vendored scripts are now fetched by ember-auto-import at compile time
2022-06-20 15:01:06 +01:00
Jarek Radosz
ba2c7b8f35
DEV: Use the block form of module() (#17151) 2022-06-20 15:42:10 +02:00
Jarek Radosz
321118f384
DEV: Change locationType to history. (#17152)
`auto` value is deprecated, and we never really supported `hash` (which was the type `auto` was falling back into)
2022-06-20 15:41:53 +02:00
Gerhard Schlager
1c6f8f8a36
DEV: Upgrade Markdown.it to v13.0.1 (#17099)
Updates markdown-it to v13.0.1

Noteworthy changes:
* `markdownit()` is now available on `globalThis` instead of `window`.

* The `text_collapse` rule was renamed to `fragments_join` which affected the `bbcode-inline` implementation.

* The `linkify` rule was added to the `inline` chain which affected the handling of the `[url]` BBCode. If available, our implementation reuses `link_open` and `link_close` tokens created by linkify in order to prevent duplicate links.

* The rendered HTML for code changed slightly. There's now a linebreak before the `</code>` tag. The tests were adjusted accordingly.
2022-06-20 15:25:13 +02:00
Jarek Radosz
051167c98a
DEV: Fix this.clearRender deprecation warning (#17150)
```
{"type":"warn","text":"DEPRECATION: Using this.clearRender has been deprecated, consider using `clearRender` imported from `@ember/test-helpers`. [deprecation id: ember-test-helpers.setup-rendering-context.clearRender]"}
```
2022-06-20 15:13:42 +02:00
Joe
93b8811f08
DEV: Moves SVG sprite to <discourse-assets> element (#17148)
Similar to #17145

This commit moves the SVG sprite container to the <discourse-assets> element.

There is 0 visual or functional changes in this PR. It just tidies up the element view in devTools.
2022-06-20 20:58:50 +08:00
Joe
9d86a2b567
DEV: Adds missing defer attribute to wizard js in dev layout (#17146)
Small followup to #17063

The wizard `js` file slipped through the cracks. This only affected dev installs.
2022-06-20 16:59:42 +08:00
Joe
b2bf1db36f
DEV: Move preloaded json into <discourse-assets> element (#17145)
This PR introduces 0 visual or functional changes. The only thing that it changes is that it moves the data-preloaded div (which has the app boot json into the <discourse-assets> element.

See #17078 for a bit more context.

The reason behind this change is that it makes devTools element view a little bit less cluttered.
2022-06-20 16:39:11 +08:00
Sam
9361d9a587
FIX: stop logging blank and invalid CSP reports (#17144)
Certain rogue bots such as Yandex may send across invalid CSP reports
when CSP report collection is enabled.

This ensures that invalid reports will not cause log floods and simply
returns a 422 error.

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2022-06-20 16:57:46 +10:00
Osama Sayegh
5176c689e9
UX: Change wording for 'regular' categories to 'normal' (#17134)
At some point in the past we decided to rename the 'regular' notification state of topics/categories to 'normal'. However, some UI copy was missed when the initial renaming was done so this commit changes the spots that were missed to the new name.
2022-06-20 06:49:33 +03:00
Alan Guo Xiang Tan
986060a850
FEATURE: Expand messages filter links when viewing private messages. (#17106) 2022-06-20 11:43:01 +08:00
Joe
2f66eb59c2
DEV: Slightly defer loading Discourse stylesheets (#17078)
This is related to #17063 and is also a pre-request for the splash screen work.

This PR introduces 0 visual or functional changes. It just relocates the stylesheets in the load order.
`.css` stylesheets block the browser render. We need to move those out of the <head> tag.

However, they still need to be loaded before core/plugin/theme rendered HTML to avoid FOUC.
2022-06-20 10:37:28 +08:00