mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
Improve a11y (#1841)
Improve accessibility by removing unnecessary tags without hrefs. Also remove many eslint errors and warnings.
This commit is contained in:
@@ -37,15 +37,15 @@ const buttons = [
|
||||
{
|
||||
className: "is-outlined",
|
||||
label: "Cancel",
|
||||
onClick: () => null
|
||||
onClick: () => null,
|
||||
},
|
||||
{
|
||||
label: "Submit"
|
||||
}
|
||||
label: "Submit",
|
||||
},
|
||||
];
|
||||
|
||||
storiesOf("Modal/ConfirmAlert", module)
|
||||
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
|
||||
.addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
|
||||
.add("Default", () => <ConfirmAlert message={body} title={"Are you sure about that?"} buttons={buttons} />)
|
||||
.add("WithButton", () => {
|
||||
const buttonClick = () => {
|
||||
|
||||
@@ -65,13 +65,13 @@ export const ConfirmAlert: FC<Props> = ({ title, message, buttons, close }) => {
|
||||
<div className="field is-grouped">
|
||||
{buttons.map((button, index) => (
|
||||
<p className="control" key={index}>
|
||||
<a
|
||||
<button
|
||||
className={classNames("button", "is-info", button.className, button.isLoading ? "is-loading" : "")}
|
||||
key={index}
|
||||
onClick={() => handleClickButton(button)}
|
||||
>
|
||||
{button.label}
|
||||
</a>
|
||||
</button>
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -48,8 +48,8 @@ const CreateTagModal: FC<Props> = ({ t, onClose, tagCreationLink, existingTagsLi
|
||||
useEffect(() => {
|
||||
apiClient
|
||||
.get(existingTagsLink)
|
||||
.then(response => response.json())
|
||||
.then(json => setTagNames(json._embedded.tags.map((tag: Tag) => tag.name)));
|
||||
.then((response) => response.json())
|
||||
.then((json) => setTagNames(json._embedded.tags.map((tag: Tag) => tag.name)));
|
||||
}, [existingTagsLink]);
|
||||
|
||||
const createTag = () => {
|
||||
@@ -57,7 +57,7 @@ const CreateTagModal: FC<Props> = ({ t, onClose, tagCreationLink, existingTagsLi
|
||||
apiClient
|
||||
.post(tagCreationLink, {
|
||||
revision,
|
||||
name: newTagName
|
||||
name: newTagName,
|
||||
})
|
||||
.then(onCreated)
|
||||
.catch(onError)
|
||||
@@ -83,7 +83,7 @@ const CreateTagModal: FC<Props> = ({ t, onClose, tagCreationLink, existingTagsLi
|
||||
<InputField
|
||||
name="name"
|
||||
label={t("tags.create.form.field.name.label")}
|
||||
onChange={val => setNewTagName(val)}
|
||||
onChange={(val) => setNewTagName(val)}
|
||||
value={newTagName}
|
||||
validationError={!!validationError}
|
||||
errorMessage={t(validationError)}
|
||||
|
||||
Reference in New Issue
Block a user