Commit Graph

31282 Commits

Author SHA1 Message Date
David Taylor
2f40d9b07b
DEV: Correct ember-5 lockfile generation (#24983)
The regen_ember_5_lockfile script was actually just duplicating the ember3 lockfile without changes 🤦‍♂️. This commit fixes that, and updates the ember-version-enforcement workflow to detect lockfile issues in future.
2023-12-20 11:45:01 +00:00
Isaac Janzen
043fa28fab
FIX: Add missing user search result name and styling (#24974)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2023-12-19 23:14:00 -06:00
Mark VanLandingham
6d5dd92ea1
DEV: Half-revert search-menu flicker fix (#24975) 2023-12-19 16:22:30 -06:00
David Taylor
29107b3429
DEV: Stop exporting internal routeAction function (#24946)
Consumers should use the default export. This function doesn't work directly (unless you manually construct its arguments) - the default export helper handles all that automatically.
2023-12-19 12:47:22 +00:00
David Taylor
6e259a5f25
DEV: Allow 'emails disabled' notices to be temporarily dismissed (#24952)
This makes it much easier to see what a production site will look like before launch. The notices return on the next pageload, so there is minimal risk of this affecting visibility of an email configuration problem.
2023-12-19 12:06:17 +00:00
Martin Brennan
b83d4953da
FIX: Admin problem notification minor issues (#24963)
* Icon was a gift and not exclamation-triangle...these admin problems
  are not usually a gift :P
* Added missing title translation
2023-12-19 18:37:31 +10:00
dependabot[bot]
4dceac8bda
Build(deps): Bump content-tag from 1.2.1 to 1.2.2 in /app/assets/javascripts (#24955)
* Build(deps): Bump content-tag in /app/assets/javascripts

Bumps [content-tag](https://github.com/embroider-build/content-tag) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/embroider-build/content-tag/releases)
- [Changelog](https://github.com/embroider-build/content-tag/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/content-tag/commits)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-19 08:58:23 +01:00
Alan Guo Xiang Tan
38abc0d922
DEV: Change default of cross_origin_opener_policy_header (#24940)
Why this change?

This is part of our efforts to harden the security of the Discourse
application. Setting the `CROSS_ORIGIN_OPENER_POLICY` header to `same-origin-allow-popups`
by default makes the application safer. We have opted to make this a
hidden site setting because most admins will never have to care about
this setting so we're are opting not to show it. If they do have to
change it, they can still do so by setting the
`DISCOURSE_CROSS_ORIGIN_OPENER_POLICY` env.
2023-12-19 11:46:44 +08:00
Blake Erickson
3380d283c9
FEATURE: Add API scope for /logs route (#24956)
Adds an API scope for accessing Logster's routes. This one is a bit
different than routes from core because it is mounted like

```
mount Logster::Web => "/logs"
```

and doesn't have all the route info a traditional rails app/engine does.
2023-12-18 19:45:04 -07:00
Joffrey JAFFEUX
53b96638c5
DEV: implements <Chat::Navbar /> (#24917)
This new navbar component is used for every navbar in chat, full page or drawer, and any screen.

This commit also uses this opportunity to correctly decouple drawer-routes from full page routes. This will avoid having this kind of properties in components: `@includeHeader={{false}}`. The header is now defined in the parent template using a navbar. Each route has now its own template wrapped in a div of the name of the route, eg: `<div class="c-routes-threads">..</div>`.

The navbar API:

```gjs
<Navbar as |navbar|>
 <navbar.BackButton />
 <navbar.Title @title="Foo" />
 <navbar.ChannelTitle @channel={{@channel}} />
 <navbar.Actions as |action|>
   <action.CloseThreadButton />
 </navbar.Actions>
</navbar>
```

The full list of components is listed in `plugins/chat/assets/javascripts/discourse/components/navbar/index.gjs` and `plugins/chat/assets/javascripts/discourse/components/navbar/actions.gjs`.

Visually the header is not changing much, only in drawer mode the background has been removed.

This commit also introduces a `<List />` component to facilitate rendering lists in chat plugin.
2023-12-18 17:49:58 +01:00
Blake Erickson
a08691a599
FIX: Ensure file size restriction types are ints (#24947)
Settings that are using the new `file_size_restriction` types like the
`max_image_size_kb` setting need to have their values saved as integers.
This was a recent regression in 00209f03e6
that caused these values to be saved as strings.

This change also removes negatives from the validation regex because
file sizes can't be negative anyways.

Bug report: https://meta.discourse.org/t/289037
2023-12-18 09:22:50 -07:00
chapoi
1f9e6425c6
UX: align topic notification button + text vertically (#24948) 2023-12-18 16:59:03 +01:00
Bianca Nenciu
680cf443f4
FIX: Better infinite scrolling on categories page (#24831)
This commit refactor CategoryList to remove usage of EmberObject,
hopefully make the code more readable and fixes various edge cases with
lazy loaded categories (third level subcategories not being visible,
subcategories not being visible on category page, requesting for more
pages even if the last one did not return any results, etc).

The problems have always been here, but were not visible because a lot
of the processing was handled by the server and then the result was
serialized. With more of these being moved to the client side for the
lazy category loading, the problems became more obvious.
2023-12-18 16:46:09 +02:00
Penar Musaraj
092633c14f
FIX: Modal flash tracking (#24923)
Super minor, without tracking, these error messages weren't being shown.
2023-12-18 09:34:19 -05:00
Jarek Radosz
8207e59c00
DEV: Remove unused code (#24915)
`input:focus + label.alt-placeholder` css is used for styling active input's label
2023-12-18 11:26:38 +01:00
chapoi
7fe5a6986b
UX: fullscreen modal > add missing modifier + sticky header (#24920)
* UX: table builder add missing modal modifier

* UX: fullscreen-table sticky header fix

* UX: fullscreen table > autosize width
2023-12-18 11:18:54 +01:00
David Taylor
31c2a4717b
DEV: Allow plugins/themes to add global notices at any time (#24922)
Previously, `addGlobalNotice` would have to be called before the GlobalNotice component was rendered. By using a TrackedArray, we can improve that so that plugins can call the function at any time and the notice will be rendered immediately
2023-12-18 09:56:23 +00:00
Natalie Tay
e24c015b9c
FIX: Correct urls to account for subfolder setup (#24941) 2023-12-18 16:49:06 +08:00
Ted Johansson
0edf39409c
DEV: Convert min_trust_level_to_allow_ignore to groups (#24894)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_level_to_allow_ignore  site setting to ignore_allowed_groups.

This PR maintains backwards compatibility until we can update plugins and themes using this.
2023-12-18 13:04:37 +08:00
Kelv
1f6d778561
DEV: enable grant badge utils test and force boolean type return value for isBadgeGrantable (#24928) 2023-12-18 10:47:13 +08:00
Martin Brennan
6de00f89c2
FEATURE: Initial admin sidebar navigation (#24789)
This is v0 of admin sidebar navigation, which moves
all of the top-level admin nav from the top of the page
into a sidebar. This is hidden behind a enable_admin_sidebar_navigation
site setting, and is opt-in for now.

This sidebar is dynamically shown whenever the user enters an
admin route in the UI, and is hidden and replaced with either
the:

* Main forum sidebar
* Chat sidebar

Depending on where they navigate to. For now, custom sections
are not supported in the admin sidebar.

This commit removes the experimental admin sidebar generation rake
task but keeps the experimental sidebar UI for now for further
testing; it just uses the real nav as the default now.
2023-12-18 11:48:25 +10:00
Martin Brennan
194c84b217
FIX: Sort plugin list by name properly (#24839)
Some plugins have discourse- prefixed on their name
and some don't, so sorting in the list was inconsistent.

---------

Co-authored-by: Ted Johansson <ted@discourse.org>
2023-12-18 11:42:55 +10:00
marstall
6f3c498b83
FIX: when showing edit invite form, display saved invite data in fields (#24907)
https://meta.discourse.org/t/lets-talk-suggestion-for-improvement-invite-feature/284655/11?u=yigit
2023-12-16 09:49:21 -05:00
Ty Correll
e30da10486
UX: fix overlap obstructed anon topic reply (#24927) 2023-12-15 17:15:38 -05:00
Mark VanLandingham
fe06a76cab
REVERT: "UX: fix overlap obstructed anon topic reply (#24921)" (#24925)
This reverts commit 368f4ef24d.
2023-12-15 15:08:34 -06:00
Blake Erickson
7a7c53894d
FIX: Excessive video data downloading from service worker (#24924)
This bug appears to only be on Chrome due to the service worker fetching
the video content on page load instead of on play. For some reason
though the service worker would fetch around 4x more than the size of
the video resulting in excessive data being downloaded especially for
larger videos.

meta https://meta.discourse.org/t/287817
internal /t/111387/52
2023-12-15 13:29:50 -07:00
Ty Correll
368f4ef24d
UX: fix overlap obstructed anon topic reply (#24921)
This commit addresses the overlap between the anonymous reply button in a topic and the related or new and unread topics component.
2023-12-15 13:24:33 -06:00
Keegan George
388a2c5274
DEV: Add outlets and actions to move topic modal (#24913) 2023-12-15 08:50:29 -08:00
Kelv
2477bcc32e
DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
Penar Musaraj
8a4ab79be2
DEV: Improve header offset calculation (#24910) 2023-12-15 15:29:17 +01:00
chapoi
ed4840200b
UX: revert icon colour change in alerts (#24916) 2023-12-15 13:32:35 +01:00
Osama Sayegh
eff6e4b405
FIX: Position Float Kit elements correctly in RTL mode (#24908)
Float-kit elements (menus/tooltips) are positioned where they should be by setting an inline `left` property in JavaScript when they're rendered. For some reasons, we also set `left: 0` on float-kit elements here:

25d9927785/app/assets/stylesheets/common/float-kit/d-menu.scss (L11-L15)

This property is overridden by the inline property that the library sets in JavaScript. However, in RTL mode, all of our scss files are flipped where everything left becomes right and vice versa. In this case, the `left: 0` property in the scss file above becomes `right: 0`.

This results in a conflict specific to RTL mode where both the `left` and `right` properties are defined on the same absolute-positioned element; the `right` property will always be set to 0 because it comes from the (flipped) scss file above, and the inline `left` property will be set to some px amount determined in JavaScript.

The `right` property will take precedence over the inline `left` property due to the page being right-to-left (source: https://developer.mozilla.org/en-US/docs/Web/CSS/right#description) and this causes float-kit elements to incorrectly always stick to the right.

This commit removes the `left: 0` property altogether for float-kit elements from our scss files. It's not clear from git history why the property was added, and removing it doesn't seem to cause any issues.

Meta topic: https://meta.discourse.org/t/positioning-issues-with-rtl-locales-after-recent-updates/280220?u=osama
2023-12-15 13:16:31 +03:00
Keegan George
46eec95719
DEV: Add outlet and changes to support AI proofread (#24909) 2023-12-14 19:30:30 -08:00
Jarek Radosz
9f00c16a7a
DEV: Make DatePicker placeholder customizable (#24911) 2023-12-15 03:28:57 +01:00
Mark VanLandingham
25d9927785
DEV: Remove DefaultNotificationItem widget (#24906)
These are no longer used anymore because we use glimmer notification items everywhere 🎉
2023-12-14 13:45:59 -06:00
Daniel Waterworth
d7a09fb08d
DEV: Add true_fields method for CustomFields (#24876)
This is useful for plugins that might otherwise rely on the
CUSTOM_FIELD_TRUE constant.
2023-12-14 11:06:21 -06:00
Mark VanLandingham
74f964f2b4
DEV: Add current menu-panel tab ID as data attribute to panel (#24901) 2023-12-14 10:36:51 -06:00
David Taylor
f51f467030
DEV: Throw error if renderInOutlet component has no template (#24900) 2023-12-14 15:51:47 +00:00
Jarek Radosz
057778b710
DEV: Update content-tag to 1.2.1 (#24888) 2023-12-14 12:00:36 +01:00
Ted Johansson
48116186af
DEV: Convert tl4_delete_posts_and_topics to groups (#24866)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the tl4_delete_posts_and_topics  site setting to delete_all_posts_and_topics_allowed_groups.

This one is a bit different from previous ones, as it's a boolean flag, and the default should be no group. Pay special attention to the migration during review.
2023-12-14 09:56:42 +08:00
Blake Erickson
00209f03e6
DEV: Add file_size_restriction site setting type (#24704)
This change will allow admins to configure file sizes in mb instead of
having to convert to kb.

Co-authored-by: Ella <ella.estigoy@gmail.com>
2023-12-13 16:22:48 -07:00
dependabot[bot]
d993c38f3c
Build(deps-dev): Bump the embroider group in /app/assets/javascripts with 2 updates (#24877)
* Build(deps-dev): Bump the embroider group

Bumps the embroider group in /app/assets/javascripts with 2 updates: [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat) and [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core).


Updates `@embroider/compat` from 3.4.0 to 3.4.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/compat)

Updates `@embroider/core` from 3.4.2 to 3.4.3
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-13 22:32:35 +01:00
dependabot[bot]
bb2d3ab300
Build(deps): Bump ember-auto-import from 2.7.0 to 2.7.1 in /app/assets/javascripts (#24878)
* Build(deps): Bump ember-auto-import in /app/assets/javascripts

Bumps [ember-auto-import](https://github.com/ef4/ember-auto-import/tree/HEAD/packages/ember-auto-import) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/ef4/ember-auto-import/releases)
- [Changelog](https://github.com/embroider-build/ember-auto-import/blob/main/packages/ember-auto-import/CHANGELOG.md)
- [Commits](https://github.com/ef4/ember-auto-import/commits/HEAD/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>

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-13 22:30:51 +01:00
Mark VanLandingham
c051bfc2fc
DEV: Plugin-api methods for user-notifications route customizations (#24873) 2023-12-13 15:15:42 -06:00
Daniel Waterworth
f7aefffea7
DEV: Concerns can use class_methods (#24875) 2023-12-13 14:12:03 -06:00
chapoi
7392e0e8a2
UX: have svg icons inherit colour (#24871) 2023-12-13 15:34:29 +01:00
David Taylor
fadcfd1451
DEV: Add safe_mode=deprecation_errors mode (#24870)
This commit adds an additional toggle to our safe-mode system. When enabled, it will cause all deprecation messages to become exceptions. This gives admins a way to test their themes/plugins against upcoming Discourse changes without needing to use the browser developer tools.
2023-12-13 14:06:59 +00:00
David Taylor
5e4a730366
DEV: Remove development-only DiscourseURL global (#24869)
I don't think anyone is actually using this, and the change won't affect production because it was only happening in development/test.
2023-12-13 12:41:36 +00:00
David Taylor
e5824c5d88
DEV: Tweaks for safe mode (#24868)
- Preserve query param in URL when navigating around
- Replace inline warning svg with emoji, which works better across different color schemes
2023-12-13 12:24:35 +00:00
Ted Johansson
36057638ca
DEV: Convert min_trust_to_edit_post to groups (#24840)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_to_edit_post site setting to edit_post_allowed_groups.

The old implementation will co-exist for a short period while I update any references in plugins and themes.
2023-12-13 13:25:13 +08:00
Krzysztof Kotlarek
1017820012
DEV: Convert allow_uploaded_avatars to groups (#24810)
This change converts the allow_uploaded_avatars site setting to uploaded_avatars_allowed_groups.

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

Hides the old setting
Adds the new site setting
Adds a deprecation warning
Updates to use the new setting
Adds a migration to fill in the new setting if the old setting was changed
Adds an entry to the site_setting.keywords section
Updates tests to account for the new change
After a couple of months, we will remove the allow_uploaded_avatars setting entirely.

Internal ref: /t/117248
2023-12-13 10:53:19 +11:00
Jarek Radosz
8355664c82
FIX: Don't use :true/:false symbols (#24861)
on line 252 `has_children` is set to true/false (actual booleans) which means `has_children?` was in some cases returning incorrect value…
2023-12-13 00:27:14 +01:00
Jordan Vidrine
67594353ae
UX: Align icon with username in menu panel (#24854) 2023-12-12 15:32:16 -06:00
David Taylor
0f3a6cf042
DEV: Improve browser-update compatibility (#24852)
Now that we're using native `import()`, our main JS bundles might not even be parse-able by older browsers. In that case, `I18n` will never be defined, and so we need to account for that situation in the browser-update code.
2023-12-12 21:09:14 +00:00
Mark VanLandingham
097cef7d21
UX: Improve layout of avatar+icon notifications (#24851) 2023-12-12 14:28:29 -06:00
Angus McLeod
95c61b88dc
Apply embed unlisted setting consistently (#24294)
Applies the embed_unlisted site setting consistently across topic embeds, including those created via the WP Discourse plugin. Relatedly, adds a embed exception to can_create_unlisted_topic? check. Users creating embedded topics are not always staff.
2023-12-12 09:35:26 -05:00
chapoi
f6644a69c3
UX: prevent header buttons from wrapping text (#24845) 2023-12-12 13:31:49 +01:00
Jarek Radosz
41942357ed
DEV: Use class attribute instead of @class arg (#24804) 2023-12-12 13:09:05 +01:00
dependabot[bot]
f1969c24c6
Build(deps): Bump the babel group in /app/assets/javascripts with 2 updates (#24833)
* Build(deps): Bump the babel group

Bumps the babel group in /app/assets/javascripts with 2 updates: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) and [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.23.5 to 7.23.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.23.6/packages/babel-core)

Updates `@babel/standalone` from 7.23.5 to 7.23.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.23.6/packages/babel-standalone)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-11 22:50:33 +01:00
Jarek Radosz
3999f3e826
DEV: Convert PreferenceCheckbox to gjs (#24817) 2023-12-11 22:03:03 +01:00
Mark VanLandingham
c6a2c80441
UX: Adjust notification items when avatar is shown (#24832) 2023-12-11 14:44:14 -06:00
Jeff Wong
4e8f9e8fd2
DEV: remove animating class (#24830)
class is no longer needed to detect animations since the change in:

c2295b9d5d
2023-12-11 11:55:14 -08:00
David Taylor
683c038ec0 UX: Add some missing hljs classes 2023-12-11 18:11:27 +00:00
David Taylor
a48595ae7a DEV: Remove unused hljs css selectors
In modern hljs, languages should be targetted with `lang-` prefixes. These selectors haven't worked in Discourse for a long time, so let's drop them to reduce confusion
2023-12-11 18:11:27 +00:00
Mark VanLandingham
6fc992f66a
FIX: Color of notification icons in user-notifications index (#24826) 2023-12-11 11:35:02 -06:00
Osama Sayegh
102e1b4faf
DEV: Remove legacy hamburger menu code (#24788)
We no longer offer the option to use the legacy hamburger menu since October 9th 2023, see 832b3b9e60. However, the code for the legacy hamburger menu is still around and needs to be removed. All plugins and themes that we know of that customize the legacy hamburger menu have been updated to either remove the customizations or migrate the customizations to the new sidebar, so now we can safely remove the legacy hamburger menu code from core.

Internal topic: t/113137.
2023-12-11 20:17:00 +03:00
Mark VanLandingham
223e413a6c
DEV: Render glimmer notification items for user notification list (#24802)
This removes the widget notifications list and renders the glimmer user menu notification items instead.
2023-12-11 11:04:43 -06:00
Penar Musaraj
695ec99cea
UX: Fix highlighting regressions (#24825)
Two regressions fixed here, one introduced in 6dc5fe0c83
and the other introduced a few months ago.
2023-12-11 11:02:48 -05:00
Bianca Nenciu
81b0420614
FEATURE: Add pagination to categories page (#23976)
When `lazy_load_categories` is enabled, the categories are no longer
preloaded in the `Site` object, but instead they are being requested
on a need basis.

The categories page still loaded all categories at once, which was not
ideal for sites with many categories because ti would take a lot of
time to build and parse the response.

This commit adds pagination to the categories page using the LoadMore
helper. As the user scrolls through the categories page, more categories
are requested from the server and appended to the page.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-12-11 17:58:45 +02:00
Penar Musaraj
af23fec835
FIX: Reload page after adding 2FA when it is enforced (#24803)
When 2FA is enforced and the user has no key or TOTP on their account, we
block navigating away from the page until they have added one. However,
we don't reload the page after they have added one, so the user is left
with a page that still says they need to add 2FA.
2023-12-11 10:56:30 -05:00
David Taylor
b5fb8e89eb
FIX: Resolve computed property override when inviting to PM (#24823)
This was raising a deprecation under Ember 3, and an error under Ember 4+
2023-12-11 15:39:50 +00:00
Gerhard Schlager
d725b3ca9e DEV: Add script for preprocessing uploads as part of a migration
This script preprocesses all uploads within a intermediate DB (output of converters) and uploads those files to S3. It does the same for optimized images. This speeds up migrations when you have to run them multiple times, because you only have to preprocess and upload the files once.

This script is very hacky and mostly undocumented for now. That will change in the future.
2023-12-11 16:23:07 +01:00
Jarek Radosz
81de91751e
DEV: Remove incorrect "for" attributes (#24805)
(and correct some html whitespace)
2023-12-11 15:44:38 +01:00
Jarek Radosz
cc74bcdc85
DEV: Correct i18n helper invocation case (#24806) 2023-12-11 15:44:28 +01:00
David Taylor
4a62676512
DEV: Identify errors/deprecations triggered by browser extensions (#24820)
It's possible for browser extensions to trigger JS errors and deprecation warnings. That can lead to significant confusion and noise in our logs/metrics. One recent example we've identified is the 'Wappalyzer' extension triggering the `ember-global` deprecation.

This commit will clearly identify these errors/deprecations with a `[BROWSER EXTENSION]` prefix in the console.
2023-12-11 14:22:44 +00:00
chapoi
2eed8753fb
UX: fix icon colour on signup CTA (#24818) 2023-12-11 12:26:00 +01:00
dependabot[bot]
4949d85c15
Build(deps): Bump markdown-it from 13.0.2 to 14.0.0 in /app/assets/javascripts (#24809)
* Build(deps): Bump markdown-it in /app/assets/javascripts

Bumps [markdown-it](https://github.com/markdown-it/markdown-it) from 13.0.2 to 14.0.0.
- [Changelog](https://github.com/markdown-it/markdown-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/markdown-it/compare/13.0.2...14.0.0)

---
updated-dependencies:
- dependency-name: markdown-it
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-10 22:38:03 +01:00
David Taylor
6388d929d6
UX: Ensure wizard previews display at correct width (#24801) 2023-12-08 20:45:54 +00:00
David Taylor
4adbcf3f2a
DEV: Update before-header-panel outlet arguments (#24796)
Passing through `attrs` is problematic for a few reasons:

1. Connectors could mutate it and cause issues in the parent widget

2. It doesn't provide a clean API boundary. The connector can access all attrs of the widget. As we move towards refactoring the header away from widgets, this may change. Better to explicitly call out the things we expect plugins/themes to access

3. `attrs` is a reserved property for classic components. Passing an argument called `attrs` into a classic component raises a 'computed property override' deprecation error under Ember 3.28, and causes an error in Ember 4+.

Unfortunately this will be a breaking change to the outlet. Fortunately, it was introduced fairly recently and does not have too many users. We will make immediate updates to themes/plugins we are aware of.

Followup to 9cc2b5cc20
2023-12-08 17:02:25 +00:00
chapoi
e227008c65
UX: login modal sizing fixes (#24794) 2023-12-08 17:21:37 +01:00
Bianca Nenciu
b4cf175daf
DEV: Use category objects as values for category select kits (#24793)
Commit dcd81d56c0 changed this, but that
implementation is not ideal because the initialization of the select kit
can result in requests to the server.

This implementation has the advantage that it also fixes the user and
group properties that return categories.
2023-12-08 18:09:48 +02:00
Penar Musaraj
80d5acc0ce
FIX: Navigate search results using J/K keys (#24787) 2023-12-08 11:06:59 -05:00
Penar Musaraj
6dc5fe0c83
A11Y: improve setting focus to a post (#24786)
See https://github.com/discourse/discourse/pull/23367 for implementation details.
2023-12-08 11:06:21 -05:00
Neil Lalonde
27144f188c
UX: if no login options are configured, show a message (#24777)
Admins will be instructed to login via /u/admin-login to change their
site settings.
2023-12-08 10:49:54 -05:00
David Taylor
efbe5b7dda
DEV: Catch errors in theme/plugin onPageChange handlers (#24784)
This makes the errors easier for admins to identify/resolve, and also prevents failures from affecting core functionality.
2023-12-08 10:01:37 +00:00
Bianca Nenciu
dcd81d56c0
FIX: category selectors for lazy loaded categories (#24533)
A lot of work has been put in the select kits used for selecting
categories: CategorySelector, CategoryChooser, CategoryDrop, however
they still do not work as expected when these selectors already have
values set, because the category were still looked up in the list of
categories stored on the client-side Categrories.list().

This PR fixes that by looking up the categories when the selector is
initialized. This required altering the /categories/find.json endpoint
to accept a list of IDs that need to be looked up. The API is called
using Category.asyncFindByIds on the client-side.

CategorySelector was also updated to receive a list of category IDs as
attribute, instead of the list of categories, because the list of
categories may have not been loaded.

During this development, I noticed that SiteCategorySerializer did not
serializer all fields (such as permission and notification_level)
which are not a property of category, but a property of the relationship
between users and categories. To make this more efficient, the
preload_user_fields! method was implemented that can be used to
preload these attributes for a user and a list of categories.
2023-12-08 12:01:08 +02:00
Martin Brennan
d9a422cf61
FIX: Do not attempt S3 ACL call if secure status did not change (#24785)
When rebaking and in various other places for posts, we
run through the uploads and call `update_secure_status` on
each of them.

However, if the secure status didn't change, we were still
calling S3 to change the ACL, which would have been a noop
in many cases and takes ~1 second per call, slowing things
down a lot.

Also, we didn't account for the s3_acls_enabled site setting
being false here, and in the specs doing an assertion
that `Discourse.store.update_ACL` is not called doesn't
work; `Discourse.store` isn't a singleton, it re-initializes
`FileStore::S3Store.new` every single time.
2023-12-08 12:58:45 +10:00
Martin Brennan
d5fe9b4f8c
FEATURE: Add copy link post menu button (#24709)
This commit ports the feature by @chapoi that was
previously a theme component in core.

A new post_menu button, copyLink, is added and used
as the default instead of share.

copyLink, on desktop, will copy the link of the post
to the user's clipboard and show a nice 'lil animation.
On mobile the native share menu will be shown.

If site owners want the old behaviour back, they just
need to change the post_menu site setting to use
the share button instead of copyLink.
2023-12-08 11:45:49 +10:00
dependabot[bot]
8eb40fa059
Build(deps): Bump terser from 5.25.0 to 5.26.0 in /app/assets/javascripts (#24780)
* Build(deps): Bump terser in /app/assets/javascripts

Bumps [terser](https://github.com/terser/terser) from 5.25.0 to 5.26.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.25.0...v5.26.0)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-07 23:16:14 +01:00
Penar Musaraj
61cf76bf70
Revert "A11Y: fix setting focus to a post (#23367)" (#24783)
This reverts commit 9dce1592dc.

The change is having some adverse effects.
2023-12-07 17:03:52 -05:00
Penar Musaraj
9dce1592dc
A11Y: fix setting focus to a post (#23367)
This is a second attempt to fix this issue. First fix at #23243, see PR for details.
2023-12-07 15:44:42 -05:00
Keegan George
290f6a70bd
FIX: Form template form error visiblity (#24779) 2023-12-07 12:26:56 -08:00
Daniel Waterworth
611acaa6bc
FIX: Validate each value in an array custom field separately (#24659) 2023-12-07 14:24:04 -06:00
Isaac Janzen
bf48e14687
FIX: Move the search-menu-results-top plugin outlet (#24774)
The `search-menu-results-top` plugin outlet was not positioned at the top of `results` as expected. Additionally, the expected outlet arguments that existed in the "widget implementation" were not available on the glimmer search menu.
2023-12-07 12:36:39 -07:00
Mark VanLandingham
ddf3c571cf
FIX: Prevent error when poster isn't present in message notification item (#24776) 2023-12-07 13:21:45 -06:00
Mark VanLandingham
ee05f57e2d
FEATURE: Site setting to display user avatars in user menu (#24514) 2023-12-07 11:30:44 -06:00
David Taylor
e4c373194d
DEV: Refactor Wizard components (#24770)
This commit refactors the Wizard component code in preparation for moving it to the 'static' directory for Embroider route-splitting. It also includes a number of general improvements and simplifications.

Extracted from https://github.com/discourse/discourse/pull/23678

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-07 16:33:38 +00:00
Kris
0139481188
UX: move monospace font to variable (#24762) 2023-12-07 09:51:14 -05:00
chapoi
001d2176e5
UX: minor fixes in topic action modal (#24772) 2023-12-07 14:54:56 +01:00
Ella E
7d4fd19696
DEV: revert bg color from --tertiary-very-low to --tertiary-low (#24764) 2023-12-06 20:07:01 -07:00
Alan Guo Xiang Tan
7aab65887f
UX: Fix edit navigation tags modal height too long on desktop (#24765)
Why this change?

The tags modal loads more tags via infinite loading based on when the last tag in the
given page appears in the viewport for the user. When it comes in to
view, a request is then triggered to fetch additional tags. To ensure
that we are only loading a single page of tags each time the modal is
opened, we previously set a max height on the modal's body to ensure
that the last tag which appears in the modal will be outside of the view
port in the initial load. However, this has regressed recently due to
unknown reasons and resulted in multiple pages of tags being loaded
immediately from the server as the modal's height was not restricted.
This regression was caught by an existing test but was unfortunately
determined as flaky.

What does this change do?

This change restores the max height on the edit navigation menu tags
modal on dekstop.
2023-12-07 09:42:04 +08:00
David Taylor
a192ae4c15
FIX: Ensure bulk select toggle appears for non-admin on new/unread (#24763)
TopicList is a classic component, so we need to use `.get()` for the argument to be autotracked in a native getter 😢
2023-12-06 23:55:41 +00:00
Martin Brennan
7afb5fc481
DEV: Use Discourse::SYSTEM_USER_ID in fixtures/009_users (#24743)
I couldn't find where we created the system user and
this is why -- everywhere else in the app we reference
SYSTEM_USER_ID but here.
2023-12-07 09:04:45 +10:00
Kris
c197f8c6ee
UX: make github onebox styles more responsive (#24761) 2023-12-06 17:45:56 -05:00
Jarek Radosz
694b5f108b
DEV: Fix various rubocop lints (#24749)
These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
2023-12-06 23:25:00 +01:00
Kris
42a75e3df9
FIX: saving tag changes without description (#24753) 2023-12-06 14:17:56 -05:00
chapoi
42e5bbaf38
UX: fix double-scrollbar in keyboard-shortcuts-modal (#24751) 2023-12-06 17:12:14 +01:00
Mark VanLandingham
efcb5bb3df
DEV: Plugin outlet around user menu empty state (#24730) 2023-12-06 08:06:50 -06:00
Jarek Radosz
6a66dc1cfb
DEV: Fix Lint/BooleanSymbol (#24747) 2023-12-06 13:19:09 +01:00
Jarek Radosz
138bf486d3
DEV: Fix Lint/DuplicateMethods (#24746) 2023-12-06 13:18:34 +01:00
Jarek Radosz
4280c01153
DEV: Fix Lint/ShadowedArgument (#24733) 2023-12-06 13:16:10 +01:00
David Taylor
1e471f7ec2
FIX: Handle 404 correctly when transition has no path (#24748) 2023-12-06 12:12:19 +00:00
David Taylor
b3d1707b65
DEV: Refactor Wizard routes, controllers and templates (#24725)
Extracted from https://github.com/discourse/discourse/pull/23678

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-06 12:07:07 +00:00
David Battersby
8b46dc8bb5
FEATURE: Add thumbnails for chat image uploads (#24328)
Introduces the concept of image thumbnails in chat, prior to this we uploaded and used full size chat images within channels and direct messages.

The following changes are covered:
- Post processing of image uploads to create the thumbnail within Chat::MessageProcessor
- Extract responsive image ratios into CookedProcessorMixin (used for creating upload variations)
- Add thumbnail to upload serializer from plugin.rb
- Convert chat upload template to glimmer component using .gjs format
- Use thumbnail image within chat upload component (stores full size img in orig-src data attribute)
- Old uploads which don't have thumbnails will fallback to full size images in channels/DMs
- Update Magnific lightbox to use full size image when clicked
- Update Glimmer lightbox to use full size image (enables zooming for chat images)
2023-12-06 14:59:18 +08:00
Martin Brennan
30d5e752d7
DEV: Revert guardian changes (#24742)
I took the wrong approach here, need to rethink.

* Revert "FIX: Use Guardian.basic_user instead of new (anon) (#24705)"

This reverts commit 9057272ee2.

* Revert "DEV: Remove unnecessary method_missing from GuardianUser (#24735)"

This reverts commit a5d4bf6dd2.

* Revert "DEV: Improve Guardian devex (#24706)"

This reverts commit 77b6a038ba.

* Revert "FIX: Introduce Guardian::BasicUser for oneboxing checks (#24681)"

This reverts commit de983796e1.
2023-12-06 16:37:32 +10:00
Martin Brennan
9057272ee2
FIX: Use Guardian.basic_user instead of new (anon) (#24705)
c.f. de983796e1

There will soon be additional login_required checks
for Guardian, and the intent of many checks by automated
systems is better fulfilled by using BasicUser, which
simulates a logged in TL0 forum user, rather than an
anon user.

In some cases the use of anon still makes sense (e.g.
anonymous_cache), and in that case the more explicit
`Guardian.anon_user` is used
2023-12-06 11:56:21 +10:00
Martin Brennan
3141994e38
FIX: Add checkbox-label to notification bulk actions (#24734)
Followup to c80b5b718c
2023-12-06 11:22:48 +10:00
Ella E
47629db3db
UX: Add a link from admin reports page to meta a topic (#24707)
* UX: Add a link from admin reports page to meta a topic
* DEV: apply prettier
2023-12-05 16:37:44 -07:00
Kris
3a98474983
A11Y: allow tab titles to use default translation (#24727) 2023-12-05 17:16:56 -05:00
Kris
b65f281842
FIX: escape category description text (#24724) 2023-12-05 15:48:13 -05:00
Mark VanLandingham
d4c02d738b
DEV: Add topicNotificationLevel fn to post model (#24723) 2023-12-05 12:08:29 -06:00
David Taylor
a5fc8f3253
FIX: Account activation under ember-5 build (#24722)
We were previously relying on Ember's 'vendor' bundle to make the jquery global available on the activate_account route. That no longer happens under our Ember 5 build.

This commit updates our activate-account script to remove the need for jquery, so that it works under both Ember 3 and Ember 5 builds.
2023-12-05 17:49:40 +00:00
Isaac Janzen
6aeddad333
DEV: Add search-menu-before-advanced-search plugin outlet (#24720) 2023-12-05 10:08:27 -07:00
David Taylor
863c0cdecc
FIX: Ensure slugless topic URLs are correctly redirected (#24719)
Using `DiscourseURL.routeTo` with `replaceURL: true` wouldn't cause a true Ember redirect. That meant that the transition source would be be replaced in the browser's history stack, and the 'back' button wouldn't work as expected. Instead, we can use the router service to perform a proper redirect.
2023-12-05 15:37:01 +00:00
chapoi
ad77a6876c
UX: fix alignment (#24718) 2023-12-05 14:19:21 +01:00
dependabot[bot]
9a10f9d240
Build(deps): Bump terser from 5.24.0 to 5.25.0 in /app/assets/javascripts (#24703)
* Build(deps): Bump terser in /app/assets/javascripts

Bumps [terser](https://github.com/terser/terser) from 5.24.0 to 5.25.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.24.0...v5.25.0)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-05 11:50:29 +01:00
Isaac Janzen
b9110c5a71
FIX: Don't refresh on topic search result click (#24697)
Fixes an issue where when selecting a topic search result we were refreshing the page rather than letting `DiscourseURL` redirect us to the given topic. This was because we were leaning on a `a` tag and it's href to handle the redirect
    
3aeff56faf/app/assets/javascripts/discourse/app/components/search-menu/results/types.hbs (L15-L16)

rather than `preventDefault`'ing the redirect
2023-12-04 11:27:38 -07:00
David Taylor
87d850948f
PERF: Only apply terser to production assets (#24699)
We funnel vendored javascript through ember-cli, but that's only used for the testem environment. Therefore, there's no need to minify it in production builds. In my tests, this reduces peak RSS of a production build from 3.53GB to 3.15GB.
2023-12-04 18:05:55 +00:00
Kris
c4381e0265
FIX: don't apply extraClassName to all popup menus (#24695) 2023-12-04 11:40:57 -06:00
David Taylor
9479b30ada
FIX: Ensure 'untagged' document title is set correctly (#24689)
https://meta.discourse.org/t/286130/4
2023-12-04 13:43:02 +00:00
David Taylor
cdb904a1b0
DEV: Remove unused htmlbars-inline-precompile shim (#24687)
Since 4425e99bf9, we no longer ship the template compiler to the client under any circumstances, so this shim doesn't work. Plus, even if it did work, it would trigger the ember-global deprecation and fail under Ember 4+.
2023-12-04 12:34:45 +00:00
Jarek Radosz
e0c876696a
DEV: Fix some qunit linting issues (#24686)
`qunit/literal-compare-order`
`qunit/no-compare-relation-boolean`
`qunit/assert-args`
2023-12-04 13:32:16 +01:00
Jarek Radosz
2029777b86
DEV: Replace AdminWrapper with body-class/html-class (#24683)
AdminWrapper isn't used (directly) in all-the*

Co-authored-by: David Taylor <david@taylorhq.com>
2023-12-04 12:53:07 +01:00
chapoi
1df1a9490d
UX: fix sidebar modal (#24646)
* UX: fix modal width
2023-12-04 08:10:17 +01:00
Krzysztof Kotlarek
d9ac0c33ff
FIX: update tag description field placeholder (#24644)
Improvements after  https://github.com/discourse/discourse/pull/24561

1. Make placeholder more descriptive
2. Respect new line breaks in description
2023-12-04 09:38:20 +11:00
Kris
56795f5c07
UX: improve btn-transparent styling (#24666) 2023-12-02 14:21:22 +11:00
David Taylor
aba3acf4cc
DEV: Correct deprecation id for discovery-controller-shims (#24671) 2023-12-01 19:11:48 +00:00
Mark VanLandingham
fb06cd6712
DEV: Add JS API to adjust desktop topic timeline min/max height (#24669) 2023-12-01 10:29:12 -06:00
David Taylor
9f9c82ea97
DEV: Only add ember-global deprecation for Ember 3 (#24667)
(otherwise, we're accidentally extending support into Ember 5!)

Followup to 106c1c317f
2023-12-01 14:50:15 +00:00
chapoi
f8bf4bda00
UX: fix info text color on custom field for login (#24665) 2023-12-01 14:41:44 +01:00
David Taylor
106c1c317f
DEV: Restore ember-global deprecation in production (#24664)
Even with our patch to the deprecate() macro, this is optimized out of the production build because it's wrapped in an `if(DEBUG)` statement. (https://github.com/davidtaylorhq/ember.js/blob/14c02f53b8/packages/%40ember/-internals/bootstrap/index.ts#L19-L19)
2023-12-01 13:07:57 +00:00
David Taylor
b72a177fb3
DEV: Exclude deprecation-collector plugin from source identifier (#24662) 2023-12-01 12:21:19 +00:00
dependabot[bot]
4df672a541
Build(deps-dev): Bump jsdom from 23.0.0 to 23.0.1 in /app/assets/javascripts (#24657)
* Build(deps-dev): Bump jsdom in /app/assets/javascripts

Bumps [jsdom](https://github.com/jsdom/jsdom) from 23.0.0 to 23.0.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/23.0.0...23.0.1)

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

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-01 11:11:16 +01:00
Isaac Janzen
aadc104817
FIX: Flashing when loading glimer search results (#24658) 2023-11-30 20:54:32 -07:00
Isaac Janzen
7539b457b2
DEV: Add forceDropdownForMenuPanels to plugin api (#24655) 2023-11-30 15:26:13 -07:00
Keegan George
d2b53ccac2
DEV: Port discourse-table-builder theme component to core (#24441) 2023-11-30 10:54:29 -08:00
chapoi
9fb4175008
UX: make summary 100% height (#24649) 2023-11-30 12:29:26 +01:00
Meghna
91ab2766e9
UX: properly align close button icon on composer messages (#24632) 2023-11-30 13:21:50 +05:30
Krzysztof Kotlarek
7e013b2120
DEV: add recurrence rule parameter to downloadCalendar API (#24404)
Add option to create recurrent calendar events. Recurrence rule parameter follows rfc5545 specification: https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10
2023-11-30 13:56:22 +11:00
Martin Brennan
c58cd697d2
FIX: Further improvements for plugin list (#24622)
Followup e37fb3042d

* Automatically remove the prefix `Discourse ` from all the plugin titles to avoid repetition
* Remove the :discourse_dev: icon from the author. Consider a "By Discourse" with no labels as official
* We add a `label` metadata to plugin.rb
  * Only plugins made by us in `discourse` and `discourse-org` GitHub organizations will show these in the list
* Make the plugin author font size a little smaller
* Make the commit sha look like a link so it's more obvious it goes to the code

Also I added some validation and truncation for plugin metadata
parsing since currently you can put absolutely anything in there
and it will show on the plugin list.
2023-11-30 10:53:17 +10:00