Skip to content

Commit

Permalink
[ML] (Accessibility) Fix page heading structure
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Feb 4, 2020
1 parent a36ec32 commit 619e1e3
Show file tree
Hide file tree
Showing 36 changed files with 1,638 additions and 1,441 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const CreateJobLinkCard: FC<Props> = ({
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle size="s">
<h4>{title}</h4>
<h3>{title}</h3>
</EuiTitle>
<EuiText color="subdued">
<p>{description}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.ml-influencers-list {
line-height: 1.45; // SASSTODO: Calc proper value

.influencer-title {
font-size: $euiFontSizeM - 2px;
font-weight: 600;
line-height: 24px;
}

.field-label {
font-size: $euiFontSizeXS;
text-align: left;
Expand All @@ -15,23 +21,23 @@
}

.progress {
display:inline-block;
width: calc(100% - 34px); // SASSTODO: Calc porper value
display: inline-block;
width: calc(100% - 34px); // SASSTODO: Calc proper value
height: 22px;
min-width: 70px;
margin-bottom: 0px;
color: $euiColorDarkShade;
background-color : transparent;
background-color: transparent;

.progress-bar-holder {
width: calc(100% - 28px); // SASSTODO: Calc porper value
width: calc(100% - 28px); // SASSTODO: Calc proper value
}

.progress-bar {
height: $euiSizeXS / 2;
margin-top: $euiSizeM;
text-align: right;
line-height: 18px; // SASSTODO: Calc porper value
line-height: 18px; // SASSTODO: Calc proper value
display: inline-block;
transition: none;
}
Expand All @@ -42,6 +48,7 @@
.progress-bar {
background-color: $mlColorCritical;
}

.score-label {
border-color: $mlColorCritical;
}
Expand All @@ -51,6 +58,7 @@
.progress-bar {
background-color: $mlColorMajor;
}

.score-label {
border-color: $mlColorMajor;
}
Expand All @@ -60,6 +68,7 @@
.progress-bar {
background-color: $mlColorMinor;
}

.score-label {
border-color: $mlColorMinor;
}
Expand All @@ -69,6 +78,7 @@
.progress-bar {
background-color: $mlColorWarning;
}

.score-label {
border-color: $mlColorWarning;
}
Expand Down Expand Up @@ -99,8 +109,7 @@
}
}

// SASSTODO: Can .eui-textBreakAll
// SASSTODO: Can .eui-textBreakAll
.ml-influencers-list-tooltip {
word-break: break-all;
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import PropTypes from 'prop-types';
import React from 'react';

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiTitle, EuiToolTip } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiToolTip } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { abbreviateWholeNumber } from '../../formatters/abbreviate_whole_number';
Expand Down Expand Up @@ -114,8 +114,12 @@ function InfluencersByName({ influencerFieldName, influencerFilter, fieldValues

return (
<React.Fragment key={influencerFieldName}>
<EuiTitle size="xs" data-test-subj={`mlInfluencerFieldName ${influencerFieldName}`}>
<h4>{influencerFieldName}</h4>
<EuiTitle
size="xs"
className="influencer-title"
data-test-subj={`mlInfluencerFieldName ${influencerFieldName}`}
>
<h3>{influencerFieldName}</h3>
</EuiTitle>
<EuiSpacer size="xs" />
{influencerValues}
Expand All @@ -131,17 +135,17 @@ InfluencersByName.propTypes = {
export function InfluencersList({ influencers, influencerFilter }) {
if (influencers === undefined || Object.keys(influencers).length === 0) {
return (
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexGroup justifyContent="spaceAround" className="ml-influencers-list">
<EuiFlexItem grow={false}>
<EuiSpacer size="xxl" />
<EuiText>
<h4>
<EuiTitle size="xs" className="influencer-title">
<h3>
<FormattedMessage
id="xpack.ml.influencersList.noInfluencersFoundTitle"
defaultMessage="No influencers found"
/>
</h4>
</EuiText>
</h3>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export const DatavisualizerSelector: FC = () => {
<EuiFlexGroup gutterSize="xl">
<EuiFlexItem grow={false}>
<EuiTitle size="l">
<h2>
<h1>
<FormattedMessage
id="xpack.ml.datavisualizer.selector.dataVisualizerTitle"
defaultMessage="Data Visualizer"
/>
</h2>
</h1>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export function LoadingPanel() {
<EuiPageContent className="file-datavisualizer-about-panel__content" paddingSize="l">
<div style={{ textAlign: 'center' }}>
<EuiTitle size="s">
<h3 role="alert">
<h1 role="alert">
<FormattedMessage
id="xpack.ml.fileDatavisualizer.aboutPanel.analyzingDataTitle"
defaultMessage="Analyzing data"
/>
</h3>
</h1>
</EuiTitle>

<EuiSpacer size="l" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function WelcomeContent() {
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle size="m">
<h3>
<h1>
<FormattedMessage
id="xpack.ml.fileDatavisualizer.welcomeContent.visualizeDataFromLogFileTitle"
defaultMessage="Visualize data from a log file&nbsp;{experimentalBadge}"
Expand All @@ -44,7 +44,7 @@ export function WelcomeContent() {
),
}}
/>
</h3>
</h1>
</EuiTitle>
<EuiSpacer size="s" />
<EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export function AnalysisSummary({ results }) {
return (
<React.Fragment>
<EuiTitle size="s">
<h3>
<h2>
<FormattedMessage
id="xpack.ml.fileDatavisualizer.analysisSummary.summaryTitle"
defaultMessage="Summary"
/>
</h3>
</h2>
</EuiTitle>

<EuiSpacer size="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export function FileContents({ data, format, numberOfLines }) {
return (
<React.Fragment>
<EuiTitle size="s">
<h3>
<h2>
<FormattedMessage
id="xpack.ml.fileDatavisualizer.fileContents.fileContentsTitle"
defaultMessage="File contents"
/>
</h3>
</h2>
</EuiTitle>

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class FileDataVisualizerView extends Component {

this.state = {
files: {},
fileName: '',
fileContents: '',
fileSize: 0,
fileTooLarge: false,
Expand Down Expand Up @@ -71,6 +72,7 @@ export class FileDataVisualizerView extends Component {
loading: files.length > 0,
bottomBarVisible: files.length > 0,
loaded: false,
fileName: '',
fileContents: '',
fileSize: 0,
fileTooLarge: false,
Expand All @@ -93,6 +95,7 @@ export class FileDataVisualizerView extends Component {
const data = fileContents.data;
this.setState({
fileContents: data,
fileName: file.name,
fileSize: file.size,
});

Expand All @@ -110,6 +113,7 @@ export class FileDataVisualizerView extends Component {
loaded: false,
loading: false,
fileTooLarge: true,
fileName: file.name,
fileSize: file.size,
});
}
Expand Down Expand Up @@ -240,6 +244,7 @@ export class FileDataVisualizerView extends Component {
loaded,
results,
fileContents,
fileName,
fileSize,
fileTooLarge,
fileCouldNotBeRead,
Expand All @@ -256,7 +261,7 @@ export class FileDataVisualizerView extends Component {
: [];

return (
<div className="file-datavisualizer__content">
<div>
{mode === MODE.READ && (
<React.Fragment>
{!loading && !loaded && <AboutPanel onFilePickerChange={this.onFilePickerChange} />}
Expand All @@ -275,6 +280,7 @@ export class FileDataVisualizerView extends Component {
{loaded && (
<ResultsView
results={results}
fileName={fileName}
data={fileContents}
showEditFlyout={() => this.showEditFlyout()}
/>
Expand Down Expand Up @@ -304,8 +310,8 @@ export class FileDataVisualizerView extends Component {
<React.Fragment>
<ImportView
results={results}
fileName={fileName}
fileContents={fileContents}
fileSize={fileSize}
indexPatterns={this.props.indexPatterns}
kibanaConfig={this.props.kibanaConfig}
showBottomBar={this.showBottomBar}
Expand Down
Loading

0 comments on commit 619e1e3

Please sign in to comment.