[MM-61674]: Added appropriate roles to the menu component of post priority (#29545)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8b5a3e6217
Коммит
ed161f31be
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -61,6 +61,7 @@ const ProductMenuItem = ({icon, destination, text, active, onClick, tourTip, id}
|
||||
to={destination}
|
||||
onClick={onClick}
|
||||
id={id}
|
||||
role='menuitem'
|
||||
>
|
||||
<ProductIcon
|
||||
size={24}
|
||||
|
||||
@@ -501,6 +501,7 @@ exports[`components/global/product_switcher_menu should show integrations should
|
||||
<li
|
||||
className="MenuGroup menu-divider"
|
||||
onClick={[Function]}
|
||||
role="separator"
|
||||
/>
|
||||
<div
|
||||
onClick={[Function]}
|
||||
|
||||
@@ -141,82 +141,94 @@ function PostPriorityPicker({
|
||||
defaultMessage: 'Message priority',
|
||||
})}
|
||||
</Header>
|
||||
<div role='application'>
|
||||
<Menu className='Menu'>
|
||||
<Menu
|
||||
className='Menu'
|
||||
role='menu'
|
||||
>
|
||||
<MenuGroup>
|
||||
<MenuItem
|
||||
id='menu-item-priority-standard'
|
||||
onClick={makeOnSelectPriority()}
|
||||
isSelected={!priority}
|
||||
icon={<StandardIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.standard',
|
||||
defaultMessage: 'Standard',
|
||||
})}
|
||||
/>
|
||||
<MenuItem
|
||||
id='menu-item-priority-important'
|
||||
onClick={makeOnSelectPriority(PostPriority.IMPORTANT)}
|
||||
isSelected={priority === PostPriority.IMPORTANT}
|
||||
icon={<ImportantIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.important',
|
||||
defaultMessage: 'Important',
|
||||
})}
|
||||
/>
|
||||
<MenuItem
|
||||
id='menu-item-priority-urgent'
|
||||
onClick={makeOnSelectPriority(PostPriority.URGENT)}
|
||||
isSelected={priority === PostPriority.URGENT}
|
||||
icon={<UrgentIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.urgent',
|
||||
defaultMessage: 'Urgent',
|
||||
})}
|
||||
/>
|
||||
</MenuGroup>
|
||||
{(postAcknowledgementsEnabled || persistentNotificationsEnabled) && (
|
||||
<MenuGroup>
|
||||
<MenuItem
|
||||
id='menu-item-priority-standard'
|
||||
onClick={makeOnSelectPriority()}
|
||||
isSelected={!priority}
|
||||
icon={<StandardIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.standard',
|
||||
defaultMessage: 'Standard',
|
||||
})}
|
||||
/>
|
||||
<MenuItem
|
||||
id='menu-item-priority-important'
|
||||
onClick={makeOnSelectPriority(PostPriority.IMPORTANT)}
|
||||
isSelected={priority === PostPriority.IMPORTANT}
|
||||
icon={<ImportantIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.important',
|
||||
defaultMessage: 'Important',
|
||||
})}
|
||||
/>
|
||||
<MenuItem
|
||||
id='menu-item-priority-urgent'
|
||||
onClick={makeOnSelectPriority(PostPriority.URGENT)}
|
||||
isSelected={priority === PostPriority.URGENT}
|
||||
icon={<UrgentIcon size={18}/>}
|
||||
text={formatMessage({
|
||||
id: 'post_priority.priority.urgent',
|
||||
defaultMessage: 'Urgent',
|
||||
})}
|
||||
/>
|
||||
<li
|
||||
role='none'
|
||||
style={{all: 'unset'}}
|
||||
>
|
||||
<ul
|
||||
role='group'
|
||||
aria-label='Message and Notification Settings'
|
||||
style={{all: 'unset'}}
|
||||
>
|
||||
{postAcknowledgementsEnabled && (
|
||||
<ToggleItem
|
||||
disabled={false}
|
||||
onClick={handleAck}
|
||||
toggled={requestedAck}
|
||||
icon={<AcknowledgementIcon size={18}/>}
|
||||
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 && (
|
||||
<ToggleItem
|
||||
disabled={priority !== PostPriority.URGENT}
|
||||
onClick={handlePersistentNotifications}
|
||||
toggled={persistentNotifications}
|
||||
icon={<PersistentNotificationsIcon size={18}/>}
|
||||
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,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</ul>
|
||||
</li>
|
||||
</MenuGroup>
|
||||
{(postAcknowledgementsEnabled || persistentNotificationsEnabled) && (
|
||||
<MenuGroup>
|
||||
{postAcknowledgementsEnabled && (
|
||||
<ToggleItem
|
||||
disabled={false}
|
||||
onClick={handleAck}
|
||||
toggled={requestedAck}
|
||||
icon={<AcknowledgementIcon size={18}/>}
|
||||
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 && (
|
||||
<ToggleItem
|
||||
disabled={priority !== PostPriority.URGENT}
|
||||
onClick={handlePersistentNotifications}
|
||||
toggled={persistentNotifications}
|
||||
icon={<PersistentNotificationsIcon size={18}/>}
|
||||
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,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</MenuGroup>
|
||||
)}
|
||||
</Menu>
|
||||
</div>
|
||||
)}
|
||||
</Menu>
|
||||
{postAcknowledgementsEnabled && (
|
||||
<Footer>
|
||||
<button
|
||||
|
||||
@@ -32,7 +32,7 @@ const ItemButton = styled.button`
|
||||
align-items: center !important;
|
||||
`;
|
||||
|
||||
const Wrapper = styled.div`
|
||||
const Wrapper = styled.li`
|
||||
cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};
|
||||
|
||||
&:hover {
|
||||
@@ -117,7 +117,7 @@ function ToggleItem({
|
||||
<Wrapper
|
||||
onClick={disabled ? undefined : onClick}
|
||||
disabled={disabled}
|
||||
role='button'
|
||||
role='menuitemcheckbox'
|
||||
aria-pressed={toggled}
|
||||
>
|
||||
<ToggleMain>
|
||||
|
||||
@@ -23,11 +23,11 @@ describe('components/Menu', () => {
|
||||
<div
|
||||
aria-label="test-label"
|
||||
className="a11y__popup Menu"
|
||||
role="menu"
|
||||
>
|
||||
<ul
|
||||
className="Menu__content dropdown-menu"
|
||||
onClick={[Function]}
|
||||
role="menu"
|
||||
style={Object {}}
|
||||
>
|
||||
text
|
||||
@@ -51,11 +51,11 @@ describe('components/Menu', () => {
|
||||
aria-label="test-label"
|
||||
className="a11y__popup Menu"
|
||||
id="test-id"
|
||||
role="menu"
|
||||
>
|
||||
<ul
|
||||
className="Menu__content dropdown-menu"
|
||||
onClick={[Function]}
|
||||
role="menu"
|
||||
style={Object {}}
|
||||
>
|
||||
text
|
||||
@@ -79,11 +79,11 @@ describe('components/Menu', () => {
|
||||
<div
|
||||
aria-label="test-label"
|
||||
className="a11y__popup Menu"
|
||||
role="menu"
|
||||
>
|
||||
<ul
|
||||
className="Menu__content dropdown-menu openLeft openUp"
|
||||
onClick={[Function]}
|
||||
role="menu"
|
||||
style={Object {}}
|
||||
>
|
||||
text
|
||||
|
||||
@@ -128,9 +128,9 @@ export default class Menu extends React.PureComponent<Props> {
|
||||
aria-label={ariaLabel}
|
||||
className='a11y__popup Menu'
|
||||
id={id}
|
||||
role='menu'
|
||||
>
|
||||
<ul
|
||||
role='menu'
|
||||
id={listId}
|
||||
ref={this.node}
|
||||
style={styles}
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('components/MenuItem', () => {
|
||||
<li
|
||||
className="MenuGroup menu-divider"
|
||||
onClick={[Function]}
|
||||
role="separator"
|
||||
/>
|
||||
text
|
||||
</Fragment>
|
||||
|
||||
@@ -23,6 +23,7 @@ const MenuGroup = (props: Props) => {
|
||||
<li
|
||||
className='MenuGroup menu-divider'
|
||||
onClick={handleDividerClick}
|
||||
role='separator'
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ exports[`plugins/MainMenuActions should match snapshot in mobile view with some
|
||||
<div
|
||||
aria-label="main menu"
|
||||
className="a11y__popup Menu"
|
||||
role="menu"
|
||||
>
|
||||
<ul
|
||||
className="Menu__content dropdown-menu"
|
||||
onClick={[Function]}
|
||||
role="menu"
|
||||
style={Object {}}
|
||||
>
|
||||
<Memo(MenuGroup)>
|
||||
@@ -438,11 +438,11 @@ exports[`plugins/MainMenuActions should match snapshot in web view 1`] = `
|
||||
<div
|
||||
aria-label="team menu"
|
||||
className="a11y__popup Menu"
|
||||
role="menu"
|
||||
>
|
||||
<ul
|
||||
className="Menu__content dropdown-menu"
|
||||
onClick={[Function]}
|
||||
role="menu"
|
||||
style={Object {}}
|
||||
>
|
||||
<Memo(MenuGroup)>
|
||||
|
||||
Ссылка в новой задаче
Block a user