From ed161f31be97b1c2aac17835eb83d12deb33f841 Mon Sep 17 00:00:00 2001 From: ayush-chauhan233 Date: Tue, 28 Jan 2025 12:40:02 +0530 Subject: [PATCH] [MM-61674]: Added appropriate roles to the menu component of post priority (#29545) --- .../link_customization_e20_1_spec.js | 2 +- .../product_menu_item/product_menu_item.tsx | 1 + .../product_menu_list.test.tsx.snap | 1 + .../post_priority/post_priority_picker.tsx | 160 ++++++++++-------- .../post_priority_picker_item.tsx | 4 +- .../src/components/widgets/menu/menu.test.tsx | 6 +- .../src/components/widgets/menu/menu.tsx | 2 +- .../widgets/menu/menu_group.test.tsx | 1 + .../components/widgets/menu/menu_group.tsx | 1 + .../main_menu_action.test.tsx.snap | 4 +- 10 files changed, 99 insertions(+), 83 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js index 991893f298..8e542c5a9e 100644 --- a/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/system_console/site_configuration/link_customization_e20_1_spec.js @@ -140,7 +140,7 @@ describe('SupportSettings', () => { cy.uiOpenProductMenu().within(() => { // * Verify that 'Download Apps' has expected link cy.findByText('Download Apps'). - parent(). + parents('a'). should('have.attr', 'href', link); }); }); diff --git a/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu_item/product_menu_item.tsx b/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu_item/product_menu_item.tsx index ade857940f..d0699d9ce1 100644 --- a/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu_item/product_menu_item.tsx +++ b/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu_item/product_menu_item.tsx @@ -61,6 +61,7 @@ const ProductMenuItem = ({icon, destination, text, active, onClick, tourTip, id} to={destination} onClick={onClick} id={id} + role='menuitem' >
-
- + + + } + text={formatMessage({ + id: 'post_priority.priority.standard', + defaultMessage: 'Standard', + })} + /> + } + text={formatMessage({ + id: 'post_priority.priority.important', + defaultMessage: 'Important', + })} + /> + } + text={formatMessage({ + id: 'post_priority.priority.urgent', + defaultMessage: 'Urgent', + })} + /> + + {(postAcknowledgementsEnabled || persistentNotificationsEnabled) && ( - } - text={formatMessage({ - id: 'post_priority.priority.standard', - defaultMessage: 'Standard', - })} - /> - } - text={formatMessage({ - id: 'post_priority.priority.important', - defaultMessage: 'Important', - })} - /> - } - text={formatMessage({ - id: 'post_priority.priority.urgent', - defaultMessage: 'Urgent', - })} - /> +
  • +
      + {postAcknowledgementsEnabled && ( + } + text={formatMessage({ + id: 'post_priority.requested_ack.text', + defaultMessage: 'Request acknowledgement', + })} + description={formatMessage({ + id: 'post_priority.requested_ack.description', + defaultMessage: 'An acknowledgement button will appear with your message', + })} + /> + )} + {priority === PostPriority.URGENT && persistentNotificationsEnabled && ( + } + text={formatMessage({ + id: 'post_priority.persistent_notifications.text', + defaultMessage: 'Send persistent notifications', + })} + description={formatMessage( + { + id: 'post_priority.persistent_notifications.description', + defaultMessage: 'Recipients will be notified every {interval, plural, one {1 minute} other {{interval} minutes}} until they acknowledge or reply', + }, { + interval, + }, + )} + /> + )} +
    +
  • - {(postAcknowledgementsEnabled || persistentNotificationsEnabled) && ( - - {postAcknowledgementsEnabled && ( - } - text={formatMessage({ - id: 'post_priority.requested_ack.text', - defaultMessage: 'Request acknowledgement', - })} - description={formatMessage({ - id: 'post_priority.requested_ack.description', - defaultMessage: 'An acknowledgement button will appear with your message', - })} - /> - )} - {priority === PostPriority.URGENT && persistentNotificationsEnabled && ( - } - text={formatMessage({ - id: 'post_priority.persistent_notifications.text', - defaultMessage: 'Send persistent notifications', - })} - description={formatMessage( - { - id: 'post_priority.persistent_notifications.description', - defaultMessage: 'Recipients will be notified every {interval, plural, one {1 minute} other {{interval} minutes}} until they acknowledge or reply', - }, { - interval, - }, - )} - /> - )} - - )} -
    -
    + )} + {postAcknowledgementsEnabled && (