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

@@ -45,7 +45,7 @@ const ConfigForm: FC<Props> = ({
loading,
configReadPermission,
configUpdatePermission,
namespaceStrategies
namespaceStrategies,
}) => {
const [t] = useTranslation("config");
const [innerConfig, setInnerConfig] = useState<Config>({
@@ -74,7 +74,7 @@ const ConfigForm: FC<Props> = ({
mailDomainName: "",
emergencyContacts: [],
enabledApiKeys: true,
_links: {}
_links: {},
});
const [showNotification, setShowNotification] = useState(false);
const [changed, setChanged] = useState(false);
@@ -83,7 +83,7 @@ const ConfigForm: FC<Props> = ({
loginAttemptLimit: boolean;
}>({
loginAttemptLimitTimeout: false,
loginAttemptLimit: false
loginAttemptLimit: false,
});
useEffect(() => {

View File

@@ -30,7 +30,7 @@ import {
InputField,
MemberNameTagGroup,
AutocompleteAddEntryToTableField,
Select
Select,
} from "@scm-manager/ui-components";
import NamespaceStrategySelect from "./NamespaceStrategySelect";
@@ -68,7 +68,7 @@ const GeneralSettings: FC<Props> = ({
namespaceStrategy,
namespaceStrategies,
onChange,
hasUpdatePermission
hasUpdatePermission,
}) => {
const { t } = useTranslation("config");
const userSuggestions = useUserSuggestions();
@@ -181,7 +181,7 @@ const GeneralSettings: FC<Props> = ({
options={[
{ label: t("general-settings.anonymousMode.full"), value: "FULL" },
{ label: t("general-settings.anonymousMode.protocolOnly"), value: "PROTOCOL_ONLY" },
{ label: t("general-settings.anonymousMode.off"), value: "OFF" }
{ label: t("general-settings.anonymousMode.off"), value: "OFF" },
]}
helpText={t("help.allowAnonymousAccessHelpText")}
testId={"anonymous-mode-select"}

View File

@@ -43,7 +43,7 @@ class LoginAttempt extends React.Component<Props, State> {
this.state = {
loginAttemptLimitError: false,
loginAttemptLimitTimeoutError: false
loginAttemptLimitTimeoutError: false,
};
}
render() {
@@ -84,7 +84,7 @@ class LoginAttempt extends React.Component<Props, State> {
handleLoginAttemptLimitChange = (value: string) => {
this.setState({
...this.state,
loginAttemptLimitError: !validator.isNumberValid(value)
loginAttemptLimitError: !validator.isNumberValid(value),
});
this.props.onChange(validator.isNumberValid(value), value, "loginAttemptLimit");
};
@@ -92,7 +92,7 @@ class LoginAttempt extends React.Component<Props, State> {
handleLoginAttemptLimitTimeoutChange = (value: string) => {
this.setState({
...this.state,
loginAttemptLimitTimeoutError: !validator.isNumberValid(value)
loginAttemptLimitTimeoutError: !validator.isNumberValid(value),
});
this.props.onChange(validator.isNumberValid(value), value, "loginAttemptLimitTimeout");
};

View File

@@ -43,7 +43,7 @@ class NamespaceStrategySelect extends React.Component<Props> {
available = namespaceStrategies.available;
}
return available.map(ns => {
return available.map((ns) => {
const key = "namespaceStrategies." + ns;
let label = t(key);
if (label === key) {
@@ -51,7 +51,7 @@ class NamespaceStrategySelect extends React.Component<Props> {
}
return {
value: ns,
label: label
label: label,
};
});
};

View File

@@ -39,16 +39,8 @@ type Props = WithTranslation & {
class ProxySettings extends React.Component<Props> {
render() {
const {
t,
proxyPassword,
proxyPort,
proxyServer,
proxyUser,
enableProxy,
proxyExcludes,
hasUpdatePermission,
} = this.props;
const { t, proxyPassword, proxyPort, proxyServer, proxyUser, enableProxy, proxyExcludes, hasUpdatePermission } =
this.props;
return (
<div>