diff --git a/.eslintignore b/.eslintignore index 6aa531a34c..713cf58aa6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,6 +5,7 @@ package-lock.json tsconfig.json fix-readme-links.js fix-repo-url.js +schema.graphql # Ignore the Docusaurus website subdirectory docs/** diff --git a/docs/docs/auto-docs/App/functions/default.md b/docs/docs/auto-docs/App/functions/default.md index 3678b5e827..f25a6b1976 100644 --- a/docs/docs/auto-docs/App/functions/default.md +++ b/docs/docs/auto-docs/App/functions/default.md @@ -10,7 +10,7 @@ Defined in: [src/App.tsx:74](https://github.com/PalisadoesFoundation/talawa-admi This is the main function for our application. It sets up all the routes and components, defining how the user can navigate through the app. The function uses React Router's `Routes` -and `Route` components to map different URL paths to corresponding screens and components. +and `Route` components to map different URL paths to corresponding screens and components. ## Important Details - **UseEffect Hook**: This hook checks user authentication status using the `CHECK_AUTH` GraphQL query. diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADMIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADMIN_MUTATION.md index 083e3de63d..6890e98814 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADMIN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADMIN_MUTATION.md @@ -6,4 +6,4 @@ > `const` **ADD\_ADMIN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:351](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L351) +Defined in: [src/GraphQl/Mutations/mutations.ts:313](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L313) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADVERTISEMENT_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADVERTISEMENT_MUTATION.md index ed293629a9..c0f2b2a86d 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADVERTISEMENT_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADVERTISEMENT_MUTATION.md @@ -6,4 +6,4 @@ > `const` **ADD\_ADVERTISEMENT\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:486](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L486) +Defined in: [src/GraphQl/Mutations/mutations.ts:448](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L448) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_MEMBER_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_MEMBER_MUTATION.md index b4087e790a..87caa52d78 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_MEMBER_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_MEMBER_MUTATION.md @@ -6,4 +6,4 @@ > `const` **ADD\_MEMBER\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:361](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L361) +Defined in: [src/GraphQl/Mutations/mutations.ts:323](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L323) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_PLUGIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_PLUGIN_MUTATION.md index e60fc3d095..8459fd8f00 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_PLUGIN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_PLUGIN_MUTATION.md @@ -6,7 +6,7 @@ > `const` **ADD\_PLUGIN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:468](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L468) +Defined in: [src/GraphQl/Mutations/mutations.ts:430](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L430) ## Remarks diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_EVENT_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_EVENT_MUTATION.md index 6be8bf0750..caea9d5140 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_EVENT_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_EVENT_MUTATION.md @@ -6,4 +6,4 @@ > `const` **CREATE\_EVENT\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:265](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L265) +Defined in: [src/GraphQl/Mutations/mutations.ts:227](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L227) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_ORGANIZATION_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_ORGANIZATION_MUTATION.md index 5ec9601ca2..9f761c38b0 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_ORGANIZATION_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_ORGANIZATION_MUTATION.md @@ -6,4 +6,4 @@ > `const` **CREATE\_ORGANIZATION\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:227](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L227) +Defined in: [src/GraphQl/Mutations/mutations.ts:189](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L189) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_POST_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_POST_MUTATION.md index d9f159e0f9..192f77eb1d 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_POST_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_POST_MUTATION.md @@ -6,4 +6,4 @@ > `const` **CREATE\_POST\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:371](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L371) +Defined in: [src/GraphQl/Mutations/mutations.ts:333](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L333) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ADVERTISEMENT_BY_ID.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ADVERTISEMENT_BY_ID.md index cb4dd14d0e..02bea93d78 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ADVERTISEMENT_BY_ID.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ADVERTISEMENT_BY_ID.md @@ -6,4 +6,4 @@ > `const` **DELETE\_ADVERTISEMENT\_BY\_ID**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:536](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L536) +Defined in: [src/GraphQl/Mutations/mutations.ts:498](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L498) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_EVENT_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_EVENT_MUTATION.md index a66eb9ddac..e64e13bb1f 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_EVENT_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_EVENT_MUTATION.md @@ -6,4 +6,4 @@ > `const` **DELETE\_EVENT\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:321](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L321) +Defined in: [src/GraphQl/Mutations/mutations.ts:283](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L283) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ORGANIZATION_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ORGANIZATION_MUTATION.md index 5ffd5c21fc..d7770974c5 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ORGANIZATION_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_ORGANIZATION_MUTATION.md @@ -6,4 +6,4 @@ > `const` **DELETE\_ORGANIZATION\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:253](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L253) +Defined in: [src/GraphQl/Mutations/mutations.ts:215](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L215) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_POST_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_POST_MUTATION.md index aeff2c39a4..972265a03e 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_POST_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_POST_MUTATION.md @@ -6,4 +6,4 @@ > `const` **DELETE\_POST\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:397](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L397) +Defined in: [src/GraphQl/Mutations/mutations.ts:359](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L359) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DONATE_TO_ORGANIZATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DONATE_TO_ORGANIZATION.md index cdb5361b35..ce01cef20c 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DONATE_TO_ORGANIZATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DONATE_TO_ORGANIZATION.md @@ -6,4 +6,4 @@ > `const` **DONATE\_TO\_ORGANIZATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:663](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L663) +Defined in: [src/GraphQl/Mutations/mutations.ts:625](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L625) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/FORGOT_PASSWORD_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/FORGOT_PASSWORD_MUTATION.md index 52d64c0298..1b83c7e9e9 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/FORGOT_PASSWORD_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/FORGOT_PASSWORD_MUTATION.md @@ -6,4 +6,4 @@ > `const` **FORGOT\_PASSWORD\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:413](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L413) +Defined in: [src/GraphQl/Mutations/mutations.ts:375](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L375) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GENERATE_OTP_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GENERATE_OTP_MUTATION.md index cf77ebe1b1..6e82341a57 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GENERATE_OTP_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GENERATE_OTP_MUTATION.md @@ -6,4 +6,4 @@ > `const` **GENERATE\_OTP\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:405](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L405) +Defined in: [src/GraphQl/Mutations/mutations.ts:367](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L367) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LIKE_POST.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LIKE_POST.md index 5eb02eeeff..84ca8a746e 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LIKE_POST.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LIKE_POST.md @@ -6,4 +6,4 @@ > `const` **LIKE\_POST**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:621](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L621) +Defined in: [src/GraphQl/Mutations/mutations.ts:583](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L583) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LOGIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LOGIN_MUTATION.md deleted file mode 100644 index 78c780b315..0000000000 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LOGIN_MUTATION.md +++ /dev/null @@ -1,9 +0,0 @@ -[Admin Docs](/) - -*** - -# Variable: LOGIN\_MUTATION - -> `const` **LOGIN\_MUTATION**: `DocumentNode` - -Defined in: [src/GraphQl/Mutations/mutations.ts:175](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L175) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RECAPTCHA_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RECAPTCHA_MUTATION.md index dd8d6b25a8..8f23e103be 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RECAPTCHA_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RECAPTCHA_MUTATION.md @@ -6,4 +6,4 @@ > `const` **RECAPTCHA\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:219](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L219) +Defined in: [src/GraphQl/Mutations/mutations.ts:181](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L181) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REFRESH_TOKEN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REFRESH_TOKEN_MUTATION.md index 0b51e6631f..07bbbe0f02 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REFRESH_TOKEN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REFRESH_TOKEN_MUTATION.md @@ -6,4 +6,4 @@ > `const` **REFRESH\_TOKEN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:200](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L200) +Defined in: [src/GraphQl/Mutations/mutations.ts:162](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L162) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REGISTER_EVENT.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REGISTER_EVENT.md index 976bd18f9c..865c1e3839 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REGISTER_EVENT.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REGISTER_EVENT.md @@ -6,4 +6,4 @@ > `const` **REGISTER\_EVENT**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:637](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L637) +Defined in: [src/GraphQl/Mutations/mutations.ts:599](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L599) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_ADMIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_ADMIN_MUTATION.md index 460547fa64..450e3bb7b9 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_ADMIN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_ADMIN_MUTATION.md @@ -6,4 +6,4 @@ > `const` **REMOVE\_ADMIN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:333](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L333) +Defined in: [src/GraphQl/Mutations/mutations.ts:295](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L295) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION.md index 5a27bc8fc1..3dac8a023d 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION.md @@ -6,4 +6,4 @@ > `const` **REMOVE\_MEMBER\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:342](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L342) +Defined in: [src/GraphQl/Mutations/mutations.ts:304](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L304) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RESET_COMMUNITY.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RESET_COMMUNITY.md index 2aaa83a80d..aefb3f277d 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RESET_COMMUNITY.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RESET_COMMUNITY.md @@ -6,4 +6,4 @@ > `const` **RESET\_COMMUNITY**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:657](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L657) +Defined in: [src/GraphQl/Mutations/mutations.ts:619](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L619) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REVOKE_REFRESH_TOKEN.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REVOKE_REFRESH_TOKEN.md index 5afdb06c14..55089850ff 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REVOKE_REFRESH_TOKEN.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REVOKE_REFRESH_TOKEN.md @@ -6,4 +6,4 @@ > `const` **REVOKE\_REFRESH\_TOKEN**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:211](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L211) +Defined in: [src/GraphQl/Mutations/mutations.ts:173](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L173) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UNLIKE_POST.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UNLIKE_POST.md index 19bcfd95f6..6039c94f94 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UNLIKE_POST.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UNLIKE_POST.md @@ -6,4 +6,4 @@ > `const` **UNLIKE\_POST**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:629](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L629) +Defined in: [src/GraphQl/Mutations/mutations.ts:591](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L591) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ADVERTISEMENT_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ADVERTISEMENT_MUTATION.md index 972d6a7f1f..580dc6b1e9 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ADVERTISEMENT_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ADVERTISEMENT_MUTATION.md @@ -6,4 +6,4 @@ > `const` **UPDATE\_ADVERTISEMENT\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:511](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L511) +Defined in: [src/GraphQl/Mutations/mutations.ts:473](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L473) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_COMMUNITY.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_COMMUNITY.md index e8231bb6f2..c3a48c653f 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_COMMUNITY.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_COMMUNITY.md @@ -6,4 +6,4 @@ > `const` **UPDATE\_COMMUNITY**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:645](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L645) +Defined in: [src/GraphQl/Mutations/mutations.ts:607](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L607) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_EVENT_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_EVENT_MUTATION.md index d4539390a2..de9af1adbd 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_EVENT_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_EVENT_MUTATION.md @@ -6,4 +6,4 @@ > `const` **UPDATE\_EVENT\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:567](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L567) +Defined in: [src/GraphQl/Mutations/mutations.ts:529](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L529) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_INSTALL_STATUS_PLUGIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_INSTALL_STATUS_PLUGIN_MUTATION.md index f82633e1be..6f0e6aecb8 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_INSTALL_STATUS_PLUGIN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_INSTALL_STATUS_PLUGIN_MUTATION.md @@ -6,7 +6,7 @@ > `const` **UPDATE\_INSTALL\_STATUS\_PLUGIN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:434](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L434) +Defined in: [src/GraphQl/Mutations/mutations.ts:396](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L396) ## Remarks diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ORG_STATUS_PLUGIN_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ORG_STATUS_PLUGIN_MUTATION.md index 8a01473093..fc80fc6cb5 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ORG_STATUS_PLUGIN_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_ORG_STATUS_PLUGIN_MUTATION.md @@ -6,7 +6,7 @@ > `const` **UPDATE\_ORG\_STATUS\_PLUGIN\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:451](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L451) +Defined in: [src/GraphQl/Mutations/mutations.ts:413](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L413) ## Remarks diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_POST_MUTATION.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_POST_MUTATION.md index 3cb45932d7..9f6eb142bf 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_POST_MUTATION.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_POST_MUTATION.md @@ -6,4 +6,4 @@ > `const` **UPDATE\_POST\_MUTATION**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:545](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L545) +Defined in: [src/GraphQl/Mutations/mutations.ts:507](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L507) diff --git a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_SESSION_TIMEOUT.md b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_SESSION_TIMEOUT.md index 4efa3bdc4a..90de7c8d11 100644 --- a/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_SESSION_TIMEOUT.md +++ b/docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_SESSION_TIMEOUT.md @@ -6,4 +6,4 @@ > `const` **UPDATE\_SESSION\_TIMEOUT**: `DocumentNode` -Defined in: [src/GraphQl/Mutations/mutations.ts:651](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L651) +Defined in: [src/GraphQl/Mutations/mutations.ts:613](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Mutations/mutations.ts#L613) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ADMIN_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ADMIN_LIST.md index 8c617220d6..c033aac815 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ADMIN_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ADMIN_LIST.md @@ -6,4 +6,4 @@ > `const` **ADMIN\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:707](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L707) +Defined in: [src/GraphQl/Queries/Queries.ts:690](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L690) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/BLOCK_PAGE_MEMBER_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/BLOCK_PAGE_MEMBER_LIST.md index da210cc22b..dc70be9335 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/BLOCK_PAGE_MEMBER_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/BLOCK_PAGE_MEMBER_LIST.md @@ -6,4 +6,4 @@ > `const` **BLOCK\_PAGE\_MEMBER\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:451](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L451) +Defined in: [src/GraphQl/Queries/Queries.ts:434](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L434) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CHECK_AUTH.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CHECK_AUTH.md deleted file mode 100644 index 77f5b7819b..0000000000 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CHECK_AUTH.md +++ /dev/null @@ -1,9 +0,0 @@ -[Admin Docs](/) - -*** - -# Variable: CHECK\_AUTH - -> `const` **CHECK\_AUTH**: `DocumentNode` - -Defined in: [src/GraphQl/Queries/Queries.ts:5](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L5) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CURRENT_USER.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CURRENT_USER.md new file mode 100644 index 0000000000..1412adaf23 --- /dev/null +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/CURRENT_USER.md @@ -0,0 +1,9 @@ +[Admin Docs](/) + +*** + +# Variable: CURRENT\_USER + +> `const` **CURRENT\_USER**: `DocumentNode` + +Defined in: [src/GraphQl/Queries/Queries.ts:6](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L6) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_ATTENDEES.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_ATTENDEES.md index 7d74c2bf6b..cd9bcc1198 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_ATTENDEES.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_ATTENDEES.md @@ -6,4 +6,4 @@ > `const` **EVENT\_ATTENDEES**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:313](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L313) +Defined in: [src/GraphQl/Queries/Queries.ts:296](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L296) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_CHECKINS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_CHECKINS.md index 3c969bd1d5..3e49d51daa 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_CHECKINS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_CHECKINS.md @@ -6,4 +6,4 @@ > `const` **EVENT\_CHECKINS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:341](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L341) +Defined in: [src/GraphQl/Queries/Queries.ts:324](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L324) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_DETAILS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_DETAILS.md index cd6dc1d150..53a5482774 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_DETAILS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_DETAILS.md @@ -6,4 +6,4 @@ > `const` **EVENT\_DETAILS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:268](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L268) +Defined in: [src/GraphQl/Queries/Queries.ts:251](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L251) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_FEEDBACKS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_FEEDBACKS.md index 379b21dc26..55ae0f27a3 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_FEEDBACKS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_FEEDBACKS.md @@ -6,4 +6,4 @@ > `const` **EVENT\_FEEDBACKS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:361](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L361) +Defined in: [src/GraphQl/Queries/Queries.ts:344](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L344) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_REGISTRANTS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_REGISTRANTS.md index c31c282270..48808a454a 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_REGISTRANTS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_REGISTRANTS.md @@ -6,4 +6,4 @@ > `const` **EVENT\_REGISTRANTS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:331](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L331) +Defined in: [src/GraphQl/Queries/Queries.ts:314](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L314) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA.md index 0d2f47aa40..4b87c7eaf9 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA.md @@ -6,4 +6,4 @@ > `const` **GET\_COMMUNITY\_DATA**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:839](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L839) +Defined in: [src/GraphQl/Queries/Queries.ts:822](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L822) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_SESSION_TIMEOUT_DATA.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_SESSION_TIMEOUT_DATA.md index 6b9749297f..6ac5288945 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_SESSION_TIMEOUT_DATA.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_SESSION_TIMEOUT_DATA.md @@ -6,4 +6,4 @@ > `const` **GET\_COMMUNITY\_SESSION\_TIMEOUT\_DATA**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:860](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L860) +Defined in: [src/GraphQl/Queries/Queries.ts:858](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L858) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERSHIP_REQUEST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERSHIP_REQUEST.md index 2cb135e6b3..82c17a022b 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERSHIP_REQUEST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERSHIP_REQUEST.md @@ -6,4 +6,4 @@ > `const` **MEMBERSHIP\_REQUEST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:724](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L724) +Defined in: [src/GraphQl/Queries/Queries.ts:707](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L707) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST.md index 6f5bf3323e..84a2abac35 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST.md @@ -6,4 +6,4 @@ > `const` **MEMBERS\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:432](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L432) +Defined in: [src/GraphQl/Queries/Queries.ts:415](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L415) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_LIST.md index 2feeac046a..edfccaccba 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATIONS\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:376](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L376) +Defined in: [src/GraphQl/Queries/Queries.ts:359](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L359) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_MEMBER_CONNECTION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_MEMBER_CONNECTION_LIST.md index 3ebd01c06d..213178d0e5 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_MEMBER_CONNECTION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_MEMBER_CONNECTION_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATIONS\_MEMBER\_CONNECTION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:478](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L478) +Defined in: [src/GraphQl/Queries/Queries.ts:461](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L461) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_CONNECTION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_CONNECTION_LIST.md index f439cfcc6d..2f8ec61bb7 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_CONNECTION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_CONNECTION_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATION\_CONNECTION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:67](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L67) +Defined in: [src/GraphQl/Queries/Queries.ts:50](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L50) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_DONATION_CONNECTION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_DONATION_CONNECTION_LIST.md index b81e1203de..f7a86de7d2 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_DONATION_CONNECTION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_DONATION_CONNECTION_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATION\_DONATION\_CONNECTION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:686](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L686) +Defined in: [src/GraphQl/Queries/Queries.ts:669](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L669) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_CONNECTION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_CONNECTION_LIST.md index 0b9d57cb15..9a817c9f1b 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_CONNECTION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_CONNECTION_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATION\_EVENT\_CONNECTION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:630](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L630) +Defined in: [src/GraphQl/Queries/Queries.ts:613](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L613) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_LIST.md index 3d61032105..5a23d6b535 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATION\_EVENT\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:611](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L611) +Defined in: [src/GraphQl/Queries/Queries.ts:594](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L594) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_LIST.md index 111eff9a3e..5c93e88d6b 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_LIST.md @@ -6,4 +6,4 @@ > `const` **ORGANIZATION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:35](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L35) +Defined in: [src/GraphQl/Queries/Queries.ts:18](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L18) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/RECURRING_EVENTS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/RECURRING_EVENTS.md index 287683559a..d750a0aea1 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/RECURRING_EVENTS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/RECURRING_EVENTS.md @@ -6,4 +6,4 @@ > `const` **RECURRING\_EVENTS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:299](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L299) +Defined in: [src/GraphQl/Queries/Queries.ts:282](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L282) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/SIGNIN_QUERY.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/SIGNIN_QUERY.md new file mode 100644 index 0000000000..fda4a8da4d --- /dev/null +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/SIGNIN_QUERY.md @@ -0,0 +1,9 @@ +[Admin Docs](/) + +*** + +# Variable: SIGNIN\_QUERY + +> `const` **SIGNIN\_QUERY**: `DocumentNode` + +Defined in: [src/GraphQl/Queries/Queries.ts:842](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L842) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USERS_CONNECTION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USERS_CONNECTION_LIST.md index 259df21ced..aac80f6102 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USERS_CONNECTION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USERS_CONNECTION_LIST.md @@ -6,4 +6,4 @@ > `const` **USERS\_CONNECTION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:750](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L750) +Defined in: [src/GraphQl/Queries/Queries.ts:733](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L733) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_DETAILS.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_DETAILS.md index 21c5e0d2b9..be5b6a619b 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_DETAILS.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_DETAILS.md @@ -6,4 +6,4 @@ > `const` **USER\_DETAILS**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:522](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L522) +Defined in: [src/GraphQl/Queries/Queries.ts:505](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L505) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST.md index 3a8870fe3f..2e33aff19a 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST.md @@ -6,4 +6,4 @@ > `const` **USER\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:109](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L109) +Defined in: [src/GraphQl/Queries/Queries.ts:92](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L92) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_FOR_TABLE.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_FOR_TABLE.md index 0df8540eea..aa1e26ccca 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_FOR_TABLE.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_FOR_TABLE.md @@ -6,4 +6,4 @@ > `const` **USER\_LIST\_FOR\_TABLE**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:205](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L205) +Defined in: [src/GraphQl/Queries/Queries.ts:188](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L188) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_REQUEST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_REQUEST.md index fc3dab2f59..fc8cb26ce1 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_REQUEST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_LIST_REQUEST.md @@ -6,4 +6,4 @@ > `const` **USER\_LIST\_REQUEST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:225](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L225) +Defined in: [src/GraphQl/Queries/Queries.ts:208](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L208) diff --git a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_ORGANIZATION_LIST.md b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_ORGANIZATION_LIST.md index 570b9cd415..53a9f941ac 100644 --- a/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_ORGANIZATION_LIST.md +++ b/docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_ORGANIZATION_LIST.md @@ -6,4 +6,4 @@ > `const` **USER\_ORGANIZATION\_LIST**: `DocumentNode` -Defined in: [src/GraphQl/Queries/Queries.ts:508](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L508) +Defined in: [src/GraphQl/Queries/Queries.ts:491](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/GraphQl/Queries/Queries.ts#L491) diff --git a/docs/docs/auto-docs/screens/LoginPage/LoginPage/functions/default.md b/docs/docs/auto-docs/screens/LoginPage/LoginPage/functions/default.md index 0945bded4d..3d7454eb8f 100644 --- a/docs/docs/auto-docs/screens/LoginPage/LoginPage/functions/default.md +++ b/docs/docs/auto-docs/screens/LoginPage/LoginPage/functions/default.md @@ -6,7 +6,7 @@ > **default**(): `Element` -Defined in: [src/screens/LoginPage/LoginPage.tsx:46](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/LoginPage/LoginPage.tsx#L46) +Defined in: [src/screens/LoginPage/LoginPage.tsx:45](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/LoginPage/LoginPage.tsx#L45) LoginPage component is used to render the login page of the application where user can login or register to the application using email and password. The component also provides the functionality to switch between login and diff --git a/schema.graphql b/schema.graphql index a0ff7bde8b..4c60185f5f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -482,7 +482,7 @@ type LanguageModel { scalar Latitude input LoginInput { - email: EmailAddress! + email: String! password: String! } @@ -551,11 +551,6 @@ type MinimumValueError implements FieldError { path: [String!]! } -enum AdvertisementType { - BANNER - MENU - POPUP -} input CreateAdvertisementInput { endDate: Date! @@ -663,7 +658,6 @@ type Mutation { leaveOrganization(organizationId: ID!): User! likeComment(id: ID!): Comment likePost(id: ID!): Post - login(data: LoginInput!): AuthData! logout: Boolean! otp(data: OTPInput!): OtpData! recaptcha(data: RecaptchaVerification!): Boolean! @@ -695,7 +689,7 @@ type Mutation { saveFcmToken(token: String): Boolean! sendMembershipRequest(organizationId: ID!): MembershipRequest! sendMessageToChat(chatId: ID!, messageContent: String!, type: String!, replyTo: ID): ChatMessage! - signUp(data: UserInput!, file: String): AuthData! + signUp(input: UserInput!, file: String): AuthData! togglePostPin(id: ID!, title: String): Post! unassignUserTag(input: ToggleUserTagAssignInput!): User unblockUser(organizationId: ID!, userId: ID!): User! @@ -780,12 +774,6 @@ type OrganizationCustomField { type: String! } -type OrganizationCustomField { - _id: ID! - name: String! - organizationId: String! - type: String! -} type OrganizationInfoNode { _id: ID! @@ -798,6 +786,10 @@ type OrganizationInfoNode { visibleInSearch: Boolean! } +type AuthenticationPayload { + authenticationToken: String, + user: User +} input OrganizationInput { address: AddressInput! apiUrl: URL @@ -1004,6 +996,7 @@ input PostWhereInput { } type Query { + signIn(input: LoginInput!) : AuthenticationPayload actionItem(id: ID!): ActionItem actionItemCategoriesByOrganization(organizationId: ID!): [ActionItemCategory] actionItemCategory(id: ID!): ActionItemCategory @@ -1011,7 +1004,7 @@ type Query { actionItemsByOrganization(organizationId: ID!): [ActionItem] adminPlugin(orgId: ID!): [Plugin] agendaCategory(id: ID!): AgendaCategory! - checkAuth: User! + currentUser: User! customDataByOrganization(organizationId: ID!): [UserCustomData!]! customFieldsByOrganization(id: ID!): [OrganizationCustomField] chatById(id: ID!): Chat! diff --git a/src/App.spec.tsx b/src/App.spec.tsx index 45b73943cf..56a6c6db0d 100644 --- a/src/App.spec.tsx +++ b/src/App.spec.tsx @@ -7,9 +7,10 @@ import { I18nextProvider } from 'react-i18next'; import { describe, it, expect, vi } from 'vitest'; import App from './App'; import { store } from 'state/store'; -import { CHECK_AUTH } from 'GraphQl/Queries/Queries'; +import { CURRENT_USER } from 'GraphQl/Queries/Queries'; import i18nForTest from './utils/i18nForTest'; import { StaticMockLink } from 'utils/StaticMockLink'; +import './style/app.module.css'; vi.mock('@mui/x-charts/PieChart', () => ({ pieArcLabelClasses: vi.fn(), @@ -27,17 +28,16 @@ vi.mock('/src/assets/svgs/talawa.svg?react', () => ({ const MOCKS = [ { request: { - query: CHECK_AUTH, + query: CURRENT_USER, }, result: { data: { - checkAuth: { - _id: '123', - firstName: 'John', - lastName: 'Doe', + currentUser: { + id: '123', + name: 'John Doe', createdAt: '2023-04-13T04:53:17.742+00:00', image: 'john.jpg', - email: 'johndoe@gmail.com', + emailAddress: 'johndoe@gmail.com', birthDate: '1990-01-01', educationGrade: 'NO_GRADE', employmentStatus: 'EMPLOYED', diff --git a/src/App.tsx b/src/App.tsx index 413ff6fbe5..adb9ecc898 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,7 +29,7 @@ import Users from 'screens/Users/Users'; import CommunityProfile from 'screens/CommunityProfile/CommunityProfile'; import OrganizationVenues from 'screens/OrganizationVenues/OrganizationVenues'; import Leaderboard from 'screens/Leaderboard/Leaderboard'; - +import './style/app.module.css'; import React, { useEffect } from 'react'; // User Portal Components import Donate from 'screens/UserPortal/Donate/Donate'; @@ -40,7 +40,7 @@ import People from 'screens/UserPortal/People/People'; import Settings from 'screens/UserPortal/Settings/Settings'; import Chat from 'screens/UserPortal/Chat/Chat'; import { useQuery } from '@apollo/client'; -import { CHECK_AUTH } from 'GraphQl/Queries/Queries'; +import { CURRENT_USER } from 'GraphQl/Queries/Queries'; import Advertisements from 'components/Advertisements/Advertisements'; import SecuredRouteForUser from 'components/UserPortal/SecuredRouteForUser/SecuredRouteForUser'; @@ -57,7 +57,7 @@ const { setItem } = useLocalStorage(); /** * This is the main function for our application. It sets up all the routes and components, * defining how the user can navigate through the app. The function uses React Router's `Routes` - * and `Route` components to map different URL paths to corresponding screens and components. + * and `Route` components to map different URL paths to corresponding screens and components. * * ## Important Details * - **UseEffect Hook**: This hook checks user authentication status using the `CHECK_AUTH` GraphQL query. @@ -97,16 +97,15 @@ function app(): JSX.Element { // TODO: Fetch Installed plugin extras and store for use within MainContent and Side Panel Components. - const { data, loading } = useQuery(CHECK_AUTH); + const { data, loading } = useQuery(CURRENT_USER); useEffect(() => { - if (!loading && data?.checkAuth) { - const auth = data.checkAuth; + if (!loading && data?.currentUser) { + const auth = data.currentUser; setItem('IsLoggedIn', 'TRUE'); - setItem('name', `${auth.firstName} ${auth.lastName}`); - setItem('FirstName', auth.firstName); - setItem('LastName', auth.lastName); - setItem('email', auth.email); + setItem('id', auth.id); + setItem('name', auth.name); + setItem('email', auth.emailAddress); setItem('UserImage', auth.image); } }, [data, loading, setItem]); diff --git a/src/GraphQl/Mutations/mutations.ts b/src/GraphQl/Mutations/mutations.ts index 79b8c1cfd1..7f173ef8ac 100644 --- a/src/GraphQl/Mutations/mutations.ts +++ b/src/GraphQl/Mutations/mutations.ts @@ -1,5 +1,5 @@ import gql from 'graphql-tag'; - +import '../../style/app.module.css'; export const UNBLOCK_USER_MUTATION = gql` mutation UnblockUser($userId: ID!, $orgId: ID!) { unblockUser(organizationId: $orgId, userId: $userId) { @@ -145,56 +145,18 @@ export const UPDATE_USER_PASSWORD_MUTATION = gql` // to sign up in the talawa admin export const SIGNUP_MUTATION = gql` - mutation SignUp( - $firstName: String! - $lastName: String! - $email: EmailAddress! - $password: String! - $orgId: ID! - ) { - signUp( - data: { - firstName: $firstName - lastName: $lastName - email: $email - password: $password - selectedOrganization: $orgId - } - ) { + mutation SignUp($name: String!, $email: String!, $password: String!) { + signUp(input: { name: $name, emailAddress: $email, password: $password }) { user { - _id + id } - accessToken - refreshToken + authenticationToken } } `; // to login in the talawa admin -export const LOGIN_MUTATION = gql` - mutation Login($email: EmailAddress!, $password: String!) { - login(data: { email: $email, password: $password }) { - user { - _id - firstName - lastName - image - email - } - appUserProfile { - adminFor { - _id - } - isSuperAdmin - appLanguageCode - } - accessToken - refreshToken - } - } -`; - // to get the refresh token export const REFRESH_TOKEN_MUTATION = gql` diff --git a/src/GraphQl/Queries/Queries.ts b/src/GraphQl/Queries/Queries.ts index 9cf1a92755..3f30962093 100644 --- a/src/GraphQl/Queries/Queries.ts +++ b/src/GraphQl/Queries/Queries.ts @@ -1,32 +1,15 @@ import gql from 'graphql-tag'; - +import '../../style/app.module.css'; //Query List // Check Auth -export const CHECK_AUTH = gql` + +export const CURRENT_USER = gql` query { - checkAuth { - _id - firstName - lastName - createdAt - image - email - birthDate - educationGrade - employmentStatus - gender - maritalStatus - phone { - mobile - } - address { - line1 - state - countryCode - } - eventsAttended { - _id - } + currentUser { + id + name + role + emailAddress } } `; @@ -856,6 +839,21 @@ export const GET_COMMUNITY_DATA = gql` } } `; +export const SIGNIN_QUERY = gql` + query SignIn($email: String!, $password: String!) { + signIn(input: { emailAddress: $email, password: $password }) { + user { + id + name + emailAddress + role + countryCode + avatarURL + } + authenticationToken + } + } +`; export const GET_COMMUNITY_SESSION_TIMEOUT_DATA = gql` query getCommunityData { diff --git a/src/components/EventDashboardScreen/EventDashboardScreen.spec.tsx b/src/components/EventDashboardScreen/EventDashboardScreen.spec.tsx index 7fc5028658..cfe4dd2f10 100644 --- a/src/components/EventDashboardScreen/EventDashboardScreen.spec.tsx +++ b/src/components/EventDashboardScreen/EventDashboardScreen.spec.tsx @@ -11,7 +11,7 @@ import EventDashboardScreen from './EventDashboardScreen'; import { ORGANIZATIONS_LIST } from 'GraphQl/Queries/Queries'; import { StaticMockLink } from 'utils/StaticMockLink'; import useLocalStorage from 'utils/useLocalstorage'; - +import '../../style/app.module.css'; const { setItem } = useLocalStorage(); Object.defineProperty(window, 'matchMedia', { @@ -122,6 +122,7 @@ describe('Testing LeftDrawer in OrganizationScreen', () => { }); it('Testing LeftDrawer in page functionality', async () => { setItem('IsLoggedIn', true); + setItem('name', 'John Doe'); setItem('AdminFor', [ { _id: '6637904485008f171cf29924', __typename: 'Organization' }, ]); diff --git a/src/components/LeftDrawer/LeftDrawer.spec.tsx b/src/components/LeftDrawer/LeftDrawer.spec.tsx index b73cab654b..d86cac4be9 100644 --- a/src/components/LeftDrawer/LeftDrawer.spec.tsx +++ b/src/components/LeftDrawer/LeftDrawer.spec.tsx @@ -11,6 +11,7 @@ import { StaticMockLink } from 'utils/StaticMockLink'; import { MockedProvider } from '@apollo/react-testing'; import useLocalStorage from 'utils/useLocalstorage'; import { vi, it, describe, beforeEach, afterEach, expect } from 'vitest'; +import '../../style/app.module.css'; const { setItem } = useLocalStorage(); @@ -48,8 +49,7 @@ vi.mock('react-toastify', () => ({ })); beforeEach(() => { - setItem('FirstName', 'John'); - setItem('LastName', 'Doe'); + setItem('name', 'John Doe'); setItem( 'UserImage', 'https://api.dicebear.com/5.x/initials/svg?seed=John%20Doe', @@ -65,8 +65,7 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { it('Component should be rendered properly', async () => { setItem('UserImage', ''); setItem('SuperAdmin', true); - setItem('FirstName', 'John'); - setItem('LastName', 'Doe'); + setItem('name', 'John Doe'); await act(async () => { render( diff --git a/src/components/OrganizationScreen/OrganizationScreen.spec.tsx b/src/components/OrganizationScreen/OrganizationScreen.spec.tsx index e6a75c46d8..37c0d67023 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.spec.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.spec.tsx @@ -11,6 +11,9 @@ import { ORGANIZATION_EVENT_LIST } from 'GraphQl/Queries/Queries'; import { StaticMockLink } from 'utils/StaticMockLink'; import styles from './OrganizationScreen.module.css'; import { vi } from 'vitest'; +import useLocalStorage from 'utils/useLocalstorage'; +import '../../style/app.module.css'; +const { setItem } = useLocalStorage(); const mockID: string | undefined = '123'; vi.mock('react-router-dom', async () => ({ ...(await vi.importActual('react-router-dom')), @@ -50,6 +53,12 @@ const MOCKS = [ const link = new StaticMockLink(MOCKS, true); describe('Testing OrganizationScreen', () => { + beforeAll(() => { + setItem('name', 'John Doe'); + }); + afterAll(() => { + localStorage.clear(); + }); const renderComponent = (): void => { render( diff --git a/src/components/ProfileDropdown/ProfileDropdown.spec.tsx b/src/components/ProfileDropdown/ProfileDropdown.spec.tsx index 769a084f9e..0fb3300d0d 100644 --- a/src/components/ProfileDropdown/ProfileDropdown.spec.tsx +++ b/src/components/ProfileDropdown/ProfileDropdown.spec.tsx @@ -1,5 +1,5 @@ import React, { act } from 'react'; -import { render, screen, waitFor } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { BrowserRouter, Route, Routes } from 'react-router-dom'; import ProfileDropdown from './ProfileDropdown'; @@ -10,6 +10,7 @@ import { I18nextProvider } from 'react-i18next'; import i18nForTest from 'utils/i18nForTest'; import { GET_COMMUNITY_SESSION_TIMEOUT_DATA } from 'GraphQl/Queries/Queries'; import { vi } from 'vitest'; +import '../../style/app.module.css'; const { setItem } = useLocalStorage(); @@ -60,8 +61,7 @@ vi.mock('react-toastify', () => ({ })); beforeEach(() => { - setItem('FirstName', 'John'); - setItem('LastName', 'Doe'); + setItem('name', 'John Doe'); setItem( 'UserImage', 'https://api.dicebear.com/5.x/initials/svg?seed=John%20Doe', @@ -167,52 +167,6 @@ describe('ProfileDropdown Component', () => { }); }); - test('handles error when revoking refresh token during logout', async () => { - // Mock the revokeRefreshToken mutation to throw an error - const MOCKS_WITH_ERROR = [ - { - request: { - query: REVOKE_REFRESH_TOKEN, - }, - error: new Error('Failed to revoke refresh token'), - }, - ]; - - const consoleErrorMock = vi - .spyOn(console, 'error') - .mockImplementation(() => {}); - - render( - - - - - , - ); - - // Open the dropdown - await act(async () => { - userEvent.click(screen.getByTestId('togDrop')); - }); - - // Click the logout button - await act(async () => { - userEvent.click(screen.getByTestId('logoutBtn')); - }); - - // Wait for any pending promises - await waitFor(() => { - // Assert that console.error was called - expect(consoleErrorMock).toHaveBeenCalledWith( - 'Error revoking refresh token:', - expect.any(Error), - ); - }); - - // Cleanup mock - consoleErrorMock.mockRestore(); - }); - test('navigates to /user/settings for a user', async () => { setItem('SuperAdmin', false); setItem('AdminFor', []); diff --git a/src/components/ProfileDropdown/ProfileDropdown.tsx b/src/components/ProfileDropdown/ProfileDropdown.tsx index 182b0d66db..fab3dc0654 100644 --- a/src/components/ProfileDropdown/ProfileDropdown.tsx +++ b/src/components/ProfileDropdown/ProfileDropdown.tsx @@ -33,8 +33,7 @@ const profileDropdown = (): JSX.Element => { : adminFor?.length > 0 ? 'Admin' : 'User'; - const firstName = getItem('FirstName'); - const lastName = getItem('LastName'); + const name = getItem('name') || ''; const userImage = getItem('UserImage'); const navigate = useNavigate(); const { orgId } = useParams(); @@ -50,11 +49,10 @@ const profileDropdown = (): JSX.Element => { navigate('/'); }; const MAX_NAME_LENGTH = 20; - const fullName = `${firstName} ${lastName}`; const displayedName = - fullName.length > MAX_NAME_LENGTH - ? fullName.substring(0, MAX_NAME_LENGTH - 3) + '...' - : fullName; + name.length > MAX_NAME_LENGTH + ? name.substring(0, MAX_NAME_LENGTH - 3) + '...' + : name; return ( { data-testid="display-img" size={45} avatarStyle={styles.avatarStyle} - name={`${firstName} ${lastName}`} + name={name} alt={`dummy picture`} /> )} diff --git a/src/components/SuperAdminScreen/SuperAdminScreen.spec.tsx b/src/components/SuperAdminScreen/SuperAdminScreen.spec.tsx index 53804a54db..0d15c12061 100644 --- a/src/components/SuperAdminScreen/SuperAdminScreen.spec.tsx +++ b/src/components/SuperAdminScreen/SuperAdminScreen.spec.tsx @@ -8,6 +8,9 @@ import { store } from 'state/store'; import i18nForTest from 'utils/i18nForTest'; import SuperAdminScreen from './SuperAdminScreen'; import { describe, test, expect } from 'vitest'; +import useLocalStorage from 'utils/useLocalstorage'; +import '../../style/app.module.css'; +const { setItem } = useLocalStorage(); const resizeWindow = (width: number): void => { window.innerWidth = width; @@ -19,6 +22,12 @@ const clickToggleMenuBtn = (toggleButton: HTMLElement): void => { }; describe('Testing LeftDrawer in SuperAdminScreen', () => { + beforeAll(() => { + setItem('name', 'John Doe'); + }); + afterAll(() => { + localStorage.clear(); + }); test('Testing LeftDrawer in page functionality', async () => { render( diff --git a/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx b/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx index 7476bd8061..831d328717 100644 --- a/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx +++ b/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx @@ -297,8 +297,7 @@ const MOCKS = [ user: { _id: 'orgEmpty', image: null, - firstName: 'Noble', - lastName: 'Mittal', + name: 'Noble Mittal', email: 'noble@mittal.com', createdAt: '2023-02-18T09:22:27.969Z', joinedOrganizations: [], @@ -384,6 +383,7 @@ const renderUserSidebar = ( describe('UserSidebar Component Tests in User Portal', () => { beforeEach(() => { + setItem('name', 'Noble Mittal'); vi.clearAllMocks(); }); @@ -432,6 +432,14 @@ describe('UserSidebar Component Tests in User Portal', () => { }); }); + it('displays the user name from localStorage correctly', async () => { + await act(async () => { + renderUserSidebar('properId', link); + await wait(); + }); + expect(screen.getByText('Noble Mittal')).toBeInTheDocument(); + }); + it('UserSidebar renders correctly on smaller screens and toggles drawer visibility', async () => { await act(async () => { resizeWindow(800); diff --git a/src/index.tsx b/src/index.tsx index c64bf652b1..b13eabb9d5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -14,9 +14,9 @@ import { GraphQLWsLink } from '@apollo/client/link/subscriptions'; import { createClient } from 'graphql-ws'; import { onError } from '@apollo/link-error'; import './assets/css/app.css'; -import 'bootstrap/dist/js/bootstrap.min.js'; -import 'react-datepicker/dist/react-datepicker.css'; -import 'flag-icons/css/flag-icons.min.css'; +import 'bootstrap/dist/js/bootstrap.min.js'; // Bootstrap JS (ensure Bootstrap is installed) +import 'react-datepicker/dist/react-datepicker.css'; // React Datepicker Styles +import 'flag-icons/css/flag-icons.min.css'; // Flag Icons Styles import { Provider } from 'react-redux'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; @@ -29,12 +29,11 @@ import { BACKEND_URL, REACT_APP_BACKEND_WEBSOCKET_URL, } from 'Constant/constant'; -import { refreshToken } from 'utils/getRefreshToken'; import { ThemeProvider, createTheme } from '@mui/material'; import { ApolloLink } from '@apollo/client/core'; import { setContext } from '@apollo/client/link/context'; -import '../src/assets/css/scrollStyles.css'; - +import './assets/css/scrollStyles.css'; +import './style/app.module.css'; const theme = createTheme({ palette: { primary: { @@ -60,38 +59,23 @@ const authLink = setContext((_, { headers }) => { }; }); -const errorLink = onError( - ({ graphQLErrors, networkError, operation, forward }) => { - if (graphQLErrors) { - graphQLErrors.map(({ message }) => { - if (message === 'User is not authenticated') { - refreshToken().then((success) => { - if (success) { - const oldHeaders = operation.getContext().headers; - operation.setContext({ - headers: { - ...oldHeaders, - authorization: 'Bearer ' + getItem('token'), - }, - }); - return forward(operation); - } else { - localStorage.clear(); - } - }); - } - }); - } else if (networkError) { - console.log(`[Network error]: ${networkError}`); - toast.error( - 'API server unavailable. Check your connection or try again later', - { - toastId: 'apiServer', - }, - ); - } - }, -); +const errorLink = onError(({ graphQLErrors, networkError }) => { + if (graphQLErrors) { + graphQLErrors.map(({ message }) => { + if (message === 'You must be authenticated to perform this action.') { + localStorage.clear(); + } + }); + } else if (networkError) { + console.log(`[Network error]: ${networkError}`); + toast.error( + 'API server unavailable. Check your connection or try again later', + { + toastId: 'apiServer', + }, + ); + } +}); const httpLink = new HttpLink({ uri: BACKEND_URL, @@ -141,6 +125,7 @@ const client: ApolloClient = new ApolloClient({ const fallbackLoader =
; const container = document.getElementById('root'); + if (!container) { throw new Error('Root container missing in the DOM'); } diff --git a/src/screens/LoginPage/LoginPage.spec.tsx b/src/screens/LoginPage/LoginPage.spec.tsx index 242f00f2b2..4c04785f1a 100644 --- a/src/screens/LoginPage/LoginPage.spec.tsx +++ b/src/screens/LoginPage/LoginPage.spec.tsx @@ -14,21 +14,24 @@ import { I18nextProvider } from 'react-i18next'; import { StaticMockLink } from 'utils/StaticMockLink'; import LoginPage from './LoginPage'; import { - LOGIN_MUTATION, RECAPTCHA_MUTATION, SIGNUP_MUTATION, } from 'GraphQl/Mutations/mutations'; +import { + SIGNIN_QUERY, + GET_COMMUNITY_DATA, + ORGANIZATION_LIST, +} from 'GraphQl/Queries/Queries'; import { store } from 'state/store'; import i18nForTest from 'utils/i18nForTest'; import { BACKEND_URL } from 'Constant/constant'; import useLocalStorage from 'utils/useLocalstorage'; -import { GET_COMMUNITY_DATA, ORGANIZATION_LIST } from 'GraphQl/Queries/Queries'; import { vi, beforeEach, expect, it, describe } from 'vitest'; - +import '../../style/app.module.css'; const MOCKS = [ { request: { - query: LOGIN_MUTATION, + query: SIGNIN_QUERY, variables: { email: 'johndoe@gmail.com', password: 'johndoe', @@ -36,16 +39,11 @@ const MOCKS = [ }, result: { data: { - login: { + signIn: { user: { - _id: '1', - }, - appUserProfile: { - isSuperAdmin: false, - adminFor: ['123', '456'], + id: '1', }, - accessToken: 'accessToken', - refreshToken: 'refreshToken', + authenticationToken: 'authenticationToken', }, }, }, @@ -54,8 +52,7 @@ const MOCKS = [ request: { query: SIGNUP_MUTATION, variables: { - firstName: 'John Patrick ', - lastName: 'Doe ', + name: 'John Patrick', email: 'johndoe@gmail.com', password: 'johnDoe', }, @@ -64,10 +61,13 @@ const MOCKS = [ data: { register: { user: { - _id: '1', + id: '1', + name: 'John Patrick', + emailAddress: 'johndoe@gmail.com', + role: 'User', + countryCode: '12', }, - accessToken: 'accessToken', - refreshToken: 'refreshToken', + authenticationToken: 'authenticationToken', }, }, }, @@ -97,35 +97,35 @@ const MOCKS = [ }, ]; -const MOCKS2 = [ - { - request: { - query: GET_COMMUNITY_DATA, - }, - result: { - data: { - getCommunityData: { - _id: 'communitId', - websiteLink: 'http://link.com', - name: 'testName', - logoUrl: 'image.png', - __typename: 'Community', - socialMediaUrls: { - facebook: 'http://url.com', - gitHub: 'http://url.com', - youTube: 'http://url.com', - instagram: 'http://url.com', - linkedIn: 'http://url.com', - reddit: 'http://url.com', - slack: 'http://url.com', - X: null, - __typename: 'SocialMediaUrls', - }, - }, - }, - }, - }, -]; +// const MOCKS2 = [ +// { +// request: { +// query: GET_COMMUNITY_DATA, +// }, +// result: { +// data: { +// getCommunityData: { +// _id: 'communitId', +// websiteLink: 'http://link.com', +// name: 'testName', +// logoUrl: 'image.png', +// __typename: 'Community', +// socialMediaUrls: { +// facebook: 'http://url.com', +// gitHub: 'http://url.com', +// youTube: 'http://url.com', +// instagram: 'http://url.com', +// linkedIn: 'http://url.com', +// reddit: 'http://url.com', +// slack: 'http://url.com', +// X: null, +// __typename: 'SocialMediaUrls', +// }, +// }, +// }, +// }, +// }, +// ]; const MOCKS3 = [ { request: { @@ -201,7 +201,7 @@ const MOCKS3 = [ ]; const link = new StaticMockLink(MOCKS, true); -const link2 = new StaticMockLink(MOCKS2, true); +// const link2 = new StaticMockLink(MOCKS2, true); const link3 = new StaticMockLink(MOCKS3, true); async function wait(ms = 100): Promise { @@ -309,55 +309,54 @@ describe('Testing Login Page Screen', () => { expect(window.location.pathname).toBe('/orglist'); }); - it('There should be default values of pre-login data when queried result is null', async () => { - render( - - - - - - - - - , - ); - await wait(); - - expect(screen.getByTestId('PalisadoesLogo')).toBeInTheDocument(); - expect( - screen.getAllByTestId('PalisadoesSocialMedia')[0], - ).toBeInTheDocument(); - - await wait(); - expect(screen.queryByTestId('preLoginLogo')).not.toBeInTheDocument(); - expect(screen.queryAllByTestId('preLoginSocialMedia')[0]).toBeUndefined(); - }); - - it('There should be a different values of pre-login data if the queried result is not null', async () => { - render( - - - - - - - - - , - ); - await wait(); - expect(screen.getByTestId('preLoginLogo')).toBeInTheDocument(); - expect(screen.getAllByTestId('preLoginSocialMedia')[0]).toBeInTheDocument(); - - await wait(); - expect(screen.queryByTestId('PalisadoesLogo')).not.toBeInTheDocument(); - expect(screen.queryAllByTestId('PalisadoesSocialMedia')[0]).toBeUndefined(); - }); + // it('There should be default values of pre-login data when queried result is null', async () => { + // render( + // + // + // + // + // + // + // + // + // , + // ); + // await wait(); + + // expect(screen.getByTestId('PalisadoesLogo')).toBeInTheDocument(); + // expect( + // screen.getAllByTestId('PalisadoesSocialMedia')[0], + // ).toBeInTheDocument(); + + // await wait(); + // expect(screen.queryByTestId('preLoginLogo')).not.toBeInTheDocument(); + // expect(screen.queryAllByTestId('preLoginSocialMedia')[0]).toBeUndefined(); + // }); + + // it('There should be a different values of pre-login data if the queried result is not null', async () => { + // render( + // + // + // + // + // + // + // + // + // , + // ); + // await wait(); + // expect(screen.getByTestId('preLoginLogo')).toBeInTheDocument(); + // expect(screen.getAllByTestId('preLoginSocialMedia')[0]).toBeInTheDocument(); + + // await wait(); + // expect(screen.queryByTestId('PalisadoesLogo')).not.toBeInTheDocument(); + // expect(screen.queryAllByTestId('PalisadoesSocialMedia')[0]).toBeUndefined(); + // }); it('Testing registration functionality', async () => { const formData = { - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', email: 'johndoe@gmail.com', password: 'John@123', confirmPassword: 'John@123', @@ -381,14 +380,7 @@ describe('Testing Login Page Screen', () => { await wait(); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( @@ -401,8 +393,7 @@ describe('Testing Login Page Screen', () => { it('Testing registration functionality when all inputs are invalid', async () => { const formData = { - firstName: '1234', - lastName: '8890', + name: '124', email: 'j@l.co', password: 'john@123', confirmPassword: 'john@123', @@ -426,14 +417,7 @@ describe('Testing Login Page Screen', () => { await wait(); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( @@ -445,8 +429,7 @@ describe('Testing Login Page Screen', () => { it('Testing registration functionality, when password and confirm password is not same', async () => { const formData = { - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', email: 'johndoe@gmail.com', password: 'johnDoe@1', confirmPassword: 'doeJohn@2', @@ -468,14 +451,7 @@ describe('Testing Login Page Screen', () => { userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last Name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( @@ -488,8 +464,7 @@ describe('Testing Login Page Screen', () => { it('Testing registration functionality, when input is not filled correctly', async () => { const formData = { - firstName: 'J', - lastName: 'D', + name: 'J D', email: 'johndoe@gmail.com', password: 'joe', confirmPassword: 'joe', @@ -511,14 +486,8 @@ describe('Testing Login Page Screen', () => { userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last Name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); + userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( @@ -531,8 +500,7 @@ describe('Testing Login Page Screen', () => { it('switches to login tab on successful registration', async () => { const formData = { - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', email: 'johndoe@gmail.com', password: 'johndoe', confirmPassword: 'johndoe', @@ -553,14 +521,8 @@ describe('Testing Login Page Screen', () => { await wait(); userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); + userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( @@ -632,8 +594,7 @@ describe('Testing Login Page Screen', () => { it('Testing ReCaptcha functionality, it should refresh on unsuccessful SignUp, using duplicate email', async () => { const formData = { - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', email: 'johndoe@gmail.com', password: 'johnDoe@1', confirmPassword: 'johnDoe@1', @@ -655,14 +616,8 @@ describe('Testing Login Page Screen', () => { userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); - userEvent.type( - screen.getByPlaceholderText(/First Name/i), - formData.firstName, - ); - userEvent.type( - screen.getByPlaceholderText(/Last Name/i), - formData.lastName, - ); + userEvent.type(screen.getByPlaceholderText(/Name/i), formData.name); + userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); userEvent.type(screen.getByPlaceholderText('Password'), formData.password); userEvent.type( diff --git a/src/screens/LoginPage/LoginPage.tsx b/src/screens/LoginPage/LoginPage.tsx index 7c3bbbcf91..7b17fc2c57 100644 --- a/src/screens/LoginPage/LoginPage.tsx +++ b/src/screens/LoginPage/LoginPage.tsx @@ -1,4 +1,4 @@ -import { useQuery, useMutation } from '@apollo/client'; +import { useQuery, useMutation, useLazyQuery } from '@apollo/client'; import { Check, Clear } from '@mui/icons-material'; import type { ChangeEvent } from 'react'; import React, { useEffect, useRef, useState } from 'react'; @@ -10,7 +10,7 @@ import ReCAPTCHA from 'react-google-recaptcha'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; import { toast } from 'react-toastify'; - +import '../../style/app.module.css'; import EmailOutlinedIcon from '@mui/icons-material/EmailOutlined'; import { BACKEND_URL, @@ -18,18 +18,17 @@ import { RECAPTCHA_SITE_KEY, } from 'Constant/constant'; import { - LOGIN_MUTATION, RECAPTCHA_MUTATION, SIGNUP_MUTATION, } from 'GraphQl/Mutations/mutations'; -import { GET_COMMUNITY_DATA, ORGANIZATION_LIST } from 'GraphQl/Queries/Queries'; +import { ORGANIZATION_LIST, SIGNIN_QUERY } from 'GraphQl/Queries/Queries'; import PalisadoesLogo from 'assets/svgs/palisadoes.svg?react'; import TalawaLogo from 'assets/svgs/talawa.svg?react'; import ChangeLanguageDropDown from 'components/ChangeLanguageDropdown/ChangeLanguageDropDown'; import LoginPortalToggle from 'components/LoginPortalToggle/LoginPortalToggle'; import { errorHandler } from 'utils/errorHandler'; import useLocalStorage from 'utils/useLocalstorage'; -import { socialMediaLinks } from '../../constants'; +// import { socialMediaLinks } from '../../constants'; import styles from 'style/app.module.css'; import type { InterfaceQueryOrganizationListObject } from 'utils/interfaces'; import { Autocomplete, TextField } from '@mui/material'; @@ -68,8 +67,7 @@ const loginPage = (): JSX.Element => { const [role, setRole] = useState<'admin' | 'user'>('admin'); const [isInputFocused, setIsInputFocused] = useState(false); const [signformState, setSignFormState] = useState({ - signfirstName: '', - signlastName: '', + signName: '', signEmail: '', signPassword: '', cPassword: '', @@ -122,12 +120,12 @@ const loginPage = (): JSX.Element => { const toggleConfirmPassword = (): void => setShowConfirmPassword(!showConfirmPassword); - const { data, refetch } = useQuery(GET_COMMUNITY_DATA); - useEffect(() => { - // refetching the data if the pre-login data updates - refetch(); - }, [data]); - const [login, { loading: loginLoading }] = useMutation(LOGIN_MUTATION); + // const { data, refetch } = useQuery(GET_COMMUNITY_DATA); + // useEffect(() => { + // // refetching the data if the pre-login data updates + // refetch(); + // }, [data]); + const [signin, { loading: loginLoading }] = useLazyQuery(SIGNIN_QUERY); const [signup, { loading: signinLoading }] = useMutation(SIGNUP_MUTATION); const [recaptcha] = useMutation(RECAPTCHA_MUTATION); const { data: orgData } = useQuery(ORGANIZATION_LIST); @@ -188,14 +186,8 @@ const loginPage = (): JSX.Element => { const signupLink = async (e: ChangeEvent): Promise => { e.preventDefault(); - const { - signfirstName, - signlastName, - signEmail, - signPassword, - cPassword, - signOrg, - } = signformState; + const { signName, signEmail, signPassword, cPassword, signOrg } = + signformState; const isVerified = await verifyRecaptcha(recaptchaToken); @@ -221,10 +213,8 @@ const loginPage = (): JSX.Element => { }; if ( - isValidName(signfirstName) && - isValidName(signlastName) && - signfirstName.trim().length > 1 && - signlastName.trim().length > 1 && + isValidName(signName) && + signName.trim().length > 1 && signEmail.length >= 8 && signPassword.length > 1 && validatePassword(signPassword) @@ -233,8 +223,7 @@ const loginPage = (): JSX.Element => { try { const { data: signUpData } = await signup({ variables: { - firstName: signfirstName, - lastName: signlastName, + name: signName, email: signEmail, password: signPassword, orgId: signOrg, @@ -249,8 +238,7 @@ const loginPage = (): JSX.Element => { ); setShowTab('LOGIN'); setSignFormState({ - signfirstName: '', - signlastName: '', + signName: '', signEmail: '', signPassword: '', cPassword: '', @@ -266,11 +254,8 @@ const loginPage = (): JSX.Element => { toast.warn(t('passwordMismatches') as string); } } else { - if (!isValidName(signfirstName)) { - toast.warn(t('firstName_invalid') as string); - } - if (!isValidName(signlastName)) { - toast.warn(t('lastName_invalid') as string); + if (!isValidName(signName)) { + toast.warn(t('name_invalid') as string); } if (!validatePassword(signPassword)) { toast.warn(t('password_invalid') as string); @@ -291,39 +276,39 @@ const loginPage = (): JSX.Element => { } try { - const { data: loginData } = await login({ + const { data: signInData } = await signin({ variables: { email: formState.email, password: formState.password, }, }); + console.log(signInData); + + if (signInData) { + if (signInData.signIn.user.countryCode !== null) { + i18n.changeLanguage(signInData.signIn.user.countryCode); + } - if (loginData) { - i18n.changeLanguage(loginData.login.appUserProfile.appLanguageCode); - const { login } = loginData; - const { user, appUserProfile } = login; - const isAdmin: boolean = - appUserProfile.isSuperAdmin || appUserProfile.adminFor.length !== 0; + const { signIn } = signInData; + const { user, authenticationToken } = signIn; + const isAdmin: boolean = user.role === 'administrator'; if (role === 'admin' && !isAdmin) { toast.warn(tErrors('notAuthorised') as string); return; } - const loggedInUserId = user._id; + const loggedInUserId = user.id; - setItem('token', login.accessToken); - setItem('refreshToken', login.refreshToken); + setItem('token', authenticationToken); setItem('IsLoggedIn', 'TRUE'); - setItem('name', `${user.firstName} ${user.lastName}`); - setItem('email', user.email); - setItem('FirstName', user.firstName); - setItem('LastName', user.lastName); - setItem('UserImage', user.image); + setItem('name', user.name); + setItem('email', user.emailAddress); + // setItem('FirstName', user.firstName); + // setItem('LastName', user.lastName); + // setItem('UserImage', user.avatarURL); if (role === 'admin') { setItem('id', loggedInUserId); - setItem('SuperAdmin', appUserProfile.isSuperAdmin); - setItem('AdminFor', appUserProfile.adminFor); } else { setItem('userId', loggedInUserId); } @@ -339,31 +324,31 @@ const loginPage = (): JSX.Element => { } }; - const socialIconsList = socialMediaLinks.map(({ href, logo, tag }, index) => - data?.getCommunityData ? ( - data.getCommunityData?.socialMediaUrls?.[tag] && ( - - - - ) - ) : ( - - - - ), - ); + // const socialIconsList = socialMediaLinks.map(({ href, logo, tag }, index) => + // data?.getCommunityData ? ( + // data.getCommunityData?.socialMediaUrls?.[tag] && ( + // + // + // + // ) + // ) : ( + // + // + // + // ), + // ); return ( <> @@ -371,7 +356,7 @@ const loginPage = (): JSX.Element => {
- {data?.getCommunityData ? ( + {/* {data?.getCommunityData ? ( { />

{data.getCommunityData.name}

- ) : ( - - -

{t('fromPalisadoes')}

-
- )} + ) : ( */} + + +

{t('fromPalisadoes')}

+
+ {/* )} */}
-
{socialIconsList}
+ {/*
{socialIconsList}
*/}
@@ -539,27 +524,27 @@ const loginPage = (): JSX.Element => { {tCommon('register')} - -
- {tCommon('firstName')} - { - setSignFormState({ - ...signformState, - signfirstName: e.target.value, - }); - }} - /> -
- - + {/* */} +
+ {tCommon('Name')} + { + setSignFormState({ + ...signformState, + signName: e.target.value, + }); + }} + /> +
+ {/* */} + {/*
{tCommon('lastName')} { signlastName: e.target.value, }); }} - /> + />dwdwdw
- + */}
{tCommon('email')} diff --git a/src/screens/OrganizationPeople/AddMember.tsx b/src/screens/OrganizationPeople/AddMember.tsx index 5cf76f9171..e1732b74f2 100644 --- a/src/screens/OrganizationPeople/AddMember.tsx +++ b/src/screens/OrganizationPeople/AddMember.tsx @@ -229,7 +229,7 @@ function AddMember(): JSX.Element { orgId: currentUrl, }, }); - const createdUserId = registeredUser?.data.signUp.user._id; + const createdUserId = registeredUser?.data.signUp.user.id; await createMember(createdUserId); diff --git a/src/screens/UserPortal/Organizations/Organizations.spec.tsx b/src/screens/UserPortal/Organizations/Organizations.spec.tsx index 0aafba3b55..26eddb1d23 100644 --- a/src/screens/UserPortal/Organizations/Organizations.spec.tsx +++ b/src/screens/UserPortal/Organizations/Organizations.spec.tsx @@ -16,8 +16,8 @@ import i18nForTest from 'utils/i18nForTest'; import useLocalStorage from 'utils/useLocalstorage'; import Organizations from './Organizations'; import React, { act } from 'react'; -const { getItem } = useLocalStorage(); - +const { getItem, setItem } = useLocalStorage(); +import '../../../style/app.module.css'; /** * Mock data for GraphQL queries. */ @@ -56,8 +56,7 @@ const MOCKS = [ userRegistrationRequired: true, creator: { __typename: 'User', - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', }, members: [ { @@ -119,7 +118,7 @@ const MOCKS = [ }, createdAt: '1234567890', userRegistrationRequired: true, - creator: { __typename: 'User', firstName: 'John', lastName: 'Doe' }, + creator: { __typename: 'User', name: 'John Doe' }, members: [ { _id: '56gheqyr7deyfuiwfewifruy8', @@ -163,7 +162,7 @@ const MOCKS = [ }, description: 'desc', userRegistrationRequired: true, - creator: { __typename: 'User', firstName: 'John', lastName: 'Doe' }, + creator: { __typename: 'User', name: 'John Doe' }, members: [ { _id: '56gheqyr7deyfuiwfewifruy8', @@ -226,8 +225,7 @@ const MOCKS = [ userRegistrationRequired: true, creator: { __typename: 'User', - firstName: 'John', - lastName: 'Doe', + name: 'John Doe', }, members: [ { @@ -289,7 +287,7 @@ const MOCKS = [ }, userRegistrationRequired: true, createdAt: '1234567890', - creator: { __typename: 'User', firstName: 'John', lastName: 'Doe' }, + creator: { __typename: 'User', name: 'John Doe' }, members: [ { _id: '56gheqyr7deyfuiwfewifruy8', @@ -344,6 +342,10 @@ describe('Testing Organizations Screen [User Portal]', () => { /** * Test to ensure the screen is rendered properly. */ + const TEST_USER_NAME = 'Noble Mittal'; + beforeEach(() => { + setItem('name', TEST_USER_NAME); + }); test('Screen should be rendered properly', async () => { render( diff --git a/src/screens/UserPortal/Settings/Settings.spec.tsx b/src/screens/UserPortal/Settings/Settings.spec.tsx index f24c59d50a..5229e02edb 100644 --- a/src/screens/UserPortal/Settings/Settings.spec.tsx +++ b/src/screens/UserPortal/Settings/Settings.spec.tsx @@ -11,10 +11,11 @@ import i18nForTest from 'utils/i18nForTest'; import { StaticMockLink } from 'utils/StaticMockLink'; import Settings from './Settings'; import userEvent from '@testing-library/user-event'; -import { CHECK_AUTH } from 'GraphQl/Queries/Queries'; +import { CURRENT_USER } from 'GraphQl/Queries/Queries'; import { toast } from 'react-toastify'; import { errorHandler } from 'utils/errorHandler'; - +import useLocalStorage from 'utils/useLocalstorage'; +import '../../../style/app.module.css'; vi.mock('react-toastify', () => ({ toast: { success: vi.fn(), @@ -59,11 +60,11 @@ const MOCKS = [ const Mocks1 = [ { request: { - query: CHECK_AUTH, + query: CURRENT_USER, }, result: { data: { - checkAuth: { + currentUser: { email: 'johndoe@gmail.com', firstName: 'John', lastName: 'Doe', @@ -93,11 +94,11 @@ const Mocks1 = [ const Mocks2 = [ { request: { - query: CHECK_AUTH, + query: CURRENT_USER, }, result: { data: { - checkAuth: { + currentUser: { email: 'johndoe@gmail.com', firstName: '', lastName: '', @@ -203,6 +204,8 @@ async function wait(ms = 100): Promise { describe('Testing Settings Screen [User Portal]', () => { beforeAll(() => { + const { setItem } = useLocalStorage(); + setItem('name', 'John Doe'); vi.useFakeTimers(); Object.defineProperty(window, 'matchMedia', { writable: true, @@ -452,8 +455,8 @@ describe('Testing Settings Screen [User Portal]', () => { ...Mocks1[0], result: { data: { - checkAuth: { - ...Mocks1[0].result.data.checkAuth, + currentUser: { + ...Mocks1[0].result.data.currentUser, eventsAttended: mockEventsAttended, }, }, diff --git a/src/screens/UserPortal/Settings/Settings.tsx b/src/screens/UserPortal/Settings/Settings.tsx index 5f1313784c..4ee6a3faa2 100644 --- a/src/screens/UserPortal/Settings/Settings.tsx +++ b/src/screens/UserPortal/Settings/Settings.tsx @@ -7,7 +7,7 @@ import { UPDATE_USER_MUTATION } from 'GraphQl/Mutations/mutations'; import { useMutation, useQuery } from '@apollo/client'; import { errorHandler } from 'utils/errorHandler'; import { toast } from 'react-toastify'; -import { CHECK_AUTH } from 'GraphQl/Queries/Queries'; +import { CURRENT_USER } from 'GraphQl/Queries/Queries'; import useLocalStorage from 'utils/useLocalstorage'; import { educationGradeEnum, @@ -23,7 +23,7 @@ import Avatar from 'components/Avatar/Avatar'; import type { InterfaceEvent } from 'components/EventManagement/EventAttendance/InterfaceEvents'; import { EventsAttendedByUser } from 'components/UserPortal/UserProfile/EventsAttendedByUser'; import UserAddressFields from 'components/UserPortal/UserProfile/UserAddressFields'; - +import '../../../style/app.module.css'; /** * The Settings component allows users to view and update their profile settings. * It includes functionality to handle image uploads, reset changes, and save updated user details. @@ -57,7 +57,7 @@ export default function settings(): JSX.Element { }, []); const { setItem } = useLocalStorage(); - const { data } = useQuery(CHECK_AUTH, { fetchPolicy: 'network-only' }); + const { data } = useQuery(CURRENT_USER, { fetchPolicy: 'network-only' }); const [updateUserDetails] = useMutation(UPDATE_USER_MUTATION); const [userDetails, setUserDetails] = React.useState({ firstName: '', @@ -158,7 +158,7 @@ export default function settings(): JSX.Element { */ const handleResetChanges = (): void => { setisUpdated(false); - /* istanbul ignore next */ + if (data) { const { firstName, @@ -171,7 +171,7 @@ export default function settings(): JSX.Element { employmentStatus, maritalStatus, address, - } = data.checkAuth; + } = data.currentUser; setUserDetails({ ...userDetails, @@ -192,7 +192,6 @@ export default function settings(): JSX.Element { }; useEffect(() => { - /* istanbul ignore next */ if (data) { const { firstName, @@ -208,7 +207,7 @@ export default function settings(): JSX.Element { address, image, eventsAttended, - } = data.checkAuth; + } = data.currentUser; setUserDetails({ firstName, @@ -314,9 +313,8 @@ export default function settings(): JSX.Element { role="button" aria-label="Edit profile picture" tabIndex={0} - onKeyDown={ - /*istanbul ignore next*/ - (e) => e.key === 'Enter' && handleImageUpload() + onKeyDown={(e) => + e.key === 'Enter' && handleImageUpload() } />
@@ -330,18 +328,31 @@ export default function settings(): JSX.Element { data-testid="fileInput" multiple={false} ref={fileInputRef} - onChange={ - /* istanbul ignore next */ - async ( - e: React.ChangeEvent, - ): Promise => { - const file = e.target?.files?.[0]; - if (file) { + onChange={async ( + e: React.ChangeEvent, + ): Promise => { + const file = e.target?.files?.[0]; + if (file) { + try { + // Validate file size (e.g., 5MB limit) + if (file.size > 5 * 1024 * 1024) { + alert('File size should not exceed 5MB'); + return; + } + + // Validate file type + if (!file.type.startsWith('image/')) { + toast.error('Only image files are allowed'); + return; + } const image = await convertToBase64(file); setUserDetails({ ...userDetails, image }); + } catch (error) { + toast.error('Failed to process image'); + console.error('Image processing error:', error); } } - } + }} style={{ display: 'none' }} /> diff --git a/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx b/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx index 95a1f633da..ebbb109a1e 100644 --- a/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx +++ b/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx @@ -22,7 +22,9 @@ import UserScreen from './UserScreen'; import { ORGANIZATIONS_LIST } from 'GraphQl/Queries/Queries'; import { StaticMockLink } from 'utils/StaticMockLink'; import '@testing-library/jest-dom'; +import useLocalStorage from 'utils/useLocalstorage'; +const { setItem } = useLocalStorage(); let mockID: string | undefined = '123'; let mockLocation: string | undefined = '/user/organization/123'; @@ -90,6 +92,7 @@ const clickToggleMenuBtn = (toggleButton: HTMLElement): void => { describe('UserScreen tests with LeftDrawer functionality', () => { beforeEach(() => { + setItem('name', 'John Doe'); mockID = '123'; mockLocation = '/user/organization/123'; }); diff --git a/src/screens/UserPortal/UserScreen/UserScreen.tsx b/src/screens/UserPortal/UserScreen/UserScreen.tsx index 5a877865c3..ca07611f41 100644 --- a/src/screens/UserPortal/UserScreen/UserScreen.tsx +++ b/src/screens/UserPortal/UserScreen/UserScreen.tsx @@ -11,7 +11,7 @@ import UserSidebarOrg from 'components/UserPortal/UserSidebarOrg/UserSidebarOrg' import ProfileDropdown from 'components/ProfileDropdown/ProfileDropdown'; import type { InterfaceMapType } from 'utils/interfaces'; import { useTranslation } from 'react-i18next'; - +import '../../../style/app.module.css'; const map: InterfaceMapType = { organization: 'home', people: 'people',