Skip to content

Commit

Permalink
[MM-17067] reorder dot menu items (mattermost#3526)
Browse files Browse the repository at this point in the history
* [MM-17065] unread since given post from dots menu

* [MM-17065] add i18n

* [MM-17754] remove unneeded dispatch

* [MM-17754] only allow unreading from center

* [MM-17754] pass channelId to handle own posts

* [MM-17067] reorder dot menu, group items, mark delete as dangerous

* [MM-17067] new reordering

* [MM-17067] fix tests, restore divider
  • Loading branch information
Willyfrog authored Sep 2, 2019
1 parent 75f827d commit f8e78da
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 182 deletions.
246 changes: 128 additions & 118 deletions components/dot_menu/__snapshots__/dot_menu.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,69 +47,74 @@ exports[`components/dot_menu/DotMenu should match snapshot, canDelete 1`] = `
openLeft={true}
openUp={false}
>
<Connect(ChannelPermissionGate)
permissions={
Array [
"add_reaction",
]
}
>
<MenuGroup>
<MenuItemAction
onClick={[MockFunction]}
show={true}
text="Reply"
/>
<Connect(ChannelPermissionGate)
permissions={
Array [
"add_reaction",
]
}
>
<MenuItemAction
onClick={[Function]}
show={false}
text="Add Reaction"
/>
</Connect(ChannelPermissionGate)>
<MenuItemAction
id="unread_post_post_id_1"
onClick={[Function]}
show={true}
text="Mark as Unread"
/>
<MenuItemAction
onClick={[Function]}
show={true}
text="Permalink"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Add Reaction"
text="Unflag"
/>
</Connect(ChannelPermissionGate)>
<MenuItemAction
onClick={[Function]}
show={false}
text="Unflag"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Flag"
/>
<MenuItemAction
onClick={[MockFunction]}
show={true}
text="Reply"
/>
<MenuItemAction
onClick={[Function]}
show={true}
text="Permalink"
/>
<MenuItemAction
id="unpin_post_post_id_1"
onClick={[Function]}
show={false}
text="Unpin"
/>
<MenuItemAction
id="pin_post_post_id_1"
onClick={[Function]}
show={true}
text="Pin"
/>
<MenuItemAction
id="unread_post_post_id_1"
onClick={[Function]}
show={true}
text="Mark as Unread"
/>
<MenuItemAction
id="delete_post_post_id_1"
onClick={[Function]}
show={true}
text="Delete"
/>
<MenuItemAction
id="edit_post_post_id_1"
onClick={[Function]}
show={true}
text="Edit"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Flag"
/>
<MenuItemAction
id="unpin_post_post_id_1"
onClick={[Function]}
show={false}
text="Unpin"
/>
<MenuItemAction
id="pin_post_post_id_1"
onClick={[Function]}
show={true}
text="Pin"
/>
</MenuGroup>
<MenuGroup>
<MenuItemAction
id="edit_post_post_id_1"
onClick={[Function]}
show={true}
text="Edit"
/>
<MenuItemAction
id="delete_post_post_id_1"
isDangerous={true}
onClick={[Function]}
show={true}
text="Delete"
/>
</MenuGroup>
<Connect(Pluggable)
pluggableName="PostDropdownMenuItem"
postId="post_id_1"
Expand Down Expand Up @@ -165,69 +170,74 @@ exports[`components/dot_menu/DotMenu should match snapshot, on Center 1`] = `
openLeft={true}
openUp={false}
>
<Connect(ChannelPermissionGate)
permissions={
Array [
"add_reaction",
]
}
>
<MenuGroup>
<MenuItemAction
onClick={[MockFunction]}
show={true}
text="Reply"
/>
<Connect(ChannelPermissionGate)
permissions={
Array [
"add_reaction",
]
}
>
<MenuItemAction
onClick={[Function]}
show={false}
text="Add Reaction"
/>
</Connect(ChannelPermissionGate)>
<MenuItemAction
id="unread_post_post_id_1"
onClick={[Function]}
show={true}
text="Mark as Unread"
/>
<MenuItemAction
onClick={[Function]}
show={true}
text="Permalink"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Add Reaction"
text="Unflag"
/>
</Connect(ChannelPermissionGate)>
<MenuItemAction
onClick={[Function]}
show={false}
text="Unflag"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Flag"
/>
<MenuItemAction
onClick={[MockFunction]}
show={true}
text="Reply"
/>
<MenuItemAction
onClick={[Function]}
show={true}
text="Permalink"
/>
<MenuItemAction
id="unpin_post_post_id_1"
onClick={[Function]}
show={false}
text="Unpin"
/>
<MenuItemAction
id="pin_post_post_id_1"
onClick={[Function]}
show={true}
text="Pin"
/>
<MenuItemAction
id="unread_post_post_id_1"
onClick={[Function]}
show={true}
text="Mark as Unread"
/>
<MenuItemAction
id="delete_post_post_id_1"
onClick={[Function]}
show={false}
text="Delete"
/>
<MenuItemAction
id="edit_post_post_id_1"
onClick={[Function]}
show={true}
text="Edit"
/>
<MenuItemAction
onClick={[Function]}
show={false}
text="Flag"
/>
<MenuItemAction
id="unpin_post_post_id_1"
onClick={[Function]}
show={false}
text="Unpin"
/>
<MenuItemAction
id="pin_post_post_id_1"
onClick={[Function]}
show={true}
text="Pin"
/>
</MenuGroup>
<MenuGroup>
<MenuItemAction
id="edit_post_post_id_1"
onClick={[Function]}
show={true}
text="Edit"
/>
<MenuItemAction
id="delete_post_post_id_1"
isDangerous={true}
onClick={[Function]}
show={false}
text="Delete"
/>
</MenuGroup>
<Connect(Pluggable)
pluggableName="PostDropdownMenuItem"
postId="post_id_1"
Expand Down
Loading

0 comments on commit f8e78da

Please sign in to comment.