Commit Graph

17271 Commits

Author SHA1 Message Date
Ted Johansson
9915236e42
FEATURE: Warn about outdated translation overrides in admin dashboard (#22384)
This PR adds a feature to help admins stay up-to-date with their translations. We already have protections preventing admins from problems when they update their overrides. This change adds some protection in the other direction (where translations change in core due to an upgrade) by creating a notice for admins when defaults have changed.

Terms:

- In the case where Discourse core changes the default translation, the translation override is considered "outdated".
- In the case above where interpolation keys were changed from the ones the override is using, it is considered "invalid".
- If none of the above applies, the override is considered "up to date".

How does it work?

There are a few pieces that makes this work:

- When an admin creates or updates a translation override, we store the original translation at the time of write. (This is used to detect changes later on.)
- There is a background job that runs once every day and checks for outdated and invalid overrides, and marks them as such.
- When there are any outdated or invalid overrides, a notice is shown in admin dashboard with a link to the text customization page.

Known limitations

The link from the dashboard links to the default locale text customization page. Given there might be invalid overrides in multiple languages, I'm not sure what we could do here. Consideration for future improvement.
2023-07-10 10:06:40 +08:00
Martin Brennan
ba53df5254
FIX: Show preview of Arial/System font in wizard (#22486)
Followup to db80a8ce79

The previous commit broke previewing the Arial and System fonts (which do
not have variant URLs to load).
2023-07-07 15:28:40 +10:00
Osama Sayegh
d2d6d727de
FEATURE: Add default site settings to control the defaults of navigation menu preferences (#22485)
Follow-up to b27e12445d

This commit adds 2 new site settings `default_sidebar_link_to_filtered_list` and `default_sidebar_show_count_of_new_items` to control the default values for the navigation menu preferences that were added in the linked commit (`sidebar_link_to_filtered_list` and `sidebar_show_count_of_new_items` respectively).
2023-07-07 04:52:10 +03:00
Alan Guo Xiang Tan
bf582290ba
FIX: Can't dismiss new topics for experimental new new view (#22484)
Regressed in 8b80132f88 due to a lack of
tests.
2023-07-07 08:28:27 +08:00
dependabot[bot]
67c7b1cc46
Build(deps-dev): Bump @babel/standalone from 7.22.6 to 7.22.8 in /app/assets/javascripts (#22479)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.22.6 to 7.22.8.
- [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.22.8/packages/babel-standalone)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 07:09:37 +08:00
dependabot[bot]
271e60e8c4
Build(deps-dev): Bump @babel/core from 7.22.6 to 7.22.8 in /app/assets/javascripts (#22482)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.6 to 7.22.8.
- [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.22.8/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 06:55:10 +08:00
Kris
98afea4748
UX: adjust sidebar modal styles, consolidate css (#22444)
This gets all the related CSS into the common file, and removes desktop and mobile variants.

This also makes some general styling adjustments.
2023-07-07 06:54:47 +08:00
Joffrey JAFFEUX
f0d82de5d9
DEV: fix flakeyness with drawer specs (#22476)
Chat drawer was using the `DiscourseURL` hook `afterRouteComplete`. This hook suffer from a very poor implementation which makes it very unreliable:

```javascript
if (typeof opts.afterRouteComplete === "function") {
  schedule("afterRender", opts.afterRouteComplete);
}
```

This commit attempts to return the promise from `handleURL` to directly use it and have a very reliable after transition hook.
2023-07-07 00:46:04 +02:00
Isaac Janzen
a9040be47c
FIX: Don't redirect when manually adding 2fa (#22474)
<img width="369" alt="Screenshot 2023-07-06 at 3 41 12 PM" src="https://github.com/discourse/discourse/assets/50783505/847d54ed-a62a-4266-b99e-31279f5bf747">

No changes in styling, the adding of classes was to give targets for testing
2023-07-06 16:44:40 -05:00
Isaac Janzen
7df4eab038
DEV: Convert activation modals to new component-based API (#22227)
This PR converts the following modals:
- `activation-edit`
- `activation-resent`
- `not-activated`

to make use of the new component-based API
2023-07-06 12:36:23 -05:00
Isaac Janzen
8b80132f88
DEV: Convert dismiss modals to component-based API (#22262)
This PR converts the following modals:
- `dismiss-new`
- `dismiss-read`
- `dismiss-notification-confirmation`

to make use of the new component-based API

# Additional Changes
## Before
By default we display a warning modal when dismissing a notification however we bypass the warning modal for specific notification types when they are a 'low priority' type of notification (eg. likes). To do this we were overwriting `dismissWarningModal` on a given notification type component

```javascript
dismissWarningModal() {
  return null
}
```

but in the case we wanted to change the text within the modal we were calling `showModal` and then passing in the respective options all over again, putting the logic of rendering the modal in multiple places.

```javascript
dismissWarningModal() {
  const modalController = showModal("dismiss-notification-confirmation");
  modalController.set(
    "confirmationMessage",
    I18n.t("notifications.dismiss_confirmation.body.assigns", {
      count: this._unreadAssignedNotificationsCount,
    })
  );
  return modalController;
}
```
 

## After
I simplified this by adding an extensible `dismissConfirmationText` function that can be updated on a per component basis as that was the only option being overridden. 

eg

```javascript
get dismissConfirmationText() {
  return I18n.t("notifications.dismiss_confirmation.body.bookmarks", {
    count: this.#unreadBookmarkRemindersCount,
});
```

This saves us from importing the entire modal again and keeps the core logic in one place.

Instead of overwriting the `dismissWarningModal` function and returning `null` to bypass the confirmation modal, I added another extension point of `renderDismissConfirmation` (defaults to true) to _toggle_ whether we should display a confirmation when dismissing notifications.

eg

```javascript
get renderDismissConfirmation() {
  return false;
}
```

we utilize this in core for specific _low priority_ notification types. When you need the confirmation modal to be displayed no matter the case you can set `alwaysRenderDismissConfirmation` to `true`

```
get alwaysRenderDismissConfirmation(){
  return true
}
```

This can be useful when you want to render the confirmation modal on a custom notification type that is not deemed as _high priority_, leading to the confirmation modal never being rendered.

You can see this in use in [Discourse Assign](https://github.com/discourse/discourse-assign/pull/481)
2023-07-06 12:14:26 -05:00
Isaac Janzen
c05e54e461
DEV: Convert second-factor-backup-edit modal to component-based API (#22366)
This PR converts the `second-factor-backup-edit` modal to make use of the new component-based API
2023-07-06 11:03:18 -05:00
David Taylor
f92ed88c52
FEATURE: Enable loading slider by default (#22439)
Followup to d51baa3bb3

Also includes: Force full rerender of post-stream widget when switching topics. This ensures that plugin/theme decorators are re-run when we switch between topics with the loading slider enabled.
2023-07-06 17:02:59 +01:00
David Taylor
f0f0c7cd6c
DEV: Simplify 'dismiss' button display logic (#22467)
Previously we were using the `didInsertElement` hook and querying the DOM to check whether the other button was visible. This is problematic from a performance point of view because it forces the browser to render the layout prematurely. It can also lead to subtle bugs based on the current scroll position.

In addition, having this logic on a `didInsertElement` hook makes it totally incompatible with the new 'loading slider' feature (because the component is not re-rendered between different topic lists).

This commit updates the logic to be based simply on the count of topics in the list. If there are fewer than 5 topics, the top button is hidden.
2023-07-06 15:28:45 +01:00
David Taylor
b40347dcac
FIX: Do not attempt to focus topic-list-item after destroy (#22468)
Under certain conditions, this `afterRender` hook can be triggered after the topic-list-item has been removed from the DOM. This is more likely when the 'loading slider' strategy is used on a site.
2023-07-06 15:27:19 +01:00
David Taylor
c6cd3af5b5
DEV: Convert share-topic modal to new component-based API (#22154) 2023-07-06 11:46:20 +01:00
Martin Brennan
1cd512a03a
DEV: Normalize key modifier checks for keyboard shortcuts (#22451)
This introduces a PLATFORM_KEY_MODIFIER const that
can be used both client and server side, to determine
whether we should be using the Meta or Ctrl key based
on whether the user is on Windows/Linux or Mac.
2023-07-06 13:34:24 +10:00
Krzysztof Kotlarek
fee3ebd812
DEV: Switch edit sidebar section modal to component (#22430)
Why this change?

A new component based API for modals was introduced in
b3a23bd9d6. This commit moves the edit
sidebar section modal to the new API.

Reviewer notes
No functionality or visual change is introduced in this PR.
2023-07-06 11:42:25 +10:00
Krzysztof Kotlarek
0744d242c6
FIX: post alerter notification when topic directly watched (#22433)
In previous PR https://github.com/discourse/discourse/pull/22340 bug was introduced. Notifications were blocked when, even if topic was watched directly. New query is taking TopicUser into consideration.

In addition, in user interface, when `watched_precedence_over_muted` is not set, then value from SiteSetting should be displayed.
2023-07-06 11:27:23 +10:00
Jarek Radosz
e72153dd1a
DEV: Remove unused raw-email code (#22364)
This code seems unused, since ~2016?
2023-07-05 18:13:30 +02:00
dependabot[bot]
07bb4453d9
Build(deps-dev): Bump @babel/standalone in /app/assets/javascripts (#22419)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.22.5 to 7.22.6.
- [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.22.6/packages/babel-standalone)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-05 17:05:32 +02:00
Isaac Janzen
2a598db08a
DEV: Convert second-factor-add-totp modal to component-based API (#22358)
This PR converts the `second-factor-add-totp` modal to make use of the new component-based API
2023-07-05 09:56:04 -05:00
dependabot[bot]
760668dfde
Build(deps-dev): Bump @babel/core in /app/assets/javascripts (#22418)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.5 to 7.22.6.
- [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.22.6/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-05 16:47:28 +02:00
David Taylor
d51baa3bb3
FEATURE: Introduce 'loading slider' for page navigations (#22042)
This brings the functionality from https://github.com/discourse/discourse-loading-slider into Discourse core. Default behaviour remains the same - the new slider mode can be enabled using the new 'page_loading_indicator' site setting.
2023-07-05 14:59:24 +01:00
Andrei Prigorshnev
a9dfda2d66
DEV: fix flaky specs for user status tooltip (#22435)
A follow-up to 585a2e4e. A couple of tests with the new rich tooltip were flaky. 
We suppose the reason is some problem related to widgets lifecycle. This PR 
doesn't fix the issue, but isolates testing of the tooltip related logic related 
inside its own test, which should make it not flaky.

This is a temporal solution, we're going to move all these code to using 
glimmer components.
2023-07-05 16:46:09 +04:00
Isaac Janzen
239d56dd69
DEV: Convert group-add-members modal to component-based API (#22368) 2023-07-05 11:04:06 +01:00
Keegan George
ad1b466cd4
DEV: Update JSON Editor to Glimmer and use new modalAPI (#22421) 2023-07-05 10:27:29 +01:00
Keegan George
d458ca154c
DEV: Update keyboard shortcuts to glimmer and new modal api (#22422) 2023-07-05 10:13:16 +01:00
Joffrey JAFFEUX
40ec9ab97b
DEV: skip post-inline-mention test (#22417)
Mentions tests are flakey ATM
2023-07-04 23:12:08 +02:00
Isaac Janzen
3f91656c2d
DEV: Convert do-not-disturb modal to component-based API (#22394)
This PR converts the `do-not-disturb` modal to make use of the new component-based API
2023-07-04 15:27:41 -05:00
Isaac Janzen
aaccb774de
DEV: Update default modal alert class (#22416)
This PR changes the default to not append any classes (when `@flashType` isn't present) and instead leans on the `alert` class for styling the alert which is a 1 to 1 match of the `alert-error` class.

8f21d2cf40/app/assets/stylesheets/common/base/alert.scss (L1-L4)

8f21d2cf40/app/assets/stylesheets/common/base/alert.scss (L22-L24)

In essence this changes the default modal alert styling from `success` to `error` if not overridden by `@flashType`
2023-07-04 15:22:14 -05:00
Keegan George
904450594d
DEV: Convert form template modals to new component-based API (#22196) 2023-07-04 12:42:36 -07:00
Renato Atilio
ce0ddfba8c
FIX: mobile share canonical URL (#22370)
* FIX: mobile share canonical url

* FIX: test

* DEV: address PR comments
2023-07-04 15:02:52 -03:00
Isaac Janzen
8f21d2cf40
DEV: Convert second-factor-edit modals to component-based API (#22367)
This PR converts the following modals:
- `second-factor-edit-security-key`
- `second-factor-edit`

to make use of the new component-based API
2023-07-04 12:13:54 -05:00
David Taylor
1122454904
DEV: Error if invalid @flashType passed to modal (#22414) 2023-07-04 18:11:29 +01:00
Isaac Janzen
148431d521
DEV: Convert fullscreen modals to component-based API (#22248)
This PR converts the following modals:
- `fullscreen-code`
- `fullscreen-table`

to make use of the new component-based API
2023-07-04 10:35:10 -05:00
Isaac Janzen
a579bd6b28
DEV: Convert second-factor-add-security-key modal to component-based API (#22351) 2023-07-04 16:15:37 +01:00
David Taylor
e549b0f132
DEV: Ensure DModal model argument is still available during destroy (#22411)
Previously, the `@model` argument would be unset before the component's `willDestroy` hook was called. Wrapping up the component and the opts in a single tracked `activeModal` field, and then using the `#each` helper with an array of 1 element means that Glimmer will keep the `@model` argument available until the end of the component's lifecycle.
2023-07-04 14:40:41 +01:00
David Taylor
999014e8e5
DEV: Add @bodyClass argument to <DModal> component (#22410) 2023-07-04 10:26:46 +01:00
Krzysztof Kotlarek
134dcdd63a
FEATURE: allow user to override watched_precedence_over_muted setting (#22340)
Recently, site setting watched_precedence_over_muted was introduced - https://github.com/discourse/discourse/pull/22252

In this PR, we are allowing users to override it. The option is only displayed when the user has watched categories and muted tags, or vice versa.
2023-07-04 15:08:29 +10:00
Alan Guo Xiang Tan
82d6420e31
PERF: Paginate loading of tags in edit nav menu tags modal (#22380)
What is the problem?

Before this change, we were relying on the  `/tags` endpoint which 
returned all the tags that are visible to a give user on the site leading to potential performance problems. 
The attribute keys of the response also changes based on the `tags_listed_by_group` site setting. 

What is the fix?

This commit fixes the problems listed above by creating a dedicate `#list` action in the
`TagsController` to handle the listing of the tags in the edit
navigation menu tags modal. This is because the `TagsController#index`
action was created specifically for the `/tags` route and the response
body does not really map well to what we need. The `TagsController#list`
action added here is also much safer since the response is paginated and
we avoid loading a whole bunch of tags upfront.
2023-07-04 11:36:39 +08:00
Alan Guo Xiang Tan
6ae4d6cd4c
DEV: Fix edit nav menu modals not appearing on mobile (#22403)
What is the problem?

This regressed in fe294ab1a7 and we did
not have any tests on mobile to catch the regression. The problem was
that we were conditionally rendering the edit nav menu modals component
in the sidebar. However, the sidebar is collapsed on mobile when a
button is clicked. When the sidebar collapses, the edit nav menu modals
ended up being destroyed with it.
2023-07-04 11:11:47 +08:00
Alan Guo Xiang Tan
fe294ab1a7
DEV: Switch edit nav menu tags/categories modal to component (#22401)
Why this change?

A new component based API for modals was introduced in
b3a23bd9d6. This commit moves the edit
navigation menu tags and categories modal to the new API.
2023-07-04 09:45:21 +08:00
Isaac Janzen
de192b1fbd
DEV: Skip flaky post-inline-mention test (#22399) 2023-07-03 17:09:30 -05:00
Bianca Nenciu
6a50d79044
DEV: Update diffhtml to 1.0.0-beta.29 again (#22365)
This reverts commit d40da76c8e.
2023-07-03 19:38:43 +03:00
David Taylor
1b693d0d60
DEV: Set owner on widget instances (#22391)
This allows us to use `getOwner(this)` on widgets (without needing to resort to our custom `discourse-common/lib/get-owner` implementation which has a hacky fallback)
2023-07-03 17:34:24 +01:00
David Taylor
0790e9f4f1
FIX: Correctly intercept <a href target="_self" (#22077)
`_self` is the default, so we should treat it the same as having no value specified. This fixes navigation to links like `/my/...` in custom sidebar links.
2023-07-03 16:46:40 +01:00
Jan Cernik
9bbfb6e171
DEV: Update hasTouchCapabilities in d-tooltip.js (#22388) 2023-07-03 11:45:06 -03:00
Jan Cernik
585a2e4e77
FEATURE: Use rich user status tooltip everywhere (#21125)
- Inline mentions on posts
- Inline mentions on chat messages
- The user autocomplete for the composer
- The user autocomplete for chat
- The chat section of the sidebar
2023-07-03 11:09:41 -03:00
David Taylor
b3a23bd9d6
DEV: Introduce new component-based DModal API (#21304)
Ember 4.x will be removing the 'named outlet' feature, which were previously relying on to render modal 'controllers' and their associated templates. This commit updates the modal.show API to accept a component class, and also introduces a declarative API which can be used by including the <DModal component directly in your template.

For more information on the API design, and conversion instructions from the current API, see these Meta topics:

DModal API: https://meta.discourse.org/t/268304
Conversion: https://meta.discourse.org/t/268057
2023-07-03 10:51:27 +01:00
Jarek Radosz
45c504d024
DEV: Remove unused testSelectKitModule (#22363) 2023-07-03 11:23:41 +02:00
Alan Guo Xiang Tan
68a3328999
FIX: Tags in tag groups not shown in edit nav menu tags modal (#22382)
What is the problem?

Before this change, the edit navigation menu tags modal was not
displaying tags that belonged to a tag_group when the tags_listed_by_group
site setting was set to true. This is because we are relying on the
/tags endpoint which returned tags in various keys depending on the
tags_listed_by_group site setting. When the site setting is set to
true, tags under belonging to tag groups were returned in the
extra.tag_groups attribute.

What is the fix?

This commit fixes it by pushing all tags in returned under the
`tag_groups` attribute into the list of tags to displayed. In a
following commit, we will move away from the `/tags` endpoint to a
dedicated route to handle the listing of tags in the modal.
2023-07-03 14:29:05 +08:00
Martin Brennan
db80a8ce79
FIX: Preload fonts before rerendering wizard style canvas (#22361)
]When changing fonts in the `/wizard/steps/styling` step of
the wizard, users would not see the font loaded straight away,
having to switch to another one then back to the original to
see the result. This is because we are using canvas to render
the style preview and this fails with a Chrome-based intervention
when font loading is taking too long:

> [Intervention] Slow network is detected. See
https://www.chromestatus.com/feature/5636954674692096 for more details.
Fallback font will be used while loading:
https://sea2.discourse-cdn.com/business7/fonts/Roboto-Bold.ttf?v=0.0.9

We can get around this by manually loading the fonts selected using
the FontFace JS API when the user selects them and before rerendering
the canvas. This just requires preloading more information about the
fonts if the user is admin so the wizard can query this data.
2023-07-03 11:30:26 +10:00
Martin Brennan
7de3cb9b02
FIX: Revert uppy aws-s3 upgrade (#22376)
Reverting 898e571a91
which is causing upload failures for site settings and custom
avatars, same reason this one was reverted:

e0a20398dd
2023-07-03 10:07:34 +10:00
dependabot[bot]
19b1ecdf86
Build(deps-dev): Bump eslint from 8.43.0 to 8.44.0 in /app/assets/javascripts (#22372)
Bumps [eslint](https://github.com/eslint/eslint) from 8.43.0 to 8.44.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.43.0...v8.44.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 07:10:40 +08:00
Jarek Radosz
5584fb1e3b
DEV: Clean up package.json files (#22349)
Motivation: aligning us with JS/Ember practices (runtime deps in `dependencies`, build/dev-time deps in `devDependencies`)

1. Move deps to devDeps where applicable (rule of thumb: it's a devDep unless it's required at runtime by the rails app or it's imported in the addon's code)
2. Remove unused dependencies and add missing ones (in addons)
3. Remove empty `repository` fields
4. Move `engines` and `ember` fields to the bottom
2023-06-30 13:01:45 +02:00
Martin Brennan
e0a20398dd
Revert "Build(deps): Bump @uppy/aws-s3-multipart from 3.1.3 to 3.4.0 in /app/assets/javascripts (#22190)" (#22359)
This reverts commit d8f0f17b50.

This causes errors when uploading to S3 because we are missing
a getFilesByIds function in core which we have not updated
yet c.f. https://github.com/discourse/discourse/pull/22195

Tests don't catch this because tests only try uploads.json
uploading.
2023-06-30 14:05:19 +10:00
dependabot[bot]
d8f0f17b50
Build(deps): Bump @uppy/aws-s3-multipart from 3.1.3 to 3.4.0 in /app/assets/javascripts (#22190)
Bumps [@uppy/aws-s3-multipart](https://github.com/transloadit/uppy) from 3.1.3 to 3.4.0.
- [Release notes](https://github.com/transloadit/uppy/releases)
- [Changelog](https://github.com/transloadit/uppy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/transloadit/uppy/compare/@uppy/aws-s3-multipart@3.1.3...@uppy/aws-s3-multipart@3.4.0)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3-multipart"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-30 10:32:41 +08:00
Krzysztof Kotlarek
3c019b1c0f
FIX: consistent sidebar section external links (#22343)
Before this change, links which required full reload because they are not in ember routes like `/my/preferences` or links to docs like `/pub/*` were treated as real external links. Therefore, they were opening in self window or new tab based on user  `external_links_in_new_tab` setting.

To be consistent with behavior when full reload links are in the post, they are treated as internal and always open in the same window.
2023-06-30 12:25:43 +10:00
dependabot[bot]
898e571a91
Build(deps): Bump @uppy/aws-s3 from 3.0.6 to 3.2.0 in /app/assets/javascripts (#22192)
Bumps [@uppy/aws-s3](https://github.com/transloadit/uppy) from 3.0.6 to 3.2.0.
- [Release notes](https://github.com/transloadit/uppy/releases)
- [Changelog](https://github.com/transloadit/uppy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/transloadit/uppy/compare/@uppy/aws-s3@3.0.6...@uppy/aws-s3@3.2.0)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-30 09:09:33 +08:00
dependabot[bot]
b902978fb6
Build(deps): Bump @uppy/utils from 5.2.0 to 5.4.0 in /app/assets/javascripts (#22191)
Bumps [@uppy/utils](https://github.com/transloadit/uppy) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/transloadit/uppy/releases)
- [Changelog](https://github.com/transloadit/uppy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/transloadit/uppy/compare/@uppy/utils@5.2.0...@uppy/utils@5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-30 09:09:11 +08:00
Jarek Radosz
e8490a735b
DEV: Update sub-dependencies (#22325)
Achieved by running `yarn upgrade --latest` both yarn.lock directories, then reverting changes to package.json files and running `yarn` again.

I also de-duped yarn.lock files with `npx yarn-deduplicate && yarn`
2023-06-29 17:08:33 +02:00
marstall
60273e4508
FIX: DateTimeInputRange should show correct intervals with @relativeDate param (#22331) 2023-06-29 09:43:01 -04:00
Jarek Radosz
a7421d3675
DEV: Remove unused User methods (#22347) 2023-06-29 12:23:59 +02:00
Jarek Radosz
3290c954f9
DEV: Fix random typos (#22345) 2023-06-29 12:23:28 +02:00
dependabot[bot]
4c95f786c0
Build(deps-dev): Bump eslint-plugin-qunit in /app/assets/javascripts (#22337)
Bumps [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit) from 7.3.4 to 8.0.0.
- [Release notes](https://github.com/platinumazure/eslint-plugin-qunit/releases)
- [Changelog](https://github.com/platinumazure/eslint-plugin-qunit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/platinumazure/eslint-plugin-qunit/compare/v7.3.4...v8.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-qunit
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 01:09:34 +02:00
dependabot[bot]
09feb03056
Build(deps): Bump message-bus-client in /app/assets/javascripts (#22335)
Bumps [message-bus-client](https://github.com/discourse/message_bus) from 4.3.2 to 4.3.7.
- [Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
- [Commits](https://github.com/discourse/message_bus/compare/v4.3.2...v4.3.7)

---
updated-dependencies:
- dependency-name: message-bus-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 01:00:36 +02:00
dependabot[bot]
c5b4168d3a
Build(deps): Bump webpack in /app/assets/javascripts (#22336)
Bumps [webpack](https://github.com/webpack/webpack) from 5.88.0 to 5.88.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.88.0...v5.88.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 01:00:12 +02:00
Kris
9cc2b5cc20
DEV: add before-header-panel plugin outlet (#22285) 2023-06-28 17:26:30 -04:00
Keegan George
b6f03fcecd
DEV: Add support for uploads to form templates (#22232) 2023-06-28 12:49:05 -07:00
Jarek Radosz
d40da76c8e
Revert "DEV: Update diffhtml from 1.0.0-beta.20 to 1.0.0-beta.29 (#22311)" (#22327) 2023-06-28 14:49:20 +02:00
Jarek Radosz
b74d0633d8
DEV: Fix default pretenders (#22326)
Prevent state leakage and update `/tags` to match the server
2023-06-28 13:59:17 +02:00
Ted Johansson
6fc62586a2
FEATURE: Show available interpolation keys when overriding translations (#22220)
This is the first of a number of PRs aimed at helping admins manage their translation overrides. It simply adds a list of available interpolation keys below the input field when editing an override.

It also includes custom interpolation key.
2023-06-28 19:03:04 +08:00
Jarek Radosz
7791bb1276
DEV: Update moment-timezone-with-data (#22313)
`Africa/Cairo` timezone introduced DST so I replaced it in tests with `America/Lima`
2023-06-28 11:33:55 +02:00
Jarek Radosz
80bd7d7509
DEV: Update diffhtml from 1.0.0-beta.20 to 1.0.0-beta.29 (#22311)
It was already up to date in package.json but wasn't plugged in.
2023-06-28 10:27:42 +02:00
Jarek Radosz
3ceed88854
DEV: Update chartjs-plugin-datalabels from 2.0.0 to 2.2.0 (#22310)
It was already up to date in the package.json but it wasn't "plugged in"
2023-06-28 10:12:12 +02:00
dependabot[bot]
51657bee8d
Build(deps-dev): Bump terser from 5.18.1 to 5.18.2 in /app/assets/javascripts (#22315)
Bumps [terser](https://github.com/terser/terser) from 5.18.1 to 5.18.2.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.18.1...v5.18.2)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 09:42:23 +08:00
Alan Guo Xiang Tan
aef7c2fe8f
UX: Use modals to edit categories and tags that appear in sidebar (#22295)
Why this change?

We are currently not fully satisfied with the current way to edit the
categories and tags that appears in the sidebar where the user is
redirected to the tracking preferences tab in the user's profile causing
the user to lose context of the current page. In addition, the dropdown
to select categories or tags limits the amount of information we can
display.

Since editing or adding a custom categories section is already using a
modal, we have decided to switch editing the categories and tags that
appear in the sidebar to use a modal as well.

This commit removes the `new_edit_sidebar_categories_tags_interface_groups` site setting and
make the modals the default for all users.
2023-06-28 07:20:31 +08:00
Jarek Radosz
d3facec7d0
DEV: Update @json-editor/json-editor (#22308)
Manually tried it out by editing a json_schema setting of a theme component
2023-06-27 23:01:58 +02:00
Kris
b30ef5d6a0
FIX: nest theme translation data so it saves (#22306) 2023-06-27 14:27:32 -04:00
Vinoth Kannan
ca016c1655
DEV: add group-messages css class to user private messages group page. (#22302)
It adds `group-messages` and `group-NAME` css classes to the PM topic list.
2023-06-27 21:34:07 +05:30
Roman Rizzi
f4e7a80600
DEV: Cache summarization strategy results. (#22230)
Updates the interface for implementing summarization strategies and adds a cache layer to summarize topics once.

The cache stores the final summary and each chunk used to build it, which will be useful when we have to extend or rebuild it.
2023-06-27 11:44:34 -03:00
Vinoth Kannan
78d8bd7c81
FIX: hide "Save Draft" button when editing post on same topic. (#22266)
When the composer is open with a draft for a topic and the user clicks the edit button of a post on the same topic, we shouldn't display the "Save Draft" button. Because the edited post's draft will override the existing draft of the same topic even if we saved it.
2023-06-27 14:07:23 +05:30
Jarek Radosz
4880b30bc4
DEV: Force update of unset-value (#22287)
…to close automated upgrade warnings. the api didn't have any breaking changes between 1.x and 2.x
2023-06-27 10:26:59 +02:00
Vinoth Kannan
d261e0aee0
DEV: add raw plugin outlet to create new topic list item columns. (#22296)
This commit will introduce a new plugin outlet in the raw topic list item handlebar. We can add a new column at the end using this plugin outlet.
2023-06-27 13:48:54 +05:30
Jarek Radosz
11da996304
DEV: Remove ember-rfc176-data (#22290) 2023-06-27 07:55:51 +02:00
Alan Guo Xiang Tan
75b402f07c
UX: Fix position of filters in edit categories/tags nav menu modals (#22292)
Why this change?

We want the position of the filters to remain fixed when scrolling
through the list of categories or tags. Otherwise, the user has to
scroll all the way back to othe top in order to access the filters when
the list of categories or tags is large.
2023-06-27 12:52:42 +08:00
Alan Guo Xiang Tan
4f7f9ef87c
UX: Order categories in edit navigation menu modal by name (#22291)
Why does this change do?

If the `fixed_category_positions` is `false`, we want to order the
categories in the edit navigation menu categories modal by name. This
makes it easier to filter through a large list of categories.

This commit also fixes a bug where we were unintentionally mutating the
`this.site.categories` array.
2023-06-27 10:31:48 +08:00
Jarek Radosz
6517e6d47a
DEV: Force upgrade of loader-utils (#22289) 2023-06-27 02:09:27 +02:00
Alan Guo Xiang Tan
df04a99db9
FIX: Abort transition when transition.from present on new-topic route (#22253)
Why is this change required?

The `/new-topic` route is a special route which we use to open the
composer by loading a URL. By default, the `new-topic` route is replaced with the
`discovery.latest` route. On a fresh page load, this makes sense since
there is no template for the `new-topic` route to render. However, this
behavior does not make sense if we're transition from another route.
There is no need to replace the current route with the `discovery.latest` when all we want
is to open the composer.

What does this commit do?

This commit fixes the undesirable behaviour described above by aborting
the existing transition to the `new-topic` route if `transition.from` is
present. This indicates that we're navigating from an existing route and
we can just open the composer.
2023-06-27 08:03:51 +08:00
Vinoth Kannan
fa047d928d
FIX: render plugin's commit URL correctly and open in new window. (#22273)
Previously, the URLs are missed in the commit links in the version column. Follow up to: https://github.com/discourse/discourse/pull/22176
2023-06-26 22:43:25 +05:30
Bianca Nenciu
4bb4be958c
FIX: Show tag chooser in composer for PM on mobile (#22241)
This was not displayed on mobile due to space constraints. With better
organization of the title, category and tags inputs, it can be
displayed.
2023-06-26 20:12:32 +03:00
Jarek Radosz
0ca6f0cdb0
DEV: Remove ember-cli-dependency-checker (#22283)
While still in ember-cli new app blueprint, I don't think this package does much for us. It has support for older things like bower and npm-shrinkwrap, but doesn't support checking yarn.lock and doesn't necessarily work well with our project structure.
2023-06-26 17:57:12 +02:00
Jarek Radosz
d65c7d6ce3
DEV: Update ember-cli to 5.0.0 (#22280) 2023-06-26 17:15:59 +02:00
Jarek Radosz
9a276cb688
DEV: Update ember-resolver (#22277) 2023-06-26 16:14:27 +02:00
dependabot[bot]
4dd9487e25
Build(deps): Bump html-entities in /app/assets/javascripts (#22269)
Bumps [html-entities](https://github.com/mdevils/html-entities) from 2.3.6 to 2.4.0.
- [Release notes](https://github.com/mdevils/html-entities/releases)
- [Changelog](https://github.com/mdevils/html-entities/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mdevils/html-entities/compare/v2.3.6...v2.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-26 13:16:09 +02:00
Vinoth Kannan
52894b9d7c
FEATURE: display commit hash for each plugin on /admin/plugins page. (#22176)
It will help to find out the current version of the plugins even without the `docker_manager` plugin.
2023-06-26 10:09:57 +05:30
Sérgio Saquetim
486edb845c
DEV: Added data attributes to identify the user settings in the UI (#22261)
This commit adds data attributes to identify the controls in the user settings UI.

Plugins and TCs can use this information to target each setting to highlight or hide
them.

Although most of the settings also have specific classes identifying them, using data
attributes is more future proof as it is less likely to change them classes, specially
as we increase the adoption of the BEM methodology in CSS.

Using data attributes also are semantically correct as the setting name is data not really related to the classes used.
2023-06-23 16:51:59 -03:00
Sérgio Saquetim
40301fae36
DEV: Add plugin outlet above the navigation in the messages tab in the user profile (#22254) 2023-06-23 16:14:02 -03:00
Kris
dec93cdac5
DEV: add before/after/below main-outlet outlets (#22260) 2023-06-23 14:12:27 -04:00
Mark VanLandingham
36b9572bb1
FIX: Attempt to reconnect to server when browser visibilty changes (#22259) 2023-06-23 11:32:34 -05:00
Penar Musaraj
a984a807fd
A11Y: Don't output aria-labelledby when card is empty (#22247)
The user card is always present in the DOM. Therefore we only need to
add the `aria-labelledby` attribute when there is a user (and a title)
to point to.
2023-06-23 09:25:03 -04:00
Alan Guo Xiang Tan
303fcf303c
FEATURE: Add dropdown to filter by selected in edit nav menu modal (#22251)
What does this change do?

This change adds a dropdown filter that allows a user to filter by
selected or unselected categories/tags in the edit navigation menu
modal.

For the categories modal, parent categories that do not match the
dropdown filter will be displayed as disabled since those parent
categories need to be displayed to maintain the hieracy of the child
child categories.
2023-06-23 10:29:00 +08:00
Alan Guo Xiang Tan
6e3f3dff86
DEV: Refactor edit tags/categories modal to reduce duplication (#22240)
Why this change?

There was alot of duplication between the edit navigation menu tags/categories modal which
was making it hard to introduce new changes as the work had to be
duplicated into multiple places.

This commit mainly extracts the duplicated code into common components
such that it is easier to make styling changes across both modals.
2023-06-23 08:28:55 +08:00
Jarek Radosz
ba62d20f71
DEV: Update ember-template-lint (#22242) 2023-06-22 22:54:46 +02:00
Osama Sayegh
b27e12445d
FEATURE: Split navigation preference for count and behavior of sidebar links (#22203)
This PR splits up the preference that controls the count vs dot and destination of sidebar links, which is really hard to understand, into 2 simpler checkboxes:

The new preferences/checkboxes are off by default, but there are database migrations to switch the old preference to the new ones so that existing users don't have to update their preferences to keep their preferred behavior of sidebar links when this changed is rolled out.

Internal topic: t/103529.
2023-06-22 19:04:13 +03:00
Mark VanLandingham
fcaa9757f3
DEV: Use online/offline window events to track network connectivity (#22243) 2023-06-22 09:09:28 -05:00
tshenry
dccdbd52a3
DEV: Add plugin outlet to latest-topic-list-item component (#22238)
Introduces a new above-latest-topic-list-item-post-count outlet, providing a clean way to add other useful elements to the topic-stats section of the latest-topic-list-item template.
2023-06-22 01:24:00 -07:00
Alan Guo Xiang Tan
d875e6e998
UX: Fix edit tags/categories navigation menu modal has no focus on input (#22237)
What this change?

When a user opens the modal to edit tags or categories for the
navigation menu, we want to input filter to have focus. This commit
fixes that by doing the following:

1. Changes <DModal> component such that it prioritises elements with the
   autofocus attribute first.
2. Adds `autofocus` to the input elements on the edit tags/categories
   modal form.
2023-06-22 09:56:12 +08:00
dependabot[bot]
f8b631cba6
Build(deps): Bump webpack from 5.87.0 to 5.88.0 in /app/assets/javascripts (#22235)
Bumps [webpack](https://github.com/webpack/webpack) from 5.87.0 to 5.88.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.87.0...v5.88.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 09:45:20 +08:00
dependabot[bot]
d6ef268d5a
Build(deps-dev): Bump sass from 1.63.4 to 1.63.6 in /app/assets/javascripts (#22236)
Bumps [sass](https://github.com/sass/dart-sass) from 1.63.4 to 1.63.6.
- [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.63.4...1.63.6)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 09:45:07 +08:00
Jarek Radosz
876ff17cc2
DEV: Update eslint/prettier (#22226) 2023-06-21 20:59:03 +02:00
dependabot[bot]
530c9aa7c6
Build(deps-dev): Bump terser in /app/assets/javascripts (#22193)
Bumps [terser](https://github.com/terser/terser) from 5.18.0 to 5.18.1.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.18.0...v5.18.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-21 11:35:50 +02:00
Alan Guo Xiang Tan
f5af4936d4
FIX: Site's top tags not shown for anonymous user (#22219)
When a site does not have `default_navigation_menu_tags`
site setting set, anonymous users should be shown the site's top tags as
a default in the tags section. However, this regressed in 9fad71809c
and we ended up showing anonymous users a tags section with only the
`All Tags` section link.

As part of this commit, I have also refactored the QUnit acceptance
tests to system tests which are much easier to work with.
2023-06-21 14:37:40 +08:00
Alan Guo Xiang Tan
547b520261
FEATURE: Add deslect all and reset to defaults btn edit nav menu modal (#22218)
What does this change do?

This change adds the deselect all and reset to defaults buttons to the
edit navigation menu tags modal. The deselect all button when
clicked deselects all the selected tags in the modal. If the user
saves with no tags selected, the user's tags section in the
navigation menu will be set to the site's top tags.

The reset to defaults button is only shown when the
`default_navigation_menu_tags` site setting has been configured.
When clicked, the user's tags section in the navigation menu is
automatically set to the tags defined by the
`default_navigation_menu_tags` site setting.
2023-06-21 12:45:48 +08:00
Alan Guo Xiang Tan
53d2e44e14
UX: Display spinner while loading tags for edit nav menu tags modal (#22217)
What does this change do?

This change adds a loading spinner to the edit navigation menu tags
modal when the request to fetch all the tags for a site is in progress.
This mainly to improve the user experience such that we indicate that
something is being loaded instead of just displaying a large empty
space.

What are there no tests for this change?

This change is kind of hard to test and since it is mostly a UX change,
we can live with such regressions in the future. It is still bad to
regress UX wise but impact of such a regression is likely to be low.
2023-06-21 12:45:37 +08:00
Krzysztof Kotlarek
a64cb948ed
FIX: update unread and new count for categories (#22145)
There is a problem that unread and new count is not updated to reflecting topicTrackingState.

It is because discourseComputed on Category is not working properly with topicTrackingState. Moving it to component level is making counter reliable.
2023-06-21 13:42:30 +10:00
Alan Guo Xiang Tan
609562be3e
FEATURE: Add input filter for editing tags in navigation menu modal (#22216)
What does this change do?

This commit adds an input filter to filter through the tag checkboxes in the
modal to edit tags that are shown in the user's navigation menu. The
filtering is a simple matching of the given filter term against the
names of the tags.
2023-06-21 10:59:56 +08:00
Alan Guo Xiang Tan
08d8bd9f43
FEATURE: Add modal for editing tags in navigation menu (#22214)
What does this change do?

This change is a first pass for adding a modal used to edit tags that appears in
the navigation menu. As the feature is being worked on in phases, it is
currently hidden behind the `new_edit_sidebar_categories_tags_interface_groups` site setting.

The following features will be worked on in future commits:

1. Input filter to filter through the tgas
2. Button to reset tag selection to default navigation menu tags site
   settings
3. Button to deselect all current selection
2023-06-21 09:09:56 +08:00
dependabot[bot]
d6f2b9c72c
Build(deps-dev): Bump sinon from 15.1.2 to 15.2.0 in /app/assets/javascripts (#22211)
Bumps [sinon](https://github.com/sinonjs/sinon) from 15.1.2 to 15.2.0.
- [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/v15.1.2...v15.2.0)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-21 07:23:39 +08:00
Keegan George
75e711284a
DEV: Add custom error messages to form template forms (#22169) 2023-06-20 13:45:58 -07:00
Isaac Janzen
e1561bc459
FIX: 'in all topics' should search in all topics (#22207)
When searching in the context of a topic the <kbd>in all topics</kbd> link would not search globally for the given term and instead it would always search within the current topic. This PR fixes the link to properly update the search context and search globally for the given term.

This fix reveals some _secretly_ broken tests. Update these as well.
2023-06-20 11:59:15 -05:00
Osama Sayegh
cee15d4177
FIX: Don't error when clicking on a custom link in community section (#22174) 2023-06-20 16:35:33 +08:00
Martin Brennan
fc199d42fa
FIX: Add aria-label attribute to cooked hashtags (#22182)
This commit adds an aria-label attribute to cooked hashtags using
the post/chat message decorateCooked functionality. I have just used
the inner content of the hashtag (the tag/category/channel name) for
the label -- we can reexamine at some point if we want something
different like "Link to dev category" or something, but from what I
can tell things like Twitter don't even have aria-labels for hashtags
so the text would be read out directly.

This commit also refactors any ruby specs checking the HTML of hashtags
to use rspec-html-matchers which is far clearer than having to maintain
the HTML structure in a HEREDOC for comparison, and gives better spec
failures.

c.f. https://meta.discourse.org/t/hashtags-are-getting-a-makeover/248866/23?u=martin
2023-06-20 15:47:17 +10:00
Sam
a999deaab9
revert message bus (#22200)
* Revert "Build(deps): Bump message-bus-client from 4.3.2 to 4.3.3 in /app/assets/javascripts (#22194)"

This reverts commit cdcf6cf0dd.

* Revert "Build(deps): Bump message_bus from 4.3.2 to 4.3.3 (#22188)"

This reverts commit c7a9da1f10.
2023-06-20 10:39:39 +10:00
Alan Guo Xiang Tan
289d2a5540
DEV: Deselect all and reset to defaults btns to edit categories modal (#22143)
What does this change do?

This change adds the deselect all and reset to defaults buttons to the
edit navigation menu categories modal. The deselect all button when
click deselects all the selected categories in the modal. If the user
saves with no categories selected, the user's categories section in the
navigation menu will be set to the site's top categories.

The reset to defaults button is only shown when the
`default_navigation_menu_categories` site setting has been configured.
When clicked, the user's categories section in the navigation menu is
automatically set to the categories defined by the
`default_navigation_menu_categories` site setting.
2023-06-20 08:17:53 +08:00
dependabot[bot]
cdcf6cf0dd
Build(deps): Bump message-bus-client from 4.3.2 to 4.3.3 in /app/assets/javascripts (#22194)
Bumps [message-bus-client](https://github.com/discourse/message_bus) from 4.3.2 to 4.3.3.
- [Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
- [Commits](https://github.com/discourse/message_bus/compare/v4.3.2...v4.3.3)

---
updated-dependencies:
- dependency-name: message-bus-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 07:11:35 +08:00
Penar Musaraj
f89b5680cb
FEATURE: Enable image grid by default (#22160) 2023-06-19 13:24:52 -04:00
Penar Musaraj
fc11e77eff
FIX: Theme translations resetting on save (#22072)
Fixes an issue where saving a theme translation would reset unsaved
changes made to other theme translations.

Also cleans up unused `saveSettings` and `saveTranslations` actions.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-06-19 10:37:43 -04:00
Alan Guo Xiang Tan
57c96ed03d
FIX: Broken group messages inboxes when group name is mixed case (#22183)
This is a follow up to 1cbc65ba79 where
visiting a group with a mixed case name would result in an error.
2023-06-19 17:36:04 +08:00
Krzysztof Kotlarek
8837ee4b39
FIX: small bug with topics and my posts translations (#22179)
1. `everything` was changed to `topics`
2. Path for my posts translation is `sidebar.sections.community.links.my_posts.content` not `sidebar.sections.community.links.my/posts.content`
2023-06-19 17:51:33 +10:00
dependabot[bot]
e2e17bfb0f
Build(deps-dev): Bump eslint from 8.42.0 to 8.43.0 in /app/assets/javascripts (#22178)
Bumps [eslint](https://github.com/eslint/eslint) from 8.42.0 to 8.43.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.42.0...v8.43.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 09:12:12 +08:00
Isaac Janzen
37e4c050c5
DEV: Cleanup glimmer search menu tests (#22170) 2023-06-17 08:31:11 -05:00
Isaac Janzen
afa6c0a9a4
DEV: Escape html and emojis in search menu topic result type titles (#22166)
# Before
<img width="419" alt="Screenshot 2023-06-16 at 3 23 49 PM" src="https://github.com/discourse/discourse/assets/50783505/557e0657-afc8-4608-b025-d9896fd9a8c9">

# After
<img width="433" alt="Screenshot 2023-06-16 at 3 21 41 PM" src="https://github.com/discourse/discourse/assets/50783505/1df71b3b-479b-4163-8a7c-5bb434102a55">
2023-06-16 15:56:41 -05:00
Juan David Martínez Cubillos
93e5272223
FIX: Incompatibility between default_composer_category and default_subcategory_on_read_only_category (#22165) 2023-06-16 15:56:25 -05:00
David Taylor
e061166a05
FIX: Restore behavior of window.Discourse (#22167)
The work in fa509224f0 updated our initializer patterns to match modern Ember. This caused the initializer from the (deprecated) ember-export-application-global addon to change its behavior from exporting the ApplicationInstance to exporting the Application. This affects customizations which were using some long-deprecated APIs we had attached to the ApplicationInstance.

This commit removes the deprecated addon, restores the previous ApplicationInstance behavior which we've come to depend on, and adds a test for the expected behavior. It also bumps the `dropFrom` version to make it clear that we do not intend to remove these APIs during this release cycle.
2023-06-16 21:54:15 +01:00
Jarek Radosz
9984accfa5
DEV: Remove renderTemplate from 2fa preferences, email preferences, and new-category (#22156) 2023-06-16 16:50:45 +02:00
Jarek Radosz
37030ed348
DEV: Convert d-navigation-item to glimmer (#22155) 2023-06-16 16:36:50 +02:00
Isaac Janzen
a2b038ffe7
DEV: Upgrade search-menu to glimmer (#20482)
# Top level view
This PR is the first version of converting the search menu and its logic from (deprecated) widgets to glimmer components. The changes are hidden behind a group based feature flag. This will give us the ability to test the new implementation in a production setting before fully committing to the new search menu.

# What has changed
The majority of the logic from the widget implementation has been updated to fit within the context of a glimmer component, but it has not fundamentally changed. Instead of having a single widget - [search-menu.js](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/search-menu.js) - that built the bulk of the search menu logic, we split the logic into (20+) bite size components. This greatly increases the readability and makes extending a component in the search menu much more straightforward.

That being said, certain pieces needed to be rewritten from scratch as they did not translate from widget -> glimmer, or there was a general code upgraded needed. There are a few of these changes worth noting:

### Search Service
**Search Term** -> In the widget implementation we had a overly complex way of managing the current search term. We tracked the search term across multiple different states (`term`, `opts.term`, `searchData.term`) causing headaches. This PR introduces a single source of truth: 
```js
this.search.activeGlobalSearchTerm
```
This tracked value is available anywhere the `search` service is injected. In the case the search term should be needs to be updated you can call 
```js
this.search.activeGlobalSearchTerm = "foo"
```
 
**event listeners** -> In the widget implementation we defined event listeners **only** on the search input to handle things such as 
- keyboard navigation / shortcuts
- closing the search menu
- performing a search with "enter"

Having this in one place caused a lot of bloat in our logic as we had to handle multiple different cases in one location. Do _x_ if it is this element, but do _y_ if it is another. This PR updates the event listeners to be attached to individual components, allowing for a more fine tuned set of actions per element. To not duplicate logic across multiple components, we have condensed shared logic to actions on the search service to be reused. For example - `this.search.handleArrowUpOrDown` - to handle keyboard navigation.

### Search Context
We have unique logic based on the current search context (topic / tag / category / user / etc). This context is set within a models route file. We have updated the search service with a tracked value `searchContext` that can be utilized and updated from any component where the search service is injected.

```js
# before
this.searchService.set("searchContext", user.searchContext);

# after
this.searchService.searchContext = user.searchContext;
```

# Views
<img width="434" alt="Screenshot 2023-06-15 at 11 01 01 AM" src="https://github.com/discourse/discourse/assets/50783505/ef57e8e6-4e7b-4ba0-a770-8f2ed6310569">

<img width="418" alt="Screenshot 2023-06-15 at 11 04 11 AM" src="https://github.com/discourse/discourse/assets/50783505/2c1e0b38-d12c-4339-a1d5-04f0c1932b08">

<img width="413" alt="Screenshot 2023-06-15 at 11 04 34 AM" src="https://github.com/discourse/discourse/assets/50783505/b871d164-88cb-405e-9b78-d326a6f63686">

<img width="419" alt="Screenshot 2023-06-15 at 11 07 51 AM" src="https://github.com/discourse/discourse/assets/50783505/c7309a19-f541-47f4-94ef-10fa65658d8c">

<img width="424" alt="Screenshot 2023-06-15 at 11 04 48 AM" src="https://github.com/discourse/discourse/assets/50783505/f3dba06e-b029-431c-b3d0-36727b9e6dce">

<img width="415" alt="Screenshot 2023-06-15 at 11 08 57 AM" src="https://github.com/discourse/discourse/assets/50783505/ad4e7250-040c-4d06-bf06-99652f4c7b7c">
2023-06-16 09:24:07 -05:00
Joffrey JAFFEUX
7dafd275ac
FIX: various mobile chat improvements (#22132)
- FIX: improves reactions and thread indicator touch event on mobile
These "buttons" are located inside a scroll list which makes them very specific. The general idea is to ensure these events are passive and are not bubbling to the parent.
- DEV: moves state on top level message node
- FIX: ensures popover arrow has the correct border
- FIX: makes a message expanded by default
- FIX applies the same ios scroll fix on thread and channel
- UI: better active/hover state for thread indicator
- UI: attempts to follow more closely our BEM naming scheme
- FIX: reduces bottom padding on message with thread indicator and user info hidden
- UI: add padding for first message in thread
- FIX: prevents actions backdrop to open thread
- UI: makes thread indicator resizable
2023-06-16 11:36:43 +02:00
Martin Brennan
d6374fdc53
FEATURE: Allow users to manually track threads without replying (#22100)
This commit adds a tracking dropdown to each individual thread, similar to topics,
that allows the user to change the notification level for a thread manually. Previously
the user had to reply to a thread to track it and see unread indicators.

Since the user can now manually track threads, the thread index has also been changed
to only show threads that the user is a member of, rather than threads that they had sent
messages in.

Unread indicators also respect the notification level -- Normal level thread tracking
will not show unread indicators in the UI when new messages are sent in the thread.
2023-06-16 12:08:26 +10:00
Alan Guo Xiang Tan
783bce4b2c
DEV: Don't render header on invites page (#22138)
What this change?

Previous solution relied on CSS to hide the header which is first
wasteful since we're still rendering the header and second makes it
untestable. If we don't want the header to show, we should avoid
rendering it in the first place.
2023-06-16 09:42:00 +08:00
Alan Guo Xiang Tan
9fad71809c
UX: Improve defaults shown for categories and tags section in sidebar (#22062)
Why is this change required?

When a site is newly setup and a user has just been created, the
categories and tags sections are hidden from the user. This happens
because the admin has not configured the `default_navigation_menu_categories` or
`default_navigation_menu_tags` site settings. When the categories and tags
sections are hidden from the user, the sidebar looks extremely bare and
does not create a good experience.

What is being change?

In this commit, we're changing the logic such that the site's top
categories and tags are displayed if the user does not have any
categories/tags configured in each respective section. The only
regression introduced in this change is that the categories and tags
section can no longer be hidden as a result. However, we have plans to
address this in the future by allowing sidebar sections to be configured
to be hidden by each individual user.
2023-06-16 09:06:01 +08:00
dependabot[bot]
d53e306681
Build(deps-dev): Bump ember-cli-app-version in /app/assets/javascripts (#22136)
Bumps [ember-cli-app-version](https://github.com/ember-cli/ember-cli-app-version) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/ember-cli/ember-cli-app-version/releases)
- [Changelog](https://github.com/ember-cli/ember-cli-app-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli-app-version/compare/v6.0.0...v6.0.1)

---
updated-dependencies:
- dependency-name: ember-cli-app-version
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-16 01:38:49 +02:00
dependabot[bot]
3995b87667
Build(deps-dev): Bump ember-cli-dependency-checker (#22137)
Bumps [ember-cli-dependency-checker](https://github.com/quaertym/ember-cli-dependency-checker) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/quaertym/ember-cli-dependency-checker/releases)
- [Commits](https://github.com/quaertym/ember-cli-dependency-checker/commits)

---
updated-dependencies:
- dependency-name: ember-cli-dependency-checker
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-16 01:38:34 +02:00
dependabot[bot]
a5c69ee56a
Build(deps): Bump @ember/test-helpers in /app/assets/javascripts (#22133)
Bumps [@ember/test-helpers](https://github.com/emberjs/ember-test-helpers) from 2.9.3 to 2.9.4.
- [Release notes](https://github.com/emberjs/ember-test-helpers/releases)
- [Changelog](https://github.com/emberjs/ember-test-helpers/blob/v2.9.4/CHANGELOG.md)
- [Commits](https://github.com/emberjs/ember-test-helpers/compare/v2.9.3...v2.9.4)

---
updated-dependencies:
- dependency-name: "@ember/test-helpers"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 20:27:08 +02:00
Godfrey Chan
0fa92529ed
DEV: enable plain functions as helpers in Ember (#22023)
* Enable "plain function as helpers" polyfill

This feature landed in Ember 4.5+, but this polyfill would allow
it to work on 3.25+

References

RFC: https://github.com/emberjs/rfcs/pull/756
Update: https://github.com/emberjs/rfcs/pull/788
Guides: https://github.com/ember-learn/guides-source/pull/1924

* Convert truth-helpers to use plain functions

Mainly to test that the polyfill is working, but it's a good
refactor anyway.
2023-06-15 19:57:41 +02:00
dependabot[bot]
5bd09edc2d
Build(deps): Bump webpack in /app/assets/javascripts (#22121)
Bumps [webpack](https://github.com/webpack/webpack) from 5.86.0 to 5.87.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.86.0...v5.87.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 15:40:08 +02:00
Meghna
7da307669f
UX: stack group inbox label horizontally (#22130) 2023-06-15 18:35:36 +05:30
Godfrey Chan
fa509224f0
DEV: Migrate discourse core to Ember initializers (#22095)
https://meta.discourse.org/t/updating-our-initializer-naming-patterns/241919

For historical reasons, Discourse has different initializers conventions than standard Ember:

```
| Ember                 | Discourse          |                        |
| initializers          | pre-initializers   | runs once per app load |
| instance-initializers | (api-)initializers | runs once per app boot |
```

In addition, the arguments to the initialize function is different – Ember initializers get either the `Application` or `ApplicationInstance` as the only argument, but the "Discourse style" gets an extra container argument preceding that.

This is confusing, but it also causes problems with Ember addons, which expects the standard naming and argument conventions:

1. Typically, V1 addons will define their (app, instance) initializers in the `addon/(instance-)initializers/*`, which appears as `ember-some-addon-package-name/(instance-)initializers/*` in the require registry.

2. Just having those modules defined isn't supposed to do anything, so typically they also re-export them in `app/(instance-)initializers/*`, which gets merged into `discourse/(instance-)initializers/*` in the require registry.

3. The `ember-cli-load-initializers` package supplies a function called `loadInitializers`, which typically gets called in `app.js` to load the initializers according to the conventions above. Since we don't follow the same conventions, we can't use this function and instead have custom code in `app.js`, loosely based on official version but attempts to account for the different conventions.

The custom code that loads initializers is written with Discourse core and plug-ins/themes in mind, but does not take into account the fact that addons can also bring initializers, which causes the following problems:

* It does not check for the `discourse/` module prefix, so initializers in the `addon/` folders (point 1 above) get picked up as well. This means the initializer code is probably registered twice (once from the `addon/` folder, once from the `app/` re-export). This either causes a dev mode assertion (if they have the same name) or causes the code to run twice (if they have different names somehow).

* In modern Ember blueprints, it is customary to omit the `"name"` of the initializer since `ember-cli-load-initializers` can infer it from the module name. Our custom code does not do this and causes a dev mode assertion instead.

* It runs what then addon intends to be application initializers as instance initializers due to the naming difference. There is at least one known case of this where the `ember-export-application-global` application initialize is currently incorrectly registered as an instance initializer. (It happens to not use the `/addon` folder convention and explicitly names the initializer, so it does not trigger the previous error scenarios.)

* It runs the initializers with the wrong arguments. If all the addon initializer does is lookup stuff from the container, it happens to work, otherwise... ???

* It does not check for the `/instance-initializers/` module path so any instance initializers introduced by addons are silently ignored.

These issues were discovered when trying to install an addon that brings an application initializer in #22023.

To resolve these issues, this commit:

* Migrates Discourse core to use the standard Ember conventions – both in the naming and the arguments of the initialize function

* Updates the custom code for loading initializers:
  * For Discourse core, it essentially does the same thing as `ember-cli-load-initializers`
  * For plugins and themes, it preserves the existing Discourse conventions and semantics (to be revisited at a later time)

This ensures that going forward, Ember addons will function correctly.
2023-06-15 14:17:43 +02:00