Commit Graph

15743 Commits

Author SHA1 Message Date
David Taylor 3d070b4a32
FIX: Ensure topic-list adapter never serializes `undefined` (#17924)
There was existing logic for this, but it was broken because the values were being run through `encodeURI` before checking its type. This commit takes the opportunity to modernise the function to use `URLSearchParams`, which means we no longer need to handle encoding/joining strings manually.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-08-15 12:16:01 +01:00
David Taylor 6e5f08543e
DEV: Modernise navigation-item query parameter construction (#17926)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 12:12:32 +01:00
David Taylor a185713e5f
DEV: Ensure date-time-input-range-test works in all timezones (#17923)
The test was failing when run outside of the UTC timezone
2022-08-15 11:28:30 +02:00
David Taylor 6cac35ca29 DEV: Update JS class sorting to match new lint rule 2022-08-15 09:28:31 +01:00
Krzysztof Kotlarek 8cd1340170
Revert "DEV: Experimental scroll sidebar to specific element event handler (#17727)" (#17920)
This reverts commit af912b4b0e.
2022-08-15 11:10:58 +08:00
Alan Guo Xiang Tan 5a271fdc90
DEV: Skip flaky sidebar test (#17918)
The test is still useful and I intend to look at it in the future but
this is not the utmost priority at this point.

Follow-up to 68cefc9f9d
2022-08-15 10:33:59 +08:00
Penar Musaraj c66d544cf9
A11Y: Keep composer as focused element when dismissing Link modal via keyboard (#17893) 2022-08-15 09:37:19 +08:00
Jarek Radosz cac1608213
DEV: Fix `sidebar-hidden` localStorage value (#17915)
Previously ,`undefined` value for `sidebar-hidden` would mean "hide". Not it uses `true`.

Also, extract it into a const.
2022-08-15 09:35:01 +08:00
Jarek Radosz afaa2d5417
DEV: Fix localStorage test leakage (#17917)
We weren't clearing the store in all cases.
2022-08-15 09:33:25 +08:00
Arpit Jalan 3a21618e4e
FEATURE: allow wizard checkbox field to be disabled (#17916)
* FEATURE: allow wizard checkbox field to be disabled

* Changes per review feedback
2022-08-15 05:52:07 +05:30
Jarek Radosz 0be67cb513
DEV: Fix random test ordering (#17905)
And don't reorder failed tests when providing a seed - that was making failure debugging more difficult.
2022-08-15 02:04:44 +02:00
Jarek Radosz f25e779226
DEV: Prefer kvs over raw localStorage (#17907) 2022-08-14 17:31:49 +02:00
Jarek Radosz 92035cdc62
DEV: Change test localStorage prefix (#17906)
…to something more easily recognizable and less collision-prone
2022-08-14 17:31:37 +02:00
Joffrey JAFFEUX ccd76ec48d
FIX: markdown-it parse fn requires an env arg with {} as default (#17900)
See https://markdown-it.github.io/markdown-it/#MarkdownIt.parse for more details
2022-08-13 15:56:41 +02:00
Joffrey JAFFEUX 7476c22324
DEV: implements parseAsync in discourse/lib/text (#17899)
`parseAsync` allows to parse a block of markdown into tokens.

Usage:

```javascript
import { parseAsync } from "discourse/lib/text";

// ...

await parseAsync("**test**").then((tokens) => {
 console.log(tokens);
})
```
2022-08-13 14:25:32 +02:00
Joffrey JAFFEUX 3dac4fe075
A11Y: ensures featured topic btn is focused when modal closes (#17898) 2022-08-13 14:21:58 +02:00
Isaac Janzen 5e521b6c0d
DEV: Add before-composer-fields plugin outlet (#17891)
Add ability to insert content before composer-fields
2022-08-12 15:37:41 -05:00
Joffrey JAFFEUX bcb89beb99
A11Y: makes toolbar tabindex independent from its context (#17889)
Prior to this fix, if `<DEditor />` was used in a context where quote would not be the first button, then no  button would be focusable.
2022-08-12 15:24:20 -04:00
Joffrey JAFFEUX 494cc2c69d
A11Y: moves anchor rendering out of conditional to prevent losing focus (#17887) 2022-08-12 15:20:18 -04:00
Rafael dos Santos Silva 5afdf24292
FEATURE: PWA users are prompted for push before first post (#17888) 2022-08-12 15:30:28 -03:00
David Taylor 636be8cac5
DEV: Remove `discourse/components/glimmer` superclass (#17877)
This was a temporary solution while we updated the resolver and migrated all our singletons to true ember services. Now that's done, we can switch to use `@glimmer/component` directly, and explicitly inject services as required.
2022-08-12 17:05:51 +01:00
Penar Musaraj 2c5ab47204
FIX: Regression with Categories nav item (#17885) 2022-08-12 11:30:39 -04:00
Osama Sayegh 69664d2153
DEV: Make group message summary notification Link to the group inbox (#17884)
This fix is for the experimental user menu.
2022-08-12 15:15:43 +03:00
Osama Sayegh b5a6015155
DEV: Fallback to `bookmarkable_url` if bookmark reminder notification has no topic info (#17883)
This fix is for the experimental user menu. Some `bookmark_reminder` notifications may not be associated with a topic/post (e.g. bookmark reminder for a chat message) in which case the default notification renderer cannot figure out the `href` for those `bookmark_reminder` notifications. This commit teaches the `bookmark_reminder` notification type renderer to fallback to `bookmarkable_url` that's present in the notification data if the default notification renderer doesn't return a `href` for the notification.
2022-08-12 14:40:44 +03:00
Alan Guo Xiang Tan b653b86806
DEV: Remove undefined in Sidebar::SectionLink class attribute (#17881) 2022-08-12 12:12:39 +08:00
Alan Guo Xiang Tan 68cefc9f9d
DEV: Remove flaky sidebar acceptance test. (#17882)
At a certain point, the cost of debugging a flaky acceptance test is
just too high for what we're testing for here. I've decided to just
accept the risk of a minor UX feature.

Follow-up to 55fa94f759
2022-08-12 12:12:19 +08:00
Alan Guo Xiang Tan 3deabb00d4
DEV: Route PM only tags to PM tags show route (#17870)
Previously, PM only tags were being routed to the public topic list with
the tag added as a filter. However, the public topic list does not fetch
PMs and hence PM only tags did not provide any value when added to the
Sidebar. This commit changes that by allowing the client to
differentiate PM only tag and thus routes the link to the PM tags show
route.

Counts for PM only tags section links are not supported as of this
commit and will be added in a follow up commit.
2022-08-12 11:26:56 +08:00
David Taylor e4fbb3be21
DEV: Update composer-fullscreen-prompt to template-only component (#17871)
1. Replace `{{did-insert` with the builtin `{{on` modifier
2. Move the i18n call into the template

With both of those changes, there is no logic left in the backing class, so we can switch to `templateOnly()` which is significantly faster. (granted, not a big deal for a component like this, but it makes for a good demonstration)
2022-08-12 10:43:38 +08:00
David Taylor 06030743e8
DEV: Update sidebar components to use `@glimmer/component` (#17875)
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection

This also updates `section-message` to be a templateOnly glimmer component rather than a classic component.
2022-08-12 07:07:57 +08:00
David Taylor cef264ab1f
DEV: Update welcome-topic-banner to use `@glimmer/component` (#17876)
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection
2022-08-11 18:47:15 +01:00
Vinoth Kannan fe436523a5
FIX: don't preview color scheme if it's not current user's profile. (#17855) 2022-08-11 19:47:49 +05:30
Joe c85921a548
FEATURE: Adds full screen composer submit button and prompt (#17839)
Context: https://meta.discourse.org/t/still-display-the-reply-create-topic-button-when-using-full-screen-composition/123597/6?u=johani

Right now, we don't show the submit buttons when you enter the full-screen composer. The reasons for that are described in the context link above.

This PR adds the improvements highlighted here: https://meta.discourse.org/t/still-display-the-reply-create-topic-button-when-using-full-screen-composition/123597/12?u=johani

Here's a list of the changes this PR introduces:

1. When you enter full-screen mode, we will now add a prompt that matches the browser fullscreen <kbd>F11</kbd> function. It looks like so

    <img width="500" src="https://user-images.githubusercontent.com/33972521/183529813-71a20167-a661-466c-b9ef-c4d34e231000.png">
    
    The prompt fades away after a couple of seconds.
    
2. This PR adds the submit buttons to the full-screen composer mode. The submit buttons should work like normal if the post has no errors. If the post has errors (title too short, body too short, required categories/tags), then the button will make the composer exit the full-screen mode so that users will see the errors and fix them. The error logic is based on what we currently have; this PR doesn't add any new validation. Here's a video of what that looks like:

    https://meta.discourse.org/t/-/127948/14?u=johani
2022-08-11 14:38:56 +08:00
David Taylor 5ee2741a4c
DEV: Update user-menu components to use `@glimmer/component` (#17869)
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection
2022-08-11 07:56:52 +03:00
Andrei Prigorshnev e87ca397be
FEATURE: show status in search results when mentioning user in composers (#17811) 2022-08-10 19:49:26 +04:00
Alan Guo Xiang Tan 55fa94f759
DEV: Attempt to fix flaky sidebar test (#17852)
Makes displaying and hiding the list more deterministic.

```
Error: QUnit Test Failure: Exam Partition 1 - Acceptance: Sidebar - Community Section: clicking on more... link
not ok 491 Firefox 91.0 - [722 ms] - Exam Partition 1 - Acceptance: Sidebar - Community Section: clicking on more... link
    ---
        actual: >
            true
        expected: >
            false
        stack: >
            @http://localhost:7357/assets/core-tests.js:9826:14

        message: >
            additional section links are hidden
        negative: >
            false
        browser log: |
```
2022-08-10 21:22:55 +08:00
Alan Guo Xiang Tan 5283088269
DEV: `site-settings:main` -> `service:site-settings` (#17854) 2022-08-10 21:08:25 +08:00
Bianca Nenciu e029a9b36c
FEATURE: Allow private themes to be partially installed (#17644)
A public key must be added to GitHub when installing private themes.
When the process happens asynchronously (for example if the admin does
not have admin permissions to the GitHub repository), installing
private themes becomes very difficult.

In this case, the Discourse admin can partially install the theme by
letting Discourse save the private key, create a placeholder theme and
give the admin a public key to be used as a deploy key. After the key
is installed, the admin can finish theme installation by pressing a
button on the theme page.
2022-08-10 13:30:18 +03:00
Osama Sayegh 590a13377b
DEV: Fix the build (#17853)
473695ee4d and 23520b88c2 were merged very close to each other, but they had some subtle conflicting changes that broke some tests.
2022-08-10 10:10:34 +03:00
Osama Sayegh 473695ee4d
DEV: Add messages tab to the new user menu (#17850)
Some of the changes in this PR are extracted from https://github.com/discourse/discourse/pull/17379.

Similar to the bookmarks tab in the new user menu, the messages tab also displays a mix of notifications and messages. When there are unread message notifications, the tab displays all of these notifications at the top and fills the remaining space in the menu with a list of the user's messages. The bubble/badge count on the messages tab indicates how many unread message notifications there are.
2022-08-10 08:25:39 +03:00
Alan Guo Xiang Tan 23520b88c2
DEV: Add `registerUserMenuTab` plugin API (#17851)
Co-authored-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2022-08-10 13:21:37 +08:00
Kris 424e968538
UX: add left sidebar toggle when sidebar enabled (#17831) 2022-08-10 10:12:35 +08:00
Arpit Jalan 10a1b6b0a9
FEATURE: update bootstrap mode notice to add invite and wizard links (#17822)
* FEATURE: update bootstrap mode notice to add invite and wizard links

* Updates per feedback on PR

* Fix the wizard link not showing

* Remove unneeded function

* Remove router service injection
2022-08-10 00:13:42 +05:30
Arpit Jalan d57bea4de3
FEATURE: add welcome topic cta banner (#17821) 2022-08-09 21:52:39 +05:30
David Taylor 7f9c2c0bfb
DEV: Remove vendored babel and update config for plugins/themes (#17832)
The new plugin list is based on the ones currently used in our ember-cli pipeline, and are based on our official browser support policy.

This commit includes an update to the raw-handlebars compiler to remove the 'very hacky but lets us use ES6' code. It's  served us well for the last 6 years, but the babel config changes broke it (`const` -> `let`). This commit takes the opportunity to refactor it to take a similar approach to PrettyText, by leaning on `mini-loader.js`.
2022-08-09 11:53:24 +01:00
Jarek Radosz 9645cbea26
DEV: Clear extra header buttons (#17829) 2022-08-08 19:57:56 +02:00
Sérgio Saquetim e0f469eab8
FEATURE: Add above-modal-header plugin outlet (#17812) 2022-08-08 14:40:35 -03:00
Jarek Radosz f7e7f9a6a7
DEV: Fix a function name typo (#17828)
Co-authored-by: Osama Sayegh <asooomaasoooma90@gmail.com>
2022-08-08 18:50:39 +02:00
Jarek Radosz 8b8cbe7905
DEV: Set owner of sidebar section objects (#17827)
Allows e.g. `@service` usage in their implementation
2022-08-08 16:35:14 +02:00
Osama Sayegh 4fdb275683
DEV: Add bookmarks tab to the new user menu (#17814)
Some of the changes in this commit are extracted from https://github.com/discourse/discourse/pull/17379.

The bookmarks tab in the new user menu is different from the other tabs in that it can display a mixture of notifications and bookmarks. When there are unread bookmark reminder notifications, the tab displays all of these notifications at the top and fills the remaining space in the menu with the rest of the bookmarks. The bubble/badge count on the bookmarks tab indicates how many unread bookmark reminder notifications there are.

On the technical aspect, since this commit introduces a new `bookmark-item` component, we've done some refactoring so that all 3 "item" components (`notification-item`, `reviewable-item` and the new `bookmark-item`) inherit from a base component and get identical HTML structure so they all look consistent.

Internal tickets: t70584 and t65045.
2022-08-08 17:24:04 +03:00
Andrei Prigorshnev 94ac8611f4
FEATURE: show status on post streams (#17813) 2022-08-08 17:35:26 +04:00
Jarek Radosz e6fa05f8c3
DEV: Asyncify `findTopicList()` (#17816) 2022-08-08 11:46:09 +02:00
Joffrey JAFFEUX 2003c2d4cd
FIX: prevents android keyboard to be hidden instantly on sk focus (#17810) 2022-08-05 13:09:38 -04:00
Andrei Prigorshnev 8f66d57b86
UX: Improve empty state copy on the activity/topics page (#17746) 2022-08-05 18:37:06 +04:00
Andrei Prigorshnev 4283cef2ed
DEV: add status to the user info component (#17809)
We use the user-info component in several places, and we want to show status on some of them. If you want status to appear, do this:

{{user-info showStatus=true}}
2022-08-05 16:54:54 +04:00
Andrei Prigorshnev 9f5ba2db90
DEV: Make it possible to hide tooltip on the user status (#17808)
Sometimes status appears on popovers, and we may not want to show a tooltip in that case. But by default, tooltip is enabled.
2022-08-05 16:53:28 +04:00
Loïc Guitaut 5c37a5d0f2
FIX: Allow to add the same watched word with a different case (#17799)
Currently we can’t add a case-sensitive watched word if another one
exists with a different case. For example, the existing watched word
`Meta` has been created and is case-sensitive. Now an admin tries to add
`metA` while marking it as case-sensitive too, this won’t work and the
word won’t be added.

This patch changes this behavior by allowing to add same words that have
different cases, so the example above will now work as expected.

We still check for uniqueness but case-sensitivy is now taken
into account. It means that if the watched word `meta` already exists
and is not case-sensitive then it will not be possible to add `Meta`
(case-sensitive or not) as `meta` already matches every possible
variations of this word.
2022-08-05 12:18:17 +02:00
Osama Sayegh 0df1c4eab2
DEV: Refactor notification/reviewable items rendering in the new user menu (#17792)
Prior to this commit, we had a default Glimmer component that was responsible for handling generic rendering of notifications in the user menu, and many notification types had a custom Glimmer component that inherited from the default component to customize how they were rendered. That implementation was less than ideal because it meant plugins would have to create Glimmer components to customize notification types added by them and that would make the surface area of the API too big.

This commit changes the implementation so there's only one Glimmer component for rendering notifications, and then notification types that need to be customized can create a regular JavaScript class - `renderDirector` in the code - that provides the Glimmer component with the content it should display. We also introduce an API for plugins to register a renderer for a notification type or override an existing one.

Some of the changes are partially extracted from https://github.com/discourse/discourse/pull/17379.
2022-08-05 07:55:00 +03:00
David Taylor c1cdb6bc51
DEV: Replace `topic-tracking-state:main` with `service:topic-tracking-state` (#17802)
This will allow consumers to inject it using `topicTrackingState: service()` in preparation for the removal of implicit injections in Ember 4.0. `topic-tracking-state:main` is still available and will print a deprecation notice.

Ideally we would convert topic-tracking-state into a true service, rather than registering a model instance into the registry. However, inter-dependencies between service injections make this very difficult to achieve. We don't want to block Glimmer Component work, so this commit does the minimum for now.
2022-08-05 08:48:55 +08:00
Peter Wagenet d0cbc61619
DEV: Add jsconfig (#17800)
This enables intelligent IDE features like "Go To Reference" to function correctly within the Discourse core codebase
2022-08-04 22:50:47 +01:00
Ghassan Maslamani 2d6bd30dd8
FEATURE: add image delete button in preview. (#17624)
This commit adds a delete button to the composer preview next to the image scale buttons.

Reference: https://meta.discourse.org/t/image-remover-button-to-composer-preview/233005
2022-08-04 16:33:23 -04:00
Alan Guo Xiang Tan ad18f7488c
FIX: Secondary more section links not marked as active (#17797)
When the route of the link is equal to the active route, we promote it
out of the "more..." links drawer and display it directly under the
community section. This commit fixes a bug where the secondary links in
the "more..." links drawer was not being marked as active.

Follow-up to e09fd7cde2
2022-08-04 18:51:32 +08:00
Alan Guo Xiang Tan 02987e05d5
DEV: Support old hamburger menu custom footer links in Sidebar (#17796)
This commit extends the existing API bridge for supporting custom
general links in the old hamburger menu in Sidebar to support custom
footer links. Custom footer links can be added to the old hamburger
menu via the `api.decorateWidget("hamburger-menu:footerLinks")` API.
Footer links are added into the secondary section of the "More..." links
drawer in the Community section of the sidebar.
2022-08-04 15:05:14 +08:00
Alan Guo Xiang Tan a36584b8c8
Add support for toggling between mobile and desktop view on sidebar (#17794)
In the current hamburger menu dropdown, we have a link which allows users to toggle between mobile and desktop view on mobile and touch devices. This commit brings the same behaviour to sidebar.
2022-08-04 14:26:35 +08:00
Alan Guo Xiang Tan e09fd7cde2
UX: Move About and FAQ links into secondary section in More... dropdown (#17793)
This commit does not change any behaviour of the links and is simply
changing the positions of the links being displayed.
2022-08-04 13:41:08 +08:00
Jean 8ab6b17c36
FIX: show update banner only once on categories with subcategory lists (#17782)
* FIX: show update banner only once on categories with subcategory lists
2022-08-03 15:27:03 -04:00
Osama Sayegh 3d7829c01f
FIX: Unsubscribe from the `/reviewable_counts` channel when leaving the review-index route (#17778)
Follow-up to ce9eec8606.

When the review-index route is entered, we listen to the `/reviewable_counts` (or `/reviewable_counts/<user_id>` when the new user menu is enabled) channel so we can listen for changes to reviewables and update the UI accordingly. However, we currently don't unsubscribe when leaving the route which means each time the route is entered, we setup a new listener causing the browser to do unnecessary work and potentially state leakage.
2022-08-03 17:16:02 +03:00
David Taylor 0e6f9ef406
DEV: Replace `site:main` with `service:site` (#17766)
This will allow consumers to inject it using `site: service()` in preparation for the removal of implicit injections in Ember 4.0. `site:main` is still available and will print a deprecation notice.
2022-08-03 14:38:35 +01:00
Osama Sayegh 062a5f316d
DEV: Wire up the dimiss button in the new notifications menu (#17745)
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
2022-08-03 15:32:35 +03:00
Peter Wagenet 40cb46631f
DEV: Update `/admin/badges` to modern Ember patterns (#17672)
* Nest admin badges controller and route files

* Use standard file names for admin-badges

* Update resolver to allow standardized file structure for admin

* Add adminBadges.index controller for property tracking

* Modernize admin badges controller

* Modernize admin-badges route

* Add admin-badges index route

* Modernize admin-badges.show controller and route

* Modernize admin-badges.award controller and route

* Convert BadgeButton to a Glimmer component
2022-08-03 10:12:17 +01:00
David Taylor 36446649ff
DEV: Clear custom sidebar sections after each test (#17775)
Initializers are re-run before each test, so we need to clear out the list to avoid duplicates building up over multiple tests.
2022-08-03 09:42:29 +01:00
Alan Guo Xiang Tan d1d760ae7b
UX: Move links in Sidebar footer under community section (#17774)
Now that we have a "more..." links drawer, we can move some of the links
in footer into the links drawer. The footer itself does not have much
horizontal or vertical space for us to work with and hence limits the
amount of links which we can add to it.
2022-08-03 14:47:03 +08:00
Osama Sayegh 53dd9b0c66
DEV: Add `aria-label` option to the `d-icon` helper (#17741)
Extracted from https://github.com/discourse/discourse/pull/17379.
2022-08-03 09:33:50 +03:00
Osama Sayegh ce9eec8606
DEV: Combine all header notification bubbles into one in the new user menu (#17718)
Extracted from https://github.com/discourse/discourse/pull/17379.
2022-08-03 08:57:59 +03:00
Alan Guo Xiang Tan bd92df6bbe
FIX: Links incorrectly marked as active in Sidebar::MoreSectionLinks (#17771)
Before this commit, links with routes that require multiple models were
incorrectly displayed as the active link in the
Sidebar::MoreSectionLinks component because we were only checking if the
routeName was active.
2022-08-03 12:39:21 +08:00
Jeff Wong d4dda2c93a REFACTOR: Update fastly URLs in tests to generic example URLs 2022-08-02 14:32:08 -10:00
Jeff Wong 8d525b4188 REFACTOR: update search fixture urls 2022-08-02 14:32:08 -10:00
David Taylor be55367d6f
DEV: Replace `session:main` with `service:session` (#17765)
This will allow consumers to inject it using `session: service()` in preparation for the removal of implicit injections in Ember 4.0. `session:main` is still available and will print a deprecation notice.
2022-08-02 23:55:20 +01:00
David Taylor 89518f3155
DEV: Modernize store and messageBus injections in Glimmer base class (#17763)
These were overlooked when `store` and `messageBus` were converted to true services
2022-08-02 23:22:52 +01:00
Martin Brennan d2ddb140dd
FEATURE: Show SMTP response on admin email sent list and rearrange columns (#17143)
Follow up to 4d3c1ceb44, this commit
shows the SMTP response in the admin email sent list and also moves the
topic/post link into a new column. Reply key is now in its own column.
2022-08-03 08:11:54 +10:00
Sérgio Saquetim b16028bc79
FIX: Inject appEvents in ScreenTrack (#17751)
This commit reverts partially https://github.com/discourse/discourse/pull/17543.

Service appEvents was not being injected in ScreenTrack. This causes
`this.appEvents.trigger("topic:timings-sent", data);` to fail and the error is
swallowed by the `catch` on the promise.

This caused a regression on plugins that rely on this event to implement other
behaviors.
2022-08-02 16:22:17 -03:00
David Taylor 4c2f08b6e2 DEV: Replace `current-user:main` with `service:current-user`
This will allow consumers to inject it using `currentUser: service()` in preparation for the removal of implicit injections in Ember 4.0. `current-user:main` is still available and will print a deprecation notice.
2022-08-02 20:16:11 +01:00
David Taylor 2463a8d568 DEV: Improve `injectServiceIntoService` function
Previously we were preventing circular dependencies by looking up the service before adding it as an injection for future-initialized services. This works, but it means that the order of service injection is important, and we cannot have two services auto-injected into each other.

This commit takes a different approach. It removes the `lookup`, and instead adds a dummy injection which prevents the service being injected into itself during initialization. This allows us to have circular auto-imports, without breaking the injection resolver by injecting a service into itself.
2022-08-02 20:16:11 +01:00
David Taylor 58defe7169
DEV: Move all resolver deprecations into `resolver.js` (#17757)
Having them all in one place is much easier to reason with. It also means we can handle them without needing 'fake' registrations (which can sometimes cause odd behavior). This commit just moves the deprecation logic - it does not introduce any new deprecations.
2022-08-02 17:05:02 +01:00
David Taylor 4bf9b73296
DEV: Ensure `censorFn` copes with null `regexpList` (#17754)
This fixes the test suite failures introduced by 862007fb18
2022-08-02 11:09:51 +01:00
Arpit Jalan d3e8442937
DEV: add test for wizard last step and some minor optimizations (#17752) 2022-08-02 14:13:25 +05:30
Selase Krakani 862007fb18
FEATURE: Add support for case-sensitive Watched Words (#17445)
* FEATURE: Add case-sensitivity flag to watched_words

Currently, all watched words are matched case-insensitively. This flag
allows a watched word to be flagged for case-sensitive matching.
To allow allow for backwards compatibility the flag is set to false by
default.

* FEATURE: Support case-sensitive creation of Watched Words via API

Extend admin creation and upload of Watched Words to support case
sensitive flag. This lays the ground work for supporting
case-insensitive matching of Watched Words.

Support for an extra column has also been introduced for the Watched
Words upload CSV file. The new column structure is as follows:

 word,replacement,case_sentive

* FEATURE: Enable case-sensitive matching of Watched Words

WordWatcher's word_matcher_regexp now returns a list of regular
expressions instead of one case-insensitive regular expression.

With the ability to flag a Watched Word as case-sensitive, an action
can have words of both sensitivities.This makes the use of the global
Regexp::IGNORECASE flag added to all words problematic.

To get around platform limitations around the use of subexpression level
switches/flags, a list of regular expressions is returned instead, one for each
case sensitivity.

Word matching has also been updated to use this list of regular expressions
instead of one.

* FEATURE: Use case-sensitive regular expressions for Watched Words

Update Watched Words regular expressions matching and processing to handle
the extra metadata which comes along with the introduction of
case-sensitive Watched Words.

This allows case-sensitive Watched Words to matched as such.

* DEV: Simplify type casting of case-sensitive flag from uploads

Use builtin semantics instead of a custom method for converting
string case flags in uploaded Watched Words to boolean.

* UX: Add case-sensitivity details to Admin Watched Words UI

Update Watched Word form to include a toggle for case-sensitivity.
This also adds support for, case-sensitive testing and matching of  Watched Word
in the admin UI.

* DEV: Code improvements from review feedback

 - Extract watched word regex creation out to a utility function
 - Make JS array presence check more explicit and readable

* DEV: Extract Watched Word regex creation to utility function

Clean-up work from review feedback. Reduce code duplication.

* DEV: Rename word_matcher_regexp to word_matcher_regexp_list

Since a list is returned now instead of a single regular expression,
change `word_matcher_regexp` to `word_matcher_regexp_list` to better communicate
this change.

* DEV:  Incorporate WordWatcher updates from upstream

Resolve conflicts and ensure apply_to_text does not remove non-word characters in matches
that aren't at the beginning of the line.
2022-08-02 10:06:03 +02:00
Alan Guo Xiang Tan df264e49a9
DEV: Supports href attribute for hamburger links API bridge to sidebar (#17750)
In the old `decorateWidget("hamburger-menu:generalLinks", callbackFn)`
API, the return value of the callback function can either return a
`route` or `href`. The API bridge added in
de54bdd73d supported `route` but not `href` and
hence the need for this commit.
2022-08-02 15:30:13 +08:00
Pixlz b9c1e63bd1
UX: Change unrelated icon in the CTA Signup prompt (#17732) 2022-08-02 13:27:18 +08:00
David Taylor 5d6694ac4f
DEV: Remove duplicate getter from category-section-link (#17705) 2022-08-02 13:26:36 +08:00
Alan Guo Xiang Tan f204538f7c
UX: Remove count from more section links (#17747)
Less is more...
2022-08-02 11:20:55 +08:00
Arpit Jalan cfd0a04965
FIX: wizard last step "corporate" was not saving changes (#17739) 2022-08-01 14:49:09 +05:30
Joffrey JAFFEUX 6ce75d3824
DEV: dom clean should be cancelled on aborted transition (#17736) 2022-08-01 10:56:41 +02:00
Alan Guo Xiang Tan de54bdd73d
DEV: Add API bridge for custom hamburger menu links to sidebar (#17742)
The old hamburger menu widget was customizable via the
`api.decorateWidget("hamburger-menu:generalLinks")` plugin API. As the
hamburger menu is going to be replaced by the sidebar dropdown, we need
a way to smoothly transit plugins and theme components to the new
sidebar. This commit makes a best effort attempt to bridge
`api.decorateWidget` with `api.addCommunitySectionLink`. If an error is
encountered, a deprecation notice is logged.
2022-08-01 16:45:09 +08:00
David Taylor 9534f13256
DEV: Replace `site-settings:main` with `service:site-settings` (#17734)
This will allow consumers to inject it using `siteSettings: service()` in preparation for the removal of implicit injections in Ember 4.0. `site-settings:main` is still available and will print a deprecation notice.
2022-08-01 09:43:33 +01:00
Alan Guo Xiang Tan ad6b5825bf
DEV: `addTopicsSectionLink` -> `addCommunitySectionLink` plugin api (#17740) 2022-08-01 15:19:52 +08:00
Krzysztof Kotlarek af912b4b0e
DEV: Experimental scroll sidebar to specific element event handler (#17727) 2022-08-01 12:39:00 +08:00
Kris 2743339a7e
UX: adjust sidebar margin to avoid composer height (#17731) 2022-08-01 11:02:11 +08:00
Kris c97bfa1c44
UX: Add the TOS disclaimer to the invite signup (#17717) 2022-07-29 12:04:36 -04:00
Angus McLeod 867929d843
DEV: Add topic title suffix outlet (#17647) 2022-07-29 11:07:28 -04:00
Alan Guo Xiang Tan c9a3aba5a2
DEV: Use toggle event for sidebar more-section-links component (#17729)
A click event is trigger on a link click as well which is not what we
want. This caused the links to trigger a full reload instead of an Ember
transition for some reason.
2022-07-29 13:09:32 +08:00
Alan Guo Xiang Tan a6e815f243
UX: Only set user bookmarks loading state when loading (#17728)
Follow-up to 6bb77d3055
2022-07-29 13:11:01 +10:00
Martin Brennan 6bb77d3055
FIX: Show bookmarks loading spinner correctly (#17726)
There was a minor issue where the bookmark loading
spinner would not show correctly because of how
the route was handling the setting of loading,
this fixes the issue.
2022-07-29 12:31:53 +10:00
Jarek Radosz 6849775a2d
Revert "DEV: Minor topic-tracking-state refactor (#17707)" (#17724)
This reverts commit 8d613e0b85.
2022-07-29 09:36:14 +10:00
David Taylor 497d9849d3
FIX: Ensure all public topic-query options can be used via Ember (#17706) 2022-07-29 09:03:53 +10:00
Jarek Radosz 8d613e0b85
DEV: Minor topic-tracking-state refactor (#17707)
* Use `Set` instead of `Array` for `this.newIncoming`
* Remove `isUnseen()`
* Use array spread instead of `Array.from()`
* Don't use `@on()`
* Fix typos
* Make sure `this.incomingCount` is always a Number
2022-07-28 23:46:30 +02:00
Andrei Prigorshnev 2cb97d8de4
FEATURE: show user status on the user profile page (#17712) 2022-07-28 21:12:48 +04:00
Andrei Prigorshnev 023835cdad
DEV: a new `d-tooltip` component (#17513) 2022-07-28 18:33:20 +04:00
Alan Guo Xiang Tan 9efeaf2ae3
UX: Reduce number of links displayed in Community by default (#17703)
Additional links are hidden by default and can be accessed via the
"more..." link.
2022-07-28 16:46:46 +08:00
Osama Sayegh 988a175e94
DEV: Add reviewables tab to the new user menu (#17630)
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
2022-07-28 11:16:33 +03:00
David Taylor d3751c70c9
FIX: Ensure error handlers render correctly without preload_json (#17696)
Some errors (e.g. InvalidAccess) are rendered with `include_ember: true`. Booting the ember app requires that the 'preload' data is rendered in the HTML.

If a particular route was configured to `skip_before_action :preload_json`, and then went on to raise an InvalidAccess error, then we'd attempt to render the Ember app without the preload json. This led to a blank screen and a client-side error.

This commit ensures that error pages will fallback to the no_ember view if there is no preload data. It also adds a sanity check in `discourse-bootstrap` so that it's easier for us to identify similar errors in future.
2022-07-27 22:29:13 +01:00
Jarek Radosz 7980c41832
DEV: Fix fake-timer issues (#17681)
Occasionally some code (e.g. live-reload) would try to clear a timer that was set up before fake timers were installed. That would lead to issues and warnings. Enabling `shouldClearNativeTimers` option fixes it.
2022-07-27 22:54:22 +02:00
chapoi 47e664e3b1
UX: copy change (#17690) 2022-07-27 18:55:24 +02:00
David Taylor 96abd72387
DEV: Replace `message-bus:main` with `service:message-bus` (#17691)
This will allow consumers to inject it using `messageBus: service()` in preparation for the removal of implicit injections in Ember 4.0. `message-bus:main` is still available and will print a deprecation notice.

The MessageBus library is not en ember object, and doesn't need access to any of our injections. Therefore, we can set up a simple class which defines itself as a 'Service Factory', and returns the MessageBus library in the `create` method.
2022-07-27 17:15:58 +01:00
David Taylor a00b5a6aca
DEV: Convert pm-topic-tracking-state to Ember Service (#17688)
This will allow consumers to inject it using `pmTopicTrackingState: service()` in preparation for the removal of implicit injections in Ember 4.0. `pm-topic-tracking-state:main` is still available and will print a deprecation notice.
2022-07-27 13:00:43 +01:00
David Taylor 51957c07f1
DEV: Convert `key-value-store:main` to `service:key-value-store` (#17676)
This will allow consumers to inject it using `keyValueStore: service()` in preparation for the removal of implicit injections in Ember 4.0. `key-value-store:main` is still available and will print a deprecation notice.

To make this conversion possible, we have to bypass the `app.inject` logic which blocks injecting services into services. This is not ideal, but there is no other way for us to do this in a way that is backwards-compatible, and will still print a useful deprecation message when we eventually turn on the implicit-injections deprecation notice.
2022-07-27 11:38:33 +01:00
Joffrey JAFFEUX 9a55c9c433
DEV: fully rely on resize observer for resizing (#17685)
Not only is the current code not needed but it's also creating invalid values on safari if the header goes out of viewport with negative values.

This commit also adds a missing test for `--header-offset` property.
2022-07-27 11:32:42 +02:00
Krzysztof Kotlarek fd6fabc83c
DEV: remove sidebar outlet (#17683)
That outlet was a temporary solution and is not used anymore
2022-07-27 16:42:34 +08:00
Alan Guo Xiang Tan c787254427
DEV: Remove code that is no longer used (#17684) 2022-07-27 16:42:16 +08:00
Alan Guo Xiang Tan 3682513475
FIX: Sidebar is always disabled on wizard route (#17682) 2022-07-27 15:17:20 +08:00
Alan Guo Xiang Tan 3bd5f2d411
DEV: Introduce SiteSetting to enable/disable Sidebar. (#17662)
This commit removes the ability to enable/disable the Sidebar on a per
user basis and introduces a site wide setting. For testing purposes, sidebar can be enabled/disabled via the `enable_sidebar=1` or `enable_sidebar=0` query param.
2022-07-27 13:42:26 +08:00
Arpit Jalan 10f200a5d3
FEATURE: revamped wizard (#17477)
* FEATURE: revamped wizard

* UX: Wizard redesign (#17381)

* UX: Step 1-2

* swap out images

* UX: Finalize all steps

* UX: mobile

* UX: Fix test

* more test

* DEV: remove unneeded wizard components

* DEV: fix wizard tests

* DEV: update rails tests for new wizard

* Remove empty hbs files that were created because of rebase

* Fixes for rebase

* Fix wizard image link

* More rebase fixes

* Fix rails tests

* FIX: Update preview for new color schemes: (#17481)

* UX: make layout more responsive, update images

* fix typo

* DEV: move discourse logo svg to template only component

* DEV: formatting improvements

* Remove unneeded files

* Add tests for privacy step

* Fix banner image height for step "ready"

Co-authored-by: Jordan Vidrine <30537603+jordanvidrine@users.noreply.github.com>
Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2022-07-27 06:53:01 +05:30
David Taylor 6146a9b448
FIX: Ensure uploads work when the user's browser rewrites ellipsis (#17671)
https://meta.discourse.org/t/cannot-upload-images-with-safari/232563
2022-07-26 21:43:39 +01:00
Penar Musaraj 7592754c90
FIX: Allow users to quote in closed topics (#17645)
Previously, non-staff users could only quote if they had an open composer.

This change shows the quote control when selecting text in closed topics
at all times and if the composer isn't already open, it will default to
creating a linked topic.
2022-07-26 15:45:34 -04:00
Kris b5c1132546
UX: add bulk-select to mobile topic lists (#15386) 2022-07-26 15:36:35 -04:00
David Taylor 3960ba6588
FIX: Ensure admin templates are not used for non-admin controllers (#17667)
Previously, if a non-admin controller did not have a template defined, then the resolver would return an admin template with the same name. This is not the desired behavior, and regressed in fc36ac6cde. However, we *do* want this behavior for components defined in the admin bundle (because admin components are not namespaced).

This was noticed because the non-admin `badges` route was using the `admin/badges` template

This commit fixes the behavior, and adds a tests for these cases.
2022-07-26 17:03:49 +01:00
Bianca Nenciu 171789f47a
FIX: Make sure user list is complete and sorted (#17616)
Sometimes the user list was incomplete when multiple requests were
created to fetch next pages. If the responses did not arrive in the
same order as the requests then only the last response was parsed.

This is a follow up commit to a0f4c7fe88.
2022-07-26 17:54:52 +03:00
Andrei Prigorshnev 47917c0be4
FIX: make sure every user instance has correct status tracking counter 2022-07-26 18:42:55 +04:00
David Taylor fccbe5c604
UX: Replace site-settings link with "Admin" link in sidebar (#17665)
The main landing page for admins/mods should be the admin Dashboard, not the site settings. Having a "Settings" link can be confused with user settings.

This commit also displays the button for moderators, who are also allowed access to parts of the admin dashboard)
2022-07-26 14:46:33 +01:00
Andrei Prigorshnev 517e2f7dc4
FIX: handle correctly the case when several subscribers call trackStatus() on the user model (#17497) 2022-07-26 15:28:26 +04:00
David Taylor 17e733b6a8
DEV: Add optional timezone support to date-time-input-range (#17654)
This allows consumers to pass in, and receive, timestamps for a different timezone. Previously, attempting this would lead to very strange behavior which would become worse the further the input timestamp's timezone was from the browser's timezone.

The default behavior is unchanged - the browser's timezone will be assumed.
2022-07-26 11:14:22 +01:00
Krzysztof Kotlarek 3bfc254c4e
FIX: correct mention paths in fixtures (#17660)
Our mention path are `/u/:username` and not `/users/:username`. Test fixtures should have those values correct as well.
2022-07-26 10:09:05 +08:00
Jean 424a274c12
FEATURE: add categories page style to order topics by created date (#17500) 2022-07-25 09:41:43 -04:00
Osama Sayegh 9103081eb7
DEV: Add likes, mentions and replies tabs to the new user menu (#17623)
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
2022-07-25 15:19:53 +03:00
Joffrey JAFFEUX 43b8cfeae3
FIX: improves handling of filter with invalid tag chars (#17640)
Tags mixin is already filtering a lot of data from the user submitted filter in `createContentFromInput()` which can lead to sk receiving an empty filter while the input actually has a value.
2022-07-25 12:00:52 +02:00
Alan Guo Xiang Tan 1dff3ad79d
FIX: Title for keyboard shortcuts button in sidebar (#17638) 2022-07-25 15:47:39 +08:00
Alan Guo Xiang Tan 07424b9bb6
UX: Docking/undocking sidebar toggles sidebar hamburger dropdown (#17636)
Before this change, undocking the sidebar would just hide the sidebar
from the screen which led people to complain that they "lost" their
sidebar and had to "find" it. With this change, we automatically display
the sidebar hamburger dropdown when you undock the sidebar. Like wise
when the sidebar is docked, the sidebar hamburger dropdown is
automatically collapsed.
2022-07-25 14:45:16 +08:00
Krzysztof Kotlarek 228c14479b
DEV: expose decorateUsername function (#17637)
Expose `decorateUsername` function to make it usable in controllers or plugin initializers.
2022-07-25 14:43:54 +08:00
Jarek Radosz 10fa1cafb1
DEV: Remove yet another jQ use in tests (#17628) 2022-07-25 02:32:04 +02:00
Jarek Radosz b179fb98b1
DEV: Consistently use `response` helper (#17627) 2022-07-25 02:31:52 +02:00
Jarek Radosz 6cae26c499
DEV: Always `await` for `publishToMessageBus` (#17626)
(+ typos)
2022-07-24 19:55:58 +02:00
Jarek Radosz ff16ba1fc0
DEV: Update `@embroider/test-setup` (#17625) 2022-07-24 17:29:21 +02:00
Alan Guo Xiang Tan 49d4f7c066
FEATURE: Add users and groups links to community section in sidebar (#17609) 2022-07-22 16:00:06 +08:00
Alan Guo Xiang Tan a626b99a50
UX: Remove bookmarks link from community section (#17608)
Product decision to drop it from Sidebar at this moment.
2022-07-22 15:55:13 +08:00
Alan Guo Xiang Tan 4594ce2723
UX: Rename Sidebar 'Topics' section to 'Community' (#17605)
Product decision to rename as not all links under the section falls
under the topics umbrella
2022-07-22 15:20:01 +08:00
Alan Guo Xiang Tan 99073338de
FEATURE: Replace hamburger dropdown with Sidebar when undock (#17600)
When the experimental Sidebar is enabled, the hamburger drop down is replaced by a sidebar drop down. A user is given the ability to dock and undock the sidebar depending on their personal preference.

Do also note that the experimental sidebar is well, considered experimental at this point so I do not intend for the features here to be perfect. What I aim to do here is to ship the changes fast so that it can be used internally by the team to provide feedback. Custom links added by plugins and dark mode toggle has not been implemented as part of this commit as I aim to tackle it in another commit.

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2022-07-22 13:06:47 +08:00
Alan Guo Xiang Tan 71eb8d2e8e
DEV: Support models argument for custom sidebar section link API (#17602)
* DEV: Improve documentation for custom sidebar section interfaces

* DEV: Improvements to sidebar custom section plugin API tests

* DEV: Support models argument for custom sidebar section link API
2022-07-22 12:06:21 +08:00
Alan Guo Xiang Tan ad7d72cea7
DEV: Remove reference to discourse chat in core (#17601) 2022-07-22 11:15:43 +08:00
Osama Sayegh 6b8d635943
DEV: Add implementations for various notification types for the new user menu (#17589)
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
2022-07-22 05:07:32 +03:00
David Taylor 98bacbd2c6
DEV: Use `RenderGlimmer` for experimental user menu (#17597)
`RenderGlimmer` means we can now drop the classic-component wrapper. The old `didInsertElement` hook is reimplemented via the `did-insert` modifier.
2022-07-21 19:38:07 +01:00
David Taylor 6c5efb61c9
DEV: Introduce `RenderGlimmer` helper for use in widgets (#17592)
This allows an arbitrary Glimmer template to be rendered inside a Widget. That template can include any kind content, including Classic Ember components and Glimmer components. This leans on Ember's official `{{#in-element}}` helper which means that all component lifecycle hooks are called correctly.

This is a modern replacement for our existing `ComponentConnector` implementation. We'll deprecate `ComponentConnector` in the near future.

Example usage:

```javascript
// (inside an existing widget)
html(){
  return [
    new RenderGlimmer(
      this,
      "div.my-wrapper-class",
      hbs`<MyComponent @arg1={{@data.arg1}} />`,
      {
        arg1: "some argument value"
      }
    ),
  ]
}
```

See `widgets/render-glimmer.js` for documentation, and `render-glimmer-test` for more example uses.
2022-07-21 18:58:52 +01:00
David Taylor 327dd0beb3
DEV: Install `ember-modifier` and `@ember/render-modifiers` (#17595)
`ember-modifier` provides APIs to write our own modifiers. `@ember/render-modifiers` provides some simple `did-insert`, `did-update` and `will-destroy` modifiers.

Upcoming `ember-modifier` deprecations have been set to 'throw' in our deprecation-workflow config to ensure we don't accidently start using deprecated behaviour.
2022-07-21 18:12:29 +01:00
Jarek Radosz cb40e4c322
DEV: Use a separate KVS namespace for tests (#17591) 2022-07-21 15:27:24 +02:00
Jarek Radosz 331874229e
DEV: Fix pretender leaking request handlers (#17584) 2022-07-21 11:28:08 +02:00
Jarek Radosz e509c54b4c
DEV: Randomize tests order in more cases (#17588)
Previously it would randomize the order only when running tests:

1 .through ember-exam
2. in browser, with no params

Running just core tests, or just plugins, or a single plugin, or with filter, etc. disabled randomization.

Now all those cases are covered.
2022-07-21 03:50:32 +02:00
Bianca Nenciu 7a668460e0
FIX: Make group members bulk operations consistent (#17561)
This commit improves several parts of the group members bulk operation.
It fixes the bug that did not show the menu button when the Select all
button was clicked. The other changes make the behavior more consistent
with topic list bulk operations.
2022-07-20 16:54:21 +03:00
Krzysztof Kotlarek 8dd0f8a712
FIX: pass sidebar custom link willDestroy (#17565)
Custom sidebar link willDestroy function has to be passed to SidebarLink component to call when component is removed.

Very similar to https://github.com/discourse/discourse/pull/17551
2022-07-20 13:44:13 +10:00
Jarek Radosz a4e5bd272a
DEV: Make `publishToMessageBus()` wait for settled (#17575)
So you can just `await publishToMessageBus()` instead of following it with `await settled()` every time.
2022-07-19 22:59:52 +02:00
David Taylor 2159637e4d
FIX: Ensure injections are skipped when rehydrating stale models (#17574)
This was causing an error when opening the experimental user menu for the second time in a session

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-07-19 21:53:32 +01:00
Andrei Prigorshnev 7f112ffd4e
FIX: When a user status update received other users statuses were getting cleared (#17520) 2022-07-19 21:18:51 +04:00
Jarek Radosz 326643d08a
FIX: `isExistingIconId()` regressed in #17553 (#17570)
I missed a single `?` character 😔
2022-07-19 15:32:26 +02:00
Jarek Radosz 06135f3069
DEV: De-jQ click-track (#17539) 2022-07-19 13:45:20 +02:00
Jarek Radosz 0948a59c3f
DEV: Update all `uppy` deps (#17542) 2022-07-19 13:05:07 +02:00
Jarek Radosz 59a07e3007
FIX: Correctly invoke dynamic components by name (#17568) 2022-07-19 11:52:32 +02:00
David Taylor 897de60330 DEV: Set owner for raw views
Plugins/themes use injections in their raw view class. On recent versions of Ember these were failing with 'Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.'
2022-07-19 10:00:59 +01:00
David Taylor 20fd81c2dc DEV: Silence 3.x deprecations
This prevents a storm of deprecation messages in the developer console. We'll be working through and enabling these one-by-one over the coming weeks/months.

A dummy `discourse-ensure-deprecation-order` package is introduced to ensure that deprecation-workflow is loaded before `@ember/jquery`. This ensures that the `@ember/jquery`-triggered deprecation warnings can be silenced correctly

This also introduces a system for silencing CLI warnings.
2022-07-19 10:00:59 +01:00
Peter Wagenet 0ac90abcfa DEV: Remove rfc176-shims
Ember has now migrated to the new module layout, so these shims are no longer required
2022-07-19 10:00:59 +01:00
David Taylor 13bc2f1f39 DEV: Upgrade to Ember 3.28 2022-07-19 10:00:59 +01:00
Alan Guo Xiang Tan 086fb6d6cf
DEV: Refactor sidebar components to prepare for integration into hamburger dropdown (#17566) 2022-07-19 14:37:07 +08:00
Martin Brennan a1a960caba
DEV: Add empty array to ignored_users for currentUser fixture (#17564) 2022-07-19 15:27:07 +10:00
Osama Sayegh fac04f3e73
DEV: Introduce a basic version of the new notifications menu behind a feature flag (#17492) 2022-07-19 10:35:02 +08:00
Jarek Radosz 9028df0fda
DEV: Use `includes()` instead of `indexOf() >= 0` (#17553)
Missed those cases in #17541
2022-07-19 10:27:40 +08:00
Jarek Radosz 0db6ae1e1f
DEV: Fix typos and other spell-checker warnings (#17554) 2022-07-19 10:27:10 +08:00
Andrei Prigorshnev 48e2caf7b7
DEV: emoji helper: add the ability to set custom title (#17517) 2022-07-18 21:51:19 +04:00
Kris e57485370f
UX: plus icon for sidebar messages section header (#17558) 2022-07-18 12:54:23 -04:00
Bianca Nenciu 9e603e9374
COPY: Change "old" to "unsupported" browser (#17555)
The word choice was inaccurate because new browsers may still not work
well with Discourse because not all required browser features are
present.
2022-07-18 19:32:04 +03:00
Joffrey JAFFEUX c94a011d9f
FIX: prevents multi-select to use noneItem for its list (#17523) 2022-07-18 11:26:12 +02:00
David Taylor fab1c00c8f
DEV: Drop the deprecated `themeSettings.blah` syntax (#17394)
This syntax has been printing deprecation messages since 880311dd4d
2022-07-18 10:10:23 +01:00
Joffrey JAFFEUX ab05d931a0
DEV: updates popper to 2.11.5 (#17522)
This commit also removes a modifier used in select-kit which was causing issues with this update and doesn’t appear to be needed anymore.
2022-07-18 11:06:19 +02:00
Krzysztof Kotlarek 7230b0d436
FIX: pass custom section willDestroy (#17551)
Custom sections `willDestroy` function has to be passed to SidebarSection component  to call when component is removed.
2022-07-18 15:46:49 +10:00
Alan Guo Xiang Tan fe6ec28228
DEV: Custom section in Sidebar should implement own willDestory hook (#17550)
No need for us to specify our custom teardown hook when Sidebar
component is destroyed when each custom section link is expected to be
its own component and can implement its own `willDestory` hook.
2022-07-18 12:57:14 +08:00
Alan Guo Xiang Tan 0d72a8c458
FEATURE: API for sidebar (#17296)
This plugin API can be used to add to sections and links to sidebar
2022-07-18 14:03:37 +10:00
Alan Guo Xiang Tan 54e63b3d31
Revert "UX: Remove experimental sidebar notification text (#17290)" (#17548)
This reverts commit 4df683f88d.

We've decided to bring back the words for counts in the experimental sidebar.
2022-07-18 10:34:22 +08:00
Jarek Radosz a0a0f6f37c
DEV: Run screen-track `run` in a runloop, drop jQ (#17545) 2022-07-18 00:27:29 +02:00
Jarek Radosz 070b1cbed6
DEV: Don't double inject in `screen-track` (#17543)
1. Injecting `appEvents` service into `screen-track` was unnecessary as it's already injected into all services (and was causing an assertion error)
2. Return a promise from `sendNextConsolidatedTiming()` (no need for `await settled()` then)
2022-07-17 23:44:20 +02:00
Jarek Radosz 1ccabe62d6
DEV: Move emoji-store test to the correct dir (#17544) 2022-07-17 23:44:10 +02:00
Jarek Radosz 057d6b406d
DEV: Extensively use `includes()` (#17541)
Also, the change in insert-hyperlink (from `this.linkUrl.indexOf("http") === -1` to `!this.linkUrl.startsWith("http")`) was intentional fix: we don't want to prevent users from looking up topics with http in their titles.
2022-07-17 20:48:36 +02:00
Jarek Radosz 5f7163b5bb
DEV: Extensively use `startsWith()` (#17540) 2022-07-17 20:16:39 +02:00
Jarek Radosz 1c8d461ecc
DEV: Remove unnecessary `visit()` calls (#17536) 2022-07-17 20:15:44 +02:00
Jarek Radosz c3f7a45821
DEV: Use key names in triggerKeyEvent (#17535) 2022-07-17 20:15:28 +02:00
Jarek Radosz 5538b8442e
DEV: Introduce `discourseLater` (#17532)
A wrapper for `later()` from `@ember/runloop`, similar to `discourseDebounce`. It automatically reduces the delay in testing environment.
2022-07-17 00:50:49 +02:00
Jarek Radosz 5707431981
DEV: Don't await for updateCurrentUser (#17534)
It doesn't return Promises.
2022-07-17 00:21:12 +02:00
Jarek Radosz 39c35ee47d
DEV: Clear tagsHtmlCallbacks after each test (#17530)
Fixes leakage between tests
2022-07-16 23:24:13 +02:00
Jarek Radosz 343b8dd7aa
DEV: One more de-jQueryfied test (#17528)
Forgot to save this file when doing #17474 😅
2022-07-16 22:57:43 +02:00
Jarek Radosz facca3f46c
DEV: We already restore sinon after each test (#17529) 2022-07-16 22:57:33 +02:00
Jarek Radosz 751a5e1430
DEV: Clear clearToolbarCallbacks after each test (#17531)
Fixes leakage between tests. Have a composer toolbar with a 100 "Add emoji" buttons? I gotchu.
2022-07-16 22:57:08 +02:00
Jarek Radosz 1b4dea75ee
DEV: Also reset horizontal scroll after each test (#17527)
🤞 maybe this will cover the remaining out-of-viewport flakes
2022-07-16 22:56:19 +02:00
Joffrey JAFFEUX 0760b249ff
DEV: introduces {{concat-class}} helper (#17526)
Usage:

```
<button class={{concat-class "foo" this.bar (if true "baz")}} />
```
2022-07-16 14:09:54 +02:00
chapoi ddd9d9b620
UX: remove .btn-default from admin btn (#17515) 2022-07-15 22:09:48 +02:00
Jarek Radosz 7cf95e6339
DEV: Check if screen-track was destroyed (#17509)
This error is swallowed by `.catch()` but it's an error nonetheless.
2022-07-15 13:35:31 +02:00
Alan Guo Xiang Tan 8ddca5998c
DEV: Fix state leak in QUnit acceptance tests (#17507)
Follow-up to 0525455ef6
2022-07-15 16:51:15 +10:00