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.
This commit is contained in:
parent
a907a98d87
commit
e724a7ee69
|
@ -489,6 +489,12 @@ function initialize(api) {
|
|||
}
|
||||
}
|
||||
|
||||
api.addPostSmallActionClassesCallback((post) => {
|
||||
if (post.actionCode.includes("assigned") && !siteSettings.assigns_public) {
|
||||
return ["private-assign"];
|
||||
}
|
||||
});
|
||||
|
||||
api.addAdvancedSearchOptions(
|
||||
api.getCurrentUser() && api.getCurrentUser().can_assign
|
||||
? {
|
||||
|
|
|
@ -258,3 +258,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.private-assign {
|
||||
// when assigns are not public, make the description look like a whisper
|
||||
.small-action-custom-message {
|
||||
font-style: italic;
|
||||
color: var(--primary-medium);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,24 @@ describe "Assign | Assigning topics", type: :system, js: true do
|
|||
expect(page).to have_no_css("#topic .assigned-to")
|
||||
end
|
||||
|
||||
context "when assigns are not public" do
|
||||
before { SiteSetting.assigns_public = false }
|
||||
|
||||
it "assigned small action post has 'private-assign' in class attribute" do
|
||||
visit "/t/#{topic.id}"
|
||||
|
||||
topic_page.click_assign_topic
|
||||
assign_modal.assignee = staff_user
|
||||
assign_modal.confirm
|
||||
|
||||
expect(topic_page).to have_assigned(
|
||||
user: staff_user,
|
||||
at_post: 2,
|
||||
class_attribute: ".private-assign",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "when unassign_on_close is set to true" do
|
||||
before { SiteSetting.unassign_on_close = true }
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ module PageObjects
|
|||
|
||||
def has_assignment_action?(args)
|
||||
assignee = args[:group]&.name || args[:user]&.username
|
||||
container = args[:at_post] ? find("#post_#{args[:at_post]}") : page
|
||||
|
||||
container =
|
||||
args[:at_post] ? find("#post_#{args[:at_post]}#{args[:class_attribute] || ""}") : page
|
||||
|
||||
container.has_content?(
|
||||
I18n.t("js.action_codes.#{args[:action]}", who: "@#{assignee}", when: "just now"),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue