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 Jan 30, 2024
1 parent 4fded75 commit 6c6d1ae
Show file tree
Hide file tree
Showing 32 changed files with 1,734 additions and 1,366 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
22 changes: 15 additions & 7 deletions src/api/ecosystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { apiRoutes } from '../config/apiRoutes';
import { getFromLocalStorage } from './Auth';
import { storageKeys } from '../config/CommonConstant';
import { getHeaderConfigs } from '../config/GetHeaderConfigs';
import type { IMemberListAPIParameter } from '../components/Ecosystem/MemberList';

interface CreateEcosystemPayload {
name: string;
Expand Down Expand Up @@ -63,7 +64,12 @@ export const updateEcosystem = async (dataPayload: CreateEcosystemPayload) => {
}
};

export const getEcosystems = async (orgId: string, pageNumber?: number, pageSize?: number, search = '') => {
export const getEcosystems = async (
orgId: string,
pageNumber?: number,
pageSize?: number,
search = '',
) => {
const url = `${apiRoutes.Ecosystem.root}/${orgId}`;
const axiosPayload = {
url,
Expand Down Expand Up @@ -228,14 +234,16 @@ export const getEcosystemDashboard = async (
}
};

export const getEcosystemMemberList = async (
pageNumber: number,
pageSize: number,
search: string,
) => {
export const getEcosystemMemberList = async ({
page,
itemPerPage,
search,
sortBy,
sortingOrder,
}: IMemberListAPIParameter) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID);
const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.members}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}`;
const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.members}?pageNumber=${page}&pageSize=${itemPerPage}&search=${search}&sortBy=${sortingOrder.toLocaleLowerCase()}&sortField=${sortBy}`;

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
Loading

0 comments on commit 6c6d1ae

Please sign in to comment.