MM-15943 render divider before plugin menu items #3264
MM-15943 render divider before plugin menu items #3264
Conversation
It seems I commited some changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just waiting for @enahum's feedback on whether to include the package-lock change. Don't want to merge by accident.
If no changes to the package.json file there should not be changes to the lock file |
Removed unnecessary changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @janvt! Done UI check and looks good. Left comment on unit test.
@@ -315,6 +315,12 @@ export default class DotMenu extends Component { | |||
text={Utils.localizeMessage('post_info.edit', 'Edit')} | |||
onClick={this.handleEditMenuItemActivated} | |||
/> | |||
{pluginItems.length > 0 && | |||
<li |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add id for testing, like id='menuItemDivider'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @janvt ! Approved on dev side (still awaiting the changes requested from Saturnino).
expect(wrapper.find('#divider_post_post_post_id_1').exists()).toBe(false); | ||
|
||
wrapper.setProps({pluginMenuItems: [{id: 'test_plugin_menu_item_1', text: 'woof'}]}); | ||
expect(wrapper.find('#divider_post_post_post_id_1').length).toBe(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing on test. Element ID should be divider_post_post_id_1
. Also please update to master.
Let me know once updated so we can merge. Thanks!
@janvt Let me know if you need help. I can update the test if you don't mind so we can merge it. |
@saturninoabril yeah, that would be awesome. I've taken 2 runs at it, but not sure what I'm not understanding... :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @janvt for your contribution!
* MM-15943 render divider before plugin menu items * revert changes to package-lock.json * adjust dot menu unit test, remove dedicated plugin divider test * fix test as suggested
* MM-15943 render divider before plugin menu items * revert changes to package-lock.json * adjust dot menu unit test, remove dedicated plugin divider test * fix test as suggested
Summary
Render divider between normal menu items and plugin menu items on dot menu.
Ticket Link
Fixes mattermost/mattermost#11054
https://mattermost.atlassian.net/browse/MM-15943
Related Pull Requests
mattermost/mattermost-plugin-jira#250