From 8eb848a06f80550d176a102c4aed36405a6e8160 Mon Sep 17 00:00:00 2001 From: "sanjay.khatal" Date: Thu, 4 Apr 2024 12:56:30 +0530 Subject: [PATCH 1/8] fix: version control file expose issue Signed-off-by: sanjay.khatal --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 201797050..c794c2446 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,9 @@ ui.env # misc. .dev* + +# hidden files +._darcs +.bzr +.hg +BitKeeper \ No newline at end of file From e983a7a62836cb5722a9aab67e025b70fcdccb2d Mon Sep 17 00:00:00 2001 From: "sanjay.khatal" Date: Fri, 5 Apr 2024 18:18:39 +0530 Subject: [PATCH 2/8] fix: view-schema sql dependency, logo not loading, dashboard redirection Signed-off-by: sanjay.khatal --- src/components/BreadCrumbs/index.tsx | 2 +- .../CreateEcosystemOrgModal/index.tsx | 47 ++++++++----------- src/components/Issuance/CredDefSelection.tsx | 2 +- src/components/Resources/Schema/Schemas.tsx | 2 +- .../Resources/Schema/ViewSchema.tsx | 11 ++--- src/components/User/UserDashBoard.tsx | 34 +++++++------- .../organizations/schemas/view-schema.astro | 7 --- .../schemas/view-schema/[schemaId].astro | 9 ++++ 8 files changed, 54 insertions(+), 60 deletions(-) delete mode 100644 src/pages/organizations/schemas/view-schema.astro create mode 100644 src/pages/organizations/schemas/view-schema/[schemaId].astro diff --git a/src/components/BreadCrumbs/index.tsx b/src/components/BreadCrumbs/index.tsx index 394c3d9c1..d1b225cba 100644 --- a/src/components/BreadCrumbs/index.tsx +++ b/src/components/BreadCrumbs/index.tsx @@ -64,7 +64,7 @@ export default function BreadCrumbs() { : ''; return ( - {routes} + {decodeURIComponent(routes)} ); })} diff --git a/src/components/CreateEcosystemOrgModal/index.tsx b/src/components/CreateEcosystemOrgModal/index.tsx index 73c35713b..be337123f 100644 --- a/src/components/CreateEcosystemOrgModal/index.tsx +++ b/src/components/CreateEcosystemOrgModal/index.tsx @@ -20,6 +20,7 @@ import { createEcosystems } from '../../api/ecosystem'; import { getOrgDetails } from '../../config/ecosystem'; import defaultUserIcon from '../../../public/images/person_FILL1_wght400_GRAD0_opsz24.svg'; import EndorsementTooltip from '../../commonComponents/EndorsementTooltip'; +import { processImage } from '../../utils/processImage'; interface Values { name: string; description: string; @@ -126,29 +127,20 @@ const CreateEcosystemOrgModal = (props: IProps) => { const isEmpty = (object: any): boolean => { return true; }; + const handleImageChange = (event: any): void => { setImgError(''); - const reader = new FileReader(); - const file = event?.target?.files; - - const imgfieSize = Number((file[0]?.size / 1024 / 1024)?.toFixed(2)); - const extension = file[0]?.name - ?.substring(file[0]?.name?.lastIndexOf('.') + 1) - ?.toLowerCase(); - if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') { - if (imgfieSize <= imageSizeAccepted) { - reader.onloadend = (): void => { - ProcessImg(event); - isEmpty(reader.result); - }; - reader.readAsDataURL(file[0]); - event.preventDefault(); + processImage(event, (result, error) => { + if (result) { + setLogoImage({ + logoFile: '', + imagePreviewUrl: result, + fileName: event.target.files[0].name, + }); } else { - setImgError('Please check image size'); + setImgError(error || 'An error occurred while processing the image.'); } - } else { - setImgError('Invalid image type'); - } + }); }; const submitCreateOrganization = async (values: Values) => { @@ -299,20 +291,21 @@ const CreateEcosystemOrgModal = (props: IProps) => { >
- {typeof logoImage.logoFile === 'string' ? ( + {logoImage?.imagePreviewUrl ? ( + {logoImage.fileName} + ) : typeof logoImage.logoFile === 'string' ? ( ) : ( Jese picture )} -

{popupName} Logo diff --git a/src/components/Issuance/CredDefSelection.tsx b/src/components/Issuance/CredDefSelection.tsx index 21a546c55..3044a704b 100644 --- a/src/components/Issuance/CredDefSelection.tsx +++ b/src/components/Issuance/CredDefSelection.tsx @@ -177,7 +177,7 @@ const CredDefSelection = () => {