Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge: DEV to QA #737

Merged
merged 34 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e3eb7b4
[Deno Deploy] Update .github/workflows/deploy.yml
deno-deploy[bot] Jun 7, 2024
95aeaa6
feat: support no ledger (#689)
bhavanakarwade Jun 7, 2024
a41d5aa
fixed CSS and avatar issues (#696)
pranalidhanavade Jun 9, 2024
eb793d8
feat: support no ledger (#697)
bhavanakarwade Jun 10, 2024
252b504
refactor: responsiveness of the component (#699)
bhavanakarwade Jun 14, 2024
c318707
feat: manage keycloak client
bhavanakarwade Jun 17, 2024
d40b608
refactor: updated env sample file
bhavanakarwade Jun 17, 2024
2d8875c
fix: error messages issue from create organization and create ecosyst…
pranalidhanavade Jun 17, 2024
03147ee
Merge pull request #702 from credebl/feat/manage-keycloak-client
shitrerohit Jun 18, 2024
40c3b7e
fix: css issues (#704)
bhavanakarwade Jun 19, 2024
7300fc6
feat: add passkey warning message for unsupported devices (#706)
pranalidhanavade Jun 19, 2024
5698893
Feat/passkey warning messages (#707)
pranalidhanavade Jun 19, 2024
0dc76d1
feat: dedicated agent workflow (#693)
pranalidhanavade Jun 20, 2024
7d5a77d
fix: formik validations for dedicated agent workflow (#708)
pranalidhanavade Jun 21, 2024
a297a2a
fix: create did button restrictions (#710)
bhavanakarwade Jun 21, 2024
7616a5f
feat: changed schema payload (#711)
tipusinghaw Jun 23, 2024
a97bdfd
feat/delete wallet and organization (#712)
pranalidhanavade Jun 25, 2024
d3fce1a
fix: custom-avatar-css-issues (#714)
pranalidhanavade Jun 26, 2024
42bd813
feat: delete wallet and organization (#715)
pranalidhanavade Jun 26, 2024
c888199
refactor: added query parameter in get all schemas API (#713)
bhavanakarwade Jun 26, 2024
1f4d3bc
refactor: request schema payload (#717)
bhavanakarwade Jul 8, 2024
d0c5625
fix:client id and secret encryption (#724)
pranalidhanavade Jul 25, 2024
759305e
Client id client secret encryption (#726)
pranalidhanavade Jul 25, 2024
744a19c
feat: create schema flow for w3c (#718)
pranalidhanavade Jul 30, 2024
f24a574
wip: verification with email (#722)
bhavanakarwade Jul 30, 2024
62b2d7e
feat: Implement w3c issuance with connection,email and bulk. (#721)
pranalidhanavade Jul 31, 2024
2603675
feat: W3C verifcation with connections. (#729)
pranalidhanavade Aug 13, 2024
874fcd0
fiz: removed unwanted code from astro components
pranalidhanavade Aug 16, 2024
d43a09a
feat: oob verification using email (#732)
bhavanakarwade Aug 22, 2024
d74f17f
fix: W3C issuance schemaName not displayed correctly on ADEYA. (#733)
pranalidhanavade Aug 23, 2024
801cade
refactor: predicates number vaidations (#734)
bhavanakarwade Aug 23, 2024
08ccf3e
Fix verification dashboard changes (#735)
pranalidhanavade Aug 23, 2024
579d269
fix: email input box issue (#736)
bhavanakarwade Aug 23, 2024
aba407a
Merge branch 'qa' of https://github.com/credebl/studio into merge-dev…
pranalidhanavade Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/api/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,25 @@ export const getCredDeffById = async (schemaId: string, orgId: string) => {
}
}

export const getCredDefDetailsByCredDefId = async (credDefId: string, orgId: string) => {
const token = await getFromLocalStorage(storageKeys.TOKEN)
const details = {
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.createCredentialDefinition}/${credDefId}`,
config: {
headers: {
'Content-type': 'application/json',
'Authorization': `Bearer ${token}`,
},
},
}

try {
const response = await axiosGet(details)
return response
}
catch (error) {
const err = error as Error
return err?.message
}
}

17 changes: 17 additions & 0 deletions src/api/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ export const verifyCredential = async (payload: object, requestType:RequestType)
}
};

export const createOobProofRequest = async (payload: object, requestType: RequestType) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.oobProofRequest}?requestType=${requestType}`;
const axiosPayload = {
url,
payload,
config: await getHeaderConfigs(),
};

try {
return await axiosPost(axiosPayload);
} catch (error) {
const err = error as Error;
return err?.message;
}
};

export const getVerificationCredential = async (state: IssueCredential) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.Issuance.getIssuedCredentials}?orgId=${orgId}&state=${state}`;
Expand Down
13 changes: 12 additions & 1 deletion src/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,18 @@ export enum SchemaTypes {

export enum CredentialType {
INDY = 'indy',
JSONLD = 'jsonld'
JSONLD = 'jsonld',
}

export enum ProtocolVersion {
V1 = 'v1',
V2 = 'v2'
}

export enum AutoAccept {
ALWAYS = "always",
CONTENT_APPROVED = "contentApproved",
NEVER = "never"
}

export enum RequestType {
Expand Down
80 changes: 80 additions & 0 deletions src/commonComponents/CustomCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import React, { useEffect, useState } from 'react';
import { setToLocalStorage } from '../api/Auth';
import { storageKeys } from '../config/CommonConstant';
import type { ICustomCheckboxProps, ISchemaData } from './interface';

const CustomCheckbox: React.FC<ICustomCheckboxProps> = ({ showCheckbox, isVerificationUsingEmail, onChange, schemaData }) => {
const [checked, setChecked] = useState<boolean>(false);

useEffect(() => {
if (schemaData) {
try {
const selectedSchemas = JSON.parse(localStorage.getItem('selectedSchemas') ?? '[]');
const isChecked = selectedSchemas.some((schema: ISchemaData) => schema.schemaId === schemaData.schemaId);
setChecked(isChecked);
} catch (error) {
console.error('Error parsing JSON from localStorage:', error);
}
}
}, [schemaData]);

const handleCheckboxChange = async () => {
const newChecked = !checked;
setChecked(newChecked);
onChange(newChecked, schemaData);

try {
const selectedSchemas = JSON.parse(localStorage.getItem('selectedSchemas') ?? '[]');

if (newChecked) {
selectedSchemas.push(schemaData);
} else {
const index = selectedSchemas.findIndex((schema: ISchemaData) => schema.schemaId === schemaData?.schemaId);
if (index > -1) {
selectedSchemas.splice(index, 1);
}
}
await setToLocalStorage(storageKeys.SELECTED_SCHEMAS, JSON.stringify(selectedSchemas));
} catch (error) {
console.error('Error updating localStorage:', error);
}
};

return (
<>
{showCheckbox && (
<button
className={`w-4 h-4 ${isVerificationUsingEmail ? 'flex items-center' : 'absolute bottom-8 right-4'}`}
onClick={handleCheckboxChange}
aria-label="Checkbox"
> <input
type="checkbox"
checked={checked}
onChange={handleCheckboxChange}
className="hidden"
/>
<div
className={`w-full h-full border-2 ${checked ? 'bg-primary-700' : ''}`}
style={{ borderColor: 'rgb(31 78 173 / var(--tw-bg-opacity))', position: 'relative' }}
>
{checked && (
<svg
className="absolute top-0 left-0 w-full h-full text-white"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="5"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="20 6 9 17 4 12" />
</svg>
)}
</div>
</button>
)}
</>
);
};

export default CustomCheckbox;
Loading
Loading