Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Oct 28, 2024
1 parent 6a79d51 commit 9bc25d7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 20 deletions.
6 changes: 5 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@
"tagUpdationSuccess": "टैग सफलतापूर्वक अपडेट की गई",
"tagRemovalSuccess": "टैग सफलतापूर्वक हटाई गई",
"noTagSelected": "कोई टैग चयनित नहीं",
"changeNameToEdit": "अपडेट करने के लिए नाम बदलें"
"changeNameToEdit": "अपडेट करने के लिए नाम बदलें",
"selectTag": "टैग चुनें",
"collapse": "संक्षिप्त करें",
"expand": "विस्तारित करें",
"tagNamePlaceholder": "टैग का नाम लिखें"
},
"userListCard": {
"addAdmin": "व्यवस्थापक जोड़ें",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@
"tagUpdationSuccess": "标签更新成功",
"tagRemovalSuccess": "标签删除成功",
"noTagSelected": "未选择标签",
"changeNameToEdit": "更改名称以进行更新"
"changeNameToEdit": "更改名称以进行更新",
"selectTag": "选择标签",
"collapse": "收起",
"expand": "展开",
"tagNamePlaceholder": "输入标签名称"
},
"userListCard": {
"addAdmin": "添加管理员",
Expand Down
19 changes: 7 additions & 12 deletions src/components/TagActions/TagActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({
);

const [checkedTagId, setCheckedTagId] = useState<string | null>(null);
const [uncheckedTagId, setUnheckedTagId] = useState<string | null>(null);
const [uncheckedTagId, setUncheckedTagId] = useState<string | null>(null);

// tags that we have selected to assigned
const [selectedTags, setSelectedTags] = useState<InterfaceTagData[]>([]);
Expand Down Expand Up @@ -148,11 +148,11 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({

const addAncestorTags = (tagId: string): void => {
setCheckedTagId(tagId);
setUnheckedTagId(null);
setUncheckedTagId(null);
};

const removeAncestorTags = (tagId: string): void => {
setUnheckedTagId(tagId);
setUncheckedTagId(tagId);
setCheckedTagId(null);
};

Expand Down Expand Up @@ -315,13 +315,7 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({
: t('removeFromTags')}
</Modal.Title>
</Modal.Header>
<Form
onSubmitCapture={(e) =>
tagActionType === 'assignToTags'
? handleTagAction(e)
: handleTagAction(e)
}
>
<Form onSubmitCapture={handleTagAction}>
<Modal.Body className="pb-0">
{orgUserTagsLoading ? (
<Loader size="sm" />
Expand All @@ -341,10 +335,11 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({
className={`badge bg-dark-subtle text-secondary-emphasis lh-lg my-2 ms-2 d-flex align-items-center ${styles.tagBadge}`}
>
{tag.name}
<i
className={`${styles.removeFilterIcon} fa fa-times ms-2 text-body-tertiary`}
<button
className={`${styles.removeFilterIcon} fa fa-times ms-2 text-body-tertiary border-0 bg-transparent`}
onClick={() => deSelectTag(tag)}
data-testid={`clearSelectedTag${tag._id}`}
aria-label={t('remove')}
/>
</div>
))
Expand Down
2 changes: 1 addition & 1 deletion src/components/TagActions/TagActionsMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export const MOCKS = [
result: {
data: {
getUserTag: {
name: 'tag1',
name: 'userTag 1',
childTags: {
edges: [
{
Expand Down
5 changes: 4 additions & 1 deletion src/components/TagActions/TagNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -122,6 +122,7 @@ const TagNode: React.FC<InterfaceTagNodeProps> = ({
className="me-3"
style={{ cursor: 'pointer' }}
data-testid={`expandSubTags${tag._id}`}
aria-label={expanded ? t('collapse') : t('expand')}
>
{expanded ? '▼' : '▶'}
</span>
Expand All @@ -132,6 +133,7 @@ const TagNode: React.FC<InterfaceTagNodeProps> = ({
className="me-2"
onChange={handleCheckboxChange}
data-testid={`checkTag${tag._id}`}
aria-label={t('selectTag')}
/>
<i className="fa fa-folder mx-2" />{' '}
</>
Expand All @@ -145,6 +147,7 @@ const TagNode: React.FC<InterfaceTagNodeProps> = ({
className="ms-1 me-2"
onChange={handleCheckboxChange}
data-testid={`checkTag${tag._id}`}
aria-label={tag.name}
/>
<i className="fa fa-tag mx-2" />{' '}
</>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/ManageTag/ManageTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function ManageTag(): JSX.Element {
<Form.Label htmlFor="tagName">{t('tagName')}</Form.Label>
<Form.Control
type="name"
id="orgname"
id="tagName"
className="mb-3"
placeholder={t('tagNamePlaceholder')}
data-testid="tagNameInput"
Expand Down

0 comments on commit 9bc25d7

Please sign in to comment.