Commit Graph

304 Commits

Author SHA1 Message Date
Joffrey JAFFEUX dca24fa6fa
FIX: ensures topics can be bulk assigned on group page (#580)
Since a previous refactor the bulkSelectHelper was not correctly passed in the custom topic list page of this plugin.

A spec has also been added.
2024-07-19 18:49:35 +02:00
Joffrey JAFFEUX 6c229284a9
FIX: adaptes acceptance tests for new dropdown-menu (#570) 2024-05-08 11:01:49 +02:00
Joffrey JAFFEUX 5e75baa5f6
FIX: uses the new <DropdownMenu /> component (#569) 2024-05-08 09:08:30 +02:00
Krzysztof Kotlarek b796ae3fcc
DEV: remove assign_path and assign_icon from seralizers (#568)
Both fields are unnecessary and should not be included in the serializer to reduce payload.
2024-05-06 12:12:45 +10:00
Joffrey JAFFEUX 62563bfcea
DEV: linting arguments in templates (#567) 2024-04-24 16:45:12 +02:00
Joffrey JAFFEUX cbf3f3a908
FIX: ensures ctrl+enter from textarea saves (#566) 2024-04-24 15:54:38 +02:00
Andrei Prigorshnev c1d4633ba4
FEATURE: Make it possible to reassign posts on the topic level assign modal (#562)
This adds a new dropdown to the topic level assign modal. A topic may contain several assignments, the topic itself may be assigned and also some of the replies may be assigned. With this new dropdown, it's possible to edit all the assignments from this modal.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-04-16 14:08:39 +02:00
Andrei Prigorshnev 6070678a1c
FIX: Unassign label sometimes touches avatar (#561)
The label touches the avatar when a topic has several assignments, 
and those contain assignments to users _and_ to groups. We don't show 
avatars for groups, but the code sees there are several assignees and 
applies overlapping styling.

This commit corrects the logic and fixes the issue.

Here is how avatars on the button behave:
1. If there are from one to many assignments on the topic, but all 
the assignees are groups, we don't show avatars, only label.
2. If there are from one to many assignments to the same user, we show 
the avatar of that user.
3. And if there are from two to many assignments to different users, we 
show avatars of first two users.
2024-04-10 17:36:38 +04:00
Joffrey JAFFEUX 3507a7dd98
FIX: correctly refresh UI when changing group preference (#560)
Prior to this fix the state change was not reflected in the UI when changing the "who can assign" preference of a group.

This was actually saved in the backend but would require a full page refresh to see the updated state on the group preferences page.
2024-04-05 18:46:08 +02:00
Andrei Prigorshnev 0bcd0a1fee
FIX: Unassign buttons on the activity/assigned page don't work (#559)
We've noticed that when unassigning a topic on the `activity/assigned` one of 
two incorrect things happens when pressing this button:
1. The first topic on the page gets unassigned instead of the selected one
2. No topics get unassigned (that happens when the first topic on the list is 
not assigned and only has assigned _posts_)

That happens because this handler for all buttons somehow always use the 
same state - the state of the first topic on the page:

f2906e0885/assets/javascripts/discourse/components/assign-actions-dropdown.js (L55-L68)

There seem to be some nuances in select-kit and I'm not sure whether 
this should be qualified as a bug in select-kit. However, I've noticed that in other cases when we use `DropdownSelectBoxComponent` we use the `onChange` handler rather 
than `onSelect`.

So I switched this code to using `onChange` and that resolved the issue, 
the `onChange` handler has access to correct state.

Tests will be in a follow-up.
2024-04-04 20:03:03 +04:00
Andrei Prigorshnev 2676522abc
FEATURE: Add buttons for unassigning from posts to the topic level assign menu (#554)
Before, we only had buttons for assigning and unassigning topic on 
the topic level assign menu. This commit adds dynamic buttons for 
unassigning posts to the menu.
2024-03-29 18:10:04 +04:00
Joffrey JAFFEUX 08c2a4e0f3
UX: autofocus assignee input (#555)
With the new mobile modal we can now do this with no issue.
2024-03-25 22:58:14 +01:00
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
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
Jarek Radosz c42ae3eb7a
DEV: Update linting (#538) 2024-01-15 11:24:20 +00: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 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
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
Jarek Radosz 71f8484a75
DEV: Use `@discourse/lint-configs` (#517) 2023-10-23 12:08:11 +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
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 458306fa6b
DEV: Use the new bulk topic actions api (#491) 2023-07-18 14:15:16 +02:00
Jarek Radosz 1c079b792b
DEV: Use the new component-based modal API (#489)
Co-authored-by: David Taylor <david@taylorhq.com>
2023-07-11 10:37:57 +02:00
Isaac Janzen 41f62d9ea9
DEV: Convert dismiss modal to component-based API (#481) 2023-07-06 12:14:36 -05:00
Jarek Radosz 47a1170ec5
DEV: Merge js dirs; prefix tests (#484) 2023-07-03 17:28:02 +02:00
Jarek Radosz f89420d00e
DEV: Remove unused `assignUser` action (#483) 2023-06-30 19:18:15 +02:00
Jarek Radosz 2bff29e919
DEV: Modernization/cleanup (#480)
* Component template colocation
* Native classes
* glimmer plugin connector
* `this.` in templates
* `?.` operator
* Merged `withPluginApi` calls
* Updated deps
2023-06-22 10:06:37 +02:00
Isaac Janzen 6cd56770bc
DEV: Use angle bracket syntax (#476) 2023-05-28 09:34:13 -05:00
Jarek Radosz c5e0c2c0b3
DEV: Don't use renderTemplate (#469)
See: https://github.com/discourse/discourse/pull/21517
2023-05-19 11:00:56 +02:00
Keegan George 310fb80e54
DEV: Remove old user menu related code (#464) 2023-05-10 15:34:08 -07:00
Arkshine d79fea7e4f
FIX: Reassigning to a group creates an incorrect mention's link (#468)
Reported here: https://meta.discourse.org/t/reassigning-to-a-group-creates-a-u-link-in-the-group-mention/263659

Reassigning to a group creates an `/u/` link in the `@group` mention instead of `/g/`.

The reason is the `reassigned_group` group small post action code is not registered.
2023-05-05 10:00:49 +10:00
Arpit Jalan 69cbe1f3ee
FEATURE: allow adding note when bulk assigning topics (#466) 2023-05-02 15:20:44 +05:30
Isaac Janzen ba47a238ac
FIX: properly check key values for shortcuts (#463)
- Update angle bracket components to use vanilla attributes where possible
- Update how we check for key value after changing to `on "change"` from `onChange`
2023-04-28 13:02:13 -05:00
Isaac Janzen 11988a9e68
DEV: Resolve `computed-property.override` deprecation (#462) 2023-04-28 12:13:41 -05:00
Isaac Janzen a655a009fa
DEV: Use angle bracket syntax (#460)
- Use angle bracket syntax (updated via https://github.com/ember-codemods/ember-angle-brackets-codemod)
- Update deprecated options being passed to components (eg. @input -> on "input")
2023-04-26 15:30:50 -05:00
David Taylor 996c5ea493
DEV: Use component references for user menu (#456)
See 9b41700f87 for context.

Passing a reference works before and after that change, so there is no need to introduce a discourse-compatibility entry.
2023-03-24 17:55:23 +00:00
Kris 9bbd1e8321
UX: clearer assign messages on first post (#452) 2023-03-14 10:19:39 -04:00
Keegan George 32f6747264
FIX: Missing actions icon (#453) 2023-03-13 10:45:06 -07:00
David Taylor d2cc2c4345
DEV: Make basic-assigned-topic-list a real component (#444)
Re-exporting the BasicTopicList component as-is leads to unexpected behavior when colocating templates because `BasicAssignedTopicList` === `BasicTopicList`. Extending it gives the component its own identity.

Similar to 8ba7b0727a
2023-02-14 13:39:15 +00:00
David Taylor 8ba7b0727a
DEV: Make assigned-topic-list a real component (#442)
Re-exporting the TopicList component as-is leads to unexpected behavior when colocating templates because `AssignedTopicList` === `TopicList`. Extending it gives the component its own identity.
2023-02-13 17:54:30 +00:00
Kris c6e6a883f6
UX: remove whitespace in assign tag (#440) 2023-02-08 09:29:50 -05:00
Kris e724a7ee69
UX: class for small posts when assigns are private (#400)
The goal is to add a class so when assigns are not public, their descriptions can be styled similar to whispers... this is a light way to reassure admins of assign message visibility.
2023-02-02 15:11:53 +08:00
Bianca Nenciu f34bc92b40
FIX: Do not expand if assignee username present (#434)
This does not work as expected and can lead to a worse user experience.
2023-01-25 10:08:34 +02:00
chapoi 4934df94e2
UX: add ellipsis for assign modal (#433)
* UX: add ellipsis for assign modal

* UX: remove suggestions label
2023-01-23 18:48:17 +01:00
chapoi 0d695df595
UX: fixing alignment issue (#432)
* UX: fixing alignment issue
2023-01-23 18:47:00 +01:00
Bianca Nenciu 02b9d9423e
UX: Add suggestions label to assign modal (#429) 2023-01-18 17:43:23 +02:00