Commit Graph

45209 Commits

Author SHA1 Message Date
Martin Brennan 907adce1cb
FIX: Use registered bookmarkables for BookmarkManager (#16695)
These validate/after_create/after_destroy methods were added
back in b8828d4a2d before
the RegisteredBookmarkable API and pattern was nailed down.
This commit updates BookmarkManager to call out to the
relevant bookmarkable for these and bookmark_metadata for
consistency.
2022-05-11 09:51:03 +10:00
Martin Brennan 4037cdb6db
FIX: Allow .ics for polymorphic bookmarks (#16694)
We have a .ics endpoint for user bookmarks, this
commit makes it so polymorphic bookmarks work on
that endpoint, using the serializer associated with
the RegisteredBookmarkable.
2022-05-11 09:29:24 +10:00
dependabot[bot] cc0e53cabd
Build(deps): Bump strscan from 3.0.2 to 3.0.3 (#16709)
Bumps [strscan](https://github.com/ruby/strscan) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/ruby/strscan/releases)
- [Changelog](https://github.com/ruby/strscan/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/strscan/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: strscan
  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>
2022-05-11 00:23:12 +02:00
Discourse Translator Bot 660227434e
Update translations (#16701) 2022-05-10 21:42:02 +02:00
Bianca Nenciu 4760cf604c
FEATURE: Allow category moderators to post consecutively (#16706)
First posters and staff are already allowed to have unlimited
consecutive posts. This adds the same capabilities to category
moderators.
2022-05-10 22:18:17 +03:00
Bianca Nenciu 1d76c5ef5d
FIX: Store scroll position when using Back button (#16658)
For some pages, when navigating to a topic and then pressing the Back
browser button to go back to the topic list, the scroll position was
not preserved and the user was taken to the beginning of the list.

This happened because the application failed to detect when the user
used the Back button and whether the topic list should be fetch from
the cache or not. The scroll position is preserved only for cached
topic lists.

Other improvements:

* Improve isPoppedState

* Reset position for topic-lists from user-activity page

* Remove usage of jQuery

* Make sure the scrollTo function has effect

Follow up to 618a1ba571.
2022-05-10 19:18:55 +03:00
Chapoi 6f00feaea0
Fix user nav overflow bug on ipad (#16702) 2022-05-10 16:38:14 +01:00
Isaac Janzen 1a12e4cfc8
FEATURE: Introduce site setting to allow for non staff pm tagging (#16671)
Currently the only way to allow tagging on pms is to use the `allow_staff_to_tag_pms` site setting.  We are removing that site setting and replacing it with `pm_tags_allowed_for_groups` which will allow for non staff tagging. It will be group based permissions instead of requiring the user to be staff.

If the existing value of `allow_staff_to_tag_pms` is `true` then we include the `staff` groups as a default for `pm_tags_allowed_for_groups`.
2022-05-10 10:02:28 -05:00
Isaac Janzen cf273ec6e0
DEV: Remove ie 11 from build targets (#16652)
## Ember Upgrade

Context: https://deprecations.emberjs.com/v3.x/#toc_3-0-browser-support-policy
2022-05-10 08:33:31 -05:00
Joffrey JAFFEUX 142ae3b5e5
UX: allows to close popover on escape (#16698) 2022-05-10 13:41:02 +02:00
Loïc Guitaut 5fb6dd5664 DEV: Upgrade to Rails 7.0.3 2022-05-10 12:01:00 +02:00
Loïc Guitaut ba148e082d FIX: Apply watched words to user fields
Currently we don’t apply watched words to custom user fields nor user
profile fields.
This led to users being able to use blocked words in their bio, location
or some custom user fields.

This patch addresses this issue by adding some validations so it’s not
possible anymore to save the User model or the UserProfile model if they
contain blocked words.
2022-05-10 11:37:52 +02:00
Kris 26c5002144
UX: prevent user grid blowout on full page search (#16672) 2022-05-10 09:48:01 +08:00
dependabot[bot] 4ef1ea0264
Build(deps): Bump net-http from 0.2.0 to 0.2.2 (#16689)
Bumps [net-http](https://github.com/ruby/net-http) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/ruby/net-http/releases)
- [Commits](https://github.com/ruby/net-http/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: net-http
  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>
2022-05-10 09:46:28 +08:00
dependabot[bot] 0ade330c49
Build(deps): Bump regexp_parser from 2.3.1 to 2.4.0 (#16690)
Bumps [regexp_parser](https://github.com/ammar/regexp_parser) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/ammar/regexp_parser/releases)
- [Changelog](https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ammar/regexp_parser/compare/v2.3.1...v2.4.0)

---
updated-dependencies:
- dependency-name: regexp_parser
  dependency-type: indirect
  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>
2022-05-10 09:45:35 +08:00
dependabot[bot] c4f9f07147
Build(deps): Bump strscan from 3.0.1 to 3.0.2 (#16691)
Bumps [strscan](https://github.com/ruby/strscan) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/ruby/strscan/releases)
- [Changelog](https://github.com/ruby/strscan/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/strscan/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: strscan
  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>
2022-05-10 09:35:14 +08:00
Martin Brennan 3b3c505f3c
FIX: Polymorphic bookmarks for bookmark report (#16693)
This allows the category_id filter for the bookmark
report to work with polymorphic bookmarks. Honestly this
is a little hardcode-y at the moment but until we go and
make this report a lot more flexible with more filters
I don't think it's worth the work to add extra interfaces
to RegisteredBookmarkable and BaseBookmarkable to make
this more flexible. This is enough for now.
2022-05-10 11:14:59 +10:00
Martin Brennan 244836ddd4
FIX: Use hidden site setting for batch presign rate limit (#16692)
This was causing issues on some sites, having the const, because this really is heavily
dependent on upload speed. We request 5-10 URLs at a time with this endpoint; for
a 1.5GB upload with 5mb parts this could mean 60 requests to the server to get all
the part URLs. If the user's upload speed is super fast they may request all 60
batches in a minute, if it is slow they may request 5 batches in a minute.

The other external upload endpoints are not hit as often, so they can stay as constant
values for now. This commit also increases the default to 20 requests/minute.
2022-05-10 11:14:26 +10:00
Martin Brennan fbcc35b417
DEV: Remove PostAction/UserAction bookmark refs (#16681)
We have not used anything related to bookmarks for PostAction
or UserAction records since 2020, bookmarks are their own thing
now. Deleting all this is just cleaning up old cruft.
2022-05-10 10:42:18 +10:00
Martin Brennan 955d47bbd0
FIX: Use polymorphic bookmarks for in:bookmarks search (#16684)
This commit makes sure the in:bookmarks post advanced
search filter works with polymorphic bookmarks.
2022-05-10 09:08:01 +10:00
Sam 2df3c65ba9
FIX: add support for pipelined and multi redis commands (#16682)
Latest redis interoduces a block form of multi / pipelined, this was incorrectly
passed through and not namespaced.

Fix also updates logster, we held off on upgrading it due to missing functions
2022-05-10 08:19:02 +10:00
Rafael dos Santos Silva 919f71537e
FIX: Background like count update didn't account for own user actions (#16688)
This fixes a corner case of the perf optimization in d4e35f5.

When you have the the same post showing in multiple tab/devices and like
said post in one place, we updated the like count but didn't flip the
`acted` bool in the front-end. This caused a small visual desync.

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-05-09 17:23:39 -03:00
Daniel Waterworth bc8968fd12
DEV: Move SidekiqLogsterReporter out of initializer (#16687)
This fits more naturally in its own file.
2022-05-09 13:01:31 -05:00
Bianca Nenciu 3206452d78
FIX: Prioritize names and usernames consistently (#16686)
The prioritize_username_in_ux site settings controls if the username or
name will be prioritized in the user interface. On the user directory
page the name was never displayed if the user and username were very
similar, being completely different from all the other places where the
username or name is displayed.
2022-05-09 18:46:27 +03:00
Bianca Nenciu 618a1ba571
FEATURE: Restore scroll on user activity pages (#16661)
The scroll position was reset everytime the user pressed the back button
and returned to a user activity page. This fix applies only to pages
that uses the user-stream component. Pages with topic lists already had
this functionality implemented.
2022-05-09 18:45:57 +03:00
Roman Rizzi 6bdcd7afb2
FEATURE: Promote the "delete group" staff action log. (#16656)
We used to log group deletion as custom, which means we can't later search for them. Include group ID in the details.
2022-05-09 12:12:52 -03:00
Penar Musaraj 54759b7e8c
FIX: Limit pan event handler to fix scrolling in TOC (#16673) 2022-05-09 09:04:03 -04:00
Loïc Guitaut ab6ca78486 FIX: Use proper ActiveRecord method in import scripts
`ActiveRecord::Base.connection_config` has been deprecated since Rails
6.1 and was completely removed from Rails 7.
Instead we need to use
`ActiveRecord::Base.connection_db_config.configuration_hash`.

Import scripts were forgotten when we did the Rails 7 upgrade, this
patch fixes them.
2022-05-09 11:09:27 +02:00
dependabot[bot] c05dc01fe9
Build(deps): Bump rubocop from 1.28.2 to 1.29.0 (#16678)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.28.2 to 1.29.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.28.2...v1.29.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: indirect
  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>
2022-05-09 10:57:39 +02:00
dependabot[bot] 660dae4f23
Build(deps-dev): Bump test-prof from 1.0.8 to 1.0.9 (#16677)
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.8 to 1.0.9.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.8...v1.0.9)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 10:57:13 +02:00
dependabot[bot] 70dc04d868
Build(deps): Bump nokogiri from 1.13.5 to 1.13.6 (#16676)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.5 to 1.13.6.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.6/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.5...v1.13.6)

---
updated-dependencies:
- dependency-name: nokogiri
  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>
2022-05-09 10:56:56 +02:00
Joffrey JAFFEUX 131974b3a6
FIX: ensures d-popover closes when clicking on popper (#16675)
I think the no-invalid-interaction is fine here as on click Is not actually used for an expected interaction but as an event bubbling barrier.
2022-05-09 10:50:29 +02:00
Martin Brennan 4d0ac8636c
FIX: Polymorphic bookmarks for new user narrative bot (#16683)
This commit allows the new user narrative bot to work
with polymorphic bookmarks, gated behind the
use_polymorphic_bookmarks site setting.
2022-05-09 16:19:18 +10:00
Martin Brennan 222c8d9b6a
FEATURE: Polymorphic bookmarks pt. 3 (reminders, imports, exports, refactors) (#16591)
A bit of a mixed bag, this addresses several edge areas of bookmarks and makes them compatible with polymorphic bookmarks (hidden behind the `use_polymorphic_bookmarks` site setting). The main ones are:

* ExportUserArchive compatibility
* SyncTopicUserBookmarked job compatibility
* Sending different notifications for the bookmark reminders based on the bookmarkable type
* Import scripts compatibility
* BookmarkReminderNotificationHandler compatibility

This PR also refactors the `register_bookmarkable` API so it accepts a class descended from a `BaseBookmarkable` class instead. This was done because we kept having to add more and more lambdas/properties inline and it was very messy, so a factory pattern is cleaner. The classes can be tested independently as well.

Some later PRs will address some other areas like the discourse narrative bot, advanced search, reports, and the .ics endpoint for bookmarks.
2022-05-09 09:37:23 +10:00
Joffrey JAFFEUX c99a6b10fb
DEV: allows to set a class on d-popover component (#16670) 2022-05-06 15:23:35 +02:00
Osama Sayegh 7e026e8ddf
DEV: Add last_seen_reviewable_id to the users table (#16666)
We're adding this column now in preparation for a future commit(s) that will
redesign the avatar/notifications menu. The reason the column is added in a
separate commit is because the redesign changes are going to be complex with a
high risk of getting (temporarily) reverted and if they included a database
migration, they wouldn't revert cleanly/easily.

Internal ticket: t65045.
2022-05-06 10:11:16 +03:00
Natalie Tay 337cacc7bf
DEV: Unflak-ify tests and make them more robust (#16659) 2022-05-06 11:53:23 +08:00
Alan Guo Xiang Tan 4e5f5b67b0
DEV: Remove monkey patch that is no longer required (#16648) 2022-05-06 10:33:42 +08:00
Jarek Radosz ad7c324eb4
DEV: Remove an obsolete config line (#16668)
```
Post-install message from image_optim:
Rails image assets optimization is extracted into image_optim_rails gem
You can safely remove `config.assets.image_optim = false` if you are not going to use that gem
```
2022-05-06 10:32:51 +08:00
dependabot[bot] 05bf262c53
Build(deps): Bump json_schemer from 0.2.20 to 0.2.21 (#16667)
Bumps [json_schemer](https://github.com/davishmcclurg/json_schemer) from 0.2.20 to 0.2.21.
- [Release notes](https://github.com/davishmcclurg/json_schemer/releases)
- [Commits](https://github.com/davishmcclurg/json_schemer/compare/v0.2.20...v0.2.21)

---
updated-dependencies:
- dependency-name: json_schemer
  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>
2022-05-06 00:26:48 +02:00
Jarek Radosz e4054f040f
DEV: Replace postCreateCommand with postStartCommand (#16665)
The boot script should be run whenever the container is started. Otherwise, when you restart a stopped container you don't have the database running.
2022-05-05 23:52:35 +02:00
Ella E 406493660d
add translations for subcategories_with_featured_topics (#16663) 2022-05-05 14:07:52 -06:00
Rafael dos Santos Silva 94cfe98ee4
FEATURE: Validate setting combination between exif strip and img opt (#16662)
Admins won't be able to disable strip_image_metadata if they don't
disable composer_media_optimization_image_enabled first since the later
will strip the same metadata on client during upload, making disabling
the former have no effect.

Bug report at https://meta.discourse.org/t/-/223350
2022-05-05 15:13:17 -03:00
Kris 4b92175d4e
UX: remove horizontal scoll from narrow screens (#16657) 2022-05-05 11:34:01 -04:00
Joffrey JAFFEUX 81580e559c
FIX: prevents double user_badge_granted event (#16654)
This bug was causing double events to be fired as :user_badge_granted is already called when a `user_badge` is created. More over the signature of the block in the UserBadge code is `badge_id, user_id` not `badge, user_id`.
2022-05-05 15:09:41 +02:00
Natalie Tay 8c8b646a59
FIX: Prevent admin theme settings from blowing up (#16653) 2022-05-05 20:20:59 +08:00
Isaac Janzen 47d64b7a08
DEV: Remove last instance of {{with}} helper (#16651) 2022-05-05 06:16:34 -05:00
Alan Guo Xiang Tan 87b970cd22
UX: Ensure `#main-outlet-wrapper` takes full width. (#16650)
For some reason, we're seeing inconsistency between production and
development environment where the computed width of #main-outlet-wrapper
is not taking the full width of the grid column in production.

Follow-up to b35cf7cc0c.
2022-05-05 16:34:40 +08:00
Bianca Nenciu 62cbb766cd
FIX: Validate post's polls as acting user (#16638)
It used to validate the post from the perspective of the user who
created the post. That did not work well when an admin attempted to
add a poll to a post created by a user who cannot create posts because
it said the user cannot create polls.

The problem was that it used post.user for the validation process
instead of post.acting_user.
2022-05-05 09:54:10 +03:00
Alan Guo Xiang Tan b35cf7cc0c
DEV: First desktop design interface pass at experimental sidebar take 2. (#16647) 2022-05-05 14:35:08 +08:00