Skip to content

Commit

Permalink
Merge pull request #2222 from rhamilto/masthead-dropdown-fixes
Browse files Browse the repository at this point in the history
Fix bug where masthead dropdowns have incorrect aria-label
  • Loading branch information
openshift-merge-robot authored Jul 31, 2019
2 parents 5f2a1af + 9bc47c2 commit 0956923
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions frontend/public/components/_masthead.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

.co-username {
font-size: $pf-header-icon-fontsize; // for cases where there is no user menu
max-width: 190px !important; // PF4 does not limit username length (upstream bug)
max-width: 140px !important; // PF4 does not limit username length (upstream bug)
overflow-x: hidden;
padding: 0 8px; // so sizing is consistent with .pf-c-dropdown__toggle
text-overflow: ellipsis;
@media(min-width: 820px) {
@media(min-width: 855px) {
max-width: 225px !important;
}
@media(min-width: $screen-md-min) {
max-width: 275px !important;
}
@media(min-width: $screen-lg-min) {
max-width: 300px !important;
}
}
Expand Down
7 changes: 5 additions & 2 deletions frontend/public/components/masthead-toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ class MastheadToolbar_ extends React.Component {

return (
<ApplicationLauncher
aria-label="Utility menu"
className="co-app-launcher"
onSelect={this._onKebabDropdownSelect}
onToggle={this._onKebabDropdownToggle}
Expand All @@ -422,8 +423,9 @@ class MastheadToolbar_ extends React.Component {

return (
<ApplicationLauncher
aria-label="User menu"
data-test="user-dropdown"
className="co-app-launcher"
className="co-app-launcher co-user-menu"
onSelect={this._onUserDropdownSelect}
onToggle={this._onUserDropdownToggle}
isOpen={isUserDropdownOpen}
Expand Down Expand Up @@ -472,6 +474,7 @@ class MastheadToolbar_ extends React.Component {
</ToolbarItem>}
<ToolbarItem>
<ApplicationLauncher
aria-label="Help menu"
className="co-app-launcher"
data-test="help-dropdown-toggle"
onSelect={this._onHelpDropdownSelect}
Expand All @@ -487,7 +490,7 @@ class MastheadToolbar_ extends React.Component {
<ToolbarGroup>
{/* mobile -- (system status button) */}
<SystemStatusButton statuspageData={statuspageData} className="visible-xs-block" />
{/* mobile -- kebab dropdown [(cluster manager |) documentation, about (| logout)] */}
{/* mobile -- kebab dropdown [(application launcher |) documentation, about (| logout)] */}
<ToolbarItem className="visible-xs-block">{this._renderMenu(true)}</ToolbarItem>
{/* desktop -- (user dropdown [logout]) */}
<ToolbarItem className="hidden-xs">{this._renderMenu(false)}</ToolbarItem>
Expand Down
5 changes: 5 additions & 0 deletions frontend/public/style/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ kbd {
padding-top: 8px !important;
}
}
// Temp fix to adjust user menu dropdown toggle padding until it can be converted back to a standard dropdown
.co-user-menu .pf-c-app-launcher__toggle {
padding-left: 0;
padding-right: 0;
}

.pf-c-button--align-right {
margin-left: auto !important;
Expand Down

0 comments on commit 0956923

Please sign in to comment.