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: develop to qa #740

Merged
merged 36 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 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
a22ec34
fix: create wallet UI for shared and dedicated agents. (#738)
pranalidhanavade Aug 26, 2024
48b580b
fix: routes changes for verifcation with email flow (#739)
bhavanakarwade Aug 26, 2024
139d114
Merge branch 'qa' of https://github.com/credebl/studio into merge/dev…
tipusinghaw Aug 27, 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
8 changes: 6 additions & 2 deletions src/components/Resources/Schema/SchemasList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { checkEcosystem } from '../../../config/ecosystem';
import type { ICheckEcosystem } from '../../../config/ecosystem';

import { Create, SchemaEndorsement } from '../../Issuance/Constant';
import { DidMethod, SchemaType } from '../../../common/enums';
import { DidMethod, SchemaType, SchemaTypes } from '../../../common/enums';

const SchemaList = (props: {
schemaSelectionCallback: (
Expand Down Expand Up @@ -57,6 +57,8 @@ const SchemaList = (props: {
const [totalItem, setTotalItem] = useState(0);
const [isEcosystemData, setIsEcosystemData] = useState<ICheckEcosystem>();
const [searchValue, setSearchValue] = useState('');
const [schemaType, setSchemaType] = useState('');

const [w3cSchema,setW3CSchema]= useState<boolean>(false);
const [isNoLedger,setisNoLedger]= useState<boolean>(false);

Expand All @@ -70,7 +72,7 @@ const SchemaList = (props: {
setLoading(true);
let schemaList;
if (allSchemaFlag) {
schemaList = await getAllSchemas(schemaListAPIParameter, SchemaType.INDY);
schemaList = await getAllSchemas(schemaListAPIParameter, schemaType);
} else {
schemaList = await getAllSchemasByOrgId(
schemaListAPIParameter,
Expand Down Expand Up @@ -229,9 +231,11 @@ const SchemaList = (props: {
}
if (did.includes(DidMethod.POLYGON) || did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) {
setW3CSchema(true);
setSchemaType(SchemaTypes.schema_W3C)
}
if (did.includes(DidMethod.INDY)) {
setW3CSchema(false);
setSchemaType(SchemaTypes.schema_INDY)
}
if (did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) {
setisNoLedger(true);
Expand Down
78 changes: 35 additions & 43 deletions src/components/Verification/AttributesListData.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,46 @@
import { Card } from 'flowbite-react';
import CopyDid from '../../commonComponents/CopyDid';

interface AttributesListProps {
attributeDataList: { entity: string; properties: any[] }[]
attributeDataList: { [key: string]: any }[]
}

const AttributesListData = ({attributeDataList}: AttributesListProps): JSX.Element => {
return (
<>
<Card >
<div className="flex h-full flex-col justify-center gap-0 sm:p-0">
<div className="flex border-b">
<div className="w-5/12 font-semibold flex truncate md:pl-1 sm:mr-8 md:mr-0 text-primary-700 dark:bg-gray-800 text-xl">
Attributes
</div>
<div className="w-1/12 font-semibold flex justify-start truncate md:pl-1 sm:mr-8 md:mr-0 text-primary-700 dark:bg-gray-800 text-xl">
</div>
<div className="w-6/12 font-semibold flex truncate sm:pl-4 text-primary-700 dark:bg-gray-800 text-xl">
{' '}
Values
</div>
</div>
const AttributesListData = ({ attributeDataList }: AttributesListProps): JSX.Element => {

{
attributeDataList?.map((item, index) => (
<div
key={item?.entity + 1}
className="flex w-full"
>
<div
className={`flex w-full text-lg`}
>
<div className="w-5/12 m-1 p-1 text-start text-gray-700 dark:text-white text-lg">
{item?.entity}
</div>
<div className="w-1/12 m-1 p-1 flex items-center text-gray-700 dark:text-white text-lg">
:
</div>
<div className="w-6/12 m-1 truncate p-1 flex justify-start text-gray-700 dark:text-white text-lg">
{item?.properties.join(', ')}
return (
<>
{attributeDataList?.map((item, index) => (
<Card key={index} className="mb-4">
<div className="flex flex-col justify-start gap-2 p-4">
<div className="flex justify-start text-xl font-semibold text-gray-900 dark:text-white mb-2">
{`Credential ${index + 1}`}
</div>


{Object.entries(item).map(([key, value], idx) => (
<div key={idx} className="flex w-full text-lg items-center">
<div className="w-3/12 font-semibold text-primary-700 dark:bg-gray-800 m-1 p-1 flex justify-start items-center text-start">
{key}
</div>
<div className="flex items-center p-1 m-1">
:
</div>
<div className="w-9/12 m-1 text-start text-gray-600 dark:text-white items-center cursor-pointer overflow-auto">
{key === 'schemaId' || key === 'credDefId' ? (
<div className="flex items-center">
<CopyDid value={value} className="truncate font-courier mt-2" />
</div>
</div>
) : (
<span className="truncate font-courier">{value}</span>
)}
</div>
))
}

</div>
))}
</div>
</Card>
))}
</>
);
}

</>
)
}

export default AttributesListData;
export default AttributesListData;
13 changes: 7 additions & 6 deletions src/components/Verification/EmailAttributesSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ const EmailAttributesSelection = () => {

const handleAttributeChange = async (
attributeName: string,
schemaId: string | undefined,
changeType: 'checkbox' | 'input' | 'select',
value: string | boolean,
schemaId?: string | undefined,
credDefId?: string | undefined
) => {
const updatedAttributes = attributeData?.map(attribute => {
if (attribute.attributeName === attributeName && attribute.schemaId === schemaId) {
if (attribute.attributeName === attributeName && attribute.schemaId === schemaId && attribute.credDefId === credDefId) {
switch (changeType) {
case 'checkbox':
return {
...attribute,
isChecked: value as boolean,
value: attribute?.value || '',
value: (value as boolean) ? attribute.value : '',
selectedOption: attribute?.condition || 'Select',
inputError: '',
selectError: '',
Expand Down Expand Up @@ -255,7 +256,7 @@ const EmailAttributesSelection = () => {
showCheckbox={true}
isVerificationUsingEmail={true}
onChange={(checked: boolean) => {
handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'checkbox', checked);
handleAttributeChange(attribute?.attributeName, 'checkbox', checked, attribute?.schemaId, attribute?.credDefId);
}}
/>
</div>
Expand All @@ -270,7 +271,7 @@ const EmailAttributesSelection = () => {
disabled={!attribute?.isChecked}
value={attribute?.selectedOption}
onChange={(e) =>
handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'select', e.target.value)
handleAttributeChange(attribute?.attributeName, 'select', e.target.value, attribute?.schemaId, attribute?.credDefId)
}
className={`${!attribute?.isChecked
? 'opacity-50 cursor-not-allowed'
Expand Down Expand Up @@ -302,7 +303,7 @@ const EmailAttributesSelection = () => {
type="number"
value={attribute?.value}
onChange={(e) =>
handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'input', e.target.value)
handleAttributeChange(attribute?.attributeName, 'input', e.target.value, attribute?.schemaId, attribute?.credDefId)
}
disabled={!attribute?.isChecked}
className={`${!attribute?.isChecked
Expand Down
13 changes: 5 additions & 8 deletions src/components/Verification/ProofRequestPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ const ProofRequest = (props: IProofRrquestDetails) => {
) : (
<div className=" text-gray-500 dark:text-gray-300 w-full">
<div className="mt-1 ">
<AttributesListData attributeDataList={aggregatedData} />
<SchemaCredDefDetails
schemaCredDefList={props?.userData?.slice(0, 1)}
/>

<AttributesListData attributeDataList={props?.userData} />

</div>
</div>
)}
Expand Down Expand Up @@ -204,11 +203,9 @@ const ProofRequest = (props: IProofRrquestDetails) => {
) : (
<div className=" text-gray-500 dark:text-gray-300 w-full">
<div className="mt-1">
<AttributesListData attributeDataList={aggregatedData} />
<AttributesListData attributeDataList={props?.userData} />


<SchemaCredDefDetails
schemaCredDefList={props?.userData?.slice(0, 1)}
/>
</div>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Verification/VerificationDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const VerificationDashboard = () => {
<Dashboard
title="Verify Credential"
options={options}
backButtonPath={pathRoutes.organizations.issuedCredentials}
backButtonPath={pathRoutes.organizations.credentials}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import SetDomainValueInput from './SetDomainValueInput';
import SetPrivateKeyValueInput from './SetPrivateKeyValue';
import { getOrganizationById, setAgentConfigDetails } from '../../../api/organization';
import type { IDedicatedAgentConfig} from '../interfaces';
import React from 'react';

const RequiredAsterisk = () => <span className="text-xs text-red-500">*</span>

Expand All @@ -36,6 +37,7 @@ const DedicatedAgentForm = ({
const [selectedLedger, setSelectedLedger] = useState('');
const [selectedDid, setSelectedDid] = useState('');
const [selectedMethod, setSelectedMethod]=useState('')
const [isSelectedNetwork, setIsSelectedNetwork]=useState('')
const [privateKeyValue, setPrivateKeyValue] = useState<string>('');
const [domainValue, setDomainValue] = useState<string>('');
const [isLoading, setIsLoading] = useState<boolean>(false);
Expand Down Expand Up @@ -118,6 +120,7 @@ const DedicatedAgentForm = ({
const handleLedgerChanges = (e: ChangeEvent<HTMLInputElement>) => {
setSelectedLedger(e.target.value);
setSelectedMethod('');
setIsSelectedNetwork('');
setSelectedDid('');
};
const handleMethodChanges = (e: ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -248,6 +251,7 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv
onChange={(e) => {
formikHandlers.handleChange(e);
handleNetworkChanges(e);
setIsSelectedNetwork(networks[network])
}}
className="mr-2"
/>
Expand All @@ -258,7 +262,19 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv
));
};

const isSubmitButtonDisabled = () => {
if (!selectedLedger) {
return true;
}
else if ((selectedLedger === Ledgers.POLYGON && !privateKeyValue) || (selectedLedger === Ledgers.INDY && (!selectedMethod || !isSelectedNetwork))) {
return true;
}
else if ((selectedLedger === Ledgers.NO_LEDGER && !selectedMethod) ||(selectedLedger === Ledgers.NO_LEDGER && selectedMethod === DidMethod.WEB && !domainValue)) {
return true;
}

return false;
};

return (
<>
Expand Down Expand Up @@ -565,6 +581,7 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv


<Button
disabled={isSubmitButtonDisabled()}
isProcessing={loading}
type="submit"
className='float-right mb-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:!bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const SharedAgentForm = ({
}: ISharedAgentForm) => {
const [haveDidShared, setHaveDidShared] = useState(false);
const [selectedLedger, setSelectedLedger] = useState('');
const [selectedMethod, setSelectedMethod] = useState('');
const [selectedMethod, setSelectedMethod] = useState('');
const [selectedNetwork, setSelectedNetwork] = useState('');
const [seedVal, setSeedVal] = useState('');
const [maskedSeedVal, setMaskedSeedVal] = useState('');
const [selectedDid, setSelectedDid] = useState('');
Expand Down Expand Up @@ -119,6 +120,7 @@ const SharedAgentForm = ({
const handleLedgerChange = (e: ChangeEvent<HTMLInputElement>) => {
setSelectedLedger(e.target.value);
setSelectedMethod('');
setSelectedNetwork('');
setSelectedDid('');
};

Expand Down Expand Up @@ -222,6 +224,7 @@ const SharedAgentForm = ({
onChange={(e) => {
formikHandlers.handleChange(e)
handleNetworkChange(e)
setSelectedNetwork(networks[network])
}}
className="mr-2"
/>
Expand All @@ -232,6 +235,21 @@ const SharedAgentForm = ({
));
};

const isSubmitDisabled = () => {
if (!selectedLedger) {
return true;
}
else if ((selectedLedger === Ledgers.POLYGON && !privateKeyValue) || (selectedLedger === Ledgers.INDY && (!selectedMethod || !selectedNetwork))) {
return true;
}
else if ((selectedLedger === Ledgers.NO_LEDGER && !selectedMethod) ||(selectedLedger === Ledgers.NO_LEDGER && selectedMethod === DidMethod.WEB && !domainValue)) {
return true;
}

return false;
};


return (
<div className="mt-4 flex-col gap-4">
<div className="bg-[#F4F4F4] dark:bg-gray-700 max-w-lg">
Expand Down Expand Up @@ -508,6 +526,7 @@ const SharedAgentForm = ({

<div className="w-full flex justify-end">
<Button
disabled={isSubmitDisabled()}
type="submit"
className="flex h-min p-0.5 focus:z-10 focus:outline-none border border-transparent enabled:hover:bg-cyan-800 dark:enabled:hover:bg-cyan-700 mt-4 text-base font-medium text-center text-white bg-primary-700 rounded-md hover:!bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const WalletSpinup = (props: {
useEffect(() => {
fetchOrganizationDetails()
}, []);


const onRadioSelect = (type: string) => {
setAgentType(type);
Expand Down
12 changes: 6 additions & 6 deletions src/config/pathRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export const pathRoutes = {
},
verification: {
requestProof: '/organizations/verification/verify-credentials',
email: '/organizations/verification/verify-credentials/email/schemas',
email: '/organizations/verification/verify-credentials/schema',
schema: '/organizations/verification/verify-credentials/schemas',
credDef: '/organizations/verification/verify-credentials/schemas/cred-defs',
w3cAttributes: '/organizations/verification/verify-credentials/email/schemas/attributes',
attributes: '/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes',
emailVerification: '/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/verification-email',
w3cEmailVerification: '/organizations/verification/verify-credentials/email/schemas/attributes/verification-email',
emailCredDef: '/organizations/verification/verify-credentials/email/schemas/cred-defs',
w3cAttributes: '/organizations/verification/verify-credentials/schema/attributes',
attributes: '/organizations/verification/verify-credentials/schema/cred-defs/attributes',
emailVerification: '/organizations/verification/verify-credentials/schema/cred-defs/attributes/verification-email',
w3cEmailVerification: '/organizations/verification/verify-credentials/schema/attributes/verification-email',
emailCredDef: '/organizations/verification/verify-credentials/schema/cred-defs',
connections: '/organizations/verification/verify-credentials/schemas/cred-defs/connections',
W3CConnections: '/organizations/verification/verify-credentials/schemas/connections',

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>
Loading
Loading