diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 19bea8e4b4..3b202bd593 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -353,7 +353,11 @@ "tagUpdationSuccess": "Tag updated successfully", "tagRemovalSuccess": "Tag deleted successfully", "noTagSelected": "No Tag Selected", - "changeNameToEdit": "Change the name to make an update" + "changeNameToEdit": "Change the name to make an update", + "selectTag": "Select Tag", + "collapse": "Collapse", + "expand": "Expand", + "tagNamePlaceholder": "Write the name of the tag" }, "userListCard": { "addAdmin": "Add Admin", diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index b961c587ff..7b11e35f56 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -353,7 +353,11 @@ "tagUpdationSuccess": "Étiquette mise à jour avec succès", "tagRemovalSuccess": "Étiquette supprimée avec succès", "noTagSelected": "Aucun tag sélectionné", - "changeNameToEdit": "Modifiez le nom pour faire une mise à jour" + "changeNameToEdit": "Modifiez le nom pour faire une mise à jour", + "selectTag": "Sélectionner le tag", + "collapse": "Réduire", + "expand": "Développer", + "tagNamePlaceholder": "Écrire le nom du tag" }, "userListCard": { "addAdmin": "Ajouter un administrateur", diff --git a/public/locales/hi/translation.json b/public/locales/hi/translation.json index 940be5a73c..bab222175c 100644 --- a/public/locales/hi/translation.json +++ b/public/locales/hi/translation.json @@ -353,7 +353,11 @@ "tagUpdationSuccess": "टैग सफलतापूर्वक अपडेट की गई", "tagRemovalSuccess": "टैग सफलतापूर्वक हटाई गई", "noTagSelected": "कोई टैग चयनित नहीं", - "changeNameToEdit": "अपडेट करने के लिए नाम बदलें" + "changeNameToEdit": "अपडेट करने के लिए नाम बदलें", + "selectTag": "टैग चुनें", + "collapse": "संक्षिप्त करें", + "expand": "विस्तारित करें", + "tagNamePlaceholder": "टैग का नाम लिखें" }, "userListCard": { "addAdmin": "व्यवस्थापक जोड़ें", diff --git a/public/locales/sp/translation.json b/public/locales/sp/translation.json index 4e65b4f8d2..e301bde4d7 100644 --- a/public/locales/sp/translation.json +++ b/public/locales/sp/translation.json @@ -353,7 +353,11 @@ "tagUpdationSuccess": "Etiqueta actualizada con éxito", "tagRemovalSuccess": "Etiqueta eliminada con éxito", "noTagSelected": "Ninguna etiqueta seleccionada", - "changeNameToEdit": "Cambia el nombre para hacer una actualización" + "changeNameToEdit": "Cambia el nombre para hacer una actualización", + "selectTag": "Seleccionar etiqueta", + "collapse": "Colapsar", + "expand": "Expandir", + "tagNamePlaceholder": "Escribe el nombre de la etiqueta" }, "userListCard": { "joined": "Unido", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index d6fe494a04..07d1905ca8 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -353,7 +353,11 @@ "tagUpdationSuccess": "标签更新成功", "tagRemovalSuccess": "标签删除成功", "noTagSelected": "未选择标签", - "changeNameToEdit": "更改名称以进行更新" + "changeNameToEdit": "更改名称以进行更新", + "selectTag": "选择标签", + "collapse": "收起", + "expand": "展开", + "tagNamePlaceholder": "输入标签名称" }, "userListCard": { "addAdmin": "添加管理员", diff --git a/src/components/TagActions/TagActions.tsx b/src/components/TagActions/TagActions.tsx index b5c219aa3d..c1006c12a9 100644 --- a/src/components/TagActions/TagActions.tsx +++ b/src/components/TagActions/TagActions.tsx @@ -87,7 +87,7 @@ const TagActions: React.FC = ({ ); const [checkedTagId, setCheckedTagId] = useState(null); - const [uncheckedTagId, setUnheckedTagId] = useState(null); + const [uncheckedTagId, setUncheckedTagId] = useState(null); // tags that we have selected to assigned const [selectedTags, setSelectedTags] = useState([]); @@ -148,11 +148,11 @@ const TagActions: React.FC = ({ const addAncestorTags = (tagId: string): void => { setCheckedTagId(tagId); - setUnheckedTagId(null); + setUncheckedTagId(null); }; const removeAncestorTags = (tagId: string): void => { - setUnheckedTagId(tagId); + setUncheckedTagId(tagId); setCheckedTagId(null); }; @@ -315,13 +315,7 @@ const TagActions: React.FC = ({ : t('removeFromTags')} -
- tagActionType === 'assignToTags' - ? handleTagAction(e) - : handleTagAction(e) - } - > + {orgUserTagsLoading ? ( @@ -341,10 +335,11 @@ const TagActions: React.FC = ({ className={`badge bg-dark-subtle text-secondary-emphasis lh-lg my-2 ms-2 d-flex align-items-center ${styles.tagBadge}`} > {tag.name} - deSelectTag(tag)} data-testid={`clearSelectedTag${tag._id}`} + aria-label={t('remove')} /> )) diff --git a/src/components/TagActions/TagActionsMocks.ts b/src/components/TagActions/TagActionsMocks.ts index 46ef0b85db..30fff78e3e 100644 --- a/src/components/TagActions/TagActionsMocks.ts +++ b/src/components/TagActions/TagActionsMocks.ts @@ -389,7 +389,7 @@ export const MOCKS = [ result: { data: { getUserTag: { - name: 'tag1', + name: 'userTag 1', childTags: { edges: [ { diff --git a/src/components/TagActions/TagNode.tsx b/src/components/TagActions/TagNode.tsx index e419e22e05..4d2f6dbadd 100644 --- a/src/components/TagActions/TagNode.tsx +++ b/src/components/TagActions/TagNode.tsx @@ -11,7 +11,7 @@ import styles from './TagActions.module.css'; import InfiniteScroll from 'react-infinite-scroll-component'; /** - * Props for the `AssignToTags` component. + * Props for the `TagNode` component. */ interface InterfaceTagNodeProps { tag: InterfaceTagData; @@ -122,6 +122,7 @@ const TagNode: React.FC = ({ className="me-3" style={{ cursor: 'pointer' }} data-testid={`expandSubTags${tag._id}`} + aria-label={expanded ? t('collapse') : t('expand')} > {expanded ? '▼' : '▶'} @@ -132,6 +133,7 @@ const TagNode: React.FC = ({ className="me-2" onChange={handleCheckboxChange} data-testid={`checkTag${tag._id}`} + aria-label={t('selectTag')} /> {' '} @@ -145,6 +147,7 @@ const TagNode: React.FC = ({ className="ms-1 me-2" onChange={handleCheckboxChange} data-testid={`checkTag${tag._id}`} + aria-label={tag.name} /> {' '} diff --git a/src/screens/ManageTag/ManageTag.tsx b/src/screens/ManageTag/ManageTag.tsx index 8099ca8754..05b45b1205 100644 --- a/src/screens/ManageTag/ManageTag.tsx +++ b/src/screens/ManageTag/ManageTag.tsx @@ -628,7 +628,7 @@ function ManageTag(): JSX.Element { {t('tagName')}