Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1600752 - Accessibility improvements Compare and Alert Views #5733

Merged
2 changes: 1 addition & 1 deletion ui/perfherder/alerts/AlertTable.jsx
Expand Up @@ -307,10 +307,10 @@ export default class AlertTable extends React.Component {
{alertSummary.notes && (
<div className="bg-white px-3 py-4">
<TruncatedText
color="info"
title="Notes: "
maxLength={167}
text={alertSummary.notes}
showMoreClass="text-info"
/>
</div>
)}
Expand Down
10 changes: 5 additions & 5 deletions ui/shared/TruncatedText.jsx
Expand Up @@ -11,7 +11,7 @@ export default class TruncatedText extends React.Component {
}

render() {
const { text, maxLength, title, showMoreClass } = this.props;
const { text, maxLength, title, color } = this.props;
const { showMoreResults } = this.state;

return (
Expand All @@ -22,8 +22,10 @@ export default class TruncatedText extends React.Component {
</p>
{text.length > maxLength && (
<Button
color="link"
className={`${showMoreClass} d-block p-0 ml-auto`}
color={color || 'link'}
yogmel marked this conversation as resolved.
Show resolved Hide resolved
outline={color}
className={`${color ||
'font-weight-bold text-reset'} d-block ml-auto`}
onClick={() => this.setState({ showMoreResults: !showMoreResults })}
>
{`show ${showMoreResults ? 'less' : 'more'}`}
Expand All @@ -38,10 +40,8 @@ TruncatedText.propTypes = {
text: PropTypes.string.isRequired,
title: PropTypes.string,
maxLength: PropTypes.number.isRequired,
showMoreClass: PropTypes.string,
};

TruncatedText.defaultProps = {
showMoreClass: 'font-weight-bold',
title: '',
};