Commit Graph

52179 Commits

Author SHA1 Message Date
dcef359a8e Build(deps-dev): Bump selenium-webdriver from 4.15.0 to 4.16.0 (#24759)
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.15.0 to 4.16.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.15.0...selenium-4.16.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  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-12-06 23:08:00 +01:00
8623631a06 DEV: Fix random typos (#24756) 2023-12-06 22:25:26 +01:00
6eb1cadb73 DEV: Fix RSpec/SpecFilePathSuffix / enable 3 chat spec files (#24750)
* RSpec/SpecFilePathSuffix
* removes failing specs
* More specific selectors?

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-12-06 22:25:11 +01:00
42a75e3df9 FIX: saving tag changes without description (#24753) 2023-12-06 14:17:56 -05:00
48ec946702 UX: Restore category badge colours on 404 page (#24754) 2023-12-06 17:49:19 +00:00
42e5bbaf38 UX: fix double-scrollbar in keyboard-shortcuts-modal (#24751) 2023-12-06 17:12:14 +01:00
22bb1c8951 UX: improve poll text wrap (#24732) 2023-12-06 10:58:06 -05: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
f7c514dc99 DEV: Add ember-5 to test matrix for core/chat system specs (#24721) 2023-12-06 12:12:04 +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
78c2f116e0 DEV: skip flaky upload spec for large image thumbnails (#24745) 2023-12-06 19:08:56 +08:00
6dd4937b69 update matchers to improve test suite perf for upload specs (#24744)
This change speeds up our upload specs by avoiding Capybara's default_max_wait_time.
2023-12-06 18:02:55 +08: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
ac60b9fe72 DEV: Skip chat test (#24739)
This consistently fails on core now, see
https://github.com/discourse/discourse/actions/runs/7109919490/job/19355591619?pr=24738

Error: QUnit Test Failure: Browser Id 2 - Discourse Chat | Component | chat message collapser images: escapes link
not ok 444 Chrome 120.0 - [58 ms] - Browser Id 2 - Discourse Chat | Component | chat message collapser images: escapes link
    ---
        actual: >
            false
        expected: >
            true
        stack: >

Expected value is %3Cscript%3Esomeeviltitle%3C/script%3E and actual value is
&lt;script&gt;someeviltitle&lt;/script&gt;
2023-12-06 13:58:13 +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
d9dca6482d DEV: Incorrect setup for test (#24736)
Why this change?

The test in question is testing an anon user instead of a user that has
no permissions to a given topic.
2023-12-06 09:26:45 +08:00
a5d4bf6dd2 DEV: Remove unnecessary method_missing from GuardianUser (#24735)
Followup to 77b6a038bae010c9e9e630a137f9ccd570f60784, this
was a mistake and should have been removed before merge.
2023-12-06 11:24:19 +10:00
3141994e38 FIX: Add checkbox-label to notification bulk actions (#24734)
Followup to c80b5b718c2e3dee70b7ad70c32b22b078080efe
2023-12-06 11:22:48 +10:00
77b6a038ba DEV: Improve Guardian devex (#24706)
It's quite confusing for blank? to be overridden
on AnonymousUser and BasicUser to represent
whether the fake user is authenticated or not;
we can achieve the same thing more clearly with
a wrapper GuardianUser class around these
user classes. Also fixes an issue where
`def user` would be returning nil.
2023-12-06 10:57:04 +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
4ad6c9ce34 FIX: shortcut typo (#24731) 2023-12-05 17:17:04 -05:00
3a98474983 A11Y: allow tab titles to use default translation (#24727) 2023-12-05 17:16:56 -05:00
c4cc738d0a Build(deps): Bump json from 2.6.3 to 2.7.1 (#24729)
Bumps [json](https://github.com/flori/json) from 2.6.3 to 2.7.1.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v2.6.3...v2.7.1)

---
updated-dependencies:
- dependency-name: json
  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-12-05 22:59:08 +01:00
e305e7e218 Build(deps): Bump cgi from 0.4.0 to 0.4.1 (#24728)
Bumps [cgi](https://github.com/ruby/cgi) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/ruby/cgi/releases)
- [Commits](https://github.com/ruby/cgi/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: cgi
  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-12-05 22:58:57 +01:00
bdecb23fd4 UX: More adjustments (#24726) 2023-12-05 14:55:08 -06: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
8fb5b1fe7c DEV: Fix assertion in embedding test (#24694)
The modified test used to be the same as the test above. The bad test
was introduced in commit 77d4c4d8dc00491b99aa15dfd78eb22a47ffe663,
during a refactoring.

This was not a serious problem because the same behavior was still
tested partially by the other tests below.
2023-12-05 18:30:52 +02: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
cae2b83af8 Update translations (#24716) 2023-12-05 14:39:08 +01:00
ad77a6876c UX: fix alignment (#24718) 2023-12-05 14:19:21 +01:00
3d710fa0b8 UX:; scope details change (#24715) 2023-12-05 13:56:17 +01:00
a6c79aa27a DEV: Fix readonly admin login spec (#24714)
"prevents login by admins" should test with an admin.
2023-12-05 06:49:22 -06:00
c5aa6b5e16 FIX: correctly update replies_count on chat_threads (#24711)
The previous query would look at the existing messages, count them, and update the associated thread.

But, if for some reason messages were **ALL** deleted without updating the `replies_count`, then the query wouldn't find any message, and wouldn't update any thread's `replies_count`.
2023-12-05 13:46:58 +01:00
707acbe696 UX: details tag background colour (#24710) 2023-12-05 12:52:00 +01:00
094d597ec8 FIX: increments message version when processed (#24713)
Incrementing version, ensures the message will re-play decorators.

Also removes a debugging line which had been forgotten.
2023-12-05 12:34:19 +01:00
9362949687 Build(deps): Bump regexp_parser from 2.8.2 to 2.8.3 (#24701)
Bumps [regexp_parser](https://github.com/ammar/regexp_parser) from 2.8.2 to 2.8.3.
- [Changelog](https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ammar/regexp_parser/compare/v2.8.2...v2.8.3)

---
updated-dependencies:
- dependency-name: regexp_parser
  dependency-type: indirect
  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-12-05 11:50:48 +01:00
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
c6ee647b12 DEV: skip failing spec du to refactoring modal for now (#24712) 2023-12-05 11:47:39 +01:00
c7667f791e DEV: Fix chat notifier deprecation warnings from job arguments (#24708)
We're seeing some deprecation warnings in production. This is because we're passing a raw Ruby timestamp, which gets stringified implicitly when written to Redis. As per #15842, this conversion needs to be done explicitly.
2023-12-05 18:03:30 +08:00
de983796e1 FIX: Introduce Guardian::BasicUser for oneboxing checks (#24681)
Through internal discussion, it has become clear that
we need a conceptual Guardian user that bridges the
gap between anon users and a logged in forum user with
an absolute baseline level of access to public topics,
which can be used in cases where:

1. Automated systems are running which shouldn't see any
   private data
1. A baseline level of user access is needed

In this case we are fixing the latter; when oneboxing a local
topic, and we are linking to a topic in another category from
the current one, we need to operate off a baseline level of
access, since not all users have access to the same categories,
and we don't want e.g. editing a post with an internal link to
expose sensitive internal information.
2023-12-05 09:25:23 +10:00
7756c210da FIX: Flaky table builder spec (#24700) 2023-12-04 12:14:07 -08:00
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