Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add functionalities for bulk tag operations (GSoC) #2362

Merged
merged 22 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 21 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
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.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
./.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
meetulr marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't seem like we should ignore these files? Is this future plan to restrict it to 600 lines?

Copy link
Contributor Author

@meetulr meetulr Oct 30, 2024

Choose a reason for hiding this comment

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

I think this check was added in the months before this gsoc... I'm not sure about how 600 lines was decided upon. This could be discussed and changed as the app grows and includes more features that would cause files to be larger than 600 lines. Still I'll try to reduce this file's size in the upcoming PR for refactoring...


- name: Get changed TypeScript files
id: changed-files
Expand Down
24 changes: 22 additions & 2 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,31 @@
"subTags": "Sub Tags",
"assignedToAll": "Tag Assigned to All",
"successfullyAssignedToPeople": "Tag assigned successfully",
"assignPeople": "Assign",
"errorOccurredWhileLoadingMembers": "Error occured while loading members",
"userName": "User Name",
"actions": "Actions",
"noOneSelected": "No One Selected"
"noOneSelected": "No One Selected",
"assignToTags": "Assign to Tags",
"removeFromTags": "Remove from Tags",
"assign": "Assign",
"remove": "Remove",
"successfullyAssignedToTags": "Successfully Assigned to Tags",
"successfullyRemovedFromTags": "Successfully Removed from Tags",
"errorOccurredWhileLoadingOrganizationUserTags": "Error occurred while loading organization tags",
"errorOccurredWhileLoadingSubTags": "Error occurred while loading subTags tags",
"removeUserTag": "Delete Tag",
"removeUserTagMessage": "Do you want to delete this tag? It delete all the sub tags and all the associations.",
meetulr marked this conversation as resolved.
Show resolved Hide resolved
"tagDetails": "Tag Details",
"tagName": "Name",
"tagUpdationSuccess": "Tag updated successfully",
"tagRemovalSuccess": "Tag deleted successfully",
"noTagSelected": "No Tag Selected",
"changeNameToEdit": "Change the name to make an update",
"selectTag": "Select Tag",
"collapse": "Collapse",
"expand": "Expand",
"tagNamePlaceholder": "Write the name of the tag",
"allTags": "All Tags"
},
"userListCard": {
"addAdmin": "Add Admin",
Expand Down
24 changes: 22 additions & 2 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,31 @@
"subTags": "Sous-étiquettes",
"assignedToAll": "Étiquette attribuée à tous",
"successfullyAssignedToPeople": "Étiquette attribuée avec succès",
"assignPeople": "Attribuer",
"errorOccurredWhileLoadingMembers": "Erreur survenue lors du chargement des membres",
"userName": "Nom d'utilisateur",
"actions": "Actions",
"noOneSelected": "Personne sélectionnée"
"noOneSelected": "Personne sélectionnée",
"assignToTags": "Attribuer aux tags",
"removeFromTags": "Retirer des tags",
meetulr marked this conversation as resolved.
Show resolved Hide resolved
"assign": "Attribuer",
"remove": "Retirer",
"successfullyAssignedToTags": "Attribué aux tags avec succès",
"successfullyRemovedFromTags": "Retiré des tags avec succès",
"errorOccurredWhileLoadingOrganizationUserTags": "Erreur lors du chargement des tags de l'organisation",
"errorOccurredWhileLoadingSubTags": "Une erreur s'est produite lors du chargement des sous-tags",
"removeUserTag": "Supprimer l'étiquette",
"removeUserTagMessage": "Voulez-vous supprimer cette étiquette ? Cela supprimera toutes les sous-étiquettes et toutes les associations.",
"tagDetails": "Détails de l'étiquette",
"tagName": "Nom de l'étiquette",
"tagUpdationSuccess": "Étiquette mise à jour avec succès",
"tagRemovalSuccess": "Étiquette supprimée avec succès",
"noTagSelected": "Aucune étiquette sélectionnée",
"changeNameToEdit": "Modifiez le nom pour faire une mise à jour",
"selectTag": "Sélectionner l'étiquette",
"collapse": "Réduire",
"expand": "Développer",
"tagNamePlaceholder": "Écrire le nom de l'étiquette",
"allTags": "Toutes les étiquettes"
},
"userListCard": {
"addAdmin": "Ajouter un administrateur",
Expand Down
24 changes: 22 additions & 2 deletions public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,31 @@
"subTags": "उप-टैग्स",
"assignedToAll": "सभी को टैग असाइन किया गया",
"successfullyAssignedToPeople": "टैग सफलतापूर्वक असाइन किया गया",
"assignPeople": "असाइन करें",
"errorOccurredWhileLoadingMembers": "सदस्यों को लोड करते समय त्रुटि हुई",
"userName": "उपयोगकर्ता नाम",
"actions": "क्रियाएँ",
"noOneSelected": "कोई चयनित नहीं"
"noOneSelected": "कोई चयनित नहीं",
"assignToTags": "टैग्स को असाइन करें",
"removeFromTags": "टैग्स से हटाएं",
"assign": "असाइन करें",
"remove": "हटाएं",
"successfullyAssignedToTags": "सफलतापूर्वक टैग्स को असाइन किया गया",
"successfullyRemovedFromTags": "सफलतापूर्वक टैग्स से हटाया गया",
"errorOccurredWhileLoadingOrganizationUserTags": "संगठन टैग्स को लोड करते समय त्रुटि हुई",
"errorOccurredWhileLoadingSubTags": "उप-टैग लोड करते समय त्रुटि हुई",
"removeUserTag": "टैग हटाएं",
"removeUserTagMessage": "क्या आप इस टैग को हटाना चाहते हैं? यह सभी उप-टैग्स और सभी संबंधों को हटा देगा।",
"tagDetails": "टैग विवरण",
"tagName": "नाम",
"tagUpdationSuccess": "टैग सफलतापूर्वक अपडेट की गई",
"tagRemovalSuccess": "टैग सफलतापूर्वक हटाई गई",
"noTagSelected": "कोई टैग चयनित नहीं",
"changeNameToEdit": "अपडेट करने के लिए नाम बदलें",
"selectTag": "टैग चुनें",
"collapse": "संक्षिप्त करें",
"expand": "विस्तारित करें",
"tagNamePlaceholder": "टैग का नाम लिखें",
"allTags": "सभी टैग"
},
"userListCard": {
"addAdmin": "व्यवस्थापक जोड़ें",
Expand Down
24 changes: 22 additions & 2 deletions public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,31 @@
"subTags": "Subetiquetas",
"assignedToAll": "Etiqueta asignada a todos",
"successfullyAssignedToPeople": "Etiqueta asignada con éxito",
"assignPeople": "Asignar",
"errorOccurredWhileLoadingMembers": "Error al cargar los miembros",
"userName": "Nombre de usuario",
"actions": "Acciones",
"noOneSelected": "Nadie seleccionado"
"noOneSelected": "Nadie seleccionado",
"assignToTags": "Asignar a etiquetas",
"removeFromTags": "Eliminar de etiquetas",
"assign": "Asignar",
"remove": "Eliminar",
"successfullyAssignedToTags": "Asignado a etiquetas con éxito",
"successfullyRemovedFromTags": "Eliminado de etiquetas con éxito",
"errorOccurredWhileLoadingOrganizationUserTags": "Error al cargar las etiquetas de la organización",
"errorOccurredWhileLoadingSubTags": "Ocurrió un error al cargar las subetiquetas",
"removeUserTag": "Eliminar etiqueta",
"removeUserTagMessage": "¿Desea eliminar esta etiqueta? Esto eliminará todas las subetiquetas y todas las asociaciones.",
"tagDetails": "Detalles de la etiqueta",
"tagName": "Nombre",
"tagUpdationSuccess": "Etiqueta actualizada con éxito",
"tagRemovalSuccess": "Etiqueta eliminada con éxito",
"noTagSelected": "Ninguna etiqueta seleccionada",
"changeNameToEdit": "Cambia el nombre para hacer una actualización",
"selectTag": "Seleccionar etiqueta",
"collapse": "Colapsar",
"expand": "Expandir",
"tagNamePlaceholder": "Escribe el nombre de la etiqueta",
"allTags": "Todas las etiquetas"
},
"userListCard": {
"joined": "Unido",
Expand Down
24 changes: 22 additions & 2 deletions public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,31 @@
"subTags": "子标签",
"assignedToAll": "标签分配给所有人",
"successfullyAssignedToPeople": "标签分配成功",
"assignPeople": "分配",
"errorOccurredWhileLoadingMembers": "加载成员时出错",
"userName": "用户名",
"actions": "操作",
"noOneSelected": "未选择任何人"
"noOneSelected": "未选择任何人",
"assignToTags": "分配到标签",
"removeFromTags": "从标签中移除",
"assign": "分配",
"remove": "移除",
"successfullyAssignedToTags": "成功分配到标签",
"successfullyRemovedFromTags": "成功从标签中移除",
"errorOccurredWhileLoadingOrganizationUserTags": "加载组织标签时出错",
"errorOccurredWhileLoadingSubTags": "加载子标签时发生错误",
"removeUserTag": "删除标签",
"removeUserTagMessage": "您要删除此标签吗?这将删除所有子标签和所有关联。",
"tagDetails": "标签详情",
"tagName": "名称",
"tagUpdationSuccess": "标签更新成功",
"tagRemovalSuccess": "标签删除成功",
"noTagSelected": "未选择标签",
"changeNameToEdit": "更改名称以进行更新",
"selectTag": "选择标签",
"collapse": "收起",
"expand": "展开",
"tagNamePlaceholder": "输入标签名称",
"allTags": "所有标签"
},
"userListCard": {
"addAdmin": "添加管理员",
Expand Down
34 changes: 34 additions & 0 deletions src/GraphQl/Mutations/TagMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,37 @@ export const ADD_PEOPLE_TO_TAG = gql`
}
}
`;

/**
* GraphQL mutation to assign people to multiple tags.
*
* @param currentTagId - Id of the current tag.
* @param selectedTagIds - Ids of the selected tags to be assined.
*/

export const ASSIGN_TO_TAGS = gql`
mutation AssignToUserTags($currentTagId: ID!, $selectedTagIds: [ID!]!) {
assignToUserTags(
input: { currentTagId: $currentTagId, selectedTagIds: $selectedTagIds }
) {
_id
}
}
`;

/**
* GraphQL mutation to remove people from multiple tags.
*
* @param currentTagId - Id of the current tag.
* @param selectedTagIds - Ids of the selected tags to be removed from.
*/

export const REMOVE_FROM_TAGS = gql`
mutation RemoveFromUserTags($currentTagId: ID!, $selectedTagIds: [ID!]!) {
removeFromUserTags(
input: { currentTagId: $currentTagId, selectedTagIds: $selectedTagIds }
) {
_id
}
}
`;
2 changes: 1 addition & 1 deletion src/components/AddPeopleToTag/AddPeopleToTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
variant="primary"
data-testid="assignPeopleBtn"
>
{t('assignPeople')}
{t('assign')}
</Button>
</Modal.Footer>
</Form>
Expand Down
Loading
Loading