Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const OverviewBox = ({ items, chartData, sumTitle, withTotal, loading, errors })
return (
<li key={item}>
<button
aria-label={i18n.t("buttons.menu")}
className={css.itemButton}
type="button"
onClick={() => handleClick(indicators.getIn([item, "query"], []))}
Expand Down
1 change: 1 addition & 0 deletions app/javascript/components/flagging/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Component = ({ control, record, recordType }) => {
text={i18n.t("buttons.flags")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.flags"),
onClick: handleOpen
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const Component = ({ recordType, record, handleActiveTab }) => {
type={ACTION_BUTTON_TYPES.default}
pending={savingFlag}
rest={{
"aria-label": i18n.t("buttons.save"),
type: "submit",
disabled: savingFlag
}}
Expand All @@ -122,6 +123,7 @@ const Component = ({ recordType, record, handleActiveTab }) => {
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t("buttons.cancel"),
onClick: handleReset
}}
/>
Expand Down
1 change: 1 addition & 0 deletions app/javascript/components/form/fields/attachment-input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const AttachmentInput = ({ commonInputProps, metaInputProps }) => {
type={ACTION_BUTTON_TYPES.default}
pending={file.loading}
rest={{
"aria-label": i18n.t("fields.file_upload_box.select_file_button_text"),
component: "span",
variant: "outlined",
disabled: disabled || fieldDisabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const OrderableOptionsField = ({ commonInputProps, metaInputProps, options, show
text={i18n.t("buttons.add_another_option")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.add_another_option"),
onClick: onAddOption
}}
/>
Expand All @@ -137,6 +138,7 @@ const OrderableOptionsField = ({ commonInputProps, metaInputProps, options, show
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t("buttons.clear_default"),
onClick: onClearDefault
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Actions = ({ handleSave, handleClear }) => {
type={ACTION_BUTTON_TYPES.default}
isTransparent
rest={{
"aria-label": i18n.t("filters.save_filters"),
onClick: handleSave,
variant: "outlined"
}}
Expand All @@ -34,6 +35,7 @@ const Actions = ({ handleSave, handleClear }) => {
text={i18n.t("filters.apply_filters")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("filters.apply_filters"),
type: "submit"
}}
/>
Expand All @@ -45,6 +47,7 @@ const Actions = ({ handleSave, handleClear }) => {
type={ACTION_BUTTON_TYPES.default}
isTransparent
rest={{
"aria-label": i18n.t("filters.clear_filters"),
onClick: handleClear,
variant: "outlined"
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Search = ({ handleReset }) => {
<div className={css.searchContainer}>
<div className={css.searchInputContainer}>
<DisableOffline button>
<IconButton className={css.iconSearchButton} aria-label="menu" type="submit">
<IconButton className={css.iconSearchButton} aria-label={i18n.t("buttons.menu")} type="submit">
<SearchIcon />
</IconButton>
</DisableOffline>
Expand All @@ -78,7 +78,7 @@ const Search = ({ handleReset }) => {
inputProps={{ "aria-label": i18n.t("navigation.search") }}
endAdornment={
<InputAdornment position="end">
<IconButton className={css.iconSearchButton} onClick={handleClear}>
<IconButton aria-label={i18n.t("buttons.menu")} className={css.iconSearchButton} onClick={handleClear}>
<ClearIcon />
</IconButton>
</InputAdornment>
Expand Down
7 changes: 5 additions & 2 deletions app/javascript/components/lightbox/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { Backdrop, IconButton } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import CloseIcon from "@material-ui/icons/Close";

import { useI18n } from "../i18n";

import styles from "./styles.css";

const Component = ({ trigger, image }) => {
const css = makeStyles(styles)();
const i18n = useI18n();

const [open, setOpen] = useState(false);

Expand All @@ -19,12 +22,12 @@ const Component = ({ trigger, image }) => {

return (
<>
<button onClick={handleClose} type="button" className={css.button}>
<button aria-label={i18n.t("buttons.close")} onClick={handleClose} type="button" className={css.button}>
{trigger}
</button>
{image && (
<Backdrop className={css.backdrop} open={open} onClick={handleClose}>
<IconButton className={css.backdropClose}>
<IconButton aria-label={i18n.t("buttons.close")} className={css.backdropClose}>
<CloseIcon />
</IconButton>
<img src={image} alt="" />
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/components/nav/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import CloseIcon from "@material-ui/icons/Close";

import { useI18n } from "../i18n";
import AgencyLogo from "../agency-logo";
import ModuleLogo from "../module-logo";
import { useThemeHelper } from "../../libs";
Expand All @@ -24,6 +25,7 @@ const Nav = () => {
const mobileDisplay = useMediaQuery(theme.breakpoints.down("sm"));
const dispatch = useDispatch();
const [drawerOpen, setDrawerOpen] = useState(false);
const i18n = useI18n();

useEffect(() => {
dispatch(fetchAlerts());
Expand Down Expand Up @@ -76,7 +78,7 @@ const Nav = () => {
<div className={css.drawerHeaderContainer}>
<Hidden mdUp implementation="css">
<div className={css.drawerHeader}>
<IconButton onClick={handleToggleDrawer(false)}>
<IconButton aria-label={i18n.t("buttons.menu")} onClick={handleToggleDrawer(false)}>
<CloseIcon />
</IconButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Container = () => {
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: ROUTES.admin_agencies_new,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Component = ({ subformField }) => {
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t(`fields.clear_${fieldBy}`),
onClick
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const Component = () => {
text={i18n.t("fields.add_field")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
onClick: handleDialog
}}
/>
Expand All @@ -77,6 +78,7 @@ const Component = () => {
text={i18n.t("fields.add_existing_field")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("fields.add_existing_field"),
onClick: handleClose,
disabled: true,
fullWidth: true,
Expand All @@ -89,6 +91,7 @@ const Component = () => {
text={i18n.t("fields.add_custom_field")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("fields.add_custom_field"),
onClick: handleCustomFieldSelectorDialog,
fullWidth: true,
className: css.existingFieldButton
Expand All @@ -101,6 +104,7 @@ const Component = () => {
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t("buttons.cancel"),
onClick: handleClose,
fullWidth: true,
className: css.cancelButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const Component = ({ filterValues, modules, handleSetFilterValue, handleClearVal
type={ACTION_BUTTON_TYPES.default}
isTransparent
rest={{
"aria-label": i18n.t("clear"),
onClick: handleClearValue,
variant: "outlined",
fullWidth: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const Component = ({ handleCancel, handleSuccess, open }) => {
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t("buttons.cancel"),
onClick: handleCancel,
disabled: reorderLoading
}}
Expand All @@ -69,6 +70,7 @@ const Component = ({ handleCancel, handleSuccess, open }) => {
text={i18n.t("buttons.save_changes")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.save_changes"),
onClick: handleSuccess,
disabled: reorderLoading
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Component = () => {
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: ROUTES.lookups_new,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const Component = ({ formMode, formRef, handleCancel, setOpenDeleteDialog }) =>
text={i18n.t("buttons.edit")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.edit"),
to: `${pathname}/edit`,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const Container = () => {
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: ROUTES.admin_roles_new,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const Container = () => {
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: ROUTES.admin_user_groups_new,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Container = () => {
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: ROUTES.admin_users_new,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const NotAuthorized = () => {
text={i18n.t("navigation.home")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("navigation.home"),
to: ROUTES.dashboard,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const NotFound = () => {
text={i18n.t("navigation.home")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("navigation.home"),
to: ROUTES.dashboard,
component: Link
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const Container = () => {
text={i18n.t("buttons.login")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.login"),
type: "submit"
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Box } from "@material-ui/core";
import DeleteIcon from "@material-ui/icons/Delete";
import { makeStyles } from "@material-ui/core/styles";

import { useI18n } from "../../../../i18n";
import styles from "../../styles.css";
import ActionButton from "../../../../action-button";
import { ACTION_BUTTON_TYPES } from "../../../../action-button/constants";
Expand All @@ -15,6 +16,7 @@ import AttachmentPreview from "./attachment-preview";
const AttachmentField = ({ name, index, attachment, disabled, mode, arrayHelpers, value }) => {
const css = makeStyles(styles)();
const { attachment_url: attachmentUrl, id, _destroy: destroyed } = value;
const i18n = useI18n();

const fields = buildAttachmentFieldsObject(name, index);

Expand Down Expand Up @@ -52,6 +54,7 @@ const AttachmentField = ({ name, index, attachment, disabled, mode, arrayHelpers
type={ACTION_BUTTON_TYPES.icon}
isCancel
rest={{
"aria-label": i18n.t("buttons.delete"),
onClick: handleRemove
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const AttachmentInput = ({ attachment, fields, name, value }) => {
rest={{
component: "span",
disabled: fieldDisabled(),
variant: "outlined"
variant: "outlined",
"aria-label": i18n.t("fields.file_upload_box.select_file_button_text")
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import PropTypes from "prop-types";
import AddIcon from "@material-ui/icons/Add";
import { makeStyles } from "@material-ui/core/styles";

import { useI18n } from "../../../../i18n";
import styles from "../../styles.css";
import ActionButton from "../../../../action-button";
import { ACTION_BUTTON_TYPES } from "../../../../action-button/constants";

const AttachmentLabel = ({ label, disabled, mode, arrayHelpers, handleAttachmentAddition }) => {
const i18n = useI18n();
const css = makeStyles(styles)();
const isDisabled = !disabled && !mode.isShow;

Expand All @@ -21,6 +23,7 @@ const AttachmentLabel = ({ label, disabled, mode, arrayHelpers, handleAttachment
text="Add"
type={ACTION_BUTTON_TYPES.icon}
rest={{
"aria-label": i18n.t("buttons.new"),
onClick: () => handleAttachmentAddition(arrayHelpers)
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const DocumentField = ({
{value.description}
</div>
<div>
<IconButton onClick={handleOpen}>
<IconButton aria-label={i18n.t("buttons.view")} onClick={handleOpen}>
<KeyboardArrowRightIcon />
</IconButton>
</div>
Expand All @@ -91,7 +91,7 @@ const DocumentField = ({
<DialogTitle disableTypography className={css.title}>
<div className={css.titleText}>{title}</div>
<div>
<IconButton onClick={handleClose}>
<IconButton aria-label={i18n.t("buttons.close")} onClick={handleClose}>
<CloseIcon />
</IconButton>
</div>
Expand All @@ -104,7 +104,7 @@ const DocumentField = ({
<AttachmentInput fields={fields} attachment={attachment} value={value.attachment} name={name} />
)}
{mode.isShow || (
<IconButton onClick={handleRemove}>
<IconButton aria-label={i18n.t("buttons.delete")} onClick={handleRemove}>
<DeleteIcon />
</IconButton>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const RecordFormToolbar = ({
type={ACTION_BUTTON_TYPES.default}
pending={savingRecord}
rest={{
"aria-label": i18n.t("buttons.save"),
onClick: handleFormSubmit
}}
/>
Expand Down Expand Up @@ -105,6 +106,7 @@ const RecordFormToolbar = ({
type={ACTION_BUTTON_TYPES.default}
isCancel
rest={{
"aria-label": i18n.t("buttons.cancel"),
onClick: goBack
}}
/>
Expand All @@ -118,6 +120,7 @@ const RecordFormToolbar = ({
text={i18n.t("buttons.edit")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
to: `/${params.recordType}/${params.id}/edit`,
component: Link
}}
Expand Down
Loading