Commit Graph

20263 Commits

Author SHA1 Message Date
Jarek Radosz cb1e95cd3d
FIX: Educational composer messages regressed in 788dc0a (#21082)
Tests coming in another PR
2023-04-12 20:05:52 +02:00
David Taylor fa5a423681
Revert "DEV: Support modifyClass for native class fields on EmberObjects (#20987)" (#21080)
This reverts commit a19efc4304.

This is causing issues in production - reverting while we investigate
2023-04-12 17:38:44 +01:00
David Taylor a19efc4304
DEV: Support modifyClass for native class fields on EmberObjects (#20987)
EmberObject's `reopen` feature allows changes to be made to the prototype of the class, but it does not work with native class fields. Native class field values are set on the instance in the constructor, and therefore override any values from the prototype.

This commit implements a workaround which detects possible field overrides and then sets the values during the `init()` function of the EmberObject. This isn't perfect - old field values will still be present while any constructor function is running. But in the vast majority of cases, it should provide parity with old non-native-class EmberObject properties.

This commit also adds a warning when trying to override fields on non-EmberObject classes. There is no change in behavior here - we're just warning about the fact it doesn't work.
2023-04-12 16:49:57 +01:00
Jarek Radosz 788dc0a096
DEV: Refactor ComposerMessages (#21077)
Co-authored-by: David Taylor <david@taylorhq.com>
2023-04-12 17:02:37 +02:00
David Taylor db16700355
PERF: Memoize element references for `dockCheck` (#21079)
This is run frequently in a scroll listener. Removing the need for repeated `querySelector` calls makes those scroll handlers much faster.
2023-04-12 14:17:43 +01:00
David Taylor a328153ec2
DEV: Enable patch-package in production and in `javascripts/discourse` (#21078)
When running `yarn install` in a yarn workspace, the lifecycle hooks in the root package.json are not triggered. https://github.com/yarnpkg/yarn/issues/5790

As a workaround, we can additionally run `patch-package` from the `javascripts/discourse/package.json` `postinstall` hook. `patch-package` is idempotent, so it doesn't matter if it is triggered multiple times.

Longer term we intend to move to pnpm, which has built-in patch support.
2023-04-12 13:15:53 +01:00
David Battersby 7d34ba38a2
FIX: all staff_counters should be pluralized strings (#21048)
Make all staff_counters pluralized strings
2023-04-12 17:13:37 +08:00
Alan Guo Xiang Tan 2eb60c9713
DEV: Switch sidebar section link identifier to data attribute (#21051)
Data attribute is less restrictive than relying on the class attribute
2023-04-12 15:52:10 +08:00
dependabot[bot] f0435844df
Build(deps): Bump sass from 1.61.0 to 1.62.0 in /app/assets/javascripts (#21063)
Bumps [sass](https://github.com/sass/dart-sass) from 1.61.0 to 1.62.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.61.0...1.62.0)

---
updated-dependencies:
- dependency-name: sass
  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-04-12 09:08:49 +08:00
Kris ce601ac84c
UX: improve composer control spacing on mobile (#21021) 2023-04-11 14:11:00 -05:00
Rafael dos Santos Silva 087ee8c5e2
DEV: Experimental JS plugin API for topic summary HTML (#20963) 2023-04-11 11:22:34 -04:00
Jan Cernik a3801a9e16
DEV: Stop event propagation in `DTooltip` (#20897) 2023-04-11 12:07:03 -03:00
Jan Cernik 352bd35bf6
Add RenderGlimmer support for embedded posts (#21046) 2023-04-11 06:22:42 -03:00
Jarek Radosz b6cfcdfbb3
DEV: Force an upgrade of watch-detector (#21053)
Fixes the unnecessary message when starting ember server:

```
Invalid watchman found, version: [2023.04.03.00] did not satisfy [>= 3.0.0].
Visit https://ember-cli.com/user-guide/#watchman for more info.
```
2023-04-11 11:14:57 +02:00
NullVoxPopuli c320c286f9
DEV: Use patch-package to apply ember-jquery workaround
Co-authored-by: David Taylor <david@taylorhq.com>
2023-04-11 10:12:30 +01:00
dependabot[bot] 47eced2050
Build(deps): Bump terser in /app/assets/javascripts (#21042)
Bumps [terser](https://github.com/terser/terser) from 5.16.8 to 5.16.9.
- [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/v5.16.8...v5.16.9)

---
updated-dependencies:
- dependency-name: terser
  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-04-11 10:38:49 +02:00
Alan Guo Xiang Tan 90172e5a9e
FIX: Incorrect message inbox displayed due to username case sensitivity (#21049) 2023-04-11 11:31:10 +08:00
David Battersby 569b923fb6
FIX: staff_counters should be pluralized strings (#21039)
Small change to format the staff counter template to apply the correct pluralization for flagged posts/topics.
2023-04-10 17:00:31 +08:00
dependabot[bot] bb94cc0251
Build(deps): Bump eslint from 8.37.0 to 8.38.0 in /app/assets/javascripts (#21033)
Bumps [eslint](https://github.com/eslint/eslint) from 8.37.0 to 8.38.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.37.0...v8.38.0)

---
updated-dependencies:
- dependency-name: eslint
  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-04-10 08:09:09 +08:00
Kris e823ac7ff8
UX: truncate theme toggle text to avoid overflow (#21022) 2023-04-07 17:16:44 -04:00
Kris ba119555fe
A11Y: increase contrast of elements in wcag scheme (#21025) 2023-04-07 17:16:27 -04:00
Kris 1f0aff2719
UX: remove extra space from emoji in notifications (#21024) 2023-04-07 13:55:11 -04:00
Kris 18470c9195
UX: fix solo preference page layout (#21012) 2023-04-07 08:55:32 -04:00
Jarek Radosz 584a3a4237
DEV: Remove unneeded optional chaining operators (#21019)
(and fix a typo, and remove an unnecessary `this.element` check)
2023-04-07 14:10:49 +02:00
dependabot[bot] 92420bad6f
Build(deps): Bump sass from 1.60.0 to 1.61.0 in /app/assets/javascripts (#21014)
Bumps [sass](https://github.com/sass/dart-sass) from 1.60.0 to 1.61.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.60.0...1.61.0)

---
updated-dependencies:
- dependency-name: sass
  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-04-07 09:53:32 +02:00
Daniel Waterworth 0ff86feb96
DEV: Rely on helpers for ajax error handling to reduce repetition (#20988) 2023-04-06 11:25:24 -05:00
Daniel Waterworth 355b44472b
DEV: Allow HTML errors whenever a popup is generated (#20989)
Follow-up-to: 6bbf832400
2023-04-06 10:00:54 -05:00
dependabot[bot] cee06bdc77
Build(deps): Bump @uppy/aws-s3 in /app/assets/javascripts (#20996)
Bumps [@uppy/aws-s3](https://github.com/transloadit/uppy) from 3.0.5 to 3.0.6.
- [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.5...@uppy/aws-s3@3.0.6)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3"
  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-04-06 13:39:31 +02:00
Jarek Radosz d6bf5f40fb
DEV: Change the params for categoryNone redirect (#20944)
Makes the params (`router.currentRoute.params`) the same in this codepath as in the regular flow. (issue originally reported in: https://meta.discourse.org/t/category-banners/86241/174)

See also https://github.com/discourse/discourse-category-banners/pull/31 for the first stab at the bug.
2023-04-06 12:26:19 +02:00
dependabot[bot] 3485936517
Build(deps): Bump @uppy/aws-s3-multipart in /app/assets/javascripts (#20998)
Bumps [@uppy/aws-s3-multipart](https://github.com/transloadit/uppy) from 3.1.2 to 3.1.3.
- [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.2...@uppy/aws-s3-multipart@3.1.3)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3-multipart"
  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-04-06 12:24:20 +02:00
dependabot[bot] 38adfca295
Build(deps): Bump @uppy/xhr-upload in /app/assets/javascripts (#20993)
Bumps [@uppy/xhr-upload](https://github.com/transloadit/uppy) from 3.1.0 to 3.1.1.
- [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/xhr-upload@3.1.0...@uppy/xhr-upload@3.1.1)

---
updated-dependencies:
- dependency-name: "@uppy/xhr-upload"
  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-04-06 12:21:00 +02:00
NullVoxPopuli 97d8614811
DEV: Extract global compat code into module (#20901)
Moves a couple things from discourse-boot.js to a different JS file imported from app/app.js.

This is a forwards compatible technique to import and throw data on the window.

One thing to make note of, though, is that if the virtual-dom and discourse-widget-hbs/helpers were previously included in the build elsewhere, they will now become part of the app bundle.
Later, when using embroider, all bundles will be chunks, and webpack will optimize which chunk contains which modules appropriately.
2023-04-06 10:09:12 +01:00
dependabot[bot] 9014cd6a6f
Build(deps): Bump @uppy/utils in /app/assets/javascripts (#20992)
Bumps [@uppy/utils](https://github.com/transloadit/uppy) from 5.1.3 to 5.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/utils@5.1.3...@uppy/utils@5.2.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-04-06 10:57:41 +02:00
dependabot[bot] 718a8d1164
Build(deps): Bump webpack in /app/assets/javascripts (#20999)
Bumps [webpack](https://github.com/webpack/webpack) from 5.77.0 to 5.78.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.77.0...v5.78.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-04-06 10:55:24 +02:00
Ted Johansson 1b132dad0d
FIX: Correctly pre-select first option in bookmark notification drop-down (#20976)
When selecting the "Keep bookmark" in the user preference for what to do after a bookmark reminder is sent, it does not propagate to the drop-down in the "Create bookmark" modal. Instead it defaults to "Keep bookmark and clear reminder". All other options work fine.

We set a default ("Keep bookmark and clear reminder") if no user preference is found, However, this uses the index of the option, and the index of the first option ("Keep bookmark") is 0, which is treated as falsey in JavaScript, thus causing the default to be selected.

This change switches from logical "or" conditional `||` operator to nullish coalescing `??` operator.
2023-04-06 14:58:40 +08:00
Krzysztof Kotlarek e586f6052f
FEATURE: public custom sidebar sections visible to anonymous (#20931)
Previously, public custom sections were only visible to logged-in users. In this PR, we are making them visible to anonymous as well.

The reason is that Community Section will be moved into custom section model to be easily editable by admins.
2023-04-06 08:55:47 +10:00
Daniel Waterworth cd6d47e012
FIX: Handle errors when we show the edit user directory columns modal (#20986) 2023-04-05 14:31:32 -05:00
Daniel Waterworth 79c87b5003
FIX: Show better default error when failing to delete all user posts (#20985) 2023-04-05 14:26:00 -05:00
Keegan George 3d7833d67e
FIX: `<QuoteButton/>` shifts when content is added to header (#20878) 2023-04-05 12:08:38 -07:00
Bianca Nenciu e1a5f36d52
UX: Do not show bootstrap mode button on mobile (#20984)
It took too much place in the header.
2023-04-05 21:50:27 +03:00
dependabot[bot] 81566949f5
Build(deps): Bump ember-auto-import in /app/assets/javascripts (#20970)
Bumps [ember-auto-import](https://github.com/ef4/ember-auto-import/tree/HEAD/packages/ember-auto-import) from 2.6.1 to 2.6.2.
- [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.6.2/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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-05 12:43:21 +02:00
Martin Brennan c63783cf30
FIX: Error in CSS generation for anon on login_required (#20978)
Followup to 6ad9e4ad06,
I was not aware that `site.categories` is undefined if
the user is anon and the site is login_required, this
handles that scenario and does not continue trying to
generate CSS.
2023-04-05 19:08:44 +10:00
Martin Brennan 6ad9e4ad06
FEATURE: Add CSS class generation for category colors and hashtags (#20951)
This commit adds a system to generate CSS variables and classes for categories
and hashtags, which will be used in an effort to remove baked icons for hashtags
and add color to those icons.

This is in two parts. First I added an initializer generate a category color CSS
variable style tag in the head tag that looks like this:

```css
:root {
--category-1-color: #0088CC;
--category-2-color: #808281;
--category-3-color: #E45735;
--category-4-color: #A461EF;
--category-5-color: #ee56c9;
--category-6-color: #da28c2;
--category-7-color: #ab8b0a;
--category-8-color: #45da37;
...
}
```

The number is the category ID. This only generates CSS variables for categories
the user can access based on `site.categories`. If you need the parent color variable
you can just use the `category.parentCategory.id` to get it.

Then, I added an initializer to generate a hashtag CSS style tag using these variables.
Only the category and channel hashtags need this, the category one generates the
background-gradient needed for the swatch, and the channel just generates a color
for the icon. This is done in an extendable way using the new `api.registerHashtagType`
JS plugin API:

```css
hashtag-color--category-1 {
  background: linear-gradient(90deg, var(--category-1-color) 50%, var(--category-1-color) 50%);
}
hashtag-color--category-2 {
  background: linear-gradient(90deg, var(--category-2-color) 50%, var(--category-2-color) 50%);
}
hashtag-color--category-5 {
  background: linear-gradient(90deg, var(--category-5-color) 50%, var(--category-4-color) 50%);
}
...
.hashtag-color--channel-4 {
  color: var(--category-12-color);
}
.hashtag-color--channel-92 {
  color: var(--category-24-color);
}
```

Note if a category has a parent, its color is used in the gradient correctly. The numbers
here are again IDs (e.g. channel ID, category ID) and the channel’s chatable ID is used
to find the category color variable.
2023-04-05 13:02:35 +10:00
Kris 56f2fdf430
UX: fix spacing between assign tags (#20967) 2023-04-04 17:26:06 -04:00
Bianca Nenciu e9cd74a9e7
FIX: Show correct status for user reviewables (#20959)
The status should use the word "user" instead of "flag", for example
"approved user" instead of "approved flag". The problem was caused by
a mismatched type.
2023-04-04 19:53:04 +03:00
Mark VanLandingham 73325c6c35
FEATURE: SiteSetting to default user path to different routes (#20962) 2023-04-04 11:48:48 -05:00
Penar Musaraj 17ba00c395
FIX: icon toggles saerch menu display on click (#20950)
Using the `mouseDownOutside` event was problematic here because two
events were being triggered consecutively: `mouseDown`
would toggle the menu off and `click` would then toggle it back on. This
switches the logic to use `clickOutside` again, but with two changes:
- it limits the action to the `search-menu` key (so that theme component
overrides can do their own handling)
- it does not trigger the event when there is an active text selection
 (this was the original reason for switching to `mouseDownOutside`, see
https://github.com/discourse/discourse/pull/14788)
2023-04-04 09:49:55 -04:00
Kris 7658341b0b
UX: use relative units to prevent timeline crop (#20943) 2023-04-04 09:40:43 -04:00
Bianca Nenciu 6da2fbbf76
FIX: Use correct translation key (#20958)
The translation key is built using the name of the reviewable as it was
defined in Ruby. The chat plugin uses the `Chat` namespace and defines
`Chat::ReviewableMessage`. This was then transformed to
`chat::reviewable_message`, but it should be `chat_reviewable_message`
to resemble the other translation keys.
2023-04-04 16:28:04 +03:00
Joffrey JAFFEUX 8de45602ff
DEV: allows <UserStatusMessage /> to accept custom css class (#20954)
This will now allow:

```
<UserStatusMessage @status={{@message.user.status}} @class="foo" />
```
2023-04-04 10:04:40 +02:00