Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ Example:
```
# Run local webserver
yarn global add serve
serve coverage/dist
serve report/dist

# Upload the report
yarn global add surge
cd coverage/dist
cd report/dist
surge
```

Expand Down
17 changes: 4 additions & 13 deletions report/src/app/DataList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ interface DataListState {
isOpen: boolean;
selected: any;
sortIncreasing: boolean;
showPassedURLs: boolean;
includePossibleIssues: boolean;
sitesWithIssues: any[];
sitesWithoutIssues: any[];
Expand Down Expand Up @@ -71,7 +70,6 @@ export class ExpandableDataList extends React.Component<
isOpen: false,
selected: "Sort by URL",
sortIncreasing: true,
showPassedURLs: false,
includePossibleIssues: true,
sitesWithIssues,
sitesWithoutIssues,
Expand Down Expand Up @@ -138,12 +136,6 @@ export class ExpandableDataList extends React.Component<
expanded: shouldExpandAll ? Object.keys(this.props.report) : [],
});
};
handleShowPass = (checked, event) => {
const target = event.target;
const showPassedURLs =
target.type === "checkbox" ? target.checked : target.value;
this.setState({ showPassedURLs });
};
handlePossibleIssues = (checked, event) => {
const target = event.target;
const includePossibleIssues =
Expand Down Expand Up @@ -174,14 +166,12 @@ export class ExpandableDataList extends React.Component<
hideScreenshots,
expandAll,
sortIncreasing,
showPassedURLs,
includePossibleIssues,
sitesWithIssues,
sitesWithoutIssues,
totalNumberIssues,
} = this.state;
const { report } = this.props;

return (
<React.Fragment>
<Bullseye style={{ padding: "15px" }}>
Expand Down Expand Up @@ -216,8 +206,6 @@ export class ExpandableDataList extends React.Component<
handleChange={this.handleChange}
expandAll={expandAll}
handleExpandAll={this.handleExpandAll}
showPassedURLs={showPassedURLs}
handleShowPass={this.handleShowPass}
includePossibleIssues={includePossibleIssues}
handlePossibleIssues={this.handlePossibleIssues}
sortIncreasing={sortIncreasing}
Expand All @@ -228,7 +216,7 @@ export class ExpandableDataList extends React.Component<
<DataList aria-label="Accessibility report" isCompact>
{[
...this.state.sitesWithIssues,
...(this.state.showPassedURLs ? this.state.sitesWithoutIssues : []),
...(this.state.sitesWithoutIssues || []),
]
.filter((val: any) => {
// filter out issues that do not match current severity selection
Expand All @@ -237,6 +225,9 @@ export class ExpandableDataList extends React.Component<
const numViolations = val.filteredViolations?.length || 0;
const numIncomplete = val.filteredIncomplete?.length || 0;
if (numViolations + numIncomplete === 0) {
if (this.state.severitySelections.includes("ok")) {
return val;
}
return null;
}
return val;
Expand Down
1 change: 1 addition & 0 deletions report/src/app/SeveritySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const SeveritySelectInternal = ({ onSelect }) => {
<SelectOption value="serious">Serious</SelectOption>
<SelectOption value="moderate">Moderate</SelectOption>
<SelectOption value="minor">Minor</SelectOption>
<SelectOption value="ok">Passed</SelectOption>
</Select>
);
};
Expand Down
12 changes: 0 additions & 12 deletions report/src/app/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const Toolbar = ({
handleChange,
expandAll,
handleExpandAll,
showPassedURLs,
handleShowPass,
includePossibleIssues,
handlePossibleIssues,
sortIncreasing,
Expand All @@ -43,16 +41,6 @@ export const Toolbar = ({
<ToolbarItem>
<ExpandAll expandAll={expandAll} handleExpandAll={handleExpandAll} />
</ToolbarItem>
<ToolbarItem>
<Checkbox
label="Show passed URLs"
isChecked={showPassedURLs}
onChange={handleShowPass}
aria-label="Show passed URLs"
id="showPassedId"
name="showPassedName"
/>
</ToolbarItem>
<ToolbarItem>
<Checkbox
label={
Expand Down
3 changes: 2 additions & 1 deletion report/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
entry: path.resolve(__dirname + '/src/index.tsx'),
devtool: 'eval-cheap-source-map',
// devtool: 'eval-cheap-source-map',
devtool: 'eval-source-map',
mode: 'development',
output: {
path: path.resolve(__dirname + '/dist'),
Expand Down