Commit Graph

16300 Commits

Author SHA1 Message Date
David Taylor be3d6a56ce
DEV: Introduce minification and source maps for Theme JS (#18646)
Theme javascript is now minified using Terser, just like our core/plugin JS bundles. This reduces the amount of data sent over the network.

This commit also introduces sourcemaps for theme JS. Browser developer tools will now be able show each source file separately when browsing, and also in backtraces.

For theme test JS, the sourcemap is inlined for simplicity. Network load is not a concern for tests.
2022-10-18 18:20:10 +01:00
Keegan George e23b247690
UX: Fix alt text cancel button in dark mode (#18644) 2022-10-18 09:40:29 -07:00
David Taylor f7fdaa97d1
DEV: Replace mini-loader with Ember's `loader.js` library (#18643)
We already have this as a dependency, so it makes sense to use it rather than using our own not-quite-spec-compliant implementation
2022-10-18 14:53:06 +01:00
Jarek Radosz b6297f5dd4
DEV: Remove the router testing hack (#18640)
Doesn't seem to be needed anymore (and it doesn't work anymore with some stuff I'm updating)
2022-10-18 14:34:33 +02:00
David Taylor cb87067c77 DEV: Introduce support for template colocation in themes 2022-10-18 10:10:49 +01:00
Martin Brennan 9879cb0e68
FIX: Clarify security key copy (#18636)
In user preferences, we want to make it more obvious
that a security key is a physical device, and also
you can use your phone.
2022-10-18 16:30:48 +10:00
Krzysztof Kotlarek 243efa8931
FEATURE: allow user to set preferred sidebar list destination (#18594)
User can choose between latest or new/unread and that preference will affect behavior of sidebar links.
2022-10-18 13:21:52 +11:00
Jordan Vidrine daa8aedccf
Revert "UX: Simplify bootstrap mode visuals (#18626)" (#18638)
This reverts commit 868ab26fb3.
2022-10-18 13:19:15 +11:00
Jordan Vidrine a6d5b82886
Revert "UX: Change button to grey (#18635)" (#18637)
This reverts commit 0fe9095bad.
2022-10-18 13:18:11 +11:00
Keegan George 4907b7fa1d
DEV: Listen for escape key on hamburger & user menu (#18629) 2022-10-18 09:36:18 +08:00
Keegan George b8fcf1932e
A11Y: Bookmarks modal (#18630)
* A11Y: Add label to delete button

* A11Y: Add title attribute to options button
2022-10-18 09:34:02 +08:00
dependabot[bot] 7881a6bd2f
Build(deps): Bump qunit from 2.19.1 to 2.19.2 in /app/assets/javascripts (#18631)
Bumps [qunit](https://github.com/qunitjs/qunit) from 2.19.1 to 2.19.2.
- [Release notes](https://github.com/qunitjs/qunit/releases)
- [Changelog](https://github.com/qunitjs/qunit/blob/main/History.md)
- [Commits](https://github.com/qunitjs/qunit/compare/2.19.1...2.19.2)

---
updated-dependencies:
- dependency-name: qunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 09:33:39 +08:00
Jordan Vidrine 0fe9095bad
UX: Change button to grey (#18635) 2022-10-18 09:01:16 +08:00
Jordan Vidrine 868ab26fb3
UX: Simplify bootstrap mode visuals (#18626) 2022-10-17 16:44:30 -05:00
Keegan George de9ed8792a
A11Y: Add `href` to frequent poster avatars (#18627) 2022-10-17 14:08:59 -07:00
Keegan George 1b22ff461b
FIX: Prevent layout shift while traversing dropdown (#18624) 2022-10-17 11:40:03 -07:00
Jordan Vidrine 1d91b222da
UX: Welcome CTA edits (#18582) 2022-10-17 13:04:34 -05:00
David Taylor 731c625042
DEV: Ensure getter can always return without error (#18621)
Normally, arguments passed to components are lazily evaluated. `get prefixElementColors` will only be evaluated for `@prefixType="span"`. However, when using the Ember Inspector in development, arguments are eagerly evaluated and their values displayed in the inspector. Therefore we need to make sure that getters can always be evaluated without exceptions being thrown.
2022-10-17 15:10:17 +01:00
David Taylor f5419521f0
DEV: Support colocation of component templates in plugins (#18598)
This allows plugins to colocate component JS and HBS under `/plugins/{name}/assets/javascripts/discourse/components`.

`discourse-presence` is updated to use this new pattern, which also serves as an integration test for this part of the build pipeline.
2022-10-17 09:38:20 +01:00
David Taylor 7e372b3a15
DEV: Restrict resolver lookups to known namespaces (#18599)
Ember's default resolver only looks for components/services/etc. which are namespaced under the app's `modulePrefix` (`discourse`, in our case). To use addon components/services/etc., the addon must re-export them in its `app/` directory.

In order to support plugins, our custom resolver does a 'suffix match'. This has an unintended side-effect of matching things which are not part of the discourse app or themes/plugins. We've come to rely on this for a few in-repo addons like `select-kit`, `admin` and `wizard`.

This unrestricted 'suffix matching' can cause some very unexpected behaviour. For example, the ember-inspector browser extension has a module called `ember_debug/service/session`. When looking up `service:session`, our resolver was choosing that third-party service over our own Session service. This means Discourse fails to boot when the Ember Inspector is open.

This commit restricts the 'suffix matching' to a known set of namespaces. This brings us one step closer to the default Ember Resolver implementation, and reduces the chance of unexpected behaviour like the ember-inspector issue.

This commit also updates the `dialog-holder` addon to export its service under the app directory, so that we don't need to account for it in the resolver. We may want to consider doing the same for things like `select-kit` and `truth-helpers`, but is beyond the scope of this commit.
2022-10-17 09:33:52 +01:00
Alan Guo Xiang Tan fff575ffd2
FEATURE: Add sidebar link for admin to configure default tags (#18593)
Displays a sidebar section link to admin users when
`default_sidebar_tags` site setting has not been configured for the
site.

Internal Ref: /t/73500
2022-10-17 12:08:32 +08:00
Alan Guo Xiang Tan ae6549a6ea
FEATURE: Add sidebar link for admin to configure default categories (#18595)
Displays a sidebar section link to admin users when
`default_sidebar_categories` site setting has not been configured for the
site.

Internal Ref: /t/73500
2022-10-17 12:08:15 +08:00
dependabot[bot] 2bbacb69a7
Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618)
Bumps [ember-auto-import](https://github.com/ef4/ember-auto-import/tree/HEAD/packages/ember-auto-import) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/ef4/ember-auto-import/releases)
- [Changelog](https://github.com/ef4/ember-auto-import/blob/main/packages/ember-auto-import/CHANGELOG.md)
- [Commits](https://github.com/ef4/ember-auto-import/commits/v2.4.3/packages/ember-auto-import)

---
updated-dependencies:
- dependency-name: ember-auto-import
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-16 23:57:28 +02:00
Jarek Radosz bdd0a98f38
DEV: Fix testem output (#18609)
Failed tests list we're displaying at the end had incorrect ids. e.g

```
(…)
ok 2160 Chrome 106.0 - [54 ms] - Integration | Component | select-kit/category-drop: caretUpIcon
ok 2161 Chrome 106.0 - [20 ms] - Unit | Service | store: find embedded

Used JS Heap Size: 7.304GB

1..2161
# tests 2161
# pass  2152
# skip  7
# todo  0
# fail  2

Failures:

not ok 2162 Chrome 106.0 - [36 ms] - Acceptance: Unknown: Permalink URL to a static page
    ---
        actual: >
            null
        message: >
            Promise rejected during "Permalink URL to a static page": no no
        negative: >
            false
        browser log: |
    ...
not ok 2163 Chrome 106.0 - [238 ms] - Unit | Utility | text: parseAsync
    ---
        actual: >
            null
        message: >
            Promise rejected during "parseAsync": nope
        negative: >
            false
        browser log: |
    ...
Testem finished with non-zero exit code. Tests failed.
```
2022-10-16 19:38:20 +02:00
chapoi 7ed87979a2
UX: theme setting highlight update (#18607) 2022-10-15 15:29:37 -05:00
Roman Rizzi 588bb2ccf2
A11Y: Add more information to the "reply to" button label. (#18604)
Includes the post number and poster's username for screen readers.
2022-10-14 17:47:29 -03:00
Roman Rizzi 2933baa0ce
A11Y: Signal the toggle header can reorder table elements. (#18597)
While navigating the table, indicate what the button does and if the user pressed it or not. Also, don't lose focus after reordering elements.
2022-10-14 13:28:20 -03:00
Kris 6b4b279141
UX: horitzontal scroll controls for new user nav (#18583) 2022-10-14 09:32:02 -04:00
Jarek Radosz a5156d18ff
DEV: Modernize controller unit tests (#17412)
Aligns controller tests with the Ember standard, by using `module` and `setupTest` instead of our custom `discourseModule`)
2022-10-14 13:15:58 +02:00
Jarek Radosz 2c5e8f1763
DEV: Asyncify loadTopicView (#18585)
See https://github.com/discourse/discourse/pull/14838#issuecomment-1271935405 for details about `controllerReady` logic.

Co-authored-by: David Taylor <david@taylorhq.com>
2022-10-14 12:44:31 +02:00
Jean 7718ef97cc
DEV: add plugin connectors to the admin user lists table (#18590) 2022-10-13 22:32:48 -04:00
chapoi 92bfea2f2b
UX: hide keyboard shortcuts on mobile (#18575) 2022-10-14 09:26:21 +08:00
Penar Musaraj 78044ad2aa
A11Y: Trap focus on auth security modal (#18573) 2022-10-13 16:16:22 -04:00
Penar Musaraj c81763dcd8
A11Y: Make input popup errors keyboard-accessible (#18570)
Also sets focus to the nearest input when popups are dismissed.
2022-10-13 16:16:05 -04:00
Penar Musaraj 74a6a868d2
A11Y: Fix tab order in "Feature topic" modal (#18576)
Tab order acts strangely in Chrome when the last focusable element in a
modal is a radio group: it switches focus to the address bar. This is a
problem, because for keyboard users, it becomes very hard to return to
the previous context.

This PR adds a focusable "Cancel" button, whose mere presence fixes the
issue.
2022-10-13 16:15:45 -04:00
Jordan Vidrine 45f93ae75d
UX: Onboarding edits (#18581)
* UX: Adjust size of svg arrow

* UX: Refactor & style edits
2022-10-13 16:39:52 +03:00
Martin Brennan beaf009b4a
FIX: action_code_path not being loaded for user-stream-item (#18577)
This commit fixes an issue where we had a typo in the
UserAction.stream query which meant that action_code_path
was not loaded correctly. Once that was fixed, we were also
not actually using the action_code_path in the user-stream-item,
so that has been fixed here too.

The bug this caused was that, when the link for the action was
clicked within the user-stream-item, the user would be redirected
to a URL ending with `[missing%20%%7Bpath%7D%20value]` because
the I18n call did not have the path present.
2022-10-13 19:10:18 +10:00
Alan Guo Xiang Tan c16cb0e00b
FIX: Missing category badge for category with color stored as 3-digit hex code (#18579)
On the server side, the only limitation for `Category#color` is a length
limit of 6. Therefore, we cannot assume on the client side that the hex
code is always 6 digits.
2022-10-13 17:00:46 +08:00
Alan Guo Xiang Tan 7e94fa86d7
FIX: Category sidebar link not active when filtered by none and all (#18578) 2022-10-13 17:00:20 +08:00
Alan Guo Xiang Tan 940eb0ce4d
UX: Conditionally display sidebar tags section for user (#18558)
If a site has no default sidebar tags configured, show tags section if the user has personal sidebar tags configured.
Otherwise, hide the tags section from the sidebar for the user.

If a site has default sidebar tags configured, always display the tags section.
2022-10-13 09:52:25 +08:00
Alan Guo Xiang Tan 8e80f4c211
UX: Conditionally hide sidebar categories section for user (#18557)
If a site has no default sidebar categories configured:
  * Show categories section if user has categories configured
  * Hide categories section if user does not have categories configured

If a site has default sidebar categories configured:
  * Always show categories section
2022-10-13 09:18:39 +08:00
Alan Guo Xiang Tan deb0656b63
UX: Hide tags section in sidebar when user has no visible tags (#18539)
Also hides the tags configuration for sidebar under user preferences

Internal ref: /t/73500
2022-10-13 08:37:28 +08:00
Krzysztof Kotlarek 58e4b43fe4
FIX: replace prefixCSS with prefixElementColors (#18556)
Instead of having `prefixCSS`, only `prefixElementColors` are available to reduce chances of exposing XSS.
2022-10-13 09:01:19 +11:00
Andrei Prigorshnev 0fe111e492
FEATURE: add user status to user preferences (#18532) 2022-10-12 23:35:25 +04:00
Isaac Janzen 231dc10bbd
Add replaceContent selectKit modifier (#18569)
Add the ability to modify a selectKit's content with `replaceContent`

Eg.

```
      api.modifySelectKit("combo-box").replaceContent(() => {
        return {
          id: "foo",
          name: "Foo",
        };
      });
```

will override existing content to only include the passed object
2022-10-12 13:38:42 -05:00
Penar Musaraj d7c5a7033d
A11Y: Make "Load parent post" element accessible (#18568) 2022-10-12 14:35:31 -04:00
Andrei Prigorshnev 98620f8e0e
FIX: status emoji was shown on the left on mobile (#18567) 2022-10-12 20:54:24 +04:00
Bianca Nenciu 7611fec0da
FEATURE: Implement new onboarding popups (#18362)
This commit introduces a new framework for building user tutorials as
popups using the Tippy JS library. Currently, the new framework is used
to replace the old notification spotlight and tips and show a new one
related to the topic timeline.

All popups follow the same structure and have a title, a description and
two buttons for either dismissing just the current tip or all of them
at once.

The state of all seen popups is stored in a user option. Updating
skip_new_user_tips will automatically update the list of seen popups
accordingly.
2022-10-12 18:38:45 +03:00
Osama Sayegh 1eaa1fee2d
DEV: Merge mentions and watching tabs into the replies tab in the user menu (#18544)
This commit merges the mentions and "watching" tabs into the replies tab of the user menu. This change is kind of experimental, so we may change it back either fully or partially. Internal topic: t/76474.
2022-10-12 17:58:17 +03:00
Bianca Nenciu 33087f0bdf
A11Y: Set role=presentation if alt attr is missing (#18546)
This applies to all images posted that do not have a user description.
2022-10-12 14:07:37 +03:00
David Taylor c707ee714d
DEV: Use npm for forked backburner.js version (#18559)
Using a git-sourced package seems to cause intermittent `yarn install` failures.

Followup to ad37c6c017
2022-10-12 11:14:41 +01:00
David Taylor ad37c6c017
DEV: Update `backburner.js` to include bugfix and dev improvements (#18549)
This version of backburner is patched to include
- Fix for scheduleOnce/cancel bug: https://github.com/BackburnerJS/backburner.js/pull/402
- Async stack debugging in Chrome: https://github.com/BackburnerJS/backburner.js/pull/404

The async debugging feature is enabled only in debug builds of Discourse to ensure production performance is unaffected.

Adding to `vendorFiles` causes the JS to be inserted directly after the `ember-source` bundle. That means that the `backburner` module defined by ember-source will be replaced with the patched version.
2022-10-12 10:06:03 +01:00
Martin Brennan 84f2529138
FEATURE: Add contentCSSClass for sidebar section-link (#18555)
In some cases, like in the chat plugin for muted channels,
we want to change the style of the sidebar content text.
This adds a new contentCSSClass function to the
BaseCustomSidebarSectionLink class and uses it in both
sections and section-link to add the CSS class if it is
provided.
2022-10-12 12:42:15 +10:00
Krzysztof Kotlarek e5b306b13e
FIX: warning about sidebar prefix style (#18553)
New double color feature introduced warning about CSS. Related PR https://github.com/discourse/discourse/pull/18525
2022-10-12 08:55:47 +08:00
Kris 6d8405bbd0
UX: updated styles for user nav with sidebar (#18550) 2022-10-11 17:15:58 -04:00
Osama Sayegh ac9fbb56a4
DEV: Improve UX for user menu tabs when they're empty (#18520)
This commit adds more helpful/education messages that show up in the replies and "other notifications" tabs when they're empty. Internal topic: t/76879.
2022-10-11 18:33:09 +03:00
David Taylor f3e956a7a3
FIX: Staff action log 'show details' links (#18542)
Followup to 03b7b7d1bc
2022-10-11 12:17:36 +01:00
Alan Guo Xiang Tan b75dc04a25
UX: Hide tags section from anonymous user when site has no tags (#18538)
If there are no top tags that an anonymous user can see and the site do
not have default sidebar tags configured for anonymous users, hide the
tag section entirely.
2022-10-11 13:33:50 +08:00
Martin Brennan 472abe532e
DEV: Add experimental setting for hashtag-autocomplete changes (#18537)
This initial PR just adds a enable_experimental_hashtag_autocomplete
setting, and related JS & HBR files, replacing direct setup of
the autocomplete within d-editor and instead using the new
lib/hashtag-autocomplete. This is the beginning of preparations
to allow other data sources to be added to this autocomplete,
as well as a redesign of the menu and rendered tags in the composer
preview and posts.
2022-10-11 13:15:16 +10:00
Krzysztof Kotlarek b02ece0bbb
FEATURE: double color for subcategories prefix (#18525)
Subcategories should display color from parent category and subcategory to clearly indicate that it is a subcategory.
2022-10-11 10:27:06 +11:00
Bianca Nenciu dc89b72d46
FIX: Show error if field is same as password (#18529)
* FIX: Show user fields validation errors

* FIX: Show error if user field is same as password
2022-10-10 20:00:52 +03:00
Andrei Prigorshnev b06cc8a836
DEV: Decouple the user status modal from current user's status (#18514) 2022-10-10 17:45:21 +04:00
Alan Guo Xiang Tan b2a14eeb16
FIX: Ensure group inboxes in messages section is sorted by group name (#18508) 2022-10-10 14:47:55 +08:00
chapoi 7009f9c95e
UX: correct colour to nav instead of danger (#18515) 2022-10-08 01:06:20 +02:00
Andrei Prigorshnev ec65f3c1ad
DEV: Pass a status object to the user-status-picker instead of passing emoji + description (#18513) 2022-10-08 02:21:53 +04:00
David Taylor 26b9500983
DEV: Fix `bread-crumbs-right` `currentCategory` argument (#18491) 2022-10-07 19:34:28 +01:00
Penar Musaraj a1d67122b1
DEV: Refactor the last few bootbox dialogs (#18416) 2022-10-07 11:38:27 -04:00
Penar Musaraj 6426932834
UX: Default to dark category logo on dark schemes (#18510)
Fixes an edge case for when a category has a dark logo and the default
color scheme is dark.
2022-10-07 11:37:07 -04:00
Jarek Radosz d2d4749127
DEV: Asyncify `Composer.createPost()` (#18026)
I convert these Composer (and Topic) functions one by one because stuff do be breaking 😄

Moved the special pretender handler code from the global one to the tests that actually require it.
2022-10-07 17:25:15 +02:00
Jan Cernik 08476f17ff
FEATURE: Add dark mode option for category logos (#18460)
Adds a new upload field for a second dark mode category logo. 
This alternative will be used when the browser is in dark mode (similar to the global site setting for a dark logo).
2022-10-07 11:00:44 -04:00
Alan Guo Xiang Tan 14532ad425
DEV: Try out double nav for new experimental user page nav (#18495)
No tests and this redesign is still highly highly experimental
2022-10-07 12:20:39 +08:00
Martin Brennan cb26d52d33
DEV: Remvoe IMAGES_EXTENSIONS_REGEX const in lib/uploads (#18497)
This IMAGES_EXTENSIONS_REGEX const just creates redundancy
when we already have the `isImage` function -- the two can
easily get out of sync. Replace all usages of the former
with the latter.
2022-10-07 09:24:08 +10:00
dependabot[bot] 0059be6856
Build(deps): Bump ember-cached-decorator-polyfill (#18507)
Bumps [ember-cached-decorator-polyfill](https://github.com/ember-polyfills/ember-cached-decorator-polyfill) from 0.1.4 to 1.0.1.
- [Release notes](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/releases)
- [Changelog](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/compare/v0.1.4...v1.0.1)

---
updated-dependencies:
- dependency-name: ember-cached-decorator-polyfill
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 00:58:21 +02:00
chapoi bd61f877bb
FEATURE: new outlet topic-list-main-link-bottom added to mobile (#18505) 2022-10-06 23:51:32 +02:00
Keegan George 70d0892ac9
FIX: Arrive at topic must be hidden when `must_approve_users` (#18504) 2022-10-06 12:04:26 -07:00
Krzysztof Kotlarek d5f6262c4f
FIX: watched topic overcome muted category (#18480)
Previously, when categories were not muted by default, we were sending message about unmuted topics (topics which user explicitly set notification level to watching)

The same mechanism can be used to fix a bug. When the user was explicitly watching topic, but category was muted, then the user was not informed about new reply.
2022-10-06 11:10:43 +11:00
Alan Guo Xiang Tan 89ac01704e
DEV: Remove contextual topic list linking behaviour in sidebar (#18485)
The feedback we got here is that the contextual topic list link
behaviour is surprising and people prefer that the topic list sidebar
links always go to a consistent location.

Internal ref: /t/74666/16
2022-10-06 08:15:05 +11:00
Keegan George 15f192447b
FIX: Ability to trigger emoji after indented code block (#18478) 2022-10-05 10:33:08 -07:00
Dan Gebhardt 03b7b7d1bc
DEV: Remove usage of {{action}} modifiers - Take 2 (#18476)
This PR enables the [`no-action-modifiers`](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-action-modifiers.md) template lint rule and removes all usages of the `{{action}}` modifier in core.

In general, instances of `{{action "x"}}` have been replaced with `{{on "click" (action "x")}}`. 

In many cases, such as for `a` elements, we also need to prevent default event handling to avoid unwanted side effects. While the `{{action}}` modifier internally calls `event.preventDefault()`, we need to handle these cases more explicitly. For this purpose, this PR also adds the [ember-event-helpers](https://github.com/buschtoens/ember-event-helpers) dependency so we can use the `prevent-default` handler. For instance:

```
<a href {{on "click" (prevent-default (action "x"))}}>Do X</a>
```

Note that `action` has not in general been refactored away as a helper yet. In general, all event handlers should be methods on the corresponding component and referenced directly (e.g. `{{on "click" this.doSomething}}`). However, the `action` helper is used extensively throughout the codebase and often references methods in the `actions` hash on controllers or routes. Thus this refactor will also be extensive and probably deserves a separate PR.

Note: This work was done to complement #17767 by minimizing the potential impact of the `action` modifier override, which uses private API and arguably should be replaced with an AST transform.

This is a followup to #18333, which had to be reverted because it did not account for the default treatment of modifier keys by the {{action}} modifier.

Commits:
* Enable `no-action-modifiers` template lint rule
* Replace {{action "x"}} with {{on "click" (action "x")}}
* Remove unnecessary action helper usage
* Remove ctl+click tests for user-menu
   These tests now break in Chrome when used with addEventListener. As per the comment, they can probably be safely removed.
* Prevent default event handlers to avoid unwanted side effects
   Uses `event.preventDefault()` in event handlers to prevent default event handling. This had been done automatically by the `action` modifier, but is not always desirable or necessary.
* Restore UserCardContents#showUser action to avoid regression
   By keeping the `showUser` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showUser` argument that's been passed.
* Revert EditCategoryTab#selectTab -> EditCategoryTab#select
   Avoid potential breaking change in themes / plugins
* Restore GroupCardContents#showGroup action to avoid regression
   By keeping the `showGroup` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showGroup` argument that's been passed.
* Restore SecondFactorAddTotp#showSecondFactorKey action to avoid regression
   By keeping the `showSecondFactorKey` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showSecondFactorKey` property that's maintained on the controller.
* Refactor away from `actions` hash in ChooseMessage component
* Modernize EmojiPicker#onCategorySelection usage
* Modernize SearchResultEntry#logClick usage
* Modernize Discovery::Categories#showInserted usage
* Modernize Preferences::Account#resendConfirmationEmail usage
* Modernize MultiSelect::SelectedCategory#onSelectedNameClick usage
* Favor fn over action in SelectedChoice component
* Modernize WizardStep event handlers
* Favor fn over action usage in buttons
* Restore Login#forgotPassword action to avoid possible regression
* Introduce modKeysPressed utility
   Returns an array of modifier keys that are pressed during a given `MouseEvent` or `KeyboardEvent`.
* Don't interfere with click events on links with `href` values when modifier keys are pressed
2022-10-05 13:08:54 +01:00
Alan Guo Xiang Tan 2559c763ad
DEV: Fix message section link filters displaying icons (#18484)
Follow-up to c0037dc0f0
2022-10-05 17:59:50 +08:00
Osama Sayegh 4d05e3edab
DEV: Include pending reviewables in the main tab in the user menu (#18471)
This commit makes pending reviewables show up in the main tab (a.k.a. "all notifications" tab). Pending reviewables along with unread notifications are always shown first and they're sorted based on their creation date (most recent comes first).

The dismiss button currently only shows up if there are unread notifications and it doesn't dismiss pending reviewables. We may follow up with another change soon that allows makes the dismiss button work with reviewables and remove them from the list without taking any action on them. 

Follow-up to 079450c9e4.
2022-10-05 12:30:02 +03:00
Alan Guo Xiang Tan c0037dc0f0
FIX: Missing sidebar section link icon for PM tags (#18481)
No tests cause a missing icon regression is not the end of the world and
I don't feel like it will provide enough value as a regression test long
term.
2022-10-05 14:20:03 +08:00
Alan Guo Xiang Tan 637b1211b5
DEV: Convert experimental user page activity nav to horizontal nav (#18483)
As usual, design is still in flux so no tests for now.

Internal Ref: /t/67780/59
2022-10-05 14:19:46 +08:00
Natalie Tay 70258232f5
DEV: Add tests for review-index route (#18415)
Add tests for review-index route
2022-10-05 12:39:35 +08:00
Martin Brennan e3f1e0e9bc
DEV: Add displaySection to sidebar sections (#18479)
This PR renames the old Sidebar::Section displaySection function
to displaySectionContent, and changes the meaning of displaySection
to hide the entire sidebar section including the header. This is
implemented via an arg passed to Sidebar::Section, which will default
to true if it is not passed, and the BaseCustomSidebarSection class
implements a default of `return true` for this function.
2022-10-05 13:57:52 +10:00
Alan Guo Xiang Tan 90f1e2df80
FIX: Link to `discovery.category` in sidebar` (#18467)
`discovery.category` route respects the default view of the category as
configured by `Category#default_view`. `discovery.latestCategory` forces
the latest filter when viewing the category which is not what we want.

https://meta.discourse.org/t/239999
2022-10-05 09:54:32 +08:00
David Taylor 585c584fdb
Revert "DEV: Remove usage of `{{action}}` modifiers (#18333)" (#18469)
This reverts commit ba27ee1637.

We found some issues with handling of cmd/ctrl/shift + click on `<a` elements
2022-10-04 12:27:26 +01:00
Dan Gebhardt ba27ee1637
DEV: Remove usage of `{{action}}` modifiers (#18333)
This PR enables the [`no-action-modifiers`](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-action-modifiers.md) template lint rule and removes all usages of the `{{action}}` modifier in core.

In general, instances of `{{action "x"}}` have been replaced with `{{on "click" (action "x")}}`. 

In many cases, such as for `a` elements, we also need to prevent default event handling to avoid unwanted side effects. While the `{{action}}` modifier internally calls `event.preventDefault()`, we need to handle these cases more explicitly. For this purpose, this PR also adds the [ember-event-helpers](https://github.com/buschtoens/ember-event-helpers) dependency so we can use the `prevent-default` handler. For instance:

```
<a href {{on "click" (prevent-default (action "x"))}}>Do X</a>
```

Note that `action` has not in general been refactored away as a helper yet. In general, all event handlers should be methods on the corresponding component and referenced directly (e.g. `{{on "click" this.doSomething}}`). However, the `action` helper is used extensively throughout the codebase and often references methods in the `actions` hash on controllers or routes. Thus this refactor will also be extensive and probably deserves a separate PR.

Note: This work was done to complement #17767 by minimizing the potential impact of the `action` modifier override, which uses private API and arguably should be replaced with an AST transform.

Commits:
* Enable `no-action-modifiers` template lint rule
* Replace {{action "x"}} with {{on "click" (action "x")}}
* Remove unnecessary action helper usage
* Remove ctl+click tests for user-menu
   These tests now break in Chrome when used with addEventListener. As per the comment, they can probably be safely removed.
* Prevent default event handlers to avoid unwanted side effects
   Uses `event.preventDefault()` in event handlers to prevent default event handling. This had been done automatically by the `action` modifier, but is not always desirable or necessary.
* Restore UserCardContents#showUser action to avoid regression
   By keeping the `showUser` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showUser` argument that's been passed.
* Revert EditCategoryTab#selectTab -> EditCategoryTab#select
   Avoid potential breaking change in themes / plugins
* Restore GroupCardContents#showGroup action to avoid regression
   By keeping the `showGroup` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showGroup` argument that's been passed.
* Restore SecondFactorAddTotp#showSecondFactorKey action to avoid regression
   By keeping the `showSecondFactorKey` action, we can avoid a breaking change for plugins that rely upon it, while not interfering with the `showSecondFactorKey` property that's maintained on the controller.
* Refactor away from `actions` hash in ChooseMessage component
* Modernize EmojiPicker#onCategorySelection usage
* Modernize SearchResultEntry#logClick usage
* Modernize Discovery::Categories#showInserted usage
* Modernize Preferences::Account#resendConfirmationEmail usage
* Modernize MultiSelect::SelectedCategory#onSelectedNameClick usage
* Favor fn over action in SelectedChoice component
* Modernize WizardStep event handlers
* Favor fn over action usage in buttons
* Restore Login#forgotPassword action to avoid possible regression
2022-10-04 10:42:46 +02:00
Alan Guo Xiang Tan c654bdbfa9
DEV: Experimental changes to user page notifications nav (#18466)
No tests as the changes are experimental and unconfirmed

Internal Ref: /t/67780/58
2022-10-04 15:18:54 +08:00
Andrei Prigorshnev fe12817cb7
FIX: do not show user status on posts twice (#18458) 2022-10-04 10:35:27 +04:00
Alan Guo Xiang Tan ba2c5c7948
UX: Hide sidebar on 2FA route (#18464)
Internal Ref: /t/75929
2022-10-04 14:23:20 +08:00
Alan Guo Xiang Tan 044dc85358
DEV: Remove broken line of code (#18465)
The router service isn't even injected so the code is not used and
broken.
2022-10-04 13:37:25 +08:00
Alan Guo Xiang Tan de071fc1e8
DEV: Convert messages user page nav to experimental redesign (#18456)
No tests are written for now as we're still in a highly iterative stage
2022-10-04 12:05:09 +08:00
Alan Guo Xiang Tan 76a79b6adf
UX: Change notifications nav icon in user page to bell (#18455)
Now that we have chat, the comment icon is no longer ideal

Internal Ref: /t/67780/55
2022-10-04 10:48:33 +08:00
dependabot[bot] bd8e31cde9
Build(deps): Bump sinon from 14.0.0 to 14.0.1 in /app/assets/javascripts (#18463)
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.0 to 14.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.0...v14.0.1)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 01:33:01 +02:00
Blake Erickson 6affbabfd3
FIX: New general category changes preventing topic create (#18459)
* FIX: New general category changes preventing topic create

Follow up to: #18383

The logic in the previous commit was checking for null, but we are
seeding the SiteSetting.general_category_id with an id of -1 so we need
to check for a positive value as well as checking for null.

See: https://meta.discourse.org/t/240661

* Add js test for presence of category… dropdown option
2022-10-03 12:19:41 -06:00
Alan Guo Xiang Tan c5544a7624
FIX: Review sidebar link showing for users that can't review (#18454) 2022-10-03 16:59:25 +08:00
dependabot[bot] 060123143f
Build(deps): Bump jsdom from 20.0.0 to 20.0.1 in /app/assets/javascripts (#18452)
Bumps [jsdom](https://github.com/jsdom/jsdom) from 20.0.0 to 20.0.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/20.0.0...20.0.1)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-02 23:56:37 +02:00
jbrw ff42bef1b6
DEV: Add new plugin outlet in topic list header (#18444) 2022-09-30 17:14:21 -04:00
Blake Erickson 3b86974367
FEATURE: Make General the default category (#18383)
* FEATURE: Make General the default category

* Set general as the default category in the composer model instead

* use semicolon

* Enable allow_uncategorized_topics in create_post spec helper for now

* Check if general_category_id is set

* Enable allow_uncategorized_topics for test env

* Provide an option to the create_post helper to not set allow_uncategorized_topics

* Add tests to check that category… is not present and that General is selected automatically
2022-09-30 12:20:21 -06:00
Daniel Waterworth c1a7fa6b5d
FIX: Allow logout for admins in staff-writes-only-mode (#18441) 2022-09-30 13:03:20 -05:00
Arpit Jalan 136174e0ee
FEATURE: when entering a topic scroll to last visited line marker (#18440)
When a user enters a topic they have already visited they are navigated
to that post that is newest for them (post_number_last_read + 1). Above
that post there is a "last visited" line marker which is visible when
the user scrolls a bit above the post they landed on. This commit makes
sure that the "last visited" line marker is visible as soon as user is
landed in the topic.
2022-09-30 21:27:41 +05:30
Bianca Nenciu b615201b88
FIX: Remove zero-width space when not necessary (#18429)
A zero-width space character is inserted for icon-only buttons, but that
is unnecessary when the button has some rich-content and the block form
is used.
2022-09-30 18:34:47 +03:00
Osama Sayegh 5a5625460b
DEV: Add group messages and group_message_summary notifications in the messages tab in the user menu (#18390)
This commit adds non-archived group messages and `group_message_summary` notifications in the messages tab in the user menu. With this change, the messages tab in the user menu now includes 3 types of items:

1. Unread `private_message` notifications (notifications when you receive a reply in a PM)
2. Unread and read `group_message_summary` notifications (notifications when there's a new message in a group inbox that you track)
3. Non-archived personal and group messages

Unread `private_message` notifications are always shown first, followed by unread `group_message_summary` notifications, and then everything else (messages and read `group_message_summary` notifications) sorted by recency (most recent first).

Internal topic: t/72976.
2022-09-30 08:44:04 +03:00
Alan Guo Xiang Tan 0bdb616edc
DEV: Refactor community section code (#18436)
In a recent commit when adding the review section link, I moved to a
pattern where we allowed the section links to be refreshed after the
section has been constructed. However, we were not tearing down the old
section links when refreshing. This made me realise that refreshing
section links in a section is not a pattern I want to adopt since people
can easily forget to teardown. Instead, each section link should be
responsible for defining a teardown function for cleanup which will
always be called when the sidebar is removed.
2022-09-30 13:13:50 +08:00
Osama Sayegh 079450c9e4
DEV: Do not show handled reviewables in the user menu (#18402)
Currently, the reviewables tab in the user menu shows pending reviewables at the top of the menu and fills the remaining space in the menu with old/handled reviewables. This PR makes the revieables tab show only pending reviewables and hides the tab altogether from the menu if there are no pending reviewables. We're going to follow-up with another change soon that will show pending reviewables in the main tab of the user menu.

Internal topic: t/73220.
2022-09-30 06:10:07 +03:00
Frank 69c20a3a5e
FIX: Removed bookmark reminder alert for reminders set in the past (#18398) 2022-09-30 10:35:42 +08:00
Alan Guo Xiang Tan 4c5e575c15
FIX: Ensure closing sidebar tears down all callbacks. (#18434) 2022-09-30 10:02:51 +08:00
Martin Brennan 9daa6328b5
FIX: Quirks around starting new uploads when one was in progress (#18393)
This commit addresses issues around starting new uploads in a composer etc.
when one or more uploads are already processing or uploading.
There were a couple of issues:

1. When all preprocessors were complete, we were not resetting
    `completeProcessing` to 0, which meant that `needProcessing`
    would never match `completeProcessing` if a new upload was
    started.
2. We were relying on the uppy "complete" event which is supposed
    to fire when all uploads are complete, but this doesn't seem to take
    into account new uploads that are added. Instead now we can rely on
    our own `inProgressUploads` tracker, and consider all uploads complete
    when there are no `inProgressUploads` in flight
2022-09-30 11:01:40 +10:00
Roman Rizzi ba139b8c23
REFACTOR: Improve reusability by Decoupling flag modal from flag target. (#18251)
* REFACTOR: Improve reusability by Decoupling flag modal from flag target.

We want chat message's flags to have the same features as topic and posts' flags, but we prefer not having to duplicate core's logic. This PR moves target specific bits to different classes, allowing plugins to flag custom things by
providing their own.

* A couple of fixes for the flag modal:

- Make sure buttons are disabled until a flag type is selected.
- Don't throw an error when checking if the user can undo an action on a deleted topic.
- Disable flagging on deleted topics.
2022-09-29 11:57:36 -03:00
Jarek Radosz 300db0615f
DEV: Fix `InstallTrigger` deprecation warnings on Firefox (#18380)
"InstallTrigger is deprecated and will be removed in the future."
2022-09-29 13:31:29 +02:00
Alan Guo Xiang Tan 5248fbbe24
UX: Add flag icon for review section link in sidebar (#18414) 2022-09-29 15:41:23 +08:00
Alan Guo Xiang Tan 4f84ed6723
FIX: Use `Category#category_text` for sidebar title (#18411)
Previously we used `Category#category_excerpt` but the excerpt keeps the
HTML entities around if present and we can't really display HTML in the
title of a link.
2022-09-29 14:44:41 +08:00
Alan Guo Xiang Tan f1cbc23f1e
UX: Add icons to all section links in Sidebar (#18378)
This commit introduces an icon to all links in the sidebar. If an icon has not been configured, we will fall back to a generic "link" icon. As part of this commit, we also standardised the size of each prefix to 20px by 20px and set a fix margin. This is to allow sufficient space for text prefixes and image prefixes to be displayed. 

Tests have been intentionally left out for now as I don't feel like asserting for the icons will bring much value at this point. Time shall prove me wrong.

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2022-09-29 12:28:01 +08:00
Martin Brennan 8ebd5edd1e
DEV: Rename secure_media to secure_uploads (#18376)
This commit renames all secure_media related settings to secure_uploads_* along with the associated functionality.

This is being done because "media" does not really cover it, we aren't just doing this for images and videos etc. but for all uploads in the site.

Additionally, in future we want to secure more types of uploads, and enable a kind of "mixed mode" where some uploads are secure and some are not, so keeping media in the name is just confusing.

This also keeps compatibility with the `secure-media-uploads` path, and changes new
secure URLs to be `secure-uploads`.

Deprecated settings:

* secure_media -> secure_uploads
* secure_media_allow_embed_images_in_emails -> secure_uploads_allow_embed_images_in_emails
* secure_media_max_email_embed_image_size_kb -> secure_uploads_max_email_embed_image_size_kb
2022-09-29 09:24:33 +10:00
Osama Sayegh 70b96ac4e7
DEV: Include quote notifications in the replies tab in the user menu (#18401)
The rationale behind this change is that quote notifications are almost always as important as replies notifications so it makes sense for them to be included in the replies tab instead of the "other" tab. Internal topic: t/74748.
2022-09-28 21:41:11 +03:00
Keegan George c3d9324d4d
FEATURE: Remember adjusted composer height (#18385)
This PR makes adjusted composer height persistent for a user. After dragging to change the composer height, the updated height will be stored in localStorage and will be restored when opening the composer again.
2022-09-28 08:43:52 -07:00
Andrei Prigorshnev 833c8055e1
FEATURE: Optionally show user status on email group user chooser (#18367) 2022-09-28 17:31:20 +04:00
dependabot[bot] 297ce90a88
Build(deps): Bump @babel/core in /app/assets/javascripts (#18388)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.1 to 7.19.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.3/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-09-28 12:48:09 +02:00
Osama Sayegh b10b5eb17b
DEV: Unsubscribe from MessageBus channel when leaving review-index route (#18395)
We subscribe to a couple of MessageBus channels when the review-index route is entered, but we should unsubscribe when exiting the route otherwise callbacks would leak every time the review-index is entered and that might cause subtle and weird bugs or errors.
2022-09-28 12:58:19 +03:00
dependabot[bot] 567fcaecb8
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18389)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.19.2 to 7.19.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.3/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-28 11:43:40 +02:00
Osama Sayegh 51cabf0f26
DEV: Use the correct property for checking if redesigned user menu is enabled (#18394)
The correct attribute for the new user menu feature flag is `redesigned_user_menu_enabled`, not `enable_redesigned_user_menu`.
2022-09-28 10:50:52 +03:00
Alan Guo Xiang Tan 4b561277a9
FEATURE: Add review link to community section for logged in user (#18374)
When there are pending reviewables, the review section link is displayed
in the main section. When there are no pending reviewables, the review
section link is displayed under the more links drawer.

Internal ref: /t/74210
2022-09-28 09:58:07 +08:00
Arpit Jalan bc97f3d1c1
FIX: some composer messages were broken (#18392) 2022-09-28 07:21:20 +05:30
Renato Atilio 4c085873e5
FIX: 404 sending beacon "leave all" on subfolder install 2022-09-27 19:57:38 +01:00
Penar Musaraj cc4af80c7d
DEV: refactor bootbox alerts (#18292) 2022-09-27 14:47:13 -04:00
Keegan George ca1038187f
A11Y: Improve user card accessibility (#18348) 2022-09-27 10:06:20 -07:00
Arpit Jalan 2ee721f8aa
FEATURE: add composer warning when user haven't been seen in a long time (#18340)
* FEATURE: add composer warning when user haven't been seen in a long time

When a user creates a PM and adds a recipient that hasn't been seen in a
long time then we'll now show a warning in composer indicating that the
user hasn't been seen in a long time.
2022-09-27 22:06:40 +05:30
Rafael dos Santos Silva 0f5db0838d
FEATURE: JS API interface for hljs plugins (#18382)
* FEATURE: JS API interface for hljs plugins

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-09-27 13:26:52 -03:00
Penar Musaraj 217274f2c1
A11Y: multiple fixes to user stream items (#18368)
- in group activity, allows avatars to be selectable by tabbing or screen readers
- in user activity > drafts, fixes a bug where for draft replies, the wrong avatar was being shown in the user card
- in both group and user activity, fixes the order of focusable items
2022-09-27 10:59:26 -04:00
Penar Musaraj b97cb222c2
A11Y: Associate label with input in bookmark modal (#18371) 2022-09-27 09:18:59 -04:00
Penar Musaraj 250c0bccbd
A11Y: Add aria label to composer messages `Esc` button (#18372) 2022-09-27 08:52:09 -04:00
Rafael dos Santos Silva ab58b0cffe
FIX: Better virtual keyboard detect on Android (#18298)
* FIX: Better virtual keyboard detect on Android

Firefox has a bug where *sometimes* the visualViewport.height won't be
updated when the keyboard pops up until you scroll, making our composer
stay hidden behind the keyboard. This commit uses both window.innerHeight
and  window.visualViewport.height using the minimum of both to check for
height changes.

For Chrome/Edge we feature detect the new VirtualKeyboard API and
opt-into it when the composer opens and use it to detect if a keyboard
is being draw. Opting into the API changes how the viewport is
calculated so we have to also change how the full height composer is
calculated. To minimize breakage we opt-out when the composer component
is destroyed.

This commit also moves the `--composer-ipad-padding` to only happen on
iPads.

Bug report at https://meta.discourse.org/t/-/228382
2022-09-26 17:35:58 -03:00
Dan Gebhardt 88413c20d9
DEV: Refine showPopover / hidePopover + introduce isPopoverShown helper for use with d-popover (#18334)
Although showPopover continues to toggle the popover (showing if hidden / hiding if shown), hidePopover now will only hide the popover. Furthermore, isPopoverShown has been introduced to provide insight into whether the popover is currently shown or not, and therefore whether it should be hidden or shown.

Also, the showPopover / hidePopover test has been refined to override `trigger` and `hideOnClick` settings to allow for full imperative control of showing / hiding the popover.
2022-09-26 20:39:17 +02:00
Daniel Waterworth 69d74ae508
DEV: Differentiate staff-writes-only banner (#18364) 2022-09-26 13:16:29 -05:00
Bianca Nenciu b81afa0756
FIX: Update user results page when no users found (#18363)
The page was not updated if the server did not return any results. This
caused the page to be either empty or display the previous result set.
2022-09-26 16:37:56 +03:00
Jarek Radosz f64e7233e5
DEV: De-jQ post-cooked (#18328) 2022-09-26 14:26:38 +02:00
Martin Brennan e62e93f83a
FEATURE: Introduce personal_message_enabled_groups setting (#18042)
This will replace `enable_personal_messages` and
`min_trust_to_send_messages`, this commit introduces
the setting `personal_message_enabled_groups`
and uses it in all places that `enable_personal_messages`
and `min_trust_to_send_messages` currently apply.

A migration is included to set `personal_message_enabled_groups`
based on the following rules:

* If `enable_personal_messages` was false, then set
  `personal_message_enabled_groups` to `3`, which is
  the staff auto group
* If `min_trust_to_send_messages` is not default (1)
  and the above condition is false, then set the
  `personal_message_enabled_groups` setting to
  the appropriate auto group based on the trust level
* Otherwise just set `personal_message_enabled_groups` to
  11 which is the TL1 auto group

After follow-up PRs to plugins using these old settings, we will be
able to drop the old settings from core, in the meantime I've added
 DEPRECATED notices to their descriptions and added them
to the deprecated site settings list.

This commit also introduces a `_map` shortcut method definition
for all `group_list` site settings, e.g. `SiteSetting.personal_message_enabled_groups`
also has `SiteSetting.personal_message_enabled_groups_map` available,
which automatically splits the setting by `|` and converts it into
an array of integers.
2022-09-26 13:58:40 +10:00
Kris 61c5916b2c
Revert "FEATURE: add tooltips to timeline start/end dates (#18294)" (#18346)
This reverts commit b98cd73ace.
2022-09-23 14:20:33 -04:00
David Taylor 8964749989
DEV: Remove invalid pretender calls (#18341)
Get parameters cannot be included in the URL of request stubs. Instead, the callback can check `request.queryParams` to modify behavior.
2022-09-23 12:07:23 +01:00
Alan Guo Xiang Tan 8c7a38449c
FIX: Sidebar categories for anonymous not being sorted by name (#18339)
Sort it by name for now even though we have an on going conversation to
decide how categories should be sorted in sidebar

https://meta.discourse.org/t/sidebar-categories-are-out-of-order-for-anonymous-users/239679
2022-09-23 12:17:42 +08:00
Alan Guo Xiang Tan 0c45aa7900
FIX: Skip uncategorized category in sidebar when disabled (#18324)
When `allow_uncategorized_topics` is set to `false`, we do not want to
show the uncategorized in sidebar by default.

This commit updates a couple of places in the code related to sidebar
which was incorrectly using `suppress_uncategorized_badge` site setting
which is mainly used for hiding the category badge for uncategorized
category and should not be used to determine if uncategorized categories
should be allowed or not.
2022-09-23 10:20:30 +08:00
Alan Guo Xiang Tan 03f83c0eed
FIX: Respect site settings for sidebar users, groups and badges link (#18325)
The links should not be displayed when its associated site setting has
been disabled. This commit maintains parity with the old hamburger menu.
2022-09-23 10:19:59 +08:00
Keegan George a23d19fab0
DEV: Emoji picker keyboard accessibility updates (#18331)
This PR makes some updates to the prior keyboard accessibility commit (eb98746):
- Makes `tabindex` attribute only appear on emoji markup in the emoji picker.
- After pressing the Esc key, focus returns to the <textarea/> input (composer editor or chat input)
2022-09-22 15:21:34 -07:00
Vinoth Kannan 998bd191a5
FEATURE: site setting to disable usernames in share links. (#18315)
https://meta.discourse.org/t/share-a-link-for-a-post-should-not-leak-username/66489/22?u=vinothkannans
2022-09-22 23:12:39 +05:30
David Taylor 7a622f22bc
FIX: Hide experimental user navigation changes when disabled (#18327)
Followup to b066955838
2022-09-22 10:26:01 +01:00
dependabot[bot] da47e448ac
Build(deps): Bump sass from 1.54.9 to 1.55.0 in /app/assets/javascripts (#18323)
Bumps [sass](https://github.com/sass/dart-sass) from 1.54.9 to 1.55.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.54.9...1.55.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 11:05:55 +02:00
Alan Guo Xiang Tan b066955838
DEV: Mobile layout support for experimental user nav (#18308) 2022-09-22 09:45:50 +08:00
Rafael dos Santos Silva f11b926823
DEV: Add test case for syntax highlight of complex HTML (#18320)
* DEV: Add test case for syntax highlight of complex HTML

The commit 685e0da upgrade HighlightJS to version 11, which deprecates
syntax highlight of complex HTML elements. See https://github.com/highlightjs/highlight.js/issues/2889

This brought a regression of syntax highlighting of GitHub oneboxes,
which was fixed in 09cec7d. This commit adds a test case to prevent
future regressions like this one.

* fix test and warning
2022-09-21 19:09:53 -03:00
Keegan George eb987460f2
FEATURE: Select emojis in picker via keyboard (#18163)
* DEV: Make emoji elements focusable

Since emoji elements are of type `<img>` it requires a `tablindex="0"` in order to be focusable.

* WIP: Handle emoji focus/selection via arrow keys

Near completion, however, need a few fixes/improvements and overall code cleanup

* WIP: Testing

* DEV: Fixes and cleanup

* DEV: Follow conventions

* DEV: Improve up/down traversal when recents present

* DEV: Emoji markup in tests should include `tabindex`

* DEV: Add `tabindex` to topic tests

* DEV: Variable name as `searchInput` instead of `searchBar`

* DEV: Use appropriate method name (`_setNumEmojiPerRow`)

* DEV: Add comments and avoid nested if

* WIP: Adding test

* Fix first test

* DEV: Add assertions for arrow keys and escape key

* Some fixes for up/down navigation

This does not fix everything, when going from one section to another,
there are issues

* Fix a small regression

* FIX: Ability to focus on search results

Fixes regression

* Refactor calculating next up/down emoji

* Debugging test failure

* Skip stubborn CI test, add others

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-09-21 13:21:36 -07:00
Daniel Waterworth e37ced96bf
DEV: Don't interpret user field names as HTML (#18317)
This isn't a security bug, because only admins can create user fields
and we have to trust admins, because they can change themes, which are
shown site-wide and can contain unrestricted JS.
2022-09-21 12:21:58 -05:00
dependabot[bot] ed7ba1418b
Build(deps): Bump mout from 1.2.3 to 1.2.4 in /app/assets/javascripts (#18316)
Bumps [mout](https://github.com/mout/mout) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/mout/mout/releases)
- [Changelog](https://github.com/mout/mout/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mout/mout/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: mout
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-21 17:51:36 +02:00
David Taylor b0a9d8b761
DEV: Improve labelling of Firefox Evergreen/ESR CI runs (#18313)
Both versions are used with `--headless`, so labelling one "Firefox" and the other "Firefox Headless" doesn't really make sense. Evergreen / ESR are better descriptions.
2022-09-21 15:34:26 +01:00
Jarek Radosz eab33af5bf
SECURITY: Handle incomplete quote bbcode (#18311) 2022-09-21 14:02:50 +02:00
David Taylor e06b9d4a52
DEV: Remove support for legacy plugin JS compilation pipeline (#18293)
This became the default in b1755137
2022-09-21 12:38:02 +01:00
David Taylor ae3a5f6bf0
DEV: Improve setting of raw-view owner (#18310)
Using the owner of `site` is not perfectly reliable, especially given that `site` is stubbed in tests. Instead, we can fetch the owner of the `context` object itself.

Also, Ember sets the owner of an EmberObject based on the first parameter to `create`. This is preferable to a separate `setOwner` call because it means the owner is available during initialization.

Unfortunately we don't have any way to compile raw templates inline during tests, so testing this behavior in core is very difficult. Given that we aim to remove the raw handlebars system in the not-too-distant future, it doesn't make sense to invest lots of time on tooling here. Regressions of this behavior will be detected by theme CI tests [like this](https://github.com/discourse/discourse-topic-thumbnails/pull/21).
2022-09-21 12:23:28 +01:00
Alan Guo Xiang Tan da3e72c2b4
DEV: Ship first pass of new user page navigation behind feature flag (#18285)
This commits introduces a new SiteSetting.enable_new_user_profile_nav_groups
feature flag. When configured, users of the configured groups will see
the new user page navigation links.

As of this commit, only the user activity navigation link has been
converted to the newly proposed dropdown of navigation links.

Mobile support has not been considered.
2022-09-21 12:32:47 +08:00
Alan Guo Xiang Tan 1413de2809
UX: Add short site description for anonymous user in sidebar (#18084)
Displays the `short_site_description` site setting in the community
section when the site setting is set
2022-09-21 11:38:29 +08:00
Alan Guo Xiang Tan 04cdc2910d
UX: Clicking on a button in sidebar on mobile should collapse it (#18305) 2022-09-21 11:25:54 +08:00
Penar Musaraj 4e1b9a225e
DEV: Reduce width calculations for SK dropdowns (#18263)
Previously we were calculating both the minimum and maximum widths for
SK dropdowns using this Popper modifier. The max. width calculation was
causing issues with dropdowns in Firefox and was also sluggish when
rendering.

This switches to using CSS calculations for max. widths. It adds a 600px
global maximum and targeted maximums for the category composer dropdown
and the bookmark list dropdowns.
2022-09-20 22:59:47 -04:00
Kris b98cd73ace
FEATURE: add tooltips to timeline start/end dates (#18294) 2022-09-21 09:46:14 +08:00
Osama Sayegh 3d2de7ca03
FIX: Add missing string for reviewables in user menu when reviewable post is deleted (#18295) 2022-09-21 09:05:08 +10:00
Rafael dos Santos Silva 09cec7d6dd
FIX: Fix GitHub onebox syntax highlight (#18300)
Highlight.js 11 deprecated the feature to highlight HTML blocks while
keeping the HTML structure, which broke our GitHub onebox syntax
highlight.

This patch adds it back by bringing the maintainers code as a plugin.

See https://github.com/highlightjs/highlight.js/issues/2889
2022-09-21 09:01:14 +10:00
Osama Sayegh 496f910f03
DEV: Various A11Y improvements for the new user menu (#18288)
This commit includes various accessibility improvements for the new user menu:

* Add `title` attributes to the user menu tabs
* Properly label lists (by adding `aria-labelledby` to `<ul>` elements) for screen readers
* Change the user menu structure so that the tabs come before the content panel in the DOM, but use CSS to reverse them visually.
  Normally, changing the order of elements via CSS is bad for accessibility, but I believe this is one of the rare scenarios where it [makes sense](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Ordering_Flex_Items#use_cases_for_order). Prior to this change, if you want to reach the first notification item after you select a tab using the keyboard, you have to hit <kbd>ctrl</kbd>+<kbd>tab</kbd> because the notifications list is before the tabs list. However, with this change, <kbd>tab</kbd> will move you to the first item in the list after you select a tab using your keyboard.
* Aria-hide the unread notifications badge/count on the tabs because the `title` attribute on the tab indicates the unread count.
* Add some tests.
2022-09-20 19:31:56 +03:00
David Taylor f71a981cb9
DEV: Remove testem `parallel` limit (#18290)
In itself, this change will not cause tests to run in parallel. It just unlocks the ability to use tools like `ember exam` to run tests in parallel. For example:

```
yarn ember exam --load-balance --parallel=3 --random
```
2022-09-20 15:43:06 +01:00
David Taylor d0243f741e
UX: Use dominant color as image loading placeholder (#18248)
We previously had a system which would generate a 10x10px preview of images and add their URLs in a data-small-upload attribute. The client would then use that as the background-image of the `<img>` element. This works reasonably well on fast connections, but on slower connections it can take a few seconds for the placeholders to appear. The act of loading the placeholders can also break or delay the loading of the 'real' images.

This commit replaces the placeholder logic with a new approach. Instead of a 10x10px preview, we use imagemagick to calculate the average color of an image and store it in the database. The hex color value then added as a `data-dominant-color` attribute on the `<img>` element, and the client can use this as a `background-color` on the element while the real image is loading. That means no extra HTTP request is required, and so the placeholder color can appear instantly.

Dominant color will be calculated:
1. When a new upload is created
2. During a post rebake, if the dominant color is missing from an upload, it will be calculated and stored
3. Every 15 minutes, 25 old upload records are fetched and their dominant color calculated and stored. (part of the existing PeriodicalUpdates job)

Existing posts will continue to use the old 10x10px placeholder system until they are next rebaked
2022-09-20 10:28:17 +01:00
Alan Guo Xiang Tan e7091d2f59
DEV: Remove redundant args for user-main-nav plugin outlet (#18284) 2022-09-20 17:12:15 +08:00
Alan Guo Xiang Tan 27bff3fcfa
UX: Add icons to all navigation link on user page (#18283) 2022-09-20 12:44:40 +08:00
Andrei Prigorshnev 37777ac3a2
DEV: use sketchy favicon in dev ember proxy (#18280) 2022-09-20 10:53:18 +10:00
Gerhard Schlager 7b243f3955
FIX: Overriding text with `admin_js.*` keys didn't work (#18281) 2022-09-20 10:47:57 +10:00
Gerhard Schlager f91426a7fa
FIX: Empty inline BBCodes were broken (#18276)
Upgrading to Markdown.it v13 broke empty inline BBCodes. This works around the problem by adding an empty token before a closing token if the previous token was a BBCode token.

It also removes the unused `jump` attribute which was removed in Markdown.it v12.3
2022-09-20 09:50:22 +10:00
Jordan Vidrine a766bf8818
UX: Welcome topic CTA adjustments (#18168)
* UX: Adjust welcome cta

* more

* FIX: Adjust test syntax
2022-09-19 16:40:44 -05:00
Penar Musaraj 36aec7f546
DEV: Add two new plugin outlets in topic list (#18270) 2022-09-19 18:35:13 +02:00
Osama Sayegh 0414bd00ae
DEV: Tone down copy in experimental user menu for pending users (#18277)
The experimental user menu has a tab that displays recent reviewables and at the moment when a new signs up for the site and they need to be approved, admins see a very scary "suspicious user" copy in the reviewables tab in the user menu. We don't need the copy to be very scary because when a user needs to be approved, it's because the site operator has configured the site to force all new users to go through the review queue and it's not some kind of spam detector flagging the user.
2022-09-19 19:32:34 +03:00
Kris dc6418bd8f
Revert "UX: Retry "left-align title with content for sidebar (#18202)" (#18242)" (#18278)
This reverts commit 5ee760dc2c.
2022-09-19 11:05:41 -04:00
Arpit Jalan ce27dbd560
FIX: header offset position was not correct in some cases (#18155)
When a topic is opened in a new tab and is fully loaded the scroll
position is a bit off.

This commit partially reverts 9a55c9c433.
2022-09-19 14:56:34 +02:00
Alan Guo Xiang Tan 754ad42344
UX: Use the same text for linking to more categories and tags in sidebar (#18275)
Before this change, anonymous user and a logged in user used different
text for the links to the categories and tags routes.

Follow-up to 321aa4b4b4
2022-09-19 12:01:08 +08:00
Jarek Radosz 5259198c61
DEV: Extract virtual keyboard code (#18267)
Makes it possible for other code to use `.keyboard-visible` class on `<html>` element.
2022-09-16 21:09:28 +02:00
David Taylor 3904c23121
Introduce warning message for Safari 13 and below (#18258)
Discourse will be dropping support for these browsers in early 2023. https://meta.discourse.org/t/224747
2022-09-16 11:17:49 +01:00
dependabot[bot] 4af080d20b
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18266) 2022-09-16 02:05:44 +02:00
Joffrey JAFFEUX 1a2bf52656
DEV: adds includes helper to templates (#18259)
Usage :

```
{{#if (includes fooArray foo)}}
```

```
{{#if (includes fooString foo)}}
```
2022-09-15 14:20:37 +02:00
Jarek Radosz e567eeb927
DEV: Log theme error names and messages (#18260) 2022-09-15 14:14:52 +02:00
Penar Musaraj 2704a02e3a
FIX: In-page anchor links were broken in subfolder setups (#18250)
The key fix in this commit is that it removes `this.replaceState(path)` for anchor-only URLs. We still intercept those routing changes to properly calculate the scroll position of the anchor via `jumpToElement`, but we no longer use the Ember router to override the browser's history. This fixes the subfolder issue and also lets the browser maintain its history correctly.

The commit also includes a small refactor to the `jumpToElement` helper to facilitate stubbing in tests.
2022-09-15 08:09:34 -04:00
dependabot[bot] 38dab71448
Build(deps): Bump @babel/core in /app/assets/javascripts (#18256)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.0 to 7.19.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.1/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-09-15 12:02:05 +02:00
dependabot[bot] 51ee861ab3
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18255)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.19.0 to 7.19.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.1/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-15 12:01:01 +02:00
Penar Musaraj 86ecb6c58b
DEV: update yes/no confirmation dialogs (#18181) 2022-09-14 11:06:56 -04:00
David Taylor 04e433d286
PERF: Skip image placeholders when secure_media is enabled (#18247)
Secure media requests go through the app. In topics with many images, this makes it very easy to hit rate limiters. Skipping the low-res placeholders reduces the chance of this problem occuring.
2022-09-14 12:42:59 +01:00
communiteq 56555a0231
Disallow access to raw email for non-staff users (#17569) 2022-09-14 09:57:12 +08:00
Osama Sayegh 2f428023da
DEV: ctrl+click on user menu items should open in new tab (#18243) 2022-09-13 18:25:40 -04:00
Jarek Radosz 5ee760dc2c
UX: Retry "left-align title with content for sidebar (#18202)" (#18242)
Reverts #18241 and fixes issues with the original PR:

1. Remove an extraneous `margin-left: auto` from a grid cell (this was causing the buggy behavior in webkit)
2. Add `grid-area` name to `.extra-info-wrapper`
3. Account for `.wrap` padding
4. Remove unused css (`.header-row` and inner styles)
2022-09-13 21:45:31 +02:00
Kris c69473128b
UX: improve composer toolbar flexibility (#18195) 2022-09-13 14:20:33 -04:00
Osama Sayegh 19909a74b0
DEV: Add a tab for watching notifications to the experimental user menu (#18240)
This commit adds a new tab to the experimental user menu for the `posted` and `watching_first_post` notification types.

Internal topic: t/72835.
2022-09-13 20:52:02 +03:00
Kris 6c1b6a98ff
Revert header sidebar change 0ef68f5 (#18241) 2022-09-13 13:20:08 -04:00
Penar Musaraj b8adb70973
DEV: Refactor composer and logout dialogs (#18156) 2022-09-13 12:30:52 -04:00
Osama Sayegh 12ebdf0ff0
DEV: Convert experimental user menu tabs to links when they're active (#18158)
This PR restores a small feature which was present in the old menu and allowed users to click on the active tab in the menu to navigate to some page that showed the same items in the menu but with more details.

For example, if you switch to the PMs tab and then click on it again, currently nothing happens. However, with this change, clicking on the tab again will take you to your messages page at `/my/messages`.

Note: plugins that register custom tabs in the menu can provide a `linkWhenActive` property for their tab if they wish to mimic core's tabs, but it's optional; if they don't provide one, the tab will do nothing if the user clicks on it again.

Internal topic: t/73349.
2022-09-13 17:12:27 +03:00
Osama Sayegh 8c2c96af25
DEV: Ensure experimental user menu is always closed after clicking on items (#18231)
Because Discourse is a single-page application, clicks on the majority of `<a>` elements in the app need to be intercepted by JavaScript to prevent browsers' default action (full page reload). Links in the user menu - which include notifications, reviewables, bookmarks etc. - are no exception to this rule and currently clicks on these items are handled by the global [click-interceptor](1fa21ed415/app/assets/javascripts/discourse/app/lib/intercept-click.js (L20)) which calls the `preventDefault` function on the click event object and uses the `DiscourseURL.routeTo` function to route the user to the page they request.

However, for links in the user menu, there's an extra step which is to let the header know that it should close the user menu after clicking an item in the menu, but the global interceptor doesn't know that because the step is specific to links in the user menu. This can cause a bug on mobile devices where the menu remains open after clicking on a notification which results in the user having to close the menu to see the page that the notification takes them to.

This commit adds a click handler to user menu items that ensures the menu is closed when an item is clicked and navigates the user to wherever the item links to. There's a small downside to this change which is that user menu items now have their own click interceptor instead of relying on the global interceptor, i.e. duplicated logic, but since it's only a couple of lines, I think we can live with it for a while.

I did try to make the click handler of the user menu items only close the menu (call the `closeUserMenu` function), but for some reasons it caused a full page reload to happen when clicking a notification item due to some weird interactions between the header widget and the user menu. I didn't debug this thoroughly because we have plans to change the header implementation from widgets/virtual-dom to Glimmer component, which will likely resolve that weird full page reload issue and we'll be able to make the click handler just close the menu and let the global interceptor prevents the default action and do the routing.

Internal topic: t/71911/118.
2022-09-13 15:44:45 +03:00
Kris 0ef68f52d8
UX: left-align title with content for sidebar (#18202) 2022-09-13 09:46:57 +08:00
Kris 321aa4b4b4
UX: sidebar more link for categories & tags (#18199) 2022-09-12 13:25:25 -04:00
Kris 3f2c3d5360
UX: switch wizard SVG colors for dark mode (#18109) 2022-09-12 11:34:15 -04:00
Kris dacdec5acc
UX: trigger tooltips on click for touch devices (#18198) 2022-09-12 10:04:20 -04:00
Jarek Radosz 761864d4f4
DEV: Add favicon to dev ember proxy (#18228)
One less console warning in tests
2022-09-12 15:46:50 +02:00
Penar Musaraj 5c0f770f0f
DEV: Refactor self-delete dialog (#18180)
Also adds missing test
2022-09-12 09:45:53 -04:00
Jarek Radosz fa58eea64e
DEV: Minor code cleanup (#18225)
Various small changes made while debugging MessageBus-related tests.
2022-09-12 14:05:21 +02:00
Jarek Radosz ec32b61319
DEV: Add another missing `await` (#18226) 2022-09-12 14:03:39 +02:00
dependabot[bot] dfd0ce39f3
Build(deps): Bump mout from 1.2.2 to 1.2.3 in /app/assets/javascripts (#18224)
Bumps [mout](https://github.com/mout/mout) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/mout/mout/releases)
- [Changelog](https://github.com/mout/mout/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mout/mout/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: mout
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 11:40:29 +02:00
dependabot[bot] 0a49db14a4
Build(deps): Bump ember-exam in /app/assets/javascripts (#18221)
Bumps [ember-exam](https://github.com/ember-cli/ember-exam) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/ember-cli/ember-exam/releases)
- [Changelog](https://github.com/ember-cli/ember-exam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-exam/commits/v8.0.0)

---
updated-dependencies:
- dependency-name: ember-exam
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 10:22:42 +02:00
dependabot[bot] 327ca5b839
Build(deps): Bump webpack in /app/assets/javascripts (#18214)
Bumps [webpack](https://github.com/webpack/webpack) from 5.73.0 to 5.74.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.73.0...v5.74.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 22:35:55 +02:00
Osama Sayegh aeee7ed03d
UX: Change `posted` notification icon to `discourse-bell-exclamation` (#18217)
This PR changes the icon for `posted` notification types (these are the notifications that you receive when someone posts in a topic you're watching) from `reply` to `discourse-bell-exclamation`. We're doing this to visually distinguish between the `posted` notifications and `replied` notifications which are the notifications that you receive when someone replies to you directly.

Internal topic: t72835.
2022-09-11 22:57:14 +03:00
dependabot[bot] 725b585a43
Build(deps): Bump ember-cli-htmlbars in /app/assets/javascripts (#18212) 2022-09-11 14:53:34 +02:00
dependabot[bot] da963e88ba
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18213) 2022-09-11 14:53:10 +02:00
dependabot[bot] e4a79daf24
Build(deps): Bump follow-redirects in /app/assets/javascripts (#18205)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.3 to 1.15.1.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.3...v1.15.1)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 13:04:45 +02:00
dependabot[bot] 38327ee9d2
Build(deps): Bump sass from 1.53.0 to 1.54.9 in /app/assets/javascripts (#18197)
Bumps [sass](https://github.com/sass/dart-sass) from 1.53.0 to 1.54.9.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.53.0...1.54.9)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 13:02:42 +02:00
dependabot[bot] 0695ebbc72
Build(deps): Bump terser from 4.8.0 to 4.8.1 in /app/assets/javascripts (#18175)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v4.8.0...v4.8.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 12:09:35 +02:00
dependabot[bot] f2857cb155
Build(deps): Bump a11y-dialog in /app/assets/javascripts (#18188)
Bumps [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) from 7.5.0 to 7.5.2.
- [Release notes](https://github.com/KittyGiraudel/a11y-dialog/releases)
- [Commits](https://github.com/KittyGiraudel/a11y-dialog/compare/7.5.0...7.5.2)

---
updated-dependencies:
- dependency-name: a11y-dialog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 11:59:51 +02:00
dependabot[bot] e348ca3ef6
Build(deps): Bump @babel/core in /app/assets/javascripts (#18189)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.6 to 7.19.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 11:59:28 +02:00
dependabot[bot] 83b147aab2
Build(deps): Bump xss from 1.0.13 to 1.0.14 in /app/assets/javascripts (#18191)
Bumps [xss](https://github.com/leizongmin/js-xss) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/leizongmin/js-xss/releases)
- [Changelog](https://github.com/leizongmin/js-xss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/leizongmin/js-xss/compare/v1.0.13...v1.0.14)

---
updated-dependencies:
- dependency-name: xss
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 11:58:16 +02:00
dependabot[bot] 9112f91f57
Build(deps): Bump @popperjs/core in /app/assets/javascripts (#18196)
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.11.5 to 2.11.6.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.11.5...v2.11.6)

---
updated-dependencies:
- dependency-name: "@popperjs/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-11 11:57:56 +02:00
David Taylor 56832adf17
FIX: Ensure loading thumbnails are used in Safari (#18204)
In Safari, `img.complete` is sometimes true even before the image is loaded. Checking for the presence of `img.naturalHeight` seems to be more reliable. It is very difficult to write a test for this behaviour due to the dependence on network conditions, scroll location, etc.

`img.naturalHeight` is supported by all our target browsers, and I have verified the functionality of this commit in Chrome, Safari and Firefox.
2022-09-10 13:51:57 +02:00
David Taylor 415535d577
FIX: Ensure low-resolution placeholders are used while loading images (#18194) 2022-09-07 17:04:42 +02:00
Arpit Jalan c1887d95ff
FIX: "Exit setup" link should exit the wizard and take user to homepage (#18182) 2022-09-05 17:21:41 +05:30
Penar Musaraj 7547878cde
FIX: Regression with admin user delete dialog buttons (#18179)
This also adds a test to prevent regressions and refactors the very similar delete dialog in the user summary screen.
2022-09-05 09:31:17 +02:00
Andrei Prigorshnev 54b8500881
FIX: raw translation string in user status tooltip (#18170) 2022-09-02 23:57:17 +04:00
David Taylor 801a284968
DEV: make ember-cli skip plugin directories without `plugin.rb` (#18171)
This updates the ember-cli plugin detection logic to match the logic in `Plugin::Instance.find_all`. It will now ignore plugin directories which do not have a `plugin.rb` file.
2022-09-02 19:48:45 +01:00
Jordan Vidrine 73a2d2e9ac
UX: Fix width of preview pane to fix scroll (#18166) 2022-09-02 11:28:11 -05:00
Krzysztof Kotlarek 661a903a0b
FEATURE: other notifications tab for redesign user menu (#18164)
This commit adds to the experimental user menu a new "other notifications" tab that's very similar to the "all notifications" tab, but with the main difference being that it doesn't show notification types that do have dedicated tabs in the menu (e.g. mentions, likes, replies etc.).

The rationale behind this is that the notification types that do have dedicated tabs tend to dominate the "all notifications" tab, leaving very small chances for the user to notice rarer or infrequent notification types. Adding a tab for all the other types gives the user a way to review those infrequent notification types.

Internal ticket: t72978.

Co-authored-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2022-09-02 14:49:49 +03:00
jbrw bf6c9e0f28
DEV: Add tags to a topic fixture (#18162)
It can be useful to have a topic with some predefined tags
2022-09-02 13:48:31 +02:00
David Taylor 1279966f59
FIX: Use plugin's defined name for es6 module path (#18159)
We were using the directory name rather than the plugin's defined `name`. This was an unintended change in behaviour from the old sprockets implementation. This commit makes the ember-cli naming logic match the old sprockets logic.
2022-09-01 22:15:32 +01:00
David Taylor a335492d20
FIX: Ensure discovery-categories always clears PreloadStore (#18157)
If the server is configured to use a view like `categories_and_latest_topics`, it will preload data for the topic list. If the client doesn't actually use it (e.g. on mobile), then that preloaded data would remain cached and be used for the next loaded topic list. This commit ensures it's always removed, and adds a test for the behaviour.

https://meta.discourse.org/t/237126/35
2022-09-01 16:11:13 +01:00
Ghassan Maslamani a671fb4449
DEV: Add below-login-buttons plugin outlet (#18154) 2022-09-01 13:15:40 +01:00
David Taylor c782125985
UX: Close the revamped user menu when opening modals (#18148)
When opening the DnD modal and the User Status modal, user menu remained open, this fixes it.
2022-09-01 15:22:41 +04:00
Arpit Jalan 5bc858c676
FIX: do not show "create topics" notice on wizard route (#18153) 2022-09-01 16:37:57 +05:30
David Taylor 7e74dd0afe
DEV: Use DiscourseJsProcessor for theme template compilation (#18135)
Previously we were relying on a highly-customized version of the unmaintained Barber gem for theme template compilation. This commit switches us to use our own DiscourseJsProcessor, which makes use of more modern patterns and will be easier to maintain going forward.

In summary:
- Refactors DiscourseJsProcessor to move multiline JS heredocs into a companion `discourse-js-processor.js` file
- Use MiniRacer's `.call` method to avoid manually escaping JS strings
- Move Theme template AST transformers into DiscourseJsProcessor, and formalise interface for extending RawHandlebars AST transformations
- Update Ember template compilation to use a babel-based approach, just like Ember CLI. This gives each template its own ES6 module rather than directly assigning `Ember.TEMPLATES` values
- Improve testing of template compilation (and move some tests from `theme_javascript_compiler_spec.rb` to `discourse_js_processor_spec.rb`
2022-09-01 11:50:46 +01:00
Bianca Nenciu 19ed9dd183
FIX: Keep private theme key secret from user (#18106)
The generate RSA key and import theme routes worked separate from each
other. The RSA key returned both the public and private key and it was
the frontend which posted the private key back to the server. With this
commit, only the public key is necessary as the server keeps a map of
public and private keys that is used to get the private key back from
a public key.
2022-09-01 13:15:23 +03:00
Bianca Nenciu 5092c9804c
FIX: Return next bookmarks page only if it exists (#18139)
It used to return the next URL anyway which lead to an additional
request. On the frontend, if the result set was empty, it kept retrying
until at least one result was returned. This bug is fixed in this commit
too.
2022-09-01 13:04:00 +03:00
David Taylor 15025ac958 UX: Show information about badge errors when saving
`popupAjaxError` is used by the controller to handle errors when saving the badge model. That only works properly when it gets the original exception from the ajax call. This manipulation of the error in the badge model was breaking that behavior.

The admin-badges controller is the only place which saves this model, so this shouldn't cause any issues elsewhere in the app.
2022-09-01 09:59:14 +01:00
David Taylor 240669da3a FIX: Immediately show sql options when badge query is supplied
`buffered` and `model` are EmberObjects, so we need to call `get()` when accessing values to ensure they are autotracked
2022-09-01 09:59:14 +01:00
David Taylor 0f8e4d7acc
DEV: Compile splash screen JS with ember-cli before inlining (#18150)
This lets us use all our normal JS tooling like prettier, esline and babel on the splash screen JS. At runtime the JS file is read and inlined into the HTML. This commit also switches us to use a CSP hash rather than a nonce for the splash screen.
2022-09-01 09:58:48 +01:00
David Taylor 4ccbb91691
DEV: Improve testing and documentation of RenderGlimmer actions (#18145) 2022-09-01 09:57:48 +01:00
Arpit Jalan 3aaf4dcfd0
FIX: hide welcome topic banner as soon as the welcome topic is edited (#18125)
* FIX: hide welcome topic banner as soon as the welcome topic is edited

This commit adds a message bus listener on client to hide the welcome
topic banner as soon as the welcome topic is edited.

* update test

* only subscribe when show_welcome_topic_banner is true

* Do not lookup for messageBus service if it's not required

* Remove unneeded code

* Cache result for Site.show_welcome_topic_banner

* Update tests per latest changes

* Changes per PR review
2022-09-01 09:44:21 +05:30
Joffrey JAFFEUX bbf00fd087
DEV: message bus is always present (#18147) 2022-08-31 16:41:29 +02:00
David Taylor 564787d1dd
FIX: Transpile start-discourse.js to fix iOS12 support (#18149)
33a2624f09 introduced a JS safe-navigation operator in `discourse-boot.js`. This needs to be transpiled to maintain iOS 12 support.
2022-08-31 15:15:19 +01:00
Krzysztof Kotlarek de8cd19438
FEATURE: unified user menu notifications count (#18132)
Each new user menu notifications should have their own count. Therefore, we need to include all types to serializer and not only `grouped_unread_high_priority_notifications`

Additional PR will be created for chat and assign plugin, as they will have to switch to  `grouped_unread_notifications` as well.
2022-08-31 11:16:28 +10:00
Bianca Nenciu daa3f96d54
FIX: Allow .git end to miss from Git repo URL (#18092)
When installing private themes and theme components, the public key does
not show until the administrator types a valid Git repo URL. The regular
expression that checked the URL was too strict and it required the URL
to end with ".git".
2022-08-30 22:05:43 +03:00
Jarek Radosz af7620cef8
FIX: In prod builds classes may not be "instancesof" EmberObject (#18137)
They do have CoreObject in their prototype chain.

Fixes the issue mentioned in https://github.com/discourse/discourse-chat/pull/1204
2022-08-30 17:36:20 +02:00
Jarek Radosz e33d694361
DEV: Stick to ipv4 when proxying testem requests (#18064)
`localhost` made it use ipv6, which didn't work (on macOS 13)
2022-08-30 13:38:55 +02:00
Alan Guo Xiang Tan c245b74398
FIX: Avoid leaking TopicTrackingState listeners due to sidebar (#18131)
In eb12daa7f8 when adding community
section support for anonymous users, we changed the `sectionLinks`
property into a getter method. This meant that if the getter method was
called again after the community section has been rendered, we would end
up reintializing the section links classes. As part of the
initialisation, some section links would setup a TopicTrackingState
onStateChange listener. However, the listener is only removed when the
entire community section is removed which resulted in us leaking the
onStateChange listeners.

This commit reverts the `sectionLinks` from being defined as a getter
method into a property which is only set once when the community section
is being constructor. Also, we changed it such that the community
section will register the listener instead of each section link since it
makes cleaning up much easier to reason about.

No tests have been added for this commit because the original bug is
not possible after this change and we already have an existing tests
ensuring that TopicTrackingState change listeners are cleaned up when
the community section is destroyed.

Internal ref: /t/73224
2022-08-30 11:39:32 +08:00
Osama Sayegh 417f156f6d
DEV: Use all unread notifications count for the count in document title (#18120)
When you receive a new notification, Discourse prepends a small count `(n)` to the tab title (i.e. `document.title`) if the tab is in the background to alert the user that they have a new notification. The count that's shown in the tab title should reflect the numbers shown on the notification bubbles above the user's avatar. Prior to the experimental user menu, there were 2 bubbles: a blue one which was removed once the user opened the menu and a green one that indicated high priority notifications and it was only removed when the user read all of their high priority notifications.

In the new experimental user menu, we no longer have the green bubble; everything is now combined (including flags/reviewables) into the blue one with no change to its behavior (i.e. it's removed once the user opens the menu). However, the logic that is responsible for updating the tab title hasn't been updated and still updates the tab title to include the count of the old green bubble. This commit updates the logic for the tab title count so that it only reflects the number on the blue bubble when the experimental user menu is enabled.
2022-08-30 05:37:03 +03:00
David Taylor e16c8ea2e7
DEV: Support inline-hbs compilation in themes (#18112)
This commit makes a number of improvements to the DiscourseJsProcessor:

1. Remove dependence on the out-of-date Ember template compiler from the ember-rails gem; switch to modern template compiler
2. Refactor to make use of a proper module system with `define`/`require`
3. Introduce `babel-plugin-ember-template-compilation` to enable inline hbs compilation

The `mini-loader` is upgraded to support relative lookup and `require.has`, so that these new JS packages work correctly.
2022-08-29 19:53:42 +01:00
David Taylor 1bd1664ae0
DEV: Compile markdown-it-bundle with ember-cli (#18104)
We were already compiling the markdown bundle via ember-cli, but that version was only being used in the test environment. This commit improves the implementation, and updates the filename so it's also used in production.

This commit also
- Removes the vendored copy of `markdown-it.js` and fetches from node_modules instead
- Updates `pretty_text.rb` to remove the custom sprockets-manifest-parsing
- Removes `pretty-text-bundle.js`, which was only being used by `pretty_text.rb`
2022-08-29 19:11:59 +01:00
Penar Musaraj 4116bce902
DEV: Add A11Y-friendly dialog addon (#18028)
This adds a new framework for accessible dialogs that will eventually replace bootbox. Under the hood, it uses the a11y-dialog package and an in-repo Ember addon. See PR for usage details.
2022-08-29 13:59:57 -04:00
Andrei Prigorshnev c3a93597c1
FEATURE: show user status description on the mention popup (#18110) 2022-08-29 21:16:48 +04:00
Andrei Prigorshnev 007980fdaf
FEATURE: make user status on post streams live (#17903) 2022-08-29 19:33:50 +04:00
Bianca Nenciu f351200683
FIX: Show tag chooser if can_tag_pms (#18107)
The old logic did not make sense and hid the selector from regular users
even if they could tag PMs or showed selector for admins even if they
could not tag PMs.
2022-08-29 15:52:19 +03:00
Andrei Prigorshnev b6e0219a74
DEV: extract until date formatting in a library function (#18003) 2022-08-29 15:45:36 +04:00
Andrei Prigorshnev bbdffff41f
DEV: use the format-age helper on the DnD button on the new user menu (#18108) 2022-08-29 15:21:07 +04:00
David Taylor bad78bfdfb
FIX: Preload topic_list correctly for categories+latest (#18122)
The preload key was changed in e7a84948b9 but this location was missed. This caused an extra AJAX request and left the cached topic list in the PreloadStore, which would then be accidentally used when navigating to the next topic-list route.
2022-08-29 11:17:32 +01:00
Osama Sayegh e6dba65f18
DEV: Include reaction notifications in the likes tab (#18118) 2022-08-29 12:32:50 +08:00
Alan Guo Xiang Tan d80535d78f
UX: Remove focus on hamburger icon after toggle (#18101) 2022-08-29 10:27:24 +08:00
Kris a0f402a957
DEV: plugin outlet for wizard checkboxes (#18113) 2022-08-26 17:03:30 -04:00
Kris faceb989bf
remove focus from sidebar header toggle click (#18088) 2022-08-26 16:00:01 -04:00
Isaac Janzen 614bf76c0b
DEV: update breadcrumbs outlet values (#18111) 2022-08-26 14:26:03 -05:00
Gerhard Schlager ec93bca99e
UX: Remove confusing fallback locale warning (#18096) 2022-08-26 01:22:04 +02:00
Kris 9d9c48fcb8
DEV: allow custom composer heights in CSS (#18094) 2022-08-25 18:12:35 -04:00
Osama Sayegh 97f094e5ee
DEV: Apply model transformer API on more models (#18087)
This commit extends the plugin API introduced in 40fd82e2d1 to the `Bookmark` and `Notification` models. It also refactors the code that's responsible for loading items in the experimental menu to use `async`...`await` instead of `Promise`s.
2022-08-26 00:44:06 +03:00
Andrei Prigorshnev 7be6f341a7
FEATURE: add the set user status button to the new user menu (#18079) 2022-08-25 18:14:42 +04:00
Osama Sayegh 40fd82e2d1
DEV: Add model transformer plugin API (#18081)
This API allows plugins to transform a list of model objects before they're rendered in the UI. At the moment, this API is limited to items/lists of the experimental user menu, but it may be extended in the future to other parts of the app.

Additional context can be found in https://github.com/discourse/discourse/pull/18046.
2022-08-25 15:41:58 +03:00
David Taylor 9ebebfb4cc
FIX: Load admin-specific JS when compiling via ember-cli (#18086)
The previous sprockets implementation was including admin-specific JS in the plugin's main JS file, which would be served to all users regardless of admin status. This commit achieves the same result under the ember-cli plugin asset compiler with one difference: the admin js is compiled into a separate file. That means that in future, we'll be able to make it loaded only for admins. For now though, it's loaded for everyone, just like before.
2022-08-25 11:36:02 +01:00
David Taylor e141208605
DEV: Compile plugin tests using ember-cli (#18074)
For now, `EMBER_CLI_PLUGIN_ASSETS` can be set to 0 to restore the old behavior. This option will be removed very soon.
2022-08-25 09:43:13 +01:00
Alan Guo Xiang Tan e9dac86cc0
FIX: Sidebar hamburger panel dropdown not working for anonymous (#18085)
We were incorrectly trying to render the sidebar sections for a logged
in user.
2022-08-25 16:29:06 +08:00
Alan Guo Xiang Tan 7f198bd975 DEV: Add dedicated translations for links in sidebar
We do not want to depend on existing translations which are used
elsewhere and can break the sidebar experience when changed.
2022-08-25 09:34:36 +08:00
Alan Guo Xiang Tan eb12daa7f8 DEV: Add sidebar community section for anonymous user 2022-08-25 09:34:36 +08:00
Kris 03a599f457
UX: revert sidebar scrollbar repositioning (#18076) 2022-08-24 13:26:25 -04:00
David Taylor e7a84948b9
FIX: Avoid duplicate topic-list requests (#18073)
When preloading topic_list data we were giving it a 'preload key' which was loosely based on the parameters of the list. However, it did not include all parameters, and mismatches between client/server-side logic would cause the preloaded data to be ignored.

This commit simplifies things by using a single key for all topic_list preloading. This works on the assumption that "The first topic_list the JS app will load is the one which was preloaded". That assumption also existed to some extent in the old design, so we don't expect any regressions here.
2022-08-24 11:54:01 +01:00
David Taylor 52f9370bd6
DEV: Remove JQuery from `lib/keyboard-shortcuts.js` (#18056) 2022-08-24 10:22:51 +01:00
David Taylor b175513765
DEV: Enable ember-cli plugin assets by default (#18058)
For now, `EMBER_CLI_PLUGIN_ASSETS` can be set to 0 to restore the old behavior. This option will be removed very soon.
2022-08-24 10:20:38 +01:00
Krzysztof Kotlarek 7a58bd8827
FIX: hide sidebar toggle button when no sidebar (#18068)
When sidebar is not available (for example for anonymous user for sites which requires log in), toggle button should be hidden as well.
2022-08-24 12:09:40 +08:00
Kris 3068df4cea
UX: sidebar styling, spacing consistency, etc (#18059) 2022-08-24 09:33:15 +08:00
Krzysztof Kotlarek 6fb3610f4e
FIX: hide sidebar for anonymous when login required (#18065)
Recently anonymous sidebar was introduced, but it should be hidden when site requires users to authenticate.
2022-08-24 10:04:10 +10:00
Jarek Radosz 87f5715878
DEV: Keep global state reset in a single place (#18049) 2022-08-23 21:09:37 +02:00
David Taylor 851bd78347
DEV: Enable jquery-integration runtime deprecation (#18057)
Omitting the flag from optional-features enables the runtime deprecation notice.

Also introduces `ember-jquery-legacy` which can be used to migrate to the new behaviour early. Details at https://deprecations.emberjs.com/v3.x/#toc_jquery-event

Core does not appear to make use of `originalEvent` in Ember event handlers. When searching for `originalEvent` there are some matches which relate to our pan-events mixin, but this is our own implementation and not affected by this deprecation.
2022-08-23 19:28:22 +01:00
David Taylor 1b180a3bdb
DEV: Remove JQuery from `components/topic-list.js` (#18048) 2022-08-23 19:27:54 +01:00
Jarek Radosz e21d2ac217
DEV: De-jQ sidebar tests (#18050)
And fix a typo
2022-08-23 18:30:07 +02:00
Kris 0cb6b8b263
DEV: prevent class clash with user-field names (#18055) 2022-08-23 11:46:51 -04:00
David Taylor 3b1a46ff37
DEV: Skip loading plugin JS when running only core tests (#18047)
Plugins often change core behavior, and thereby cause core's tests to fail. In CI, we work around this problem by running core CI without any plugins loaded.

In development, the only option to safely run the core tests is to uninstall all plugins, which is clearly a bad developer experience. This commit aims to improve that experience.

The `qunit_skip_plugins=1` flag would previously prevent the plugin **tests** from running. This commit extends that flag to also affect the plugin's application JS.
2022-08-23 10:25:07 +01:00
Krzysztof Kotlarek 2d58996a3b
FEATURE: anonymous sidebar categories and tags (#18038)
Default sidebar tags for not authenticated users can be defined in admin panel. Otherwise, top 5 categories and tags are taken.

Optionally, if categories are set up in permanent order, then the first 5 categories are taken.
2022-08-23 16:20:46 +08:00
Alan Guo Xiang Tan e3501a207f
UX: Add badges section link to community section. (#18044)
We have a link to /badges in the old hamburger dropdown so maintaining
parity here.
2022-08-23 15:42:48 +08:00
Alan Guo Xiang Tan 2bcad12848
DEV: Reorganize user and anonymous sidebar files into respective folders (#18039)
This commit does not change any functionality
2022-08-23 13:17:59 +08:00
Arpit Jalan 5d44c31bfa
UX: do not show site header on wizard pages (#18037) 2022-08-23 10:17:37 +05:30
Jarek Radosz 4ca6717994 DEV: Use `.ember-application` instead of `#main`
`#main` in the test environment is replaced with `#ember-testing`, so this code would break. It never did only because we don't test these code paths 👀
2022-08-23 09:24:00 +08:00
Jarek Radosz 349f6e18f3 DEV: Correctly clear global exported variables 2022-08-23 09:21:28 +08:00
Bianca Nenciu b160331d41
FIX: Move show like logic to client side (#18025)
The logic was added in commit ec8306835d,
to show the like action even if the user could not like the post. It is
not necessary for this logic to be implemented on the server side.
2022-08-22 18:40:09 +03:00
Jarek Radosz 21abcfe5a7
FIX: Track native class deps in discourseComputed (#18023)
Co-authored-by: David Taylor <david@taylorhq.com>
2022-08-22 17:33:32 +02:00
Arpit Jalan b567cebffe
FIX: remove "--composer-height" style when composer is closed (#18022)
* FIX: remove "--composer-height" style when composer is closed

* fix typo

* fix linting
2022-08-22 17:41:56 +05:30
Bianca Nenciu ec8306835d
FIX: Improvements to like button for archived topics (#17951)
* FIX: Do not allow to remove like if topic is archived

* FIX: Always show like button

The like button used to be hidden if the topic was archived and it had
no likes. This commit changes that to always show the like button, but
with a not-allowed cursor if the topic is archived.
2022-08-22 14:58:02 +03:00
David Taylor 33a2624f09
DEV: Introduce flag for compiling Plugin JS with Ember CLI (#17965)
When `EMBER_CLI_PLUGIN_ASSETS=1`, plugin application JS will be compiled via Ember CLI. In this mode, the existing `register_asset` API will cause any registered JS files to be made available in `/plugins/{plugin-name}_extra.js`. These 'extra' files will be loaded immediately after the plugin app JS file, so this should not affect functionality.

Plugin compilation in Ember CLI is implemented as an addon, similar to the existing 'admin' addon. We bypass the normal Ember CLI compilation process (which would add the JS to the main app bundle), and reroute the addon Broccoli tree into a separate JS file per-plugin. Previously, Sprockets would add compiled templates directly to `Ember.TEMPLATES`. Under Ember CLI, they are compiled into es6 modules. Some new logic in `discourse-boot.js` takes care of remapping the new module names into the old-style `Ember.TEMPLATES`.

This change has been designed to be a like-for-like replacement of the old plugin compilation system, so we do not expect any breakage. Even so, the environment variable flag will allow us to test this in a range of environments before enabling it by default.

A manual silence implementation is added for the build-time `ember-glimmer.link-to.positional-arguments` deprecation while we work on a better story for plugins.
2022-08-22 09:56:39 +01:00
Alan Guo Xiang Tan 558e6a3ff4 Review feedback 2022-08-22 15:20:56 +08:00
Alan Guo Xiang Tan 3a5314c792 UX: Fix topic admin menu hidden on narrow screens
When there is not enough window width to display the admin menu on the
right, we display it on the left instead. Behavior is reversed on RTL
layout.

This commit also removes jQUery usage.
2022-08-22 15:20:56 +08:00
Alan Guo Xiang Tan a3565914a4 UX: Adjust scrollbar behaviour in sidebar
Vertical sidebar is only restricted to sidebar sections and not the
footer.
2022-08-22 14:09:39 +08:00
Joffrey JAFFEUX 4e3c688d65
DEV: implements `removeKeys(predicate)` in keyValueStore (#18019) 2022-08-21 19:19:25 +02:00
Jarek Radosz 9130565895
DEV: Async a bit more of Composer (#18013) 2022-08-21 12:11:10 +02:00
Jarek Radosz ff0f43014c
DEV: Remove widget-test helpers file (#18011) 2022-08-21 09:20:45 +02:00
Jarek Radosz 545bfcaca7
DEV: Simplify "Editing a post stages new content" test (#18007) 2022-08-21 09:20:26 +02:00
Jarek Radosz 870ff48470
DEV: Rework two composer actions tests (#18008) 2022-08-21 09:19:39 +02:00
Jarek Radosz d35ffe8361
DEV: `zoom` isn't used anymore (#18016) 2022-08-21 09:18:19 +02:00
Jarek Radosz cb49fcad63
DEV: Clean up keyTrapper prototype override (#18018) 2022-08-21 09:17:33 +02:00
Jarek Radosz dc5dc78309
DEV: Use async and sinon.resolves instead of rsvp (#18001)
…in tests
2022-08-20 11:20:55 +02:00
Isaac Janzen 42385d020d
DEV: Add values to bread-crumbs-right plugin outlet (#18005) 2022-08-19 12:34:46 -05:00
Isaac Janzen ce30422d6c
DEV: Add select-kit option to hide values from preview (#18002)
* DEV: Add select-kit option to hide values from preview
2022-08-19 11:39:58 -05:00
Isaac Janzen 36f766399d
DEV: Add after-title-and-category plugin outlet (#18004) 2022-08-19 11:39:46 -05:00
Osama Sayegh 67bb0d8a55
DEV: Add profile tab to the experimental user menu (#17982)
This commit adds the profile tab to the experimental user menu. We're adding it to the user menu because it contains links/buttons that are not available anywhere else. We may remove the tab again if we find better places for those links/buttons, but for now it'll stay.

For more context on the experimental user menu, see https://github.com/discourse/discourse/pull/17379.
2022-08-19 13:02:11 +03:00
David Taylor 66376a6569
PERF: Minify admin and wizard JS bundles to match app (#17992)
This regressed when we switched these bundles to be compiled by ember-cli. Before/after sizes:

```
          before                  after
admin.js: 1370 KB (190 KB gz) --> 782 KB (125 KB gzipped)
wizard.js: 127 KB ( 22 KB gz) -->  68 KB ( 18 KB gzipped)
```
2022-08-19 08:35:00 +01:00
Alan Guo Xiang Tan 2d1e50911b DEV: Use button for sidebar section header
Buttons can be focused and action triggered via the enter key compared
to a span.
2022-08-19 10:21:36 +08:00
Martin Brennan 49a70a37f1
FIX: Remove last_unread_post excerpt logic for bookmarks (#17979)
The logic to determine what post excerpt to show for
a topic-level bookmark based on the last unread post
was complex and slow, so we decided to remove it and
always just use the first post excerpt.

This commit also fixes an issue where a couple of
instances of for_topic were missed when doing the
Bookmarkable refactors, so:

1. Clicking the topic bookmark link was not taking
   the user to the last unread post
2. When replying to a topic where there was a topic
   level bookmark with the auto delete preference
   of "on owner reply", we were not removing the
   bookmark from the UI correctly.

A test has been added for the former, the latter would
be quite time-consuming to test and not really worth
it considering it's quite an edge case UI bug.
2022-08-19 09:35:25 +10:00
David Taylor df9e546f5d
DEV: Abort qunit tests when clicking in the toolbar (#17989)
Ever opened `/tests`, immediately tried to change the config, and got frustrated that focus keeps getting stolen by the running tests? Worry no more - this commit will make the tests auto-abort when you click any of the input/dropdowns in the QUnit header. It's not perfect - abort will wait until the end of the currently running test, so sometimes focus will be stolen one more time. But it's still a lot better than having to manually find and click the abort button.
2022-08-18 23:32:38 +01:00
David Taylor c63580b226
DEV: Add hint when qunit assertion fails and app is unsettled (#17984) 2022-08-18 16:19:46 +01:00
Andrei Prigorshnev e49167b311
UX: Improve empty state copy on the activity/replies page (#17784) 2022-08-18 18:00:15 +04:00
Andrei Prigorshnev d7c1ff3116
UX: show blank page placeholder instead of the blue panel that says "No Activity" (#16293) 2022-08-18 17:24:52 +04:00
Arpit Jalan 1e58bed4d2
DEV: add tests for --composer-height calculation (#17986)
Follow up for 2b43238973
2022-08-18 18:03:15 +05:30
Jarek Radosz 7b51ac418b
DEV: Asyncify most of Composer controller (#17974)
…and fix cases where we were breaking the promise/async chain (by not awaiting or not returning promises)
2022-08-18 13:58:08 +02:00
Arpit Jalan a252bbf3e8
FIX: show hide bootstrap mode notice in real time (#17981) 2022-08-18 17:09:33 +05:30
Andrei Prigorshnev be1b202fd6
FEATURE: show default custom date on time-shortcut-pickers (#17867) 2022-08-18 14:55:54 +04:00
Alan Guo Xiang Tan 5990842dd9 UX: Revamp styling of sidebar
The following changes are made in this commit:

1. Move caret icon in sidebar section header to the right.
1. Each row in sidebar takes the full width which enables us to do a
full width highlight on hover and when sidebar link is active.
1. Ensure each row in Sidebar is of the same height.

Internal refs: /t/70546, /t/72196, /t/71820
2022-08-18 16:14:49 +08:00
David Taylor 44c53cb3bf
DEV: Update internal `package.json` metadata (#17978)
These packages are not published anywhere - they only exist for organizational purposes within this repository. Even so, it makes sense for their metadata to match that of the top-level discourse/discourse repository.
2022-08-17 23:27:16 +01:00
David Taylor 72ea00d0cc
DEV: Add progress output in CI during ember-cli build (#17977)
By default, in CI environments, Ember CLI does not output anything between "building..." and "cleaning up". Depending on configuration and hardware, Discourse asset builds can take upwards of 60s, and so this lack of output can make the build feel 'stuck'.

This commit introduces an addon which checks for CI mode, and then outputs status information periodically. The logic is very similar to Ember CLI's non-CI progress output implementation (https://github.com/ember-cli/ember-cli/blob/04a38fda2c/lib/models/builder.js#L183-L185).
2022-08-17 22:39:52 +01:00
David Taylor e70bab16e0
DEV: Ensure custom ember-cli addons only output JS files (#17976)
Without this filter, a binary file (e.g. `.DS_Store`) in one of these addon directories will be concatenated into the output JS. Note that this filter is applied at the end of the build pipeline, so any hbs files have already been transpiled into `.js`.

This mirrors the filtering performed on the main application bundle by Ember CLI: https://github.com/ember-cli/ember-cli/blob/04a38fda2c/lib/broccoli/default-packager.js#L1255
2022-08-17 21:42:55 +01:00
Jarek Radosz 665327f7a4
DEV: Clean up `loadDraft()` (#17969) 2022-08-17 20:43:35 +02:00
Arpit Jalan 2b43238973
FIX: set --composer-height when the composer is in collapsed state (#17968) 2022-08-17 20:51:09 +05:30
Jarek Radosz 83a975a28b
DEV: Await for all async MessageBus callbacks (#17966)
Should take care of yet another category of flaky tests
2022-08-17 12:44:48 +02:00
Osama Sayegh 129885c260
DEV: Add test for arrow keys navigation in the experimental user menu (#17961)
This test is extracted from the changes proposed in: https://github.com/discourse/discourse/pull/17379.
2022-08-17 11:51:29 +03:00
Alan Guo Xiang Tan 95c7cdab94 DEV: Template colocation for sidebar files
We can finally rely on template colocation in our app and we'll be
standarizing on that in the near future. However, I want to have sidebar
adopt this convention earlier.
2022-08-17 16:44:04 +08:00
Alan Guo Xiang Tan 0f0ea75a21
DEV: Display Sidebar template for anonymous user (#17962)
Setup the stage for the sidebar which will be shown to anonymous users.
2022-08-17 16:17:36 +08:00
Arpit Jalan 42c64abe15
FEATURE: open create invite modal from the bootstrap notice banner (#17960) 2022-08-17 13:11:09 +05:30
Alan Guo Xiang Tan 97a20d6d82
UX: Sort tags alphabetically in sidebar (#17959) 2022-08-17 14:47:29 +08:00
Alan Guo Xiang Tan f7ed09a02c
UX: Sort categories alphabetically in Sidebar (#17958) 2022-08-17 12:39:02 +08:00
Alan Guo Xiang Tan 4657110c35
UX: Make category section link icons consistent with Sidebar's interface (#17922)
Instead of relying on another help to generate the icons, we want to
rely on the interface for adding prefix icons. This ensures that prefix
icons are consistent across the section links in Sidebar
2022-08-17 09:40:43 +08:00
Penar Musaraj 2e09a88a29
A11Y: Accessible full-screen and minimize composer buttons (#17936) 2022-08-17 09:39:41 +08:00
Penar Musaraj c790b0305c
A11Y: Use button in `d-modal-cancel` component (#17938)
Fixes issue under User profile > Preferences > Security > Recently Used
devices > Cog icon. And cleans up the "reply where" modal as well.
2022-08-17 09:39:28 +08:00
Arpit Jalan f788c1b3e4
FIX: welcome topic title was not editable (#17950)
The topic title was not editable when composer was opened from the
welcome topic banner.
2022-08-16 21:27:40 +05:30
David Taylor 3e010bc88c
DEV: Ensure RenderGlimmer handles in-place component changes (#17946)
If a widget toggles between displaying two different RenderGlimmer instances, the Widget framework treats them as the same, and so `update()` is called rather than destroy/init. This commit detects this scenario and manually destroys/inits to ensure the correct component is being rendered.
2022-08-16 16:44:21 +01:00
Penar Musaraj e862373899
A11Y: Don't include aria on reply count `span` element (#17948) 2022-08-16 10:28:31 -04:00
Jarek Radosz 5c6f8d64f9
DEV: Use afterEach instead of try/finally (#17944)
Also removes _clearSnapshots calls, as those are already being reset in testCleanup
2022-08-16 10:49:09 +02:00
Jarek Radosz 53af30ec3f
DEV: Do the full cleanup after **every** test (#17943)
Previously the global state wasn't cleared in some cases leading to widespread test failures.
2022-08-16 10:48:32 +02:00
Jarek Radosz 655941b79c
DEV: Await for async helpers (#17942)
Fixes flaky tests. Also, a typo.
2022-08-16 10:48:17 +02:00
Jarek Radosz 7673899a6b
DEV: Remove commented-out code (#17945) 2022-08-16 10:46:26 +02:00
Alan Guo Xiang Tan 083c0074d6
DEV: Remove code that is not being used (#17941) 2022-08-16 13:58:43 +08:00
Alan Guo Xiang Tan 7a05a9d411
UX: Make Sidebar more consistent with user menu on mobile (#17940)
Before this commit, we carried custom code and styles for the sidebar on
mobile. This meant the look and feel of bringing up the sidebar on
mobile was very different from the user menu resulting in a very
inconsistent experience on mobile. Also, we could not leverage on the
existing swipe to close support on mobile.

In this commit, we made it such that the sidebar dropdown is always
rendered on mobile and made the interaction with the dropdown more
consistent with the user menu. There is also more parity with the old
hamburger dropdown when the experimental sidebar is disabled.
2022-08-16 13:45:32 +08:00
David Taylor e4de738f59
DEV: Introduce on-resize modifier and service (#17935)
This commit introduces a new `{{on-resize}}` modifier along with its companion `resize-observer` Service. These automatically take care of setting up the observer and handling cleanup.
2022-08-16 10:39:42 +08:00
Osama Sayegh 75599fb88e
DEV: Refactor new user menu files (#17879)
This commit includes the changes proposed in #17823. I've made these changes so that plugins that need to add tabs/lists with mixed item types - like the bookmarks tab that displays notifications and bookmarks - to the menu, don't have to write 2 templates like we currently do for the bookmarks/messages tabs (see user-menu/bookmark-notification-item.js that has been deleted in this commit).
2022-08-16 10:37:56 +08:00
Penar Musaraj b930f4886a
UX: Add flat text button styles and use in date/time cancel modal (#17892)
Also fixes an A11Y issue with the date/time cancel button.
2022-08-15 15:06:03 -04:00
Jarek Radosz 5043669d05
DEV: Proxy `mobile_view` param to /bootstrap.json (#17934)
Without this it took an extra request for the setting to take in dev mode.

Also, append `preview_theme_id` only when present.
2022-08-15 18:56:38 +02:00
Jarek Radosz 2a1de963ac
DEV: Fix /logs in dev env (#17933)
The space character was missing in CSP between `_lr` and `logs` urls.
2022-08-15 18:56:23 +02:00
David Taylor 55f34c45c6
DEV: Modernise discovery controller query parameter construction (#17927)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 17:20:44 +01:00
David Taylor 7067f13169
DEV: Silence resolver deprecations for now (#17931)
These are in widespread use, and upgrading themes/plugins right now would break their compatibility with the stable branch. These should be unsilenced for the release of 2.9.0 stable.
2022-08-15 16:11:46 +01:00
David Taylor 3ffc213fa9
FEATURE: Add safe-mode toggle to `/u/admin-login` (#17930)
Previously, this would require manually adding `?safe_mode=...` multiple times during the email-based login flow. `/u/admin-login` is often used when debugging a site, so it makes sense for this to be easier.

This commit introduces a new checkbox on the `/u/admin-login` screen. When checked, it'll set the safe_mode parameter on the `/email-login` link, and then pass it all the way through to the homepage redirect.
2022-08-15 15:30:07 +01:00
David Taylor 64a66cf82b
UX: Improve safe-mode usability (#17929)
- `no_custom` -> `no_themes` (history: before themes existed, we had a similar tool called 'customizations')
- `only_official` -> `no_unofficial_plugins` (matches format of `no_themes` and `no_plugins`, and makes it clear that this doesn't affect themes)
- `?safe_mode=no_themes%2C%no_plugins` -> `?safe_mode=no_themes,no_plugins` (the query portion of a URL does not require commas to be encoded. This is much nicer to read)
- If `no_plugins` is chosen from `/safe-mode` the URL generated will omit the superfluous `no_unofficial_plugins` flag
- Some tweaks to copy on `/safe-mode`
2022-08-15 15:15:15 +01:00
David Taylor a9e9adf253
DEV: Modernise rest adapter query parameter construction (#17925)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 14:44:07 +01:00
David Taylor b6c6c803c2
DEV: Allow safe_mode and preview_theme_id to work via ember-cli proxy (#17928) 2022-08-15 14:43:43 +01:00
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