From 03a577d06c2b75e137ea26cd08054f639ea71b76 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 15 Dec 2023 16:45:00 +0530 Subject: [PATCH 01/18] sign in sign up page dark mode Signed-off-by: karan --- src/commonComponents/PublicNavbar.astro | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commonComponents/PublicNavbar.astro b/src/commonComponents/PublicNavbar.astro index e812a8035..44250ef9f 100644 --- a/src/commonComponents/PublicNavbar.astro +++ b/src/commonComponents/PublicNavbar.astro @@ -83,7 +83,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g > Sign Up From 6a868934aeccde9d37fe96e8cd76a8a0857c39eb Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Wed, 27 Dec 2023 18:20:49 +0530 Subject: [PATCH 02/18] refactor: feature enum and issued credential list Signed-off-by: sanjay-k1910 --- src/api/connection.ts | 2 +- src/components/Issuance/IssuedCrdentials.tsx | 3 ++- src/components/RoleViewButton/index.tsx | 2 +- src/utils/enums/features.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/connection.ts b/src/api/connection.ts index 464c1040d..60e109f98 100644 --- a/src/api/connection.ts +++ b/src/api/connection.ts @@ -19,7 +19,7 @@ export const getConnectionsByOrg = async ({ sortingOrder }: IConnectionListAPIParameter) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getAllConnections}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortByValue=${sortingOrder}&sorting=${sortBy}`; + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getAllConnections}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortingOrder}&sortField=${sortBy}`; const axiosPayload = { url, diff --git a/src/components/Issuance/IssuedCrdentials.tsx b/src/components/Issuance/IssuedCrdentials.tsx index 5f5f6a02f..037ec7755 100644 --- a/src/components/Issuance/IssuedCrdentials.tsx +++ b/src/components/Issuance/IssuedCrdentials.tsx @@ -145,6 +145,7 @@ const CredentialList = () => { setIssuedCredList(credentialList); setError(null); } else { + setError(response as string) setIssuedCredList([]); } } @@ -218,7 +219,7 @@ const CredentialList = () => { {walletCreated && ( Date: Wed, 27 Dec 2023 20:15:42 +0530 Subject: [PATCH 03/18] refactor: query params Signed-off-by: sanjay-k1910 --- src/api/connection.ts | 2 +- src/api/issuance.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api/connection.ts b/src/api/connection.ts index 60e109f98..464c1040d 100644 --- a/src/api/connection.ts +++ b/src/api/connection.ts @@ -19,7 +19,7 @@ export const getConnectionsByOrg = async ({ sortingOrder }: IConnectionListAPIParameter) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getAllConnections}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortingOrder}&sortField=${sortBy}`; + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getAllConnections}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortByValue=${sortingOrder}&sorting=${sortBy}`; const axiosPayload = { url, diff --git a/src/api/issuance.ts b/src/api/issuance.ts index e502b364d..cce5d83fe 100644 --- a/src/api/issuance.ts +++ b/src/api/issuance.ts @@ -1,4 +1,3 @@ -import axios from 'axios'; import { apiRoutes } from '../config/apiRoutes'; import { storageKeys } from '../config/CommonConstant'; import { @@ -14,8 +13,8 @@ export const getIssuedCredentials = async ({page, sortBy, sortingOrder}: IConnectionListAPIParameter) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortByValue=${sortingOrder}&sorting=${sortBy}`; - + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortingOrder}&sortField=${sortBy}`; + const axiosPayload = { url, config: await getHeaderConfigs(), From 65c5d87cec630b66e3feea256d1657229558e8ee Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 13:54:06 +0530 Subject: [PATCH 04/18] added dark mode images for dgp Signed-off-by: karan --- public/images/dark-dpg-alliance.svg | 51 +++++++++++++++++++++++++++++ src/pages/index.astro | 9 ++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 public/images/dark-dpg-alliance.svg diff --git a/public/images/dark-dpg-alliance.svg b/public/images/dark-dpg-alliance.svg new file mode 100644 index 000000000..5c8ffb092 --- /dev/null +++ b/public/images/dark-dpg-alliance.svg @@ -0,0 +1,51 @@ + + + + + + + + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index 71dd88b2f..14e460b52 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -91,13 +91,20 @@ import { pathRoutes } from '../config/pathRoutes'; >has been recognized by - + + From 127e96f33c311b6a2efff7173f09cf6929408f76 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 29 Dec 2023 13:59:20 +0530 Subject: [PATCH 05/18] refactor: network in invitation Signed-off-by: sanjay-k1910 --- .../EcosystemInvite/EcoInvitationList.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/EcosystemInvite/EcoInvitationList.tsx b/src/components/EcosystemInvite/EcoInvitationList.tsx index e60f182af..b7bac33e5 100644 --- a/src/components/EcosystemInvite/EcoInvitationList.tsx +++ b/src/components/EcosystemInvite/EcoInvitationList.tsx @@ -1,9 +1,10 @@ -import type { InvitationProps } from "./EcoSystemReceivedInvitations"; +import type { InvitationProps, NetworkDetails } from "./EcoSystemReceivedInvitations"; import CustomAvatar from '../Avatar'; +import React from "react"; const EcoInvitationList = (props: InvitationProps) => { const { invitationId, ecosystem } = props; - const { name, logoUrl, networkDetails } = ecosystem; + const { name, logoUrl, networkDetails } = ecosystem || {}; return (
@@ -32,20 +33,22 @@ const EcoInvitationList = (props: InvitationProps) => { > Ecosystem Member -
+ - +
Network:{' '} - - {(Array.isArray(networkDetails) && networkDetails.map((network: NetworkDetails) => network.name)).join(', ')} - -
+ {Array.isArray(networkDetails) && networkDetails.length > 0 && + + {networkDetails.map((network: NetworkDetails) => network.name)?.join(', ')} + + } + ); From c35b88efd8ecdf9ae8b9c3aac0e656e6e84dd254 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 14:11:49 +0530 Subject: [PATCH 06/18] fix: user org roles Signed-off-by: karan --- src/components/organization/users/EditUserRolesModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/organization/users/EditUserRolesModal.tsx b/src/components/organization/users/EditUserRolesModal.tsx index 544ab0c43..f6df63db7 100644 --- a/src/components/organization/users/EditUserRolesModal.tsx +++ b/src/components/organization/users/EditUserRolesModal.tsx @@ -31,7 +31,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - const roles: Array = data?.data.response + const roles: Array = data?.data const filterRole = roles.filter(role => { if (props?.user?.roles.includes(role.name) && role.name !== 'member') { role.checked = true @@ -44,7 +44,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: role.disabled = false } return !role.name.includes("owner") && !role.name.includes("holder"); - }) + }) setRoles(filterRole) } else { setErrMsg(resRoles as string) From 65c510fcc460ab048fbd6b6485e7bf582169b08b Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 29 Dec 2023 15:18:07 +0530 Subject: [PATCH 07/18] refactor: ecosystem list page Signed-off-by: sanjay-k1910 --- src/components/Ecosystem/EcosystemList.tsx | 107 +++++++++++++-------- 1 file changed, 67 insertions(+), 40 deletions(-) diff --git a/src/components/Ecosystem/EcosystemList.tsx b/src/components/Ecosystem/EcosystemList.tsx index df9b52683..e20dd6105 100644 --- a/src/components/Ecosystem/EcosystemList.tsx +++ b/src/components/Ecosystem/EcosystemList.tsx @@ -34,6 +34,7 @@ const initialPageState = { const EcosystemList = () => { const [openModal, setOpenModal] = useState(false); const [loading, setLoading] = useState(true); + const [selectedOrgId, setSelectedOrgId] = useState(""); const [message, setMessage] = useState(null); const [error, setError] = useState(null); const [currentPage, setCurrentPage] = useState(initialPageState); @@ -55,9 +56,9 @@ const EcosystemList = () => { }; const fetchEcosystems = async () => { - setLoading(true); const id = await getFromLocalStorage(storageKeys.ORG_ID); - // setOrgId(id); + setSelectedOrgId(id) + setLoading(true); if (id) { const response = await getEcosystems( id, @@ -70,7 +71,7 @@ const EcosystemList = () => { if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { const ecosystemData = data?.data; if (ecosystemData) { - + setEcosystemList(ecosystemData); } else { await removeFromLocalStorage(storageKeys.ECOSYSTEM_ID); @@ -132,9 +133,9 @@ const EcosystemList = () => { const isEcosystemList = Boolean(ecosystemList && ecosystemList?.length > 0); const showCreateButton = Boolean( isEcosystemList && - (isEcosystemData?.isMultiEcosystem || isEcosystemData?.isEcosystemLead), + (isEcosystemData?.isMultiEcosystem || isEcosystemData?.isEcosystemLead), ); - + return (
@@ -145,10 +146,10 @@ const EcosystemList = () => { Ecosystems
- -
+ +
{showCreateButton && ( { )}
-
- +
+ { ); })}
- + ) : ( - ecosystemList && ( - - - - } - /> - ) + <> + {ecosystemList && ( + + + + } + /> + )} + { + !selectedOrgId && + + + + } + /> + } + + )}
{isEcosystemList && ecosystemList && ecosystemList?.length > 10 && ( { setMessage(value); if (value) { setTimeout(() => { - window.location.reload(); + window.location.reload(); }, 2000); } else { fetchEcosystems(); @@ -317,6 +344,6 @@ const EcosystemList = () => {
-) + ) } export default EcosystemList; From bb3a5c1c785326c5f44379f455e20e22bb088980 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 15:32:15 +0530 Subject: [PATCH 08/18] replaced creentials images landing page Signed-off-by: karan --- public/images/mobile_mockup.svg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/images/mobile_mockup.svg b/public/images/mobile_mockup.svg index 74df5c322..e70f86b4b 100644 --- a/public/images/mobile_mockup.svg +++ b/public/images/mobile_mockup.svg @@ -1,9 +1,9 @@ - - + + - + - + From f5e6a94f226b18d1f5f2252cbd8191c3576a94ca Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 29 Dec 2023 15:42:08 +0530 Subject: [PATCH 09/18] refactor: ecosystem invitation deatils Signed-off-by: sanjay-k1910 --- .../EcosystemInvite/EcoInvitationList.tsx | 2 +- .../EcoSystemReceivedInvitations.tsx | 186 +++++++++--------- src/components/User/UserDashBoard.tsx | 2 +- 3 files changed, 97 insertions(+), 93 deletions(-) diff --git a/src/components/EcosystemInvite/EcoInvitationList.tsx b/src/components/EcosystemInvite/EcoInvitationList.tsx index b7bac33e5..384f7773a 100644 --- a/src/components/EcosystemInvite/EcoInvitationList.tsx +++ b/src/components/EcosystemInvite/EcoInvitationList.tsx @@ -3,7 +3,7 @@ import CustomAvatar from '../Avatar'; import React from "react"; const EcoInvitationList = (props: InvitationProps) => { - const { invitationId, ecosystem } = props; + const { invitationId, ecosystem } = props || {}; const { name, logoUrl, networkDetails } = ecosystem || {}; return ( diff --git a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx index 80f964dfd..6c63f8721 100644 --- a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx +++ b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx @@ -35,13 +35,14 @@ export interface NetworkDetails { indyNamespace: string; } +export interface IPropsEcoInvitationList { + name: string; + logoUrl: string; + networkDetails?: NetworkDetails[] +} export interface InvitationProps { invitationId: string; - ecosystem: { - name: string; - logoUrl: string; - networkDetails: NetworkDetails[] - }; + ecosystem: IPropsEcoInvitationList; } export interface EcosystemInvitation { ecosystem: { name: string; logoUrl: string }; @@ -315,99 +316,102 @@ const ReceivedInvitations = () => { >
    - {invitationsData.map((invitation) => ( - -
    + {invitationsData.map((invitation) => { + const ecosystem: IPropsEcoInvitationList = invitation?.ecosystem; + return ( +
    - - -
    - - + +
    +
    +
    +
    -
    - -
    -
- {invitation.selected && ( - { - setGetOrgError(null); - }} - /> - )} - - ))} + {invitation.selected && ( + { + setGetOrgError(null); + }} + /> + )} + + ) + })}
diff --git a/src/components/User/UserDashBoard.tsx b/src/components/User/UserDashBoard.tsx index 90c3a3006..dd10c6e4e 100644 --- a/src/components/User/UserDashBoard.tsx +++ b/src/components/User/UserDashBoard.tsx @@ -170,7 +170,7 @@ const UserDashBoard = () => {
Date: Fri, 29 Dec 2023 16:03:28 +0530 Subject: [PATCH 10/18] refactor: landing page Signed-off-by: sanjay-k1910 --- src/commonComponents/PublicNavbar.astro | 4 ++-- src/components/ColorModeSwitcher.astro | 5 +++-- src/pages/index.astro | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/commonComponents/PublicNavbar.astro b/src/commonComponents/PublicNavbar.astro index fb1dfbb7c..b05a06590 100644 --- a/src/commonComponents/PublicNavbar.astro +++ b/src/commonComponents/PublicNavbar.astro @@ -68,13 +68,13 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g Documentation Explore Organizations diff --git a/src/components/ColorModeSwitcher.astro b/src/components/ColorModeSwitcher.astro index b06580d22..f7765624f 100644 --- a/src/components/ColorModeSwitcher.astro +++ b/src/components/ColorModeSwitcher.astro @@ -38,9 +38,10 @@ diff --git a/src/pages/index.astro b/src/pages/index.astro index 14e460b52..bb26cbeb7 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1248,7 +1248,7 @@ import { pathRoutes } from '../config/pathRoutes';
- + - + Close modal -
+

Verified Details

From 0af84ebe931cd3551b156d5d904d8c2be7f8ecb0 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 29 Dec 2023 16:41:28 +0530 Subject: [PATCH 12/18] refaactor: issuance flow selected schema design Signed-off-by: sanjay-k1910 --- src/commonComponents/SchemaCard.tsx | 15 ++++++++++----- src/components/Issuance/CredDefSelection.tsx | 2 ++ src/components/Issuance/IssueDashboard.tsx | 18 +++++++++--------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/commonComponents/SchemaCard.tsx b/src/commonComponents/SchemaCard.tsx index 6663c9575..9a7c15da4 100644 --- a/src/commonComponents/SchemaCard.tsx +++ b/src/commonComponents/SchemaCard.tsx @@ -10,15 +10,20 @@ interface IProps { issuerDid: string, attributes: [], created: string, + isClickable?: boolean onClickCallback: (schemaId: string, attributes: string[], issuerDid: string, created: string) => void; + limitedAttributes?: boolean } const SchemaCard = (props: IProps) => { + + const attributes = props.limitedAttributes !== false ? props?.attributes?.slice(0, 3) : props?.attributes + return ( { props.onClickCallback(props.schemaId, props.attributes, props.issuerDid, props.created) }} id="schema-cards" - className='transform transition duration-500 hover:scale-105 hover:bg-gray-50 cursor-pointer h-full w-full overflow-hidden'> + className={`transform transition duration-500 ${props.isClickable !== false ? "hover:scale-105" : "hover:!cursor-default"} hover:bg-gray-50 cursor-pointer h-full w-full overflow-hidden`}>
@@ -55,10 +60,10 @@ const SchemaCard = (props: IProps) => { Attributes:
- {props.attributes && props.attributes.length > 0 && ( + {attributes && attributes.length > 0 && ( <> - {props?.attributes?.slice(0, 3).map((element, index) => ( -
+ {attributes?.map((element) => ( +
{
))} - {props?.attributes?.length > 3 && ...} + {props?.limitedAttributes !== false && props?.attributes?.length > 3 && ...} )}
diff --git a/src/components/Issuance/CredDefSelection.tsx b/src/components/Issuance/CredDefSelection.tsx index d494f8c6c..e4d9f1e94 100644 --- a/src/components/Issuance/CredDefSelection.tsx +++ b/src/components/Issuance/CredDefSelection.tsx @@ -163,6 +163,8 @@ const CredDefSelection = () => { attributes={schemaDetailsState.attributes} created={schemaDetailsState.createdDateTime} onClickCallback={schemaSelectionCallback} + isClickable={false} + limitedAttributes={false} />
)} diff --git a/src/components/Issuance/IssueDashboard.tsx b/src/components/Issuance/IssueDashboard.tsx index 5669c366d..eb674e996 100644 --- a/src/components/Issuance/IssueDashboard.tsx +++ b/src/components/Issuance/IssueDashboard.tsx @@ -25,21 +25,21 @@ const IssueDashboard = () => { }, ]; return ( -
-
+
+
-
-
-

+
+

Issue Credential

-

+ +

+
+

Select the appropriate action for issuing credential(s){' '}

-
-
-
+
{options.map((option) => ( Date: Fri, 29 Dec 2023 16:52:55 +0530 Subject: [PATCH 13/18] fix: issuance verification debouncing Signed-off-by: karan --- src/components/Issuance/IssuedCrdentials.tsx | 24 ++++++++++++------- .../VerificationCredentialList.tsx | 22 +++++++++++------ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/components/Issuance/IssuedCrdentials.tsx b/src/components/Issuance/IssuedCrdentials.tsx index 037ec7755..635a4a74c 100644 --- a/src/components/Issuance/IssuedCrdentials.tsx +++ b/src/components/Issuance/IssuedCrdentials.tsx @@ -145,7 +145,6 @@ const CredentialList = () => { setIssuedCredList(credentialList); setError(null); } else { - setError(response as string) setIssuedCredList([]); } } @@ -155,10 +154,20 @@ const CredentialList = () => { } finally { setLoading(false); } - } + }; useEffect(() => { - getIssuedCredDefs(listAPIParameter); + let getData: NodeJS.Timeout; + + if (listAPIParameter?.search?.length >= 1) { + getData = setTimeout(() => { + getIssuedCredDefs(listAPIParameter); + }, 1000); + return () => clearTimeout(getData); + } else { + getIssuedCredDefs(listAPIParameter); + } + return () => clearTimeout(getData); }, [listAPIParameter]); //onChange of Search input text @@ -295,11 +304,10 @@ const CredentialList = () => { )}
) : ( -
- - There isn't any data available. - -
+ )}
)} diff --git a/src/components/Verification/VerificationCredentialList.tsx b/src/components/Verification/VerificationCredentialList.tsx index 3c600eccd..116a426df 100644 --- a/src/components/Verification/VerificationCredentialList.tsx +++ b/src/components/Verification/VerificationCredentialList.tsx @@ -285,7 +285,6 @@ const VerificationCredentialList = () => { getproofRequestList(listAPIParameter); }; - const requestProof = async (proofVericationId: string) => { if (proofVericationId) { setOpenModal(false); @@ -294,7 +293,17 @@ const VerificationCredentialList = () => { }; useEffect(() => { - getproofRequestList(listAPIParameter); + let getData: NodeJS.Timeout; + + if (listAPIParameter?.search?.length >= 1) { + getData = setTimeout(() => { + getproofRequestList(listAPIParameter); + }, 1000); + return () => clearTimeout(getData); + } else { + getproofRequestList(listAPIParameter); + } + return () => clearTimeout(getData); }, [listAPIParameter]); const schemeSelection = () => { @@ -424,11 +433,10 @@ const VerificationCredentialList = () => { )}
) : ( -
- - There isn't any data available. - -
+ )}

)} From d58d3cfb6f93959c05718588fb08a378da0dc2e5 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 17:09:28 +0530 Subject: [PATCH 14/18] fix sonar issue Signed-off-by: karan --- src/components/Issuance/IssuedCrdentials.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Issuance/IssuedCrdentials.tsx b/src/components/Issuance/IssuedCrdentials.tsx index 635a4a74c..148f50150 100644 --- a/src/components/Issuance/IssuedCrdentials.tsx +++ b/src/components/Issuance/IssuedCrdentials.tsx @@ -272,18 +272,23 @@ const CredentialList = () => {
- ) : issuedCredList && issuedCredList.length > 0 ? ( + ) : (
- {issuedCredList && issuedCredList.length > 0 && ( + {issuedCredList && issuedCredList.length > 0 ? ( + ) : ( + )}
{Math.ceil(totalItem / listAPIParameter?.itemPerPage) > 1 && ( @@ -303,11 +308,6 @@ const CredentialList = () => {
)}
- ) : ( - )}
)} From 741d404f4637fe0bb3390b17245e73e161c4db59 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 17:27:48 +0530 Subject: [PATCH 15/18] fix: member list error handling Signed-off-by: karan --- src/components/organization/users/Members.tsx | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/src/components/organization/users/Members.tsx b/src/components/organization/users/Members.tsx index 84f8db327..7b526c89c 100644 --- a/src/components/organization/users/Members.tsx +++ b/src/components/organization/users/Members.tsx @@ -14,6 +14,7 @@ import type { User } from '../interfaces/users'; import { getFromLocalStorage } from '../../../api/Auth'; import { getOrganizationUsers } from '../../../api/organization'; import React from 'react'; +import { EmptyListMessage } from '../../EmptyListComponent'; const initialPageState = { pageNumber: 1, @@ -63,11 +64,6 @@ const Members = () => { userOrg.roles = roles; return userOrg; }); - - if (usersList.length === 0) { - setError('No Data Found'); - } - setUsersList(usersList); setCurrentPage({ ...currentPage, @@ -76,13 +72,11 @@ const Members = () => { } else { setError(response as string); } - setLoading(false); }; //This useEffect is called when the searchText changes useEffect(() => { - let getData: NodeJS.Timeout; if (searchText.length >= 1) { @@ -124,35 +118,32 @@ const Members = () => {
- setMessage(data)} - setOpenModal={props.setOpenModal} - /> + setMessage(data)} + setOpenModal={props.setOpenModal} + /> - { - setMessage(null); - setError(null); - }} - /> - {loading ? ( -
- -
- ) : ( - usersList && - usersList?.length > 0 && ( + { + setMessage(null); + setError(null); + }} + /> + {loading ? ( +
+ +
+ ) : usersList && usersList?.length > 0 ? (
    {usersList.map((user) => ( -
  • +
  • @@ -165,7 +156,9 @@ const Members = () => {
  • - {user.roles.length>1 ? 'Roles:' : 'Role:'} + {user.roles.length > 1 + ? 'Roles:' + : 'Role:'} {user.roles && user.roles.length > 0 && user.roles.map( @@ -243,18 +236,24 @@ const Members = () => {
- ) - )} - {currentPage.total > 1 && ( -
- -
- )} -
+ ) : ( +
+ +
+ )} + {currentPage.total > 1 && ( +
+ +
+ )} +
); }; From a3c6706a431e55635a6f8bc206d840fd025ffc0d Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 17:36:34 +0530 Subject: [PATCH 16/18] loading handled Signed-off-by: karan --- src/components/organization/users/Members.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/organization/users/Members.tsx b/src/components/organization/users/Members.tsx index 7b526c89c..03d3a8886 100644 --- a/src/components/organization/users/Members.tsx +++ b/src/components/organization/users/Members.tsx @@ -13,7 +13,6 @@ import SearchInput from '../../SearchInput'; import type { User } from '../interfaces/users'; import { getFromLocalStorage } from '../../../api/Auth'; import { getOrganizationUsers } from '../../../api/organization'; -import React from 'react'; import { EmptyListMessage } from '../../EmptyListComponent'; const initialPageState = { @@ -24,7 +23,7 @@ const initialPageState = { const Members = () => { const [openModal, setOpenModal] = useState(false); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const [message, setMessage] = useState(null); const [error, setError] = useState(null); const [userRoles, setUserRoles] = useState([]); From 9a6c85676f79c386a479a12e01e4286ecab85302 Mon Sep 17 00:00:00 2001 From: karan Date: Fri, 29 Dec 2023 17:41:37 +0530 Subject: [PATCH 17/18] fix: border removed Signed-off-by: karan --- src/components/organization/users/Members.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/organization/users/Members.tsx b/src/components/organization/users/Members.tsx index 03d3a8886..131d862bc 100644 --- a/src/components/organization/users/Members.tsx +++ b/src/components/organization/users/Members.tsx @@ -236,12 +236,10 @@ const Members = () => {
) : ( -
- -
+ )} {currentPage.total > 1 && (
From cfb0b6e2a2f4702673b867e66994f0beb4924a98 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 29 Dec 2023 17:42:22 +0530 Subject: [PATCH 18/18] refactor: send invitation, landing page image, explore organization Signed-off-by: sanjay-k1910 --- public/images/mobile_mockup.svg | 8 ++--- src/commonComponents/PublicNavbar.astro | 4 +-- .../organization/invitations/Invitations.tsx | 6 ++-- .../invitations/SendInvitationModal.tsx | 28 +++-------------- .../OrganisationPublicProfile.tsx | 30 ++++++++----------- 5 files changed, 26 insertions(+), 50 deletions(-) diff --git a/public/images/mobile_mockup.svg b/public/images/mobile_mockup.svg index e70f86b4b..29d965cde 100644 --- a/public/images/mobile_mockup.svg +++ b/public/images/mobile_mockup.svg @@ -1,9 +1,9 @@ - - + + - + - + diff --git a/src/commonComponents/PublicNavbar.astro b/src/commonComponents/PublicNavbar.astro index b05a06590..d5344d791 100644 --- a/src/commonComponents/PublicNavbar.astro +++ b/src/commonComponents/PublicNavbar.astro @@ -68,13 +68,13 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g Documentation Explore Organizations diff --git a/src/components/organization/invitations/Invitations.tsx b/src/components/organization/invitations/Invitations.tsx index b3a420bee..4d8c05a24 100644 --- a/src/components/organization/invitations/Invitations.tsx +++ b/src/components/organization/invitations/Invitations.tsx @@ -233,9 +233,11 @@ const Invitations = () => {
- Invited On:  {dateConversion(invitation.createDateTime)} + Invited On:  
+ {dateConversion(invitation.createDateTime)} +
{invitation.status === 'pending' && (
diff --git a/src/components/organization/invitations/SendInvitationModal.tsx b/src/components/organization/invitations/SendInvitationModal.tsx index e6f2df6c8..cbbb5aa85 100644 --- a/src/components/organization/invitations/SendInvitationModal.tsx +++ b/src/components/organization/invitations/SendInvitationModal.tsx @@ -46,7 +46,7 @@ const SendInvitationModal = (props: { const [invitations, setInvitations] = useState([]); const [memberRole, setMemberRole] = useState(null); - + const [initialData, setInitialData] = useState({ email: '', }); @@ -106,7 +106,7 @@ const SendInvitationModal = (props: { email: invitation.email, orgRoleId: [invitation.roleId], }; - }); + }); const resCreateOrg = await createInvitations(invitationPayload); const { data } = resCreateOrg as AxiosResponse; @@ -187,6 +187,7 @@ const SendInvitationModal = (props: { .string() .required('Email is required') .email('Email is invalid') + .test('is-self-email', "You can't send invitation to self", (value) => value.trim() !== selfEmail.email.trim()) .trim(), })} validateOnBlur @@ -196,17 +197,6 @@ const SendInvitationModal = (props: { values: Values, { resetForm }: FormikHelpers, ) => { - if(values.email === selfEmail.email){ - setSelfEmail({ - ...selfEmail, - error: "You can't send invitation to self." - }) - return - } - setSelfEmail({ - ...selfEmail, - error: "" - }) await includeInvitation(values); resetForm({ values: initialInvitationData }); }} @@ -226,23 +216,13 @@ const SendInvitationModal = (props: { id="email" name="email" className="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" - onChange={(e) => { - formikHandlers.handleChange(e) - }} /> {formikHandlers?.errors?.email && formikHandlers?.touched?.email ? ( {formikHandlers?.errors?.email} - ) : selfEmail.error ? - - {selfEmail.error} - - : - ( - Error - )} + ) : Error}
diff --git a/src/components/publicProfile/OrganisationPublicProfile.tsx b/src/components/publicProfile/OrganisationPublicProfile.tsx index bb908173e..b2aa4537c 100644 --- a/src/components/publicProfile/OrganisationPublicProfile.tsx +++ b/src/components/publicProfile/OrganisationPublicProfile.tsx @@ -119,28 +119,22 @@ const OrganisationPublicProfile = () => { }} className="transform transition duration-500 hover:scale-[1.02] hover:bg-gray-50 cursor-pointer" > -
- {org.logoUrl ? ( - - ) : ( - - )} +
+
+ {org.logoUrl ? ( + + ) : ( + + )} +
-

{org?.name}

+ {org?.name}
-
-
    -
  • -
    -
    - {org?.description} -
    -
    -
  • -
-
+

+ {org?.description} +