Commit Graph

19311 Commits

Author SHA1 Message Date
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
chapoi da9ce77ffd
UX: danger colour update (#18516)
* UX: danger colour update

* Update test
2022-10-12 19:01:01 +02:00
Andrei Prigorshnev 98620f8e0e
FIX: status emoji was shown on the left on mobile (#18567) 2022-10-12 20:54:24 +04:00
Andrei Prigorshnev c32ab70111
FIX: alignment of user status emoji on posts (#18563) 2022-10-12 20:07:07 +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
chapoi 899ed039b7
FIX: typo (#18566) 2022-10-12 16:50:02 +02:00
Jarek Radosz 67e422c2d4
DEV: Remove noop CSS (#18564)
The lint warnings were:

```
inline-block is ignored due to the float. If 'float' has a value other than 'none', the box is floated and 'display' is treated as 'block'

scss(propertyIgnoredDueToDisplay)
```
2022-10-12 16:35:51 +02:00
Jarek Radosz 4170b9bb58
DEV: Use more css vars (#18561)
Followup to #18518

This time it's mostly line-height vars and a couple of other uncommon vars.
2022-10-12 16:05:42 +02:00
Jarek Radosz ea326906e3
DEV: Use css var font sizes (#18518)
For consistency and and the ability to change all font sizes at once in the dev tools
2022-10-12 15:31:59 +02: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
Jordan Vidrine 47fa4dbef3
FIX: User field styling on login (#18551) 2022-10-11 16:51:02 -05: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 d507151508
UX: add more spacing to tab btns (#18506) 2022-10-06 23:53:06 +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
Bianca Nenciu 73e9875a1d
FEATURE: Handle oneboxes for complex GitHub URLs (#18474)
GitHub PR URLs can link to a commit of the PR, a comment or a review
discussion.
2022-10-06 20:26:04 +03:00
Joffrey JAFFEUX 2d518b2895
UX: ensures we don't focus invisible button in sidebar (#18502)
Prior to this fix pressing tab multiple times in the sidebar, you would end up focusing invisible "sidebar-section-header-button". This change ensures the button will become visible when tabbing even if not hovering this section.

The `background: transparent change` is to avoid a flashing background due to different transition timing on the collapsable button.
2022-10-06 14:35:06 +02: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