Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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 @@ -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="Menu" className={css.iconSearchButton} onClick={handleClear}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add i18n.t for Menu

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any direct translation for the menu in en.yml

<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
2 changes: 1 addition & 1 deletion app/javascript/components/nav/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Nav = () => {
<div className={css.drawerHeaderContainer}>
<Hidden mdUp implementation="css">
<div className={css.drawerHeader}>
<IconButton onClick={handleToggleDrawer(false)}>
<IconButton aria-label="Menu" onClick={handleToggleDrawer(false)}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any direct translation for the menu in en.yml

<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 @@ -60,6 +60,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 @@ -76,6 +77,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 @@ -88,6 +90,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 @@ -100,6 +103,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 @@ -34,6 +34,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 @@ -53,6 +53,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 @@ -64,6 +64,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 @@ -52,6 +52,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)
Comment thread
NidhiKJha marked this conversation as resolved.
Outdated
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Component = ({ handleClick, i18n, mode, subformName, subformIsDisabled })
text={i18n.t("fields.add")}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
onClick: handleClick
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const Component = ({ arrayHelpers, field, form, formik, i18n, initialSubformValu
text={renderAddText}
type={ACTION_BUTTON_TYPES.default}
rest={{
"aria-label": i18n.t("buttons.new"),
onClick: handleAddSubform
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const Component = ({ arrayHelpers, field, form, locale, mode, recordType, setDia
icon={<DeleteIcon />}
type={ACTION_BUTTON_TYPES.icon}
rest={{
"aria-label": i18n.t("buttons.delete"),
onClick: () => handleOpenModal(index)
}}
/>
Expand All @@ -124,6 +125,7 @@ const Component = ({ arrayHelpers, field, form, locale, mode, recordType, setDia
icon={<ArrowIcon />}
type={ACTION_BUTTON_TYPES.icon}
rest={{
"aria-label": i18n.t("buttons.edit"),
className: css.subformShow,
onClick: () => handleEdit(index)
}}
Expand Down
1 change: 1 addition & 0 deletions app/javascript/components/record-form/nav/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Component = ({
primeroModule,
selectedForm
}) => {
const i18n = useI18n();
Comment thread
NidhiKJha marked this conversation as resolved.
Outdated
const [open, setOpen] = useState("");
const [previousGroup, setPreviousGroup] = useState("");
const dispatch = useDispatch();
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/record-list/add-record-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const AddRecordMenu = ({ recordType }) => {
icon={<AddIcon />}
text={i18n.t("buttons.new")}
type={ACTION_BUTTON_TYPES.default}
rest={{ onClick: handleClick }}
rest={{ "aria-label": i18n.t("buttons.new"), onClick: handleClick }}
/>
{renderMenu(userModules)}
{renderDialog(moduleUniqueId)}
Expand Down
Loading