Skip to content

Commit

Permalink
Action item category (#1578)
Browse files Browse the repository at this point in the history
* add mutations and queries

* add translations

* add tests

* add dropdown for toggling settings on small screens

* minor corrections

* minor change

* minor change and refactor

* Update documentation

* Revert "Update documentation"

This reverts commit 13a638b.

* Update documentation

* Revert "Update documentation"

This reverts commit 4293627.

* Update documentation

* Revert "Update documentation"

This reverts commit bddc63d.

* add wait to tests
  • Loading branch information
meetulr authored Feb 11, 2024
1 parent 6c44d96 commit 558c475
Show file tree
Hide file tree
Showing 16 changed files with 1,187 additions and 44 deletions.
17 changes: 17 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@
"orgSettings": {
"title": "Talawa Setting",
"pageName": "Settings",
"general": "General",
"actionItemCategories": "Action Item Categories",
"updateOrganization": "Update Organization",
"seeRequest": "See Request",
"settings": "Settings",
Expand Down Expand Up @@ -742,5 +744,20 @@
"Remove Custom Field": "Remove Custom Field",
"fieldSuccessMessage": "Field added successfully",
"fieldRemovalSuccess": "Field removed successfully"
},
"orgActionItemCategories": {
"createButton": "Create",
"editButton": "Edit",
"enableButton": "Enable",
"disableButton": "Disable",
"updateActionItemCategory": "Update",
"actionItemCategoryName": "Name",
"actionItemCategoryDetails": "Action Item Category Details",
"enterName": "Enter Name",
"successfulCreation": "Action Item Category created successfully",
"successfulUpdation": "Action Item Category updated successfully",
"sameNameConflict": "Please change the name to make an update",
"categoryEnabled": "Action Item Category Enabled",
"categoryDisabled": "Action Item Category Disabled"
}
}
17 changes: 17 additions & 0 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@
"orgSettings": {
"title": "Paramètre Talawa",
"pageName": "Paramètres",
"general": "Général",
"actionItemCategories": "Catégories d’éléments d’action",
"updateYourDetails": "Mettre à jour vos informations",
"updateYourPassword": "Mettez à jour votre mot de passe",
"updateOrganization": "Mettre à jour l'organisation",
Expand Down Expand Up @@ -727,5 +729,20 @@
"Supprimer le champ personnalisé": "Supprimer le champ personnalisé",
"fieldSuccessMessage": "Champ ajouté avec succès",
"fieldRemovalSuccess": "Champ supprimé avec succès"
},
"orgActionItemCategories": {
"createButton": "Créez",
"editButton": "Éditez",
"enableButton": "Activez",
"disableButton": "Désactivez",
"updateActionItemCategory": "Mettre à jour",
"actionItemCategoryName": "Nom",
"actionItemCategoryDetails": "Détails de la catégorie d’élément d’action",
"enterName": "Entrez le nom",
"successfulCreation": "Catégorie d’élément d’action créée avec succès",
"successfulUpdation": "La catégorie d’élément d’action a été mise à jour avec succès",
"sameNameConflict": "Veuillez modifier le nom pour effectuer une mise à jour",
"categoryEnabled": "Catégorie d’action activée",
"categoryDisabled": "Catégorie d’action désactivée"
}
}
17 changes: 17 additions & 0 deletions public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@
"orgSettings": {
"title": "तलावा सेटिंग",
"pageName": "सेटिंग्स",
"general": "सामान्य",
"actionItemCategories": "कार्रवाई आइटम श्रेणियाँ",
"updateYourDetails": "अपना विवरण अपडेट करें",
"updateYourPassword": "अपना पासवर्ड अपडेट करें",
"updateOrganization": "अद्यतन संगठन",
Expand Down Expand Up @@ -728,5 +730,20 @@
"Remove Custom Field": "कस्टम फ़ील्ड हटाएँ",
"fieldSuccessMessage": "फ़ील्ड सफलतापूर्वक जोड़ा गया",
"fieldRemovalSuccess": "फ़ील्ड सफलतापूर्वक हटा दिया गया"
},
"orgActionItemCategories": {
"createButton": "बनाएं",
"editButton": "संपादित करें",
"enableButton": "सक्षम करें",
"disableButton": "अक्षम करें",
"updateActionItemCategory": "अद्यतन करें",
"actionItemCategoryName": "नाम",
"actionItemCategoryDetails": "कार्रवाई आइटम श्रेणी विवरण",
"enterName": "नाम दर्ज करें",
"successfulCreation": "कार्रवाई आइटम श्रेणी सफलतापूर्वक बनाई गई",
"successfulUpdation": "क्रिया आइटम श्रेणी सफलतापूर्वक अद्यतन की गई",
"sameNameConflict": "अपडेट करने के लिए कृपया नाम बदलें",
"categoryEnabled": "कार्रवाई आइटम श्रेणी सक्षम",
"categoryDisabled": "क्रिया आइटम श्रेणी अक्षम की गई"
}
}
17 changes: 17 additions & 0 deletions public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@
"orgSettings": {
"title": "Configuración Talawa",
"pageName": "Configuración",
"general": "General",
"actionItemCategories": "Categorías de elementos de acción",
"updateYourDetails": "Actualiza tus datos",
"updateYourPassword": "Actualice su contraseña",
"updateOrganization": "Actualizar Organización",
Expand Down Expand Up @@ -727,5 +729,20 @@
"Remove Custom Field": "Eliminar Campo Personalizado",
"fieldSuccessMessage": "Campo añadido exitosamente",
"fieldRemovalSuccess": "Campo eliminado exitosamente"
},
"orgActionItemCategories": {
"createButton": "Crear",
"editButton": "Editar",
"enableButton": "Habilitar",
"disableButton": "Inhabilitar",
"updateActionItemCategory": "Actualizar",
"actionItemCategoryName": "Nombre",
"actionItemCategoryDetails": "Detalles de la categoría de elemento de acción",
"enterName": "Introduzca el nombre",
"successfulCreation": "Categoría de elemento de acción creada correctamente",
"successfulUpdation": "Categoría de elemento de acción actualizada correctamente",
"sameNameConflict": "Cambie el nombre para realizar una actualización",
"categoryEnabled": "Categoría de elemento de acción habilitada",
"categoryDisabled": "Categoría de elemento de acción deshabilitada"
}
}
17 changes: 17 additions & 0 deletions public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@
"orgSettings": {
"title": "塔拉瓦設置",
"pageName": "设置",
"general": "一般",
"actionItemCategories": "措施项类别",
"updateYourDetails": "更新您的詳細信息",
"updateYourPassword": "更新您的密碼",
"updateOrganization": "更新組織",
Expand Down Expand Up @@ -728,5 +730,20 @@
"删除自定义字段": "删除自定义字段",
"fieldSuccessMessage": "字段添加成功",
"fieldRemovalSuccess": "字段删除成功"
},
"orgActionItemCategories": {
"createButton": "创建",
"editButton": "编辑",
"enableButton": "启用",
"disableButton": "禁用",
"updateActionItemCategory": "更新",
"actionItemCategoryName": "名称",
"actionItemCategoryDetails": "措施项类别详细信息",
"enterName": "输入名称",
"successfulCreation": "已成功创建措施项类别",
"successfulUpdation": "措施项类别已成功更新",
"sameNameConflict": "请更改名称以进行更新",
"categoryEnabled": "已启用措施项类别",
"categoryDisabled": "措施项类别已禁用"
}
}
27 changes: 27 additions & 0 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,33 @@ export const DELETE_ORGANIZATION_MUTATION = gql`
}
`;

// to create an action item category

export const CREATE_ACTION_ITEM_CATEGORY_MUTATION = gql`
mutation CreateActionItemCategory($name: String!, $organizationId: ID!) {
createActionItemCategory(name: $name, organizationId: $organizationId) {
_id
}
}
`;

// to update an action item category

export const UPDATE_ACTION_ITEM_CATEGORY_MUTATION = gql`
mutation UpdateActionItemCategory(
$actionItemCategoryId: ID!
$name: String
$isDisabled: Boolean
) {
updateActionItemCategory(
id: $actionItemCategoryId
data: { name: $name, isDisabled: $isDisabled }
) {
_id
}
}
`;

// to create the event by any organization

export const CREATE_EVENT_MUTATION = gql`
Expand Down
12 changes: 12 additions & 0 deletions src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ export const ORGANIZATION_CONNECTION_LIST = gql`
}
`;

// Query to get the action item category list

export const ACTION_ITEM_CATEGORY_LIST = gql`
query ActionItemCategoriesByOrganization($organizationId: ID!) {
actionItemCategoriesByOrganization(organizationId: $organizationId) {
_id
name
isDisabled
}
}
`;

// Query to take the User list
export const USER_LIST = gql`
query Users(
Expand Down
2 changes: 1 addition & 1 deletion src/components/DeleteOrg/DeleteOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function deleteOrg(): JSX.Element {
return (
<>
{canDelete && (
<Card border="0" className="rounded-4 mb-4">
<Card className="rounded-4 shadow-sm mb-4 border border-light-subtle">
<div className={styles.cardHeader}>
<div className={styles.cardTitle}>{t('deleteOrganization')}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.addButton {
width: 7em;
position: absolute;
right: 1rem;
top: 1rem;
}

.createModal {
margin-top: 20vh;
margin-left: 13vw;
max-width: 80vw;
}

.icon {
transform: scale(1.5);
color: var(--bs-danger);
margin-bottom: 1rem;
}

.message {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}

.titlemodal {
color: var(--bs-gray-600);
font-weight: 600;
font-size: 20px;
margin-top: 1rem;
width: 65%;
}
Loading

0 comments on commit 558c475

Please sign in to comment.