Skip to content

Commit

Permalink
Merge branch 'qa' of https://github.com/credebl/studio into merge/dev…
Browse files Browse the repository at this point in the history
…-to-qa-06-09-2024

Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Sep 6, 2024
2 parents c5708d4 + 11d8cee commit e057e4d
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/api/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,4 @@ export const getFromCookies = (cookies: AstroCookies, key: string) =>{
export const removeFromLocalStorage = async (key: string) => {
await localStorage.removeItem(key);
return true;
};
};
1 change: 0 additions & 1 deletion src/components/AddOrganizationInEcosystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ const AddOrganizationInEcosystem = () => {
await removeFromLocalStorage(storageKeys.ERROR_ORG_IN_ECOSYSTEM);
})()
}, [])


useEffect(() => {
(async () => {
Expand Down
11 changes: 7 additions & 4 deletions src/components/Issuance/EmailIssuance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,13 @@ const EmailIssuance = () => {
schemaIdentifier: schemaLedgerId,
attributes: Array.isArray(attributes) ? attributes : (attributes ? JSON.parse(attributes) : []),
}));
setCredentialOptions(options);
} else {
setSuccess(null);
setFailure(null);

setCredentialOptions(options);
} else {
setSuccess(null);
setFailure(null);
}
setLoading(false);
}
setLoading(false);
}
Expand Down
36 changes: 32 additions & 4 deletions src/components/Issuance/Issuance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ const IssueCred = () => {
attributes: attributesArray,
};
});

const issuancePayload = {
credentialData,
credentialDefinitionId: credDefId,
Expand Down Expand Up @@ -198,6 +197,35 @@ const IssueCred = () => {
setUserLoader(false);
};

const createW3cIssuanceForm = (
selectedUsers: SelectedUsers[],
attributes: DataTypeAttributes[],
orgId: string,
) => {
const credentialData = selectedUsers.map((user) => {

const attributesArray = attributes.length > 0 && attributes.map((attr) => ({
name: attr.attributeName,
value: '',
dataType: attr?.schemaDataType,
isRequired: attr.isRequired,
}));

return {
connectionId: user.connectionId,
attributes: attributesArray,
};
});

const issuancePayload = {
credentialData,
orgId,
};

setIssuanceFormPayload(issuancePayload);
setUserLoader(false);
};

const createAttributeValidationSchema = (
name: string,
value: string,
Expand Down Expand Up @@ -367,12 +395,12 @@ const getSelectedUsers = async (): Promise<SelectedUsers[]> => {
const convertedAttributesValues = {
...issuancePayload,
};

setIssuanceLoader(true);
const issueCredRes = await issueCredential(convertedAttributesValues, credentialType);

const { data } = issueCredRes as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) {
setSuccess(data?.message);
window.location.href = `${pathRoutes.organizations.issuedCredentials}`;
Expand All @@ -383,7 +411,7 @@ const getSelectedUsers = async (): Promise<SelectedUsers[]> => {
setIssuanceLoader(false);
}
};

return (
<div className="px-4 pt-2">
<div className="mb-4 col-span-full xl:mb-2">
Expand Down
2 changes: 1 addition & 1 deletion src/components/organization/EditOrgdetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { EditOrgdetailsModalProps, ILogoImage, Organisation, Values } from
import { processImage } from '../../utils/processImage';
import FormikErrorMessage from '../../commonComponents/formikerror/index'
import CustomSpinner from '../CustomSpinner';

interface IUpdateOrgPayload {
orgId: string | undefined;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organization/OrganizationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
);
};

export default OrganizationDetails;
export default OrganizationDetails;
1 change: 0 additions & 1 deletion src/components/organization/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ export interface ILedgerItem {
deletedAt: string | null;
}


export interface IOrgCount {
verificationRecordsCount: number;
connectionRecordsCount: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Card, Pagination } from 'flowbite-react';
import { Button, Pagination } from 'flowbite-react';
import { useEffect, useState } from 'react';
import type { ChangeEvent } from 'react';

Expand Down Expand Up @@ -33,7 +33,6 @@ const ReceivedInvitations = () => {
const [error, setError] = useState<string | null>(null);

const [currentPage, setCurrentPage] = useState(initialPageState);
const timestamp = Date.now();

const onPageChange = (page: number) => {
setCurrentPage({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { apiStatusCodes, storageKeys } from '../../../config/CommonConstant';
import { getFromLocalStorage, passwordEncryption } from '../../../api/Auth';
import { getFromLocalStorage } from '../../../api/Auth';
import {
createDid,
getOrganizationById,
Expand Down Expand Up @@ -93,6 +93,7 @@ const WalletSpinup = (props: {
fetchOrganizationDetails()
}, []);


const onRadioSelect = (type: string) => {
setAgentType(type);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import LayoutSidebar from "../../../../../../../app/LayoutSidebar.astro";
import EmailAttributesSelection from "../../../../../../../components/Verification/EmailAttributesSelection";
import { checkUserSession } from "../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailAttributesSelection client:load />
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import LayoutSidebar from "../../../../../../../../app/LayoutSidebar.astro";
import EmailVerification from "../../../../../../../../components/Verification/EmailVerification";
import { checkUserSession } from "../../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailVerification client:load />
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import LayoutSidebar from "../../../../../../../../app/LayoutSidebar.astro";
import EmailAttributesSelection from "../../../../../../../../components/Verification/EmailAttributesSelection";
import { checkUserSession } from "../../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailAttributesSelection client:load />
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
import LayoutSidebar from "../../../../../../../../../app/LayoutSidebar.astro";
import EmailVerification from "../../../../../../../../../components/Verification/EmailVerification";
import { checkUserSession } from "../../../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailVerification client:load />
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import LayoutSidebar from "../../../../../../../app/LayoutSidebar.astro";
import EmailCredDefSelection from "../../../../../../../components/Verification/EmailCredDefSelection";
import { pathRoutes } from "../../../../../../../config/pathRoutes";
import { checkUserSession } from "../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
const route: string = pathRoutes.auth.sinIn
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailCredDefSelection client:load/>
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import LayoutSidebar from "../../../../../../app/LayoutSidebar.astro";
import EmailSchemaSelection from "../../../../../../components/Verification/EmailSchemaSelection";
import { pathRoutes } from "../../../../../../config/pathRoutes";
import { checkUserSession } from "../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
const route: string = pathRoutes.auth.sinIn
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailSchemaSelection client:load/>
</LayoutSidebar>

0 comments on commit e057e4d

Please sign in to comment.