Improve a11y (#1841)

Improve accessibility by removing unnecessary tags without hrefs. Also remove many eslint errors and warnings.
This commit is contained in:
Eduard Heimbuch
2021-11-04 09:16:08 +01:00
committed by GitHub
parent 0efdd2a483
commit 6f61fefec5
213 changed files with 1924 additions and 2068 deletions

View File

@@ -53,7 +53,7 @@ const AutocompleteAddEntryToTableField: FC<Props> = ({
loadSuggestions,
placeholder,
loadingMessage,
noOptionsMessage
noOptionsMessage,
}) => {
const [selectedValue, setSelectedValue] = useState<SelectValue | undefined>(undefined);

View File

@@ -64,8 +64,8 @@ const ReactHookForm: FC = () => {
const { register, handleSubmit } = useForm<Settings>({
defaultValues: {
disabled: true,
readonly: true
}
readonly: true,
},
});
const [stored, setStored] = useState<Settings>();
@@ -106,7 +106,7 @@ const LegacyEvents: FC = () => {
};
storiesOf("Forms/Checkbox", module)
.addDecorator(storyFn => <MemoryRouter>{storyFn()}</MemoryRouter>)
.addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
.add("Default", () => (
<Spacing>
<Checkbox label="Not checked" checked={false} />

View File

@@ -41,10 +41,10 @@ storiesOf("Forms/DropDown", module)
options={[
"The Hitchhiker's Guide to the Galaxy",
"Dirk Gentlys Holistic Detective Agency",
"The Meaning Of Liff"
"The Meaning Of Liff",
]}
preselectedOption={"dirk"}
optionSelected={selection => {
optionSelected={(selection) => {
// nothing to do
}}
/>
@@ -54,7 +54,7 @@ storiesOf("Forms/DropDown", module)
optionValues={["alpha", "beta", "gamma"]}
options={["A", "B", "C"]}
preselectedOption={"D"}
optionSelected={selection => {
optionSelected={(selection) => {
// nothing to do
}}
/>

View File

@@ -45,7 +45,7 @@ class DropDown extends React.Component<Props> {
render() {
const { options, optionValues, preselectedOption, className, disabled } = this.props;
if (preselectedOption && options.filter(o => o === preselectedOption).length === 0) {
if (preselectedOption && options.filter((o) => o === preselectedOption).length === 0) {
options.push(preselectedOption);
}

View File

@@ -77,7 +77,7 @@ const FilterInput: FC<Props> = ({ filter, value, testId, placeholder, autoFocus,
type="search"
placeholder={placeholder || t("filterEntries")}
value={stateValue}
onChange={event => setStateValue(event.target.value)}
onChange={(event) => setStateValue(event.target.value)}
autoFocus={autoFocus || false}
/>
<span className="icon is-small is-left">

View File

@@ -36,11 +36,11 @@ type Props = WithTranslation & {
class MemberNameTagGroup extends React.Component<Props> {
render() {
const { members, label, helpText, t } = this.props;
const membersExtended = members.map(id => {
const membersExtended = members.map((id) => {
return {
id,
displayName: id,
mail: ""
mail: "",
};
});
return (
@@ -54,7 +54,7 @@ class MemberNameTagGroup extends React.Component<Props> {
}
removeEntry = (membersExtended: DisplayedUser[]) => {
const members = membersExtended.map(function(item) {
const members = membersExtended.map(function (item) {
return item["id"];
});
this.props.memberListChanged(members);

View File

@@ -44,7 +44,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
password: "",
confirmedPassword: "",
passwordValid: true,
passwordConfirmationFailed: false
passwordConfirmationFailed: false,
};
}
@@ -53,7 +53,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
password: "",
confirmedPassword: "",
passwordValid: true,
passwordConfirmationFailed: false
passwordConfirmationFailed: false,
});
}
@@ -101,7 +101,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
this.setState(
{
confirmedPassword,
passwordConfirmationFailed: !passwordConfirmed
passwordConfirmationFailed: !passwordConfirmed,
},
this.propagateChange
);
@@ -114,7 +114,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
{
passwordValid: this.validatePassword(password),
passwordConfirmationFailed,
password: password
password: password,
},
this.propagateChange
);

View File

@@ -113,7 +113,7 @@ const LegacyEvents: FC = () => {
};
storiesOf("Forms/Radio", module)
.addDecorator(storyFn => <MemoryRouter>{storyFn()}</MemoryRouter>)
.addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
.add("Default", () => (
<Spacing>
<Radio label="Not checked" checked={false} />

View File

@@ -187,8 +187,8 @@ const PreselectOption: FC = () => {
},
{
label: "USCSS Prometheus",
value: "uscss-prometheus"
}
value: "uscss-prometheus",
},
]}
onChange={setValue}
value={value}
@@ -204,5 +204,4 @@ storiesOf("Forms/Select", module)
.add("Ref", () => <Ref />)
.add("Legacy Events", () => <LegacyEvents />)
.add("ReactHookForm", () => <ReactHookForm />)
.add("Preselect option", () => <PreselectOption />)
;
.add("Preselect option", () => <PreselectOption />);