Skip to content

Commit

Permalink
Merge develop to QA (#544)
Browse files Browse the repository at this point in the history
* refactor: user profile

Signed-off-by: karan <[email protected]>

* implemented new table

Signed-off-by: karan <[email protected]>

* replaced old table with new table

Signed-off-by: karan <[email protected]>

* implemented debouncing

Signed-off-by: karan <[email protected]>

* fix: sonar lint issues

Signed-off-by: karan <[email protected]>

* fix: sonar lint issues

Signed-off-by: karan <[email protected]>

* handled dark mode

Signed-off-by: karan <[email protected]>

* made minor changes

Signed-off-by: karan <[email protected]>

* updated user dashboard

Signed-off-by: karan <[email protected]>

* feat: implemented pagination on ecosystem

Signed-off-by: karan <[email protected]>

* handled ecosystem error message

Signed-off-by: karan <[email protected]>

* added sorting

Signed-off-by: karan <[email protected]>

* handled all conditions

Signed-off-by: karan <[email protected]>

* fix: margin and padding

Signed-off-by: karan <[email protected]>

* improved tooltip data

Signed-off-by: karan <[email protected]>

* fix: width issue

Signed-off-by: karan <[email protected]>

* improved roles wise svg

Signed-off-by: karan <[email protected]>

* changed verification svg

Signed-off-by: karan <[email protected]>

* added sorting in oob

Signed-off-by: karan <[email protected]>

* improved sorting

Signed-off-by: karan <[email protected]>

* handled spell check

Signed-off-by: karan <[email protected]>

* fix: PR Commits

Signed-off-by: karan <[email protected]>

* fix: org and ecosystem edit popup

Signed-off-by: karan <[email protected]>

* fix: org and ecosystem edit popup

Signed-off-by: karan <[email protected]>

* placed process image function in enum

Signed-off-by: karan <[email protected]>

* created common component to error message

Signed-off-by: karan <[email protected]>

* fix: passkey auth

Signed-off-by: karan <[email protected]>

* fix: validation for passkey

Signed-off-by: karan <[email protected]>

* fix: connection issue

Signed-off-by: karan <[email protected]>

* fix: connection issue

Signed-off-by: karan <[email protected]>

* handled data types

Signed-off-by: karan <[email protected]>

* handled data types

Signed-off-by: karan <[email protected]>

* fix: verified details data sync issue

Signed-off-by: karan <[email protected]>

* fix: verification popup

Signed-off-by: karan <[email protected]>

---------

Signed-off-by: karan <[email protected]>
Co-authored-by: karan <[email protected]>
Co-authored-by: Sanjay Khatal <[email protected]>
Co-authored-by: Nishad Shirsat <[email protected]>
Co-authored-by: 16-karan <[email protected]>
  • Loading branch information
5 people authored and GHkrishna committed Jan 30, 2024
1 parent 1f7fd13 commit 5ac3507
Show file tree
Hide file tree
Showing 27 changed files with 1,031 additions and 986 deletions.
70 changes: 40 additions & 30 deletions src/api/BulkIssuance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '../config/GetHeaderConfigs';
import { axiosGet, axiosPost } from '../services/apiRequests';
import { getFromLocalStorage } from './Auth';
import type { IConnectionListAPIParameter } from './connection';

export const getSchemaCredDef = async () => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
Expand Down Expand Up @@ -40,7 +41,10 @@ export const DownloadCsvTemplate = async (credDefId: string) => {
}
};

export const uploadCsvFile = async (payload: {file: Uint8Array | Blob, fileName:string}, credefId: string) => {
export const uploadCsvFile = async (
payload: { file: Uint8Array | Blob; fileName: string },
credefId: string,
) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.bulk.uploadCsv}?credDefId=${credefId}`;

Expand Down Expand Up @@ -80,16 +84,19 @@ export const getCsvFileData = async (
}
};

export const issueBulkCredential = async (requestId: string, clientId: string) => {
export const issueBulkCredential = async (
requestId: string,
clientId: string,
) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}/${requestId}${apiRoutes.Issuance.bulk.bulk}`;

const axiosPayload = {
url,
config: await getHeaderConfigs(),
payload: {
clientId
}
clientId,
},
};

try {
Expand All @@ -100,31 +107,33 @@ export const issueBulkCredential = async (requestId: string, clientId: string) =
}
};

export const retryBulkIssuance = async (fileId:string, clientId:string) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}/${fileId}${apiRoutes.Issuance.bulk.retry}`;
const axiosPayload = {
url,
payload:{clientId:clientId},
config: await getHeaderConfigs(),
};
try {
return await axiosPost(axiosPayload);
} catch (error) {
const err = error as Error;
return err?.message;
}
export const retryBulkIssuance = async (fileId: string, clientId: string) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}/${fileId}${apiRoutes.Issuance.bulk.retry}`;

const axiosPayload = {
url,
payload: { clientId: clientId },
config: await getHeaderConfigs(),
};

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

export const getFilesHistory = async (
pageNumber: number,
pageSize: number,
search: string,
) => {
export const getFilesHistory = async ({
page,
itemPerPage,
search,
sortBy,
sortingOrder,
}: IConnectionListAPIParameter) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.bulk.files}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}`;
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.bulk.files}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortingOrder}&sortField=${sortBy}`;

const axiosPayload = {
url,
Expand All @@ -141,13 +150,14 @@ export const getFilesHistory = async (

export const getFilesDataHistory = async (
requestId: string,
pageNumber: number,
pageSize: number,
itemPerPage: number,
page: number,
search: string,
sortBy:string
sortingOrder: string,
sortBy: string,
) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}/${requestId}${apiRoutes.Issuance.bulk.filesData}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}&sortBy=${sortBy}`;
const url = `${apiRoutes.organizations.root}/${orgId}/${requestId}${apiRoutes.Issuance.bulk.filesData}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortBy}&sortField=${sortingOrder}`;

const axiosPayload = {
url,
Expand Down
115 changes: 73 additions & 42 deletions src/app/NavBarSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import { getFromCookies } from '../api/Auth';
import { RolePermissions } from '../config/permissions';
const { hideOrgAgent } = Astro.props;
console.log(3242, hideOrgAgent)
const role = getFromCookies(Astro.cookies, 'role');
const permittedPages = RolePermissions.find(
(item) => item.role === role,
)?.pages;
---

<nav
Expand All @@ -30,40 +28,47 @@ const permittedPages = RolePermissions.find(
<div class="flex items-center justify-between">
<div class="flex items-center justify-start">
{
!hideOrgAgent &&
<button
id="toggleSidebarMobile"
aria-expanded="true"
aria-controls="sidebar"
class="p-2 text-gray-600 rounded cursor-pointer lg:hidden hover:text-gray-900 hover:bg-gray-100 focus:bg-gray-100 dark:focus:bg-gray-700 focus:ring-2 focus:ring-gray-100 dark:focus:ring-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
>
<svg
id="toggleSidebarMobileHamburger"
class="w-6 h-6"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
clip-rule="evenodd"></path>
</svg>
<svg
id="toggleSidebarMobileClose"
class="hidden w-6 h-6"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
!hideOrgAgent && (
<button
id="toggleSidebarMobile"
aria-expanded="true"
aria-controls="sidebar"
class="p-2 text-gray-600 rounded cursor-pointer lg:hidden hover:text-gray-900 hover:bg-gray-100 focus:bg-gray-100 dark:focus:bg-gray-700 focus:ring-2 focus:ring-gray-100 dark:focus:ring-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
>
<path
fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
</button>
<svg
id="toggleSidebarMobileHamburger"
class="w-6 h-6"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
clip-rule="evenodd"
/>
</svg>
<svg
id="toggleSidebarMobileClose"
class="hidden w-6 h-6"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"
/>
</svg>
</button>
)
}
<a href={permittedPages && permittedPages[0] || pathRoutes.users.dashboard} class="flex ml-2 md:mr-24">
<a
href={(permittedPages && permittedPages[0]) ||
pathRoutes.users.dashboard}
class="flex ml-2 md:mr-24"
>
<img
src="/images/CREDEBL_ICON.png"
class="h-8 mr-3"
Expand All @@ -87,7 +92,6 @@ const permittedPages = RolePermissions.find(
<div class="hidden sm:block mr-5">
<OrgDropDwon client:visible />
</div>

</>
)
}
Expand Down Expand Up @@ -392,9 +396,21 @@ const permittedPages = RolePermissions.find(
>
<span class="sr-only">View</span>
<!-- Icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="#6B7280" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M20.047 16.473c-1.204-1.473-2.053-2.223-2.053-6.285 0-3.72-1.9-5.044-3.463-5.688a.835.835 0 0 1-.466-.495C13.79 3.072 13.022 2.25 12 2.25s-1.791.823-2.063 1.756a.827.827 0 0 1-.466.494c-1.565.645-3.463 1.965-3.463 5.688-.002 4.062-.852 4.812-2.056 6.285-.499.61-.062 1.527.81 1.527h14.48c.867 0 1.301-.92.805-1.527ZM15 18v.75a3 3 0 0 1-6 0V18"/>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke="#6B7280"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M20.047 16.473c-1.204-1.473-2.053-2.223-2.053-6.285 0-3.72-1.9-5.044-3.463-5.688a.835.835 0 0 1-.466-.495C13.79 3.072 13.022 2.25 12 2.25s-1.791.823-2.063 1.756a.827.827 0 0 1-.466.494c-1.565.645-3.463 1.965-3.463 5.688-.002 4.062-.852 4.812-2.056 6.285-.499.61-.062 1.527.81 1.527h14.48c.867 0 1.301-.92.805-1.527ZM15 18v.75a3 3 0 0 1-6 0V18"
></path>
</svg>
</button>
<!-- Dropdown menu -->
<div
Expand Down Expand Up @@ -426,13 +442,28 @@ const permittedPages = RolePermissions.find(
id="dropdown-2"
>
<DisplayUser client:load />
<ul class="py-1" role="none">
<ul class="py-1 divide-y" role="none">
<li>
<a
href={pathRoutes.users.profile}
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white"
role="menuitem">Profile</a
>
class="flex space-x-2 px-4 py-2 my-2 text-sm text-gray-700 dark:text-white hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
role="menuitem"
><svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="21"
viewBox="0 0 20 21"
fill="none"
class="text-gray-700 dark:text-white"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.5626 18.2002H3.43818C2.73179 18.2002 2.21016 17.5032 2.47658 16.8622C3.71277 13.8982 6.61694 12.2002 9.99986 12.2002C13.3838 12.2002 16.288 13.8982 17.5242 16.8622C17.7906 17.5032 17.269 18.2002 16.5626 18.2002ZM5.91667 6.20019C5.91667 3.99418 7.749 2.20018 9.99986 2.20018C12.2517 2.20018 14.0831 3.99418 14.0831 6.20019C14.0831 8.40619 12.2517 10.2002 9.99986 10.2002C7.749 10.2002 5.91667 8.40619 5.91667 6.20019ZM19.9557 17.8362C19.2136 14.4772 16.8923 11.9982 13.837 10.8732C15.456 9.59616 16.4003 7.53114 16.0532 5.27013C15.651 2.64713 13.4236 0.548173 10.7348 0.242172C7.02322 -0.180828 3.87508 2.64918 3.87508 6.20019C3.87508 8.09019 4.7693 9.77417 6.16371 10.8732C3.10744 11.9982 0.787165 14.4772 0.044024 17.8362C-0.225466 19.0572 0.778999 20.2002 2.05398 20.2002H17.9457C19.2217 20.2002 20.2262 19.0572 19.9557 17.8362Z"
fill="currentColor"></path>
</svg>
<span>Profile</span>
</a>
</li>
<li>
<SignOutButton client:load />
Expand Down
7 changes: 7 additions & 0 deletions src/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export enum OrganizationRoles {
organizationVerifier = "verifier"
}

export enum OrganizationRoles {
organizationMember = "member",
organizationOwner = "owner",
organizationIssuer = "issuer",
organizationVerifier = "verifier"
}

export enum PlatformRoles {
platformAdmin = "platform_admin"
}
Expand Down
3 changes: 2 additions & 1 deletion src/commonComponents/PasseyAddDevicePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ interface PasswordValue {
}

const PasskeyAddDevice = (props: {
setOpenModel(arg0: boolean): unknown; openModal: boolean; closeModal: (flag: boolean) => void; registerWithPasskey: (flag: boolean) => Promise<void>
setOpenModel(arg0: boolean): unknown; openModal: boolean; closeModal: (flag: boolean) => void;
registerWithPasskey: (flag: boolean) => Promise<void>
}
) => {
const [fidoUserError, setFidoUserError] = useState<string | null>(null)
Expand Down
10 changes: 6 additions & 4 deletions src/commonComponents/datatable/SortDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { IDataTable } from './interface';
import CustomSpinner from '../../components/CustomSpinner';
import SearchInput from '../../components/SearchInput';
import { Pagination } from 'flowbite-react';
import { useState } from 'react';
import { ChangeEvent, useState } from 'react';
import { EmptyListMessage } from '../../components/EmptyListComponent';

const SortDataTable: React.FC<IDataTable> = ({
Expand Down Expand Up @@ -34,7 +34,9 @@ const SortDataTable: React.FC<IDataTable> = ({
const handleSortByValues = (event: { target: { value: any } }) => {
const newSelectedValue = event.target.value;
setSelectedValue(newSelectedValue);
searchSortByValue(newSelectedValue);
if(searchSortByValue){
searchSortByValue(newSelectedValue);
}
};

const {
Expand All @@ -53,9 +55,9 @@ const SortDataTable: React.FC<IDataTable> = ({
const sortValues = [
{
label: 'Descending',
value: 'DESC',
value: 'desc',
},
{ label: 'Ascending', value: 'ASC' },
{ label: 'Ascending', value: 'asc' },
];

return (
Expand Down
6 changes: 6 additions & 0 deletions src/commonComponents/formikerror/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

const ErrorMessage = ({ error, touched }) => {
return touched && <span className="text-red-500 text-xs">{error}</span>;
};
export default ErrorMessage;
2 changes: 1 addition & 1 deletion src/components/ConnectionsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const initialPageState = {
page: 1,
search: '',
sortBy: 'createDateTime',
sortingOrder: 'DESC',
sortingOrder: 'desc',
allSearch: '',
};
const ConnectionList = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ecosystem/Endorsement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const EndorsementList = () => {
page: 1,
search: '',
sortBy: 'id',
sortingOrder: 'DESC',
sortingOrder: 'desc',
type: '',
status: '',
});
Expand Down
22 changes: 21 additions & 1 deletion src/components/Ecosystem/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,24 @@ export interface Ecosystem {
website: string
roles: string[]
logoFile:string
}
}

export interface EditEntityModalProps {
openModal: boolean;
setMessage: (message: string) => void;
setOpenModal: (flag: boolean) => void;
onEditSuccess?: () => void;
entityData: Ecosystem | null;
isOrganization: boolean;
}

export interface EditEntityValues {
name: string;
description: string;
}

export interface ILogoImage {
logoFile: string | File;
imagePreviewUrl: string | ArrayBuffer | null | File;
fileName: string;
}
Loading

0 comments on commit 5ac3507

Please sign in to comment.