From ffe52e4cf056229456cab129e1a95a242f80fff9 Mon Sep 17 00:00:00 2001 From: pranalidhanavade <137780597+pranalidhanavade@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:31:15 +0530 Subject: [PATCH] refactor: decouple ecosystem from existing code base (#764) * feat: decouple ecosystem codebase Signed-off-by: pranalidhanavade * feat: org dashboard changes Signed-off-by: pranalidhanavade * fix: added conditions for empty list components and create endorsement buttons Signed-off-by: pranalidhanavade * [Deno Deploy] Update .github/workflows/deploy.yml * feat:added env varibales in envConfig Signed-off-by: pranalidhanavade * feat: added ecosystem intercepter for ecosystem Signed-off-by: Tipu_Singh * refactor: changes in axios methods Signed-off-by: pranalidhanavade * fix: redirection logic for create schema page Signed-off-by: pranalidhanavade * fix: delete organization issues Signed-off-by: pranalidhanavade * refactor: removed unused and commented code Signed-off-by: pranalidhanavade --------- Signed-off-by: pranalidhanavade Signed-off-by: Tipu_Singh Co-authored-by: deno-deploy[bot] <75045203+deno-deploy[bot]@users.noreply.github.com> Co-authored-by: Tipu_Singh --- .github/workflows/deploy.yml | 4 ++-- .../Ecosystem/EcosystemSidebarOption.tsx | 22 ------------------- src/components/organization/Dashboard.tsx | 7 +----- .../organization/DeleteOrganization.tsx | 21 +----------------- .../organization/interfaces/index.ts | 19 ++++++++++++++++ 5 files changed, 23 insertions(+), 50 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 294b49dcd..346c25445 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,9 @@ name: Deploy on: push: - branches: develop + branches: main pull_request: - branches: develop + branches: main jobs: deploy: diff --git a/src/components/Ecosystem/EcosystemSidebarOption.tsx b/src/components/Ecosystem/EcosystemSidebarOption.tsx index 7da52e718..12b042cf5 100644 --- a/src/components/Ecosystem/EcosystemSidebarOption.tsx +++ b/src/components/Ecosystem/EcosystemSidebarOption.tsx @@ -16,38 +16,16 @@ const initialPageState = { const EcosystemSidebarOption = () => { const [isEcosystemEnabled, setIsEcosystemEnabled] = useState(false); - //TODO: Logic to disable ecosystem when organzaition and wallet is not created - - // const [currentPage, setCurrentPage] = useState(initialPageState); - // const [orgCount, setOrgCount] = useState(0); - // const [error, setError] = useState(null); - - // const getAllOrganizations = async () => { - // const response = await getOrganizations( - // currentPage.pageNumber, - // currentPage.pageSize, - // '', - // ); - // const { data } = response as AxiosResponse; - // if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - // setOrgCount(data?.data?.totalCount); - // } else { - // setError(response as string); - // } - // }; useEffect(() => { const checkEcosystemData = async () => { setIsEcosystemEnabled(true); }; checkEcosystemData(); - //TODO: Logic to disable ecosystem when organzaition and wallet is not created - // getAllOrganizations(); }, []); if (isEcosystemEnabled - // && orgCount ) { return (
  • diff --git a/src/components/organization/Dashboard.tsx b/src/components/organization/Dashboard.tsx index feec8943a..45ecf7dc8 100644 --- a/src/components/organization/Dashboard.tsx +++ b/src/components/organization/Dashboard.tsx @@ -55,14 +55,9 @@ const Dashboard = () => { const roles = orgRoles.split(','); setUserRoles(roles); }; - // const getEcosystemRole = async () => { - // const ecosysmetmRoles = await getFromLocalStorage(storageKeys.ECOSYSTEM_ROLE); - // console.log("ecosysmetmRoles",ecosysmetmRoles); - // setEcosystemUserRoles(ecosysmetmRoles) - // }; + useEffect(() => { getUserRoles(); - // getEcosystemRole(); }, []); diff --git a/src/components/organization/DeleteOrganization.tsx b/src/components/organization/DeleteOrganization.tsx index ac6d97c48..75269fedc 100644 --- a/src/components/organization/DeleteOrganization.tsx +++ b/src/components/organization/DeleteOrganization.tsx @@ -8,25 +8,6 @@ import { getOrganizationReferences } from "../../api/organization"; -export interface IEcosystemOrganizations { - id: string; - orgId: string; - status: string; - createDateTime: string; - lastChangedDateTime: string; - ecosystemId: string; - ecosystemRoleId: string; - ecosystemRole: IEcosystemRole; -} -export interface IEcosystemRole { - id: string; - name: string; - description: string; - createDateTime: string; - lastChangedDateTime: string; - deletedAt: string | null; -} - import BreadCrumbs from "../BreadCrumbs"; import { deleteOrganizationWallet } from "../../api/Agent"; import ConfirmationModal from "../../commonComponents/ConfirmationModal"; @@ -40,7 +21,7 @@ import React from "react"; import { deleteVerificationRecords } from '../../api/verification'; import { deleteIssuanceRecords } from '../../api/issuance'; import { deleteConnectionRecords} from '../../api/connection' -import type { IOrgCount } from "./interfaces"; +import type { IEcosystemOrganizations, IOrgCount } from "./interfaces"; import { EcosystemRoles } from "../../common/enums"; const DeleteOrganizations = () => { diff --git a/src/components/organization/interfaces/index.ts b/src/components/organization/interfaces/index.ts index 7fae1784f..20a799c8b 100644 --- a/src/components/organization/interfaces/index.ts +++ b/src/components/organization/interfaces/index.ts @@ -248,3 +248,22 @@ export interface ILedgerItem { orgInvitationsCount: number; orgUsersCount: number; } + + export interface IEcosystemOrganizations { + id: string; + orgId: string; + status: string; + createDateTime: string; + lastChangedDateTime: string; + ecosystemId: string; + ecosystemRoleId: string; + ecosystemRole: IEcosystemRole; + } + export interface IEcosystemRole { + id: string; + name: string; + description: string; + createDateTime: string; + lastChangedDateTime: string; + deletedAt: string | null; + }