Skip to content

Commit af2f509

Browse files
authored
feat: Add functionalities for bulk tag operations (GSoC) (PalisadoesFoundation#2362)
* add people to tag functaionality * minor change * more translations * minor change * add a variable for page size * add tag actions * add tests * translations * add subtags infinite scroll * minor correction * exclude ManageTag from countline check * fix linting * fix linting * fix linting * make coderabbit suggested changes * more changes * more changes * minor correction * add error component for tagNode subtags query * fix translation * fix translation
1 parent 6fadd0c commit af2f509

File tree

18 files changed

+2396
-41
lines changed

18 files changed

+2396
-41
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Count number of lines
3939
run: |
4040
chmod +x ./.github/workflows/countline.py
41-
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx
41+
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/screens/ManageTag/ManageTag.tsx
4242
4343
- name: Get changed TypeScript files
4444
id: changed-files

public/locales/en/translation.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,31 @@
335335
"subTags": "Sub Tags",
336336
"assignedToAll": "Tag Assigned to All",
337337
"successfullyAssignedToPeople": "Tag assigned successfully",
338-
"assignPeople": "Assign",
339338
"errorOccurredWhileLoadingMembers": "Error occured while loading members",
340339
"userName": "User Name",
341340
"actions": "Actions",
342-
"noOneSelected": "No One Selected"
341+
"noOneSelected": "No One Selected",
342+
"assignToTags": "Assign to Tags",
343+
"removeFromTags": "Remove from Tags",
344+
"assign": "Assign",
345+
"remove": "Remove",
346+
"successfullyAssignedToTags": "Successfully Assigned to Tags",
347+
"successfullyRemovedFromTags": "Successfully Removed from Tags",
348+
"errorOccurredWhileLoadingOrganizationUserTags": "Error occurred while loading organization tags",
349+
"errorOccurredWhileLoadingSubTags": "Error occurred while loading subTags tags",
350+
"removeUserTag": "Delete Tag",
351+
"removeUserTagMessage": "Do you want to delete this tag? It delete all the sub tags and all the associations.",
352+
"tagDetails": "Tag Details",
353+
"tagName": "Name",
354+
"tagUpdationSuccess": "Tag updated successfully",
355+
"tagRemovalSuccess": "Tag deleted successfully",
356+
"noTagSelected": "No Tag Selected",
357+
"changeNameToEdit": "Change the name to make an update",
358+
"selectTag": "Select Tag",
359+
"collapse": "Collapse",
360+
"expand": "Expand",
361+
"tagNamePlaceholder": "Write the name of the tag",
362+
"allTags": "All Tags"
343363
},
344364
"userListCard": {
345365
"addAdmin": "Add Admin",

public/locales/fr/translation.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,31 @@
335335
"subTags": "Sous-étiquettes",
336336
"assignedToAll": "Étiquette attribuée à tous",
337337
"successfullyAssignedToPeople": "Étiquette attribuée avec succès",
338-
"assignPeople": "Attribuer",
339338
"errorOccurredWhileLoadingMembers": "Erreur survenue lors du chargement des membres",
340339
"userName": "Nom d'utilisateur",
341340
"actions": "Actions",
342-
"noOneSelected": "Personne sélectionnée"
341+
"noOneSelected": "Personne sélectionnée",
342+
"assignToTags": "Attribuer aux étiquettes",
343+
"removeFromTags": "Retirer des étiquettes",
344+
"assign": "Attribuer",
345+
"remove": "Retirer",
346+
"successfullyAssignedToTags": "Attribué aux étiquettes avec succès",
347+
"successfullyRemovedFromTags": "Retiré des étiquettes avec succès",
348+
"errorOccurredWhileLoadingOrganizationUserTags": "Erreur lors du chargement des étiquettes de l'organisation",
349+
"errorOccurredWhileLoadingSubTags": "Une erreur s'est produite lors du chargement des sous-étiquettes",
350+
"removeUserTag": "Supprimer l'étiquette",
351+
"removeUserTagMessage": "Voulez-vous supprimer cette étiquette ? Cela supprimera toutes les sous-étiquettes et toutes les associations.",
352+
"tagDetails": "Détails de l'étiquette",
353+
"tagName": "Nom de l'étiquette",
354+
"tagUpdationSuccess": "Étiquette mise à jour avec succès",
355+
"tagRemovalSuccess": "Étiquette supprimée avec succès",
356+
"noTagSelected": "Aucune étiquette sélectionnée",
357+
"changeNameToEdit": "Modifiez le nom pour faire une mise à jour",
358+
"selectTag": "Sélectionner l'étiquette",
359+
"collapse": "Réduire",
360+
"expand": "Développer",
361+
"tagNamePlaceholder": "Écrire le nom de l'étiquette",
362+
"allTags": "Toutes les étiquettes"
343363
},
344364
"userListCard": {
345365
"addAdmin": "Ajouter un administrateur",

public/locales/hi/translation.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,31 @@
335335
"subTags": "उप-टैग्स",
336336
"assignedToAll": "सभी को टैग असाइन किया गया",
337337
"successfullyAssignedToPeople": "टैग सफलतापूर्वक असाइन किया गया",
338-
"assignPeople": "असाइन करें",
339338
"errorOccurredWhileLoadingMembers": "सदस्यों को लोड करते समय त्रुटि हुई",
340339
"userName": "उपयोगकर्ता नाम",
341340
"actions": "क्रियाएँ",
342-
"noOneSelected": "कोई चयनित नहीं"
341+
"noOneSelected": "कोई चयनित नहीं",
342+
"assignToTags": "टैग्स को असाइन करें",
343+
"removeFromTags": "टैग्स से हटाएं",
344+
"assign": "असाइन करें",
345+
"remove": "हटाएं",
346+
"successfullyAssignedToTags": "सफलतापूर्वक टैग्स को असाइन किया गया",
347+
"successfullyRemovedFromTags": "सफलतापूर्वक टैग्स से हटाया गया",
348+
"errorOccurredWhileLoadingOrganizationUserTags": "संगठन टैग्स को लोड करते समय त्रुटि हुई",
349+
"errorOccurredWhileLoadingSubTags": "उप-टैग लोड करते समय त्रुटि हुई",
350+
"removeUserTag": "टैग हटाएं",
351+
"removeUserTagMessage": "क्या आप इस टैग को हटाना चाहते हैं? यह सभी उप-टैग्स और सभी संबंधों को हटा देगा।",
352+
"tagDetails": "टैग विवरण",
353+
"tagName": "नाम",
354+
"tagUpdationSuccess": "टैग सफलतापूर्वक अपडेट की गई",
355+
"tagRemovalSuccess": "टैग सफलतापूर्वक हटाई गई",
356+
"noTagSelected": "कोई टैग चयनित नहीं",
357+
"changeNameToEdit": "अपडेट करने के लिए नाम बदलें",
358+
"selectTag": "टैग चुनें",
359+
"collapse": "संक्षिप्त करें",
360+
"expand": "विस्तारित करें",
361+
"tagNamePlaceholder": "टैग का नाम लिखें",
362+
"allTags": "सभी टैग"
343363
},
344364
"userListCard": {
345365
"addAdmin": "व्यवस्थापक जोड़ें",

public/locales/sp/translation.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,31 @@
335335
"subTags": "Subetiquetas",
336336
"assignedToAll": "Etiqueta asignada a todos",
337337
"successfullyAssignedToPeople": "Etiqueta asignada con éxito",
338-
"assignPeople": "Asignar",
339338
"errorOccurredWhileLoadingMembers": "Error al cargar los miembros",
340339
"userName": "Nombre de usuario",
341340
"actions": "Acciones",
342-
"noOneSelected": "Nadie seleccionado"
341+
"noOneSelected": "Nadie seleccionado",
342+
"assignToTags": "Asignar a etiquetas",
343+
"removeFromTags": "Eliminar de etiquetas",
344+
"assign": "Asignar",
345+
"remove": "Eliminar",
346+
"successfullyAssignedToTags": "Asignado a etiquetas con éxito",
347+
"successfullyRemovedFromTags": "Eliminado de etiquetas con éxito",
348+
"errorOccurredWhileLoadingOrganizationUserTags": "Error al cargar las etiquetas de la organización",
349+
"errorOccurredWhileLoadingSubTags": "Ocurrió un error al cargar las subetiquetas",
350+
"removeUserTag": "Eliminar etiqueta",
351+
"removeUserTagMessage": "¿Desea eliminar esta etiqueta? Esto eliminará todas las subetiquetas y todas las asociaciones.",
352+
"tagDetails": "Detalles de la etiqueta",
353+
"tagName": "Nombre",
354+
"tagUpdationSuccess": "Etiqueta actualizada con éxito",
355+
"tagRemovalSuccess": "Etiqueta eliminada con éxito",
356+
"noTagSelected": "Ninguna etiqueta seleccionada",
357+
"changeNameToEdit": "Cambia el nombre para hacer una actualización",
358+
"selectTag": "Seleccionar etiqueta",
359+
"collapse": "Colapsar",
360+
"expand": "Expandir",
361+
"tagNamePlaceholder": "Escribe el nombre de la etiqueta",
362+
"allTags": "Todas las etiquetas"
343363
},
344364
"userListCard": {
345365
"joined": "Unido",

public/locales/zh/translation.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,31 @@
335335
"subTags": "子标签",
336336
"assignedToAll": "标签分配给所有人",
337337
"successfullyAssignedToPeople": "标签分配成功",
338-
"assignPeople": "分配",
339338
"errorOccurredWhileLoadingMembers": "加载成员时出错",
340339
"userName": "用户名",
341340
"actions": "操作",
342-
"noOneSelected": "未选择任何人"
341+
"noOneSelected": "未选择任何人",
342+
"assignToTags": "分配到标签",
343+
"removeFromTags": "从标签中移除",
344+
"assign": "分配",
345+
"remove": "移除",
346+
"successfullyAssignedToTags": "成功分配到标签",
347+
"successfullyRemovedFromTags": "成功从标签中移除",
348+
"errorOccurredWhileLoadingOrganizationUserTags": "加载组织标签时出错",
349+
"errorOccurredWhileLoadingSubTags": "加载子标签时发生错误",
350+
"removeUserTag": "删除标签",
351+
"removeUserTagMessage": "您要删除此标签吗?这将删除所有子标签和所有关联。",
352+
"tagDetails": "标签详情",
353+
"tagName": "名称",
354+
"tagUpdationSuccess": "标签更新成功",
355+
"tagRemovalSuccess": "标签删除成功",
356+
"noTagSelected": "未选择标签",
357+
"changeNameToEdit": "更改名称以进行更新",
358+
"selectTag": "选择标签",
359+
"collapse": "收起",
360+
"expand": "展开",
361+
"tagNamePlaceholder": "输入标签名称",
362+
"allTags": "所有标签"
343363
},
344364
"userListCard": {
345365
"addAdmin": "添加管理员",

src/GraphQl/Mutations/TagMutations.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,37 @@ export const ADD_PEOPLE_TO_TAG = gql`
8787
}
8888
}
8989
`;
90+
91+
/**
92+
* GraphQL mutation to assign people to multiple tags.
93+
*
94+
* @param currentTagId - Id of the current tag.
95+
* @param selectedTagIds - Ids of the selected tags to be assined.
96+
*/
97+
98+
export const ASSIGN_TO_TAGS = gql`
99+
mutation AssignToUserTags($currentTagId: ID!, $selectedTagIds: [ID!]!) {
100+
assignToUserTags(
101+
input: { currentTagId: $currentTagId, selectedTagIds: $selectedTagIds }
102+
) {
103+
_id
104+
}
105+
}
106+
`;
107+
108+
/**
109+
* GraphQL mutation to remove people from multiple tags.
110+
*
111+
* @param currentTagId - Id of the current tag.
112+
* @param selectedTagIds - Ids of the selected tags to be removed from.
113+
*/
114+
115+
export const REMOVE_FROM_TAGS = gql`
116+
mutation RemoveFromUserTags($currentTagId: ID!, $selectedTagIds: [ID!]!) {
117+
removeFromUserTags(
118+
input: { currentTagId: $currentTagId, selectedTagIds: $selectedTagIds }
119+
) {
120+
_id
121+
}
122+
}
123+
`;

src/components/AddPeopleToTag/AddPeopleToTag.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
365365
variant="primary"
366366
data-testid="assignPeopleBtn"
367367
>
368-
{t('assignPeople')}
368+
{t('assign')}
369369
</Button>
370370
</Modal.Footer>
371371
</Form>

0 commit comments

Comments
 (0)