Commit Graph

31107 Commits

Author SHA1 Message Date
2eed8753fb UX: fix icon colour on signup CTA (#24818) 2023-12-11 12:26:00 +01:00
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
6388d929d6 UX: Ensure wizard previews display at correct width (#24801) 2023-12-08 20:45:54 +00:00
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 9cc2b5cc20c9dba826b9bb13dbbe742b691bdc15
2023-12-08 17:02:25 +00:00
e227008c65 UX: login modal sizing fixes (#24794) 2023-12-08 17:21:37 +01:00
b4cf175daf DEV: Use category objects as values for category select kits (#24793)
Commit dcd81d56c075c66c975320ff083e66419572ffeb 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
80d5acc0ce FIX: Navigate search results using J/K keys (#24787) 2023-12-08 11:06:59 -05:00
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
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
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
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
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
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
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
61cf76bf70 Revert "A11Y: fix setting focus to a post (#23367)" (#24783)
This reverts commit 9dce1592dc30e3c196a92b908b7ffb09f7e73908.

The change is having some adverse effects.
2023-12-07 17:03:52 -05:00
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
290f6a70bd FIX: Form template form error visiblity (#24779) 2023-12-07 12:26:56 -08:00
611acaa6bc FIX: Validate each value in an array custom field separately (#24659) 2023-12-07 14:24:04 -06:00
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
ddf3c571cf FIX: Prevent error when poster isn't present in message notification item (#24776) 2023-12-07 13:21:45 -06:00
ee05f57e2d FEATURE: Site setting to display user avatars in user menu (#24514) 2023-12-07 11:30:44 -06:00
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
0139481188 UX: move monospace font to variable (#24762) 2023-12-07 09:51:14 -05:00
001d2176e5 UX: minor fixes in topic action modal (#24772) 2023-12-07 14:54:56 +01:00
7d4fd19696 DEV: revert bg color from --tertiary-very-low to --tertiary-low (#24764) 2023-12-06 20:07:01 -07:00
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
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
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
c197f8c6ee UX: make github onebox styles more responsive (#24761) 2023-12-06 17:45:56 -05:00
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
42a75e3df9 FIX: saving tag changes without description (#24753) 2023-12-06 14:17:56 -05:00
42e5bbaf38 UX: fix double-scrollbar in keyboard-shortcuts-modal (#24751) 2023-12-06 17:12:14 +01:00
efcb5bb3df DEV: Plugin outlet around user menu empty state (#24730) 2023-12-06 08:06:50 -06:00
6a66dc1cfb DEV: Fix Lint/BooleanSymbol (#24747) 2023-12-06 13:19:09 +01:00
138bf486d3 DEV: Fix Lint/DuplicateMethods (#24746) 2023-12-06 13:18:34 +01:00
4280c01153 DEV: Fix Lint/ShadowedArgument (#24733) 2023-12-06 13:16:10 +01:00
1e471f7ec2 FIX: Handle 404 correctly when transition has no path (#24748) 2023-12-06 12:12:19 +00:00
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
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
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 9057272ee242b3bc977e50977b4142066c36c05d.

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

This reverts commit a5d4bf6dd28a8304ccd519536f33bd4a13232ed4.

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

This reverts commit 77b6a038bae010c9e9e630a137f9ccd570f60784.

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

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

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
3141994e38 FIX: Add checkbox-label to notification bulk actions (#24734)
Followup to c80b5b718c2e3dee70b7ad70c32b22b078080efe
2023-12-06 11:22:48 +10:00
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
3a98474983 A11Y: allow tab titles to use default translation (#24727) 2023-12-05 17:16:56 -05:00
b65f281842 FIX: escape category description text (#24724) 2023-12-05 15:48:13 -05:00
d4c02d738b DEV: Add topicNotificationLevel fn to post model (#24723) 2023-12-05 12:08:29 -06:00
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
6aeddad333 DEV: Add search-menu-before-advanced-search plugin outlet (#24720) 2023-12-05 10:08:27 -07:00
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
ad77a6876c UX: fix alignment (#24718) 2023-12-05 14:19:21 +01:00