mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 13:58:53 +08:00
Previously, assignment permissions only came from the global `assign_allowed_on_groups` site setting. This change lets categories grant assignment permission to additional groups, keeping assignment controls and assignee suggestions scoped to the relevant category.
30 lines
788 B
JavaScript
Vendored
30 lines
788 B
JavaScript
Vendored
import { cloneJSON } from "discourse/lib/object";
|
|
import topicFixtures from "discourse/tests/fixtures/topic";
|
|
|
|
export default function topicWithAssignedPosts() {
|
|
const username = "eviltrout";
|
|
const topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
|
|
const firstReply = topic.post_stream.posts[1];
|
|
const secondReply = topic.post_stream.posts[2];
|
|
|
|
firstReply["can_assign"] = true;
|
|
secondReply["can_assign"] = true;
|
|
topic["indirectly_assigned_to"] = {
|
|
[firstReply.id]: {
|
|
assigned_to: {
|
|
username,
|
|
},
|
|
post_number: 1,
|
|
},
|
|
[secondReply.id]: {
|
|
assigned_to: {
|
|
username,
|
|
},
|
|
post_number: 2,
|
|
},
|
|
};
|
|
firstReply["assigned_to_user"] = { username };
|
|
secondReply["assigned_to_user"] = { username };
|
|
|
|
return topic;
|
|
}
|