Commit Graph

18808 Commits

Author SHA1 Message Date
Jarek Radosz
4437579a8c
DEV: Update ember-qunit (#17251) 2022-07-11 12:40:48 +02:00
Jarek Radosz
189bebb2e4
DEV: Modernize component tests (#17368)
* Use QUnit `module` instead of `discourseModule`
* Use QUnit `test` instead of `componentTest`
* Use angle-bracket syntax
* Remove jQuery usage
* Improve assertions (and actually fix some of them)
2022-07-11 12:29:44 +02:00
Jarek Radosz
5b70b67e78
FIX: Just inline the QUnit CSS in theme-test html (#17415)
Side-steps sassc compilation issues.
2022-07-11 12:01:47 +02:00
David Taylor
0ffa93ccaf
FIX: Ensure category-tag filter routes are functioning (#17420)
This regressed as part of the changes in fc36ac6c.

This commit also introduces a test which would have caught the issue.
2022-07-11 10:54:51 +01:00
Jarek Radosz
3b4ed134ba
DEV: Remove old hbs-in-script warning (#17418)
7 years, I think that's long enough for people to notice? 😉
2022-07-11 11:42:40 +02:00
David Taylor
e62730a4c8
FIX: Ensure splash screen <noscript> is loaded for legacy browsers (#17413)
Previously we would only expand the main `<noscript>` element for older browsers. This commit ensures that we expand all noscript elements on the page, including the one used by the splashscreen to hide itself on the no-js view.
2022-07-11 09:07:10 +01:00
Jarek Radosz
a94dee31c4
DEV: Fix emoji-uploader tests (#17395) 2022-07-11 02:06:58 +02:00
Jarek Radosz
25dacc08ce
DEV: Update @ember/test-helpers (#17247) 2022-07-11 01:54:25 +02:00
Jarek Radosz
e5346ed84a
Revert "DEV: Don't vendor old qunit css (#17410)" (#17417)
This reverts commit cf85ccca7d.
2022-07-11 09:16:00 +10:00
Jarek Radosz
cf85ccca7d
DEV: Don't vendor old qunit css (#17410) 2022-07-10 14:57:22 +02:00
Jarek Radosz
0d6929d935
DEV: Avoid triggering 404 errors in tests (#17404) 2022-07-10 11:09:13 +02:00
Jarek Radosz
f19f804525
DEV: Don't try to vibrate in test mode (#17405)
It ends up just triggering an error:

```
[Intervention] Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet: https://www.chromestatus.com/feature/5644273861001216.
```
2022-07-10 10:53:00 +02:00
Jarek Radosz
9365d4e86a
DEV: Fix test leakage/flakes (#17407)
Fixes failures like:

```
Unhandled request in test environment: /forum/topics/timings (POST)
```
2022-07-10 10:52:42 +02:00
Jarek Radosz
d5dc2496d4
DEV: Update qunit (#17411) 2022-07-10 10:52:14 +02:00
Jarek Radosz
0f01cc7df2
DEV: Reduce jQuery usage in acceptance tests (#17406) 2022-07-10 10:52:02 +02:00
Joe
06ae9229e8
UX: Skip length check on reply drafts (#17408)
We don't count quote characters as part of the reply length.

We don't save drafts if the reply length is less than the min_post_length site setting.

If you start a reply that only contains a bunch of quotes with the intent to continue later, you get no draft.

This PR fixes that.

Note that we still don't save drafts if the composer is completely empty or if you're composing a new topic. This only affects replies.

This PR only changes the behavior if the reply composer contains something regardless of whether that something is a quote or not and ignores the min_post_length site setting.
2022-07-10 13:54:40 +08:00
Daniel Waterworth
e91cc340e6
FIX: Add ember redirect for tags/:tag_id -> tag/:tag_id (#17397)
/tags/:tag_id is deprecated, but links may exist in posts.
2022-07-08 14:39:43 -05:00
Kris
5a26c87fa6
UX: less janky animation for experimental sidebar (#17396) 2022-07-08 14:06:01 -04:00
Kris
4c1b8e736d
UX: add border-box to stop padding from overflow (#17391) 2022-07-08 10:31:28 -04:00
Joffrey JAFFEUX
9408ea4461
Revert "DEV: glimmerify discourse-root (#17390)" (#17392)
This reverts commit 27408c7e14.
2022-07-08 15:28:40 +02:00
Joffrey JAFFEUX
27408c7e14
DEV: glimmerify discourse-root (#17390)
As a result discourse-root will be tag-less
2022-07-08 13:55:34 +02:00
Jarek Radosz
20851f7240
FIX: Inputs using focusout regressed in #17345 (#17389) 2022-07-08 13:00:33 +02:00
David Taylor
a084680f1d
DEV: Pass static scripts through Ember CLI (#17373)
All files under `app/assets/javascripts/scripts` will be run through babel, given sourcemaps, and output under `/assets/{name}.js`. This is another step towards removing our sprockets dependence.
2022-07-08 10:13:46 +01:00
Chapoi
9dab97de70
UX: a save should always have a cancel action (#17385) 2022-07-08 10:02:16 +02:00
Alan Guo Xiang Tan
b622302351
Revert "UX: Hide user menu bookmark link when experimental sidebar is enabled (#17336)" (#17386)
This reverts commit 526e6e7a3b.

Link in dropdown user menu is kept in favor of link in experimental sidebar
2022-07-08 15:44:49 +08:00
Jarek Radosz
94c70a0909
DEV: Silence one more test (#17375)
…and improve silencing added in #17362
2022-07-08 09:15:09 +08:00
Jarek Radosz
215926f295
DEV: Don't use the deprecated route (#17376) 2022-07-08 09:13:43 +08:00
David Taylor
201228162c
DEV: Remove temporary GlimmerComponent hack (#17370)
fc36ac6c updated us to a more modern resolver, so this hack is no longer required
2022-07-07 15:08:46 +01:00
Andrei Prigorshnev
ef923f1bb1
FEATURE: Publish everyone's status to everyone (#17343) 2022-07-07 17:37:05 +04:00
Kris
7d3b22135c
UX: don't animate experimental sidebar on reload (#17372) 2022-07-07 09:33:17 -04:00
David Taylor
d037796ff4
FIX: Allow connector template names to be camelCase (#17371)
The default Ember resolver implementation allows this for components. We need the same for connectors (which are essentially components behind-the-scenes)
2022-07-07 12:42:23 +01:00
David Taylor
5b0a8bfbcb
DEV: Make sass deprecations quieter during test build (#17369) 2022-07-07 11:03:16 +01:00
Jarek Radosz
39c28cec87
DEV: Allow hooks.beforeEach usage w/ component tests (#17360) 2022-07-07 09:57:38 +02:00
Krzysztof Kotlarek
95c257e2ea
FEATURE: plugin outlet for sidebar (#17367) 2022-07-07 15:05:20 +08:00
Jarek Radosz
c32ac45b29
DEV: Reduce test noise (#17362) 2022-07-07 13:28:40 +08:00
Kris
fbc89dd41a
UX: improve experimental sidebar transitions (#17358) 2022-07-06 13:31:06 -04:00
Chapoi
63562e8b14
UX: switch highlight/select colours in select-kit (#17356) 2022-07-06 16:49:36 +02:00
David Taylor
fc36ac6cde
DEV: Modernize Ember Resolver (#17353)
This switches us to use the modern ember resolver package, and re-implements a number of our custom resolution rules within it. The legacy resolver remains for now, and is used as a fallback if the modern resolver is unable to resolve a package. When this happens, a warning will be printed to the console.

Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
2022-07-06 14:20:00 +01:00
Isaac Janzen
5c4c8d26c7
DEV: Update expand-table table query (#17347)
Instead of selecting the first table in the parent, we now select the first table after the selected <kbd>expand table</kbd> button
2022-07-06 08:01:46 -05:00
David Taylor
fb31ae04a7
FIX: Ensure there is no limit on tag list settings (#17355)
`maximum=null` is not a supported configuration option. Instead, we need to pass the `@unlimitedTagCount` attribute
2022-07-06 12:23:23 +01:00
Jarek Radosz
c3fd91670e
DEV: Update linting setup and fix issues (#17345)
Re-lands #16119 and #17298

* Update eslint-config-discourse
* Update linting workflow
* Prettier-ignore stuff
* Update template-lint config
* Auto-fix template issues
* Fix various template issues
  Mostly incorrect attributes and unused templates
* Prettier js files
* Fix template auto-fix regressions
* Small css tweak

Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
2022-07-06 10:37:54 +02:00
Jarek Radosz
f7c133ac74
DEV: Update sass (#17349) 2022-07-06 10:35:55 +02:00
David Taylor
6c49ec39ea
DEV: Disable RAISE_ON_DEPRECATION (#17351)
Some plugins/themes are still awaiting updates for some deprecations, and they started raising errors in development. It's not clear that the errors are development-only, so it can be quite confusing for developers.

Disabling this flag for now until we can make the messages clearer and fix up existing deprecation issues in themes/plugins.
2022-07-06 11:56:16 +08:00
Kris
59c8774957
UX: Prevent experimental sidebar scroll jumps (#17352) 2022-07-06 10:36:44 +08:00
Kris
7711d140da
UX: staff notice should utilize full post width (#17346) 2022-07-05 15:49:47 -04:00
Peter Wagenet
371bbadb92
No implicit this codemod (#17235)
* Run no-implicit-this codemod for app templates
* Run tagless-ember-components-codemod for plugins
* Turn on no-implicit-this lint
2022-07-05 19:41:31 +02:00
Rafael dos Santos Silva
9833b59b70
FEATURE: Allow iframe allow attribute in posts (#17291)
This is used so iframes can use mic, camera, EME, etc.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives
lists current possible values

Feature request https://meta.discourse.org/t/iframe-attributes-not-working/127383?u=falco
2022-07-05 12:25:27 -03:00
Andrei Prigorshnev
c59f1729a6
FEATURE: auto remove user status after predefined period (#17236) 2022-07-05 19:12:22 +04:00
David Taylor
2a7fb4bf3a
FIX: Correct error in ip-lookup component definition (#17339)
7caaee2 introduced a duplicate definition of the component JS. This likely happened because we had the template defined under `javascripts/discourse`, and the component JS defined under `javascript/admin`. This commit removes the duplicate definition, and moves the template to the admin addon
2022-07-05 15:13:50 +01:00
Alan Guo Xiang Tan
526e6e7a3b
UX: Hide user menu bookmark link when experimental sidebar is enabled (#17336)
Sidebar has a link to bookmarks by default
2022-07-05 15:50:25 +08:00
Alan Guo Xiang Tan
843907d1ac
UX: Update categories/tags in sidebar only after saving. (#17333)
Adding the category/tag into sidebar before the user has saved was
giving the impression that the user's record has already been updated.
2022-07-05 13:32:12 +08:00
Alan Guo Xiang Tan
4d51f9cad6
UX: Enforce bullet category style in sidebar (#17334)
The other category styles do not fit into how we want the sidebar to
look.
2022-07-05 13:28:51 +08:00
Kris
56c0d8cf92
UX: mobile experimental sidebar improvement (#17302)
First pass at the mobile experimental sidebar improvement.

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2022-07-05 11:45:02 +08:00
Chapoi
408ce1312b
UX: remove hardcoded colour value (#17323) 2022-07-05 10:47:29 +08:00
Chapoi
4730858598
UX: missing specificity (#17324) 2022-07-05 10:46:54 +08:00
Alan Guo Xiang Tan
ef7a518159
UX: Retain category badge style on categories select kit. (#17332)
Category badge changes based on the `category style` site setting so we
do not want to forcing all category names to the same color.

Follow-up to 3266350e80
2022-07-05 10:05:44 +08:00
David Taylor
c011dd7b43 DEV: Remove last few curly-component invocations 2022-07-04 17:25:42 +01:00
Joe
cfde4419f5
DEV: Preload CSS in the <head> (#17322)
This commit adds preload links for core/plugin/theme CSS stylesheets in the head.

Preload links are non-blocking and run in parallel. This means that they should have already been downloaded by the time we use the actual stylesheets (in the <body> tag).

Google is currently complaining about this here and this PR will address that warning.

This commit will also fix an issue in the splash screen where it sometimes doesn't respect the theme colors - causing a slightly jarring experience on dark themes.

Note that I opted not to add new specs because the underlying work required already has a lot of coverage. The new methods only change the output HTML so we can chuck that in the document <head>

This change also means that we can make all the stylesheets non-render blocking, but that will follow in a separate commit.
2022-07-05 00:23:09 +08:00
Jarek Radosz
a0a7b3f9c4
FIX: Correctly display /admin/emails errors (#17321)
Also removed unused codepath in `admin-badges-show`.
2022-07-04 16:03:53 +02:00
Jarek Radosz
999865401c
DEV: Remove most jQ from select-kit test helpers (#17305) 2022-07-04 11:37:11 +02:00
Jarek Radosz
aa7792cf93
DEV: Use npm bootstrap (#17315) 2022-07-04 11:36:51 +02:00
Alan Guo Xiang Tan
b42a9c3647
FIX: Experimental sidebar preferences link not shown for users (#17318)
Not writing any tests here because there is very little value to test
for an option that will eventually be removed
2022-07-04 15:18:39 +08:00
Jarek Radosz
e31002fc05
FIX: Move ember-cli-deprecation-workflow to runtime deps (#17317)
We have a weird setup where almost all deps need to be runtime…
2022-07-04 10:20:20 +08:00
Jarek Radosz
7b9e6bb303
DEV: Fix a flaky submodule/auth test (#17313) 2022-07-04 02:25:35 +02:00
Jarek Radosz
e1f16b4641
DEV: De-jQuerify get-url (#17314) 2022-07-04 02:25:15 +02:00
Jarek Radosz
9f83e8e33c
DEV: Use our ajax helper consistently (#17304)
Possibly fixes some flakes, but regardless - we need to avoid using `$.ajax` directly in most cases.
2022-07-04 02:24:55 +02:00
Peter Wagenet
7caaee27cc
DEV: Generate template backing classes for app (#17300)
```sh
npx ember-holy-futuristic-template-namespacing-batman-codemod ensure-template-only-has-backing-class
```

We would like to colocate templates but, when no backing class exists, colocated templates extend `templateOnly` instead of `Ember.Component`. Generating the backing class helps avoid any behavioral changes.

We can also run the `tagless-ember-components-codemod` to put the tags into the templates at which point we could convert these back to template-only components.
2022-07-04 01:27:29 +02:00
Peter Wagenet
82d7e76d52
Set up ember-cli-deprecation-workflow (#17268)
Let's get the ball rolling! 😃
2022-07-01 23:43:40 +02:00
Joe
adb7fa5e2f
UX: Use discourse-ready as a baseline for removing the splash (#17297)
We previously used the window load event as a target to remove the splash. The issue with that is that it means we wait for images to download before we remove the splash.

Ember has a better method that we can use ready(). This PR triggers a custom discourse-ready when that happens and uses that as the baseline for removing the splash.

This PR also adds three new performance marks. discourse-ready, discourse-splash-visible, and discourse-splash-removed

These will help us keep track of performance.

Internal topic /t/65378/81
2022-07-01 21:54:38 +08:00
Vinoth Kannan
af3262d70a
UX: made "Dismiss New" button clickable by replacing float method. (#17288)
Since we removed the `row:after { clear: both }` CSS we no longer use `float` style here. Instead, we should use `flex` style to align the button in right side.
2022-07-01 09:12:16 +05:30
Kris
199d58461b
UX: hide sidebar li overflow, remove title margin (#17294) 2022-06-30 18:24:29 -04:00
Kris
321dc29583
UX: improve experimental sidebar scrollbar (#17293) 2022-06-30 16:14:29 -04:00
Kris
b1f7da4fe3
UX: minor experimental sidebar alignment changes (#17292) 2022-06-30 16:14:17 -04:00
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
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
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
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
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
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
Jarek Radosz
d1d6868325
DEV: Update xss.js (#17216)
* DEV: Update xss.js

* Fix our hack
2022-06-24 10:28:05 +08:00
Jarek Radosz
f27dddd405
DEV: Make addons buildable on their own (#17205) 2022-06-23 22:19:54 +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
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
Isaac Janzen
b59e3b0b7c
DEV: Remove isLegacyEmber() from tests (#17184) 2022-06-21 13:37:29 -05:00
Jarek Radosz
def39b2d58
DEV: Update @babel/core (#17163) 2022-06-21 12:48:44 +02: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
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
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
Alan Guo Xiang Tan
ef5b504e9a
DEV: Remove ember legacy env conditional in sidebar tests (#17140) 2022-06-20 10:07:06 +08:00
Alan Guo Xiang Tan
222a7755a0
DEV: Rely on route action to open composer. (#17118)
Avoid duplicating composer logic in multiple places.
2022-06-20 10:06:15 +08:00
Penar Musaraj
78fab9b7e1
DEV: Add before-list-area plugin outlet (#17136) 2022-06-20 10:05:46 +08:00
Joe
804b8fd9f9
DEV: Defer loading core/plugin/theme JS files (#17063)
This is pre-request work to introduce a splash screen while site assets load.

The only change this commit introduces is that it ensures we add the defer attribute to core/plugin/theme .JS files. This will allow us to insert markup before the browser starts evaluating those scripts later on. It has no visual or functional impact on core.

This will not have any impact on how themes and plugins work. The only exception is themes loading external scripts in the </head> theme field directly via script tags. Everything will work the same but those would need to add the defer attribute if they want to keep the benefits introduced in this PR.
2022-06-20 09:47:37 +08:00
Discourse Translator Bot
7ac485fb9f
FEATURE: Add Croatian language (#17130)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2022-06-18 00:18:22 +02:00
Ghassan Maslamani
84b0a6414d
FIX: double selecting replies (#17086)
When selecting a post and its replies using the "select +replies" button, the action would push all ids, without checking if some were already selected. 

This change add a filter to remove ids that are already selected.

This fixes https://meta.discourse.org/t/selecting-posts-replies-miscounts-the-number-of-posts/229242

Co-authored-by: @ZogStriP
2022-06-17 18:32:57 +02:00
Isaac Janzen
6ad5db80de
DEV: Remove use of run-loop-dot-access (#17114)
Context: https://deprecations.emberjs.com/v3.x/#toc_deprecated-run-loop-and-computed-dot-access
2022-06-17 11:19:14 -05:00
Jarek Radosz
a69b914710
FIX: Wizard css was overriding some of core css (#17126)
* Use `var()`
* Remove imports
* Scope all wizard css to `body.wizard`
2022-06-17 17:28:54 +02:00
Isaac Janzen
1ada3a9404
DEV: Remove use of run-loop-and-computed-dot-access (#17113)
Context: https://deprecations.emberjs.com/v3.x/#toc_deprecated-run-loop-and-computed-dot-access
2022-06-17 09:43:13 -05:00
Osama Sayegh
b0a896a10f
UX: Skip special paste handling in email-group-user-chooser when maximum is 1 (#17124)
`email-group-user-chooser` currently handles paste events to allow users to paste multiple entries at once instead of entering them one by one. This behavior makes sense when the component is used in scenarios where it makes sense to provide multiple entries such as the recipients field when creating a PM. However, for instances where the component accepts only 1 entry, it doesn't make a lot of sense to do custom handling of paste events.

This commit makes our paste event handler a NOOP when the component is configured to accept only 1 entry in which case pasting will simply input the value into the component's search field.
2022-06-17 16:53:50 +03:00
Jarek Radosz
fcb4e5a1a1
DEV: Make wizard an ember addon (#17027)
Co-authored-by: David Taylor <david@taylorhq.com>
2022-06-17 14:50:21 +02:00
Jarek Radosz
79d3b25d97
DEV: Fix various frontend warnings (#17122)
3 computed property overrides and a tippy warning
2022-06-17 13:45:05 +02:00
Jarek Radosz
f27f95b2e9
DEV: Don't print uppy warnings in test env (#17121) 2022-06-17 13:44:52 +02:00
Loïc Guitaut
1166db12b4
FIX: Make watched words uploads work as intended (#17097)
* FIX: Make watched words uploads work as intended

Currently when we upload a file containing watched words, it will always
add the words to the action that was initially selected: this is the
`block` action by default but if changing manually the action in the URL
to `flag` for example, then this action will be selected and uploaded
watched words will be categorised as `flag` no matter what.

The problem lies with how the component works: it’s an Uppy object where
extra data is defined to provide an action key to the server but when
navigating to another listed action, while this action key is properly
updated on the component itself, the underlying Uppy object has already
been created and doesn’t care about the new value.

This patch solves this by using the `_perFileData` method instead of
`data`: the former is merged just before uploading a file whereas the
latter is used when the Uppy object is created.
2022-06-17 11:07:58 +02:00
Alan Guo Xiang Tan
f618fdf17f
Revert "DEV: Centralize user updates to a single MessageBus channel. (#17058)" (#17115)
This reverts commit 94c3bbc2d1.

At this current point in time, we do not have enough data on whether
this centralisation is the trade-offs of coupling features into a single
channel.
2022-06-17 12:24:15 +08:00
Penar Musaraj
4c810ca121
FIX: JSON Schema editor layout issue with subarrays (#17112) 2022-06-16 22:33:42 -04:00
David Taylor
691afa2593
DEV: Handle emoji-picker and d-editor being destroyed simultaneously (#17109) 2022-06-16 17:16:15 +01:00
David Taylor
a4fc88ce68
FIX: Ensure emoji is inserted in the correct location (#17107)
In the specific case where you start typing an emoji, then open the full emoji picker, the chosen emoji would be inserted in the wrong place. This was an unintentional side effect of the changes in 75d9c16156

This commit updates the `emojiSelected` logic to avoid mutating the 'selected' object, and also adds a test for this specific behaviour.
2022-06-16 12:16:53 +01:00
Alan Guo Xiang Tan
c625dc0adc
FEATURE: Add messages section links to experimental sidebar. (#17096) 2022-06-16 13:33:40 +08:00
Gerhard Schlager
888f50543d
DEV: Fix javascript:update rake task (#17098)
* The `javascript:update` rake task failed because recent versions of chart.js use a lowercase filename (`chart.min.js` instead of `Chart.min.js`)

* Changed `loadScript()` to use lowercase keys to lookup scripts

* `svg-arrow.css` seems to have changed slightly (linebreak at the end of file)
2022-06-15 19:49:04 +02:00
Isaac Janzen
a7034c5a14
DEV: Update create-account test to be more clear (#17102) 2022-06-15 12:47:47 -05:00
Isaac Janzen
bc0a37b642
DEV: @bind create-account actions (#17100)
DEV: @bind create-account actions

Context: https://github.com/discourse/discourse/pull/16983#discussion_r894721403
2022-06-15 12:36:04 -05:00
David Taylor
275849771f
DEV: Emit a 'change' event when PresenceChannel info changes (#17088)
e.g.

```
presenceChannel = this.presence.getChannel('/blah');
presenceChannel.subscribe();
presenceChannel.on('change', (channel) => console.log(channel.users));
```

This commit also does some refactoring to remove the use of an unnecessary EmberObject and dynamic `defineProperty` call
2022-06-15 16:13:44 +01:00
Krzysztof Kotlarek
63df2b4550
FIX: whisper available when reply to topic (#17054)
When a user is answering a whisper comment, they cannot change from whisper to regular answer.

However, user can click reply to topic. We keep `postSnapshot` so user can change mind and switch back to reply to post. In that case, a toggle whisper button should appear.

To make it happen, I am ensuring to display a toggle whisper button when user is replying to topic - `postLink` attribute is missing.
2022-06-15 09:59:57 +10:00
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