Commit Graph

901 Commits

Author SHA1 Message Date
Blake Erickson ed059d3dfe
DEV: Changes for new bulk action dropdown modal (#553)
When the new bulk actions dropdown is enabled use a new component for bulk assigning.

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-03-25 15:13:36 -06:00
Loïc Guitaut c696e44714 FIX: Recreate notifications on topic reopening
Currently, when reopening a topic that has assignments, the
notifications in the user menu aren’t recreated.

This patch fixes that issue. It also addresses the same type of issue
with posts being destroyed and recovered.
2024-03-18 10:56:08 +01:00
Andrei Prigorshnev b09a6618fa
FEATURE: Add menu to assigned text on posts (#550)
This adds a popup menu to assigned posts that makes it easier to unassign or 
reassign them.
2024-03-15 18:30:11 +04:00
Andrei Prigorshnev a1686e1ca9
DEV: Stop using FoundUserWithStatusSerializer (#546)
Starting from b3a1199493 we stop using deprecated "WithStatus" serializers. Instead we'll be passing an 'include_status' option to serilaizers, for example:

```ruby
# before
BasicUserWithStatusSerializer.new(user)
ArraySerializer.new(users, each_serializer: BasicUserWithStatusSerializer)

# now
BasicUserSerializer.new(user, include_status: true)
ArraySerializer.new(users, each_serializer: BasicUserSerializer, include_status: true)
```
2024-03-14 17:44:48 +04:00
Discourse Translator Bot 33c43ca51a
Update translations (#551) 2024-03-05 16:47:42 +01:00
Selase Krakani 885bd95966
DEV: Pin plugin for Discourse < 3.3.0.beta1-dev (#549) 2024-02-29 13:49:21 -07:00
Loïc Guitaut c33297316a
DEV: Fix new Rubocop offenses (#548) 2024-02-29 18:23:48 +01:00
Alan Guo Xiang Tan 56b0de3896
DEV: Remove `capture_logs: true` metadata (#547)
Why this change?

We believe we have figured out the problem and not longer need the debugging information.
2024-02-22 20:09:22 +08:00
Discourse Translator Bot ae26c05db5
Update translations (#545) 2024-01-30 17:02:58 +01:00
Discourse Translator Bot d3f9af3eb6
Update translations (#544) 2024-01-23 18:29:09 +01:00
Jarek Radosz c42ae3eb7a
DEV: Update linting (#538) 2024-01-15 11:24:20 +00:00
Daniel Waterworth 2113f1732c
Backport custom field security commit (#543) 2024-01-08 16:19:27 -06:00
Daniel Waterworth ad82893352
Merge pull request from GHSA-82hq-222g-j4vj
10 digits should be plenty.
2024-01-08 16:41:56 -05:00
Alan Guo Xiang Tan 87e74f7948
DEV: Capture logs for all tests in `spec/system/assign_topic_spec.rb` (#542)
Why this change?

We have been getting flaky test failures from these specs and the
failure screenshot shows that the user is not logged in when it is
supposed to be. Futher investigation shows that when the test flakes, it
is because the request to view the topic is using an auth token that is
different from the one which was created when the user was signed in.

What does this change do?

1. Add the `capture_log` metadata to all the tests in this file.

2. Enables the `verbose_auth_token_logging` site setting to give us more
   debugging information in the logs.
2024-01-04 11:18:53 +08:00
Alan Guo Xiang Tan 4ac3f02b39
DEV: Unskip flaky tests and capture logs (#541)
Why this change?

The tests are supposedly flaky but we are unskipping them and capturing
logs to figure out why.
2024-01-03 13:11:03 +08:00
Alan Guo Xiang Tan 1f24dca1cc
DEV: Fix flaky system tests (#540)
Why this change?

The spec is flaky and it seems to be DB transaction related where after
signing in as a user, the failure screenshot shows that the user has not
been signed in.

What does this change do?

Set `capture_log: true` which will log all ActiveRecord DB statements
execute while running the spec.
2024-01-02 07:37:44 +08:00
Mark VanLandingham a5b7911cb9
DEV: Fix tests for user notification changes (#537) 2023-12-11 10:56:19 -06:00
Jarek Radosz 5888025dec
FIX: Various assignment status issues (#536) 2023-12-08 11:48:34 +01:00
David Taylor 9556df664c
DEV: Resolve transitionTo deprecation (#535) 2023-12-01 16:06:09 +00:00
Jarek Radosz e1aabe0517
DEV: Update linting (#534) 2023-11-29 23:02:00 +01:00
Loïc Guitaut cac9a763dd FEATURE: Allow to reassign to same user
Currently, when only one user is available for the random auto-assign
and if that user was already assigned, then the assign will fail.

This patch addresses this issue by allowing to reassign a user who’s
already assigned. A new parameter (`allow_self_reassign`) has been added
to `Assigner#assign` with a default value of `false`.
2023-11-27 16:17:25 +01:00
Loïc Guitaut eb073febb0 DEV: Fix a flaky spec
Sometimes, the topic id actually exists for that spec (id being 1) and
it will raise about not finding the group id instead of not finding the
provided topic because the assignees group wasn’t provided in the
`fields` parameter.
2023-11-27 14:46:35 +01:00
Loïc Guitaut fbd1fa3794 FEATURE: Add a fallback to auto-assign
Currently, when the auto-assign logic can’t find a user to assign, it
will fail saying there was no one to assign. The current logic is this
one:
- Don’t pick anyone who’s been picked in the last 180 days
- If no one has been found, then try the same thing but only for the
  last 14 days.
While this is working relatively well for large enough groups, it
doesn’t work at all with very small groups (like 2 people) and it
creates unnecessary noise.

This patch addresses this issue by adding a fallback to the current
logic. Now, if the two first rules fail, instead of saying that no one
was assigned, we assign the least recently assigned person. This way,
the logic will continue to work with large groups but will also work
nicely with small groups.
2023-11-22 10:11:15 +01:00
Discourse Translator Bot 4ce9ae97f4
Update translations (#531) 2023-11-21 14:36:06 +01:00
Jarek Radosz 190017f241
DEV: Update linting setup (#530) 2023-11-19 22:43:52 +01:00
Penar Musaraj 2c6ca25c9f
Update LICENSE (#529) 2023-11-15 20:11:33 +01:00
David Taylor da20a2bf53
DEV: Update tests for core change (#525)
https://github.com/discourse/discourse/pull/23967
2023-11-15 09:23:36 +00:00
Loïc Guitaut be53c06e5a DEV: Rewrite post-migration in pure SQL 2023-11-15 09:50:54 +01:00
Discourse Translator Bot 751483ed2b
Update translations (#526) 2023-11-14 14:30:06 +01:00
chapoi 6397bf8351
UX: prepare for core modal styling changes (#524)
See https://github.com/discourse/discourse/pull/23967
2023-11-13 12:25:03 +00:00
Martin Brennan bf6df7ccd9
DEV: Change settings root from plugins: to discourse_assign (#523)
This is so the plugins settings are better categorized in the site settings UI.
2023-11-13 10:24:09 +10:00
Bianca Nenciu c234819131
DEV: Use new API to preload category custom fields (#521) 2023-11-09 18:52:04 +02:00
Loïc Guitaut 5055bcbb2c FIX: Order items properly in user menu
The recent changes to the user menu changed how we were ordering the
items in it. A small bug was noticed though, as we’re not displaying the
unread assignments at the very top.

This patch fixes the ordering like this:

- Unread individual assignment notifications
- Unread group assignment notifications
- Read individual assignments
- Read group assignments

In each group of items, they are sorted by date, the most recent ones
being at the top.
2023-11-09 16:41:48 +01:00
Martin Brennan 41f08fdd20
Update plugin.rb metadata (#519)
Co-authored-by: AlexDev <104522507+alexdevlaeminck@users.noreply.github.com>
2023-11-08 11:05:12 -08:00
Loïc Guitaut 80604e9012 FIX: Display assignments in user menu properly
Currently, we display a mix of topics and notifications in the user menu
assignments tab. This has a number of issues like having to maintain
hard to understand code instead of simply relying on the notifications
system we have, we can’t display more than one assignment per topic and
it’s not clear if an assignment is for a topic or a post nor if it’s a
group assignment or an individual one.

This patch addresses those issues by relying on the notifications system
we’re using for most of the other user menu tabs instead of a custom
implementation. This led to some heavy refactoring but it was
worthwhile as things are a bit more normalized and easier to reason
about. Instead of serializing topics with different attributes to access
various assignments, we now simply return a notification for each
existing assignment.

The UI changed a bit: tooltips are now explaining if the assignment is
for a topic or a post and if it’s for an individual or a group. Icons
are also properly set (so no more individual icon for group assignments)
and the assigned group name is displayed.

The background jobs signatures changed a bit (`assignment_id` is now
needed for the unassign job) so when deploying this patch, it’s expected
to have some jobs failing. That’s why a post-migration has been written
to handle the creation of missing notifications and the deletion of
extra notifications too.
2023-11-08 15:26:57 +01:00
Natalie Tay 20cdd5ae87
DEV: Use match_array for spec allowed groups (#520) 2023-11-02 19:16:54 +08:00
Jarek Radosz 71f8484a75
DEV: Use `@discourse/lint-configs` (#517) 2023-10-23 12:08:11 +02:00
Jarek Radosz 6ed4a13fe7
DEV: Update ruby linting (#518) 2023-10-20 17:04:03 +02:00
Kris 7fe45c8eb5
UX: simplify markup to fix j/k highlighting (#516)
This cleans up the markup a bit, so instead of a `div` as a table child we use the `td` and removes the internal wrapper. This fixes an issue with a double highlight while using j/k navigation highlighting caused by the nested `td`.
2023-10-20 08:40:55 +08:00
dependabot[bot] 92b0dd530b
Build(deps): Bump @babel/traverse from 7.22.17 to 7.23.2 (#515)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.17 to 7.23.2.
- [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.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 11:54:27 +02:00
Natalie Tay e434be7969
UX: Don't change topic notification level when unassigning (#513)
* UX: Don't change topic notification level when unassigning

* Update test
2023-10-16 04:41:44 +00:00
Discourse Translator Bot 2185513d96
Update translations (#514) 2023-10-11 11:17:57 +02:00
Krzysztof Kotlarek 0c01e8fdfd
FIX: granular webhooks (#498)
After those core changes we need additional translations

https://github.com/discourse/discourse/pull/23070
2023-10-09 03:26:40 +00:00
David Taylor df34e91b55
DEV: Resolve routing method deprecation (#512)
Uses the router service for redirecting instead of `this.transitionTo`. Also removes the first branch of logic, which was unnecessarily redirecting to the current route (and led to an infinite loop with the modern API)
2023-10-02 15:10:31 +01:00
David Taylor 93ee2cb886
DEV: Update AssignedTopicListColumn class name (#511)
The `_Test` suffix shouldn't have been included in 89807545a4. No functional change.
2023-10-02 13:15:39 +01:00
David Taylor 89807545a4
DEV: Modernise assignment topic-list implementation (#510)
- Reuse core `<BasicTopicList` instead of reimplementing
- Use raw plugin outlet to add assign controls to topic-list-item (requires https://github.com/discourse/discourse/pull/23592)
- Remove use of `.render()` in route
2023-09-28 15:07:15 +01:00
Jarek Radosz e9c7cb5c3f
DEV: Skip a flaky spec (#508) 2023-09-12 07:43:24 +08:00
Martin Brennan 7c18124a32
DEV: Fix REMINDER_BUFFER_MINUTES const reassignment warning (#506)
Without ||=, ruby warns the const is being reassigned all the time.
2023-08-31 12:51:51 +10:00
Discourse Translator Bot d28c06a973
Update translations (#505) 2023-08-29 15:50:21 +02:00
Jarek Radosz a5fb9a5e1f
DEV: Fix a core deprecation (#504)
Re-lands #475
2023-08-28 10:02:29 +02:00