Skip to content

Commit

Permalink
Added support to add members in an organization (PalisadoesFoundation…
Browse files Browse the repository at this point in the history
…#1719)

* Add support to add member to an org

* Implemented logic to register and add member to the organization

* improve code coverage

* removed unwanted code

* fix: failing tests

* implemented separate component for add member functionality

* fix: formatting issues
  • Loading branch information
disha1202 authored Mar 13, 2024
1 parent 822fbcb commit 42a225e
Show file tree
Hide file tree
Showing 12 changed files with 1,141 additions and 50 deletions.
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
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts
- name: Get changed TypeScript files
id: changed-files
Expand Down
19 changes: 18 additions & 1 deletion public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,24 @@
"searchFullName": "Enter Full Name",
"people": "People",
"sort": "Search by Role",
"actions": "Actions"
"actions": "Actions",
"addMembers": "Add Members",
"existingUser": "Existing User",
"newUser": "New User",
"firstName": "First Name",
"enterFirstName": "Enter your first name",
"lastName": "Last Name",
"enterLastName": "Enter your last name",
"emailAddress": "Email Address",
"enterEmail": "Enter your email address",
"password": "Password",
"enterPassword": "Enter your password",
"confirmPassword": "Confirm Password",
"enterConfirmPassword": "Enter your password to confirm",
"organization": "Organization",
"create": "Create",
"cancel": "Cancel",
"invalidDetailsMessage": "Please enter valid details."
},
"userListCard": {
"joined": "Joined",
Expand Down
18 changes: 17 additions & 1 deletion public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,23 @@
"searchLastName": "Entrer le nom de famille",
"people": "Personnes",
"sort": "Trier par rôle",
"actions": "Actions"
"actions": "Actions",
"existingUser": "utilisateur existant",
"newUser": "Nouvel Utilisateur",
"firstName": "Prénom",
"enterFirstName": "Entrez votre prénom",
"lastName": "Nom de famille",
"enterLastName": "Entrez votre nom de famille",
"emailAddress": "Email Address",
"enterEmail": "Entrez votre adresse email",
"password": "Mot de passe",
"enterPassword": "Tapez votre mot de passe",
"confirmPassword": "Confirmez le mot de passe",
"enterConfirmPassword": "Entrez votre mot de passe pour confirmer",
"organization": "Organization",
"create": "Créer",
"cancel": "Annuler",
"invalidDetailsMessage": "Veuillez entrer des détails valides."
},
"userListCard": {
"joined": "Inscrit",
Expand Down
18 changes: 17 additions & 1 deletion public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,23 @@
"searchLastName": "अंतिम नाम दर्ज करो",
"people": "लोग",
"sort": "भूमिका के आधार पर खोजें",
"actions": "क्रियाएँ"
"actions": "क्रियाएँ",
"existingUser": "मौजूदा उपयोगकर्ता",
"newUser": "नए उपयोगकर्ता",
"firstName": "पहला नाम",
"enterFirstName": "अपना पहला नाम दर्ज करें",
"lastName": "अंतिम नाम",
"enterLastName": "अपना अंतिम नाम दर्ज करें",
"emailAddress": "ईमेल एड्रेस",
"enterEmail": "अपना ईमेल पता दर्ज करें",
"password": "पासवर्ड",
"enterPassword": "अपना पासवर्ड डालें",
"confirmPassword": "पासवर्ड की पुष्टि कीजिये",
"enterConfirmPassword": "पुष्टि करने के लिए अपना पासवर्ड दर्ज करें",
"organization": "संगठन",
"create": "बनाएं",
"cancel": "रद्द करना",
"invalidDetailsMessage": "कृपया मान्य विवरण दर्ज करें।"
},
"userListCard": {
"joined": "में शामिल हो गए",
Expand Down
18 changes: 17 additions & 1 deletion public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,23 @@
"searchLastName": "Introduzca el apellido",
"people": "Personas",
"sort": "Ordenar por Rol",
"actions": "Acciones"
"actions": "Acciones",
"existingUser": "Usuario existente",
"newUser": "Nuevo usuario",
"firstName": "Nombre de pila",
"enterFirstName": "Ponga su primer nombre",
"lastName": "Apellido",
"enterLastName": "Ingresa tu apellido",
"emailAddress": "correo electrónico",
"enterEmail": "Ingrese su dirección de correo electrónico",
"password": "Contraseña",
"enterPassword": "Ingresa tu contraseña",
"confirmPassword": "confirmar Contraseña",
"enterConfirmPassword": "Ingrese su contraseña para confirmar",
"organization": "Organización",
"create": "Crear",
"cancel": "Cancelar",
"invalidDetailsMessage": "Ingrese detalles válidos."
},
"userListCard": {
"joined": "Unido",
Expand Down
18 changes: 17 additions & 1 deletion public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,23 @@
"searchLastName": "输入姓氏",
"people": "",
"sort": "按角色搜索",
"actions": "操作"
"actions": "操作",
"existingUser": "现有用户",
"newUser": "新用户",
"firstName": "",
"enterFirstName": "輸入您的名字",
"lastName": "",
"enterLastName": "輸入您的姓氏",
"emailAddress": "電子郵件地址",
"enterEmail": "輸入你的電子郵箱地址",
"password": "密碼",
"enterPassword": "輸入您的密碼",
"confirmPassword": "確認密碼",
"enterConfirmPassword": "輸入您的密碼以確認",
"organization": "組織",
"create": "創造",
"cancel": "取消",
"invalidDetailsMessage": "請輸入有效的詳細信息。"
},
"userListCard": {
"joined": "加入",
Expand Down
8 changes: 8 additions & 0 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ export const ADD_ADMIN_MUTATION = gql`
}
`;

export const ADD_MEMBER_MUTATION = gql`
mutation CreateMember($orgid: ID!, $userid: ID!) {
createMember(input: { organizationId: $orgid, userId: $userid }) {
_id
}
}
`;

export const CREATE_POST_MUTATION = gql`
mutation CreatePost(
$text: String!
Expand Down
76 changes: 76 additions & 0 deletions src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,82 @@ export const MEMBERSHIP_REQUEST = gql`
}
`;

export const USERS_CONNECTION_LIST = gql`
query usersConnection(
$id_not_in: [ID!]
$firstName_contains: String
$lastName_contains: String
) {
users(
where: {
id_not_in: $id_not_in
firstName_contains: $firstName_contains
lastName_contains: $lastName_contains
}
) {
firstName
lastName
image
_id
email
userType
adminApproved
adminFor {
_id
}
createdAt
organizationsBlockedBy {
_id
name
image
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
createdAt
creator {
_id
firstName
lastName
image
email
createdAt
}
}
joinedOrganizations {
_id
name
image
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
createdAt
creator {
_id
firstName
lastName
image
email
createdAt
}
}
}
}
`;

// get the list of Action Item Categories
export { ACTION_ITEM_CATEGORY_LIST } from './ActionItemCategoryQueries';

Expand Down
Loading

0 comments on commit 42a225e

Please sign in to comment.