Skip to content

Commit

Permalink
Merge branch 'qa' of https://github.com/credebl/studio into merge/dev…
Browse files Browse the repository at this point in the history
…-to-qa-04-10-2024

Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Oct 4, 2024
2 parents ffe52e4 + f40757f commit 7d6210d
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 48 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy main to Deno Deploy
on:
push:
branches: main
Expand All @@ -16,7 +16,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Install Deno
uses: denoland/setup-deno@v1
Expand All @@ -29,6 +29,6 @@ jobs:
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "credebl-dev-ui"
entrypoint: "server/entry.mjs"
root: "dist"
project: "credebl-studio"
entrypoint: "server/entry.mjs" # 📝 Update the entrypoint if necessary
root: "dist" # 📝 Update the root if necessary
2 changes: 1 addition & 1 deletion src/api/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,4 @@ export const getFromCookies = (cookies: AstroCookies, key: string) =>{
export const removeFromLocalStorage = async (key: string) => {
await localStorage.removeItem(key);
return true;
};
};
6 changes: 3 additions & 3 deletions src/api/organization.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IDedicatedAgentConfig, IUpdatePrimaryDid } from '../components/organization/interfaces';
import {
axiosDelete,
axiosGet,
Expand All @@ -11,9 +12,8 @@ import {
import { apiRoutes } from '../config/apiRoutes';
import { getFromLocalStorage } from './Auth';
import { getHeaderConfigs } from '../config/GetHeaderConfigs';
import { storageKeys } from '../config/CommonConstant';
import type { IDedicatedAgentConfig, IUpdatePrimaryDid } from '../components/organization/interfaces';
import { pathRoutes } from '../config/pathRoutes';
import { storageKeys } from '../config/CommonConstant';

export const createOrganization = async (data: object) => {
const url = apiRoutes.organizations.create;
Expand Down Expand Up @@ -541,4 +541,4 @@ export const createSchemaRequest = async (
const err = error as Error;
return err?.message;
}
};
};
2 changes: 1 addition & 1 deletion src/components/Issuance/Issuance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,4 @@ const Name = (attr: { attr: string}) => {
);
};

export default IssueCred;
export default IssueCred;
24 changes: 12 additions & 12 deletions src/components/Verification/VerificationSchemasList.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

import { Alert, Button, Pagination } from 'flowbite-react';
import { DidMethod, SchemaTypes } from '../../common/enums';
import type { IAttributesDetails, ISchema, ISchemaData } from './interface';
import React, { useEffect, useState } from 'react';
import type { ChangeEvent } from 'react';
import type { AxiosResponse } from 'axios';
import { getFromLocalStorage, setToLocalStorage } from '../../api/Auth';
import { apiStatusCodes, itemPerPage, storageKeys } from '../../config/CommonConstant';
import { getAllSchemas, getAllSchemasByOrgId } from '../../api/Schema';
import { DidMethod, SchemaTypes } from '../../common/enums';
import { getOrganizationById } from '../../api/organization';
import { Create } from '../Issuance/Constant';
import { getFromLocalStorage, setToLocalStorage } from '../../api/Auth';

import type { AxiosResponse } from 'axios';
import BreadCrumbs from '../BreadCrumbs';
import SearchInput from '../SearchInput';
import RoleViewButton from '../RoleViewButton';
import { Features } from '../../utils/enums/features';
import { pathRoutes } from '../../config/pathRoutes';
import type { ChangeEvent } from 'react';
import { Create } from '../Issuance/Constant';
import CustomSpinner from '../CustomSpinner';
import { EmptyListMessage } from '../EmptyListComponent';
import { Features } from '../../utils/enums/features';
import RoleViewButton from '../RoleViewButton';
import SchemaCard from '../../commonComponents/SchemaCard';
import type { IAttributesDetails, ISchema, ISchemaData } from './interface';
import SearchInput from '../SearchInput';
import { getOrganizationById } from '../../api/organization';
import { pathRoutes } from '../../config/pathRoutes';

const VerificationSchemasList = () => {
const [schemasList, setSchemasList] = useState([]);
Expand Down
12 changes: 6 additions & 6 deletions src/components/organization/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import type { OrgDashboard, Organisation } from './interfaces';
import { apiStatusCodes, storageKeys } from '../../config/CommonConstant';
import { getEcosystems, getOrgDashboard, getOrganizationById } from '../../api/organization';
import { getFromLocalStorage, setToLocalStorage } from '../../api/Auth';
import { useEffect, useState } from 'react';

import { Alert } from 'flowbite-react';
import { AlertComponent } from '../AlertComponent';
import type { AxiosResponse } from 'axios';
import BreadCrumbs from '../BreadCrumbs';
import CustomAvatar from '../Avatar/index';
import CustomSpinner from '../CustomSpinner';
import DashboardCard from '../../commonComponents/DashboardCard';
import EditOrgdetailsModal from './EditOrgdetailsModal';
import OrganizationDetails from './OrganizationDetails';
import { Roles } from '../../utils/enums/roles';
import { getFromLocalStorage, setToLocalStorage } from '../../api/Auth';
import { pathRoutes } from '../../config/pathRoutes';
import { AlertComponent } from '../AlertComponent';
import WalletSpinup from './walletCommonComponents/WalletSpinup';
import DashboardCard from '../../commonComponents/DashboardCard';
import { envConfig } from '../../config/envConfig';
import { pathRoutes } from '../../config/pathRoutes';

const initialPageState = {
pageNumber: 1,
Expand All @@ -38,8 +39,6 @@ const Dashboard = () => {
const [ecoCount, setEcoCount] = useState(0);
const [error, setError] = useState<string | null>(null);
const [redirectToEndorsment, setRedirectToEndorsment] = useState<boolean>();
const [ecosystemUserRoles, setEcosystemUserRoles] = useState<string>('');



const EditOrgDetails = () => {
Expand Down Expand Up @@ -92,6 +91,7 @@ const Dashboard = () => {
}
setLoading(false);
};


const fetchEcosystems = async () => {
let organizationId = await getFromLocalStorage(storageKeys.ORG_ID);
Expand Down
27 changes: 13 additions & 14 deletions src/components/organization/DeleteOrganization.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { useEffect, useState } from "react";
import "react-toastify/dist/ReactToastify.css";

import type { IEcosystemOrganizations, IOrgCount } from "./interfaces";
import { ToastContainer, toast } from "react-toastify";
import { apiStatusCodes, storageKeys } from "../../config/CommonConstant";
import type { AxiosResponse } from "axios";
import {
deleteOrganization,
getEcosystems,
getOrganizationById,
getOrganizationReferences
} from "../../api/organization";
import { getFromLocalStorage, removeFromLocalStorage } from "../../api/Auth";
import { useEffect, useState } from "react";

import { AlertComponent } from "../AlertComponent";
import type { AxiosResponse } from "axios";
import BreadCrumbs from "../BreadCrumbs";
import { deleteOrganizationWallet } from "../../api/Agent";
import ConfirmationModal from "../../commonComponents/ConfirmationModal";
import { toast, ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { getFromLocalStorage, removeFromLocalStorage } from "../../api/Auth";
import { AlertComponent } from "../AlertComponent";
import { pathRoutes } from "../../config/pathRoutes";
import DeleteOrganizationsCard from '../../components/organization/DeleteOrganizationsCard'
import { EcosystemRoles } from "../../common/enums";
import React from "react";
import { deleteVerificationRecords } from '../../api/verification';
import { deleteConnectionRecords } from '../../api/connection'
import { deleteIssuanceRecords } from '../../api/issuance';
import { deleteConnectionRecords} from '../../api/connection'
import type { IEcosystemOrganizations, IOrgCount } from "./interfaces";
import { EcosystemRoles } from "../../common/enums";
import { deleteOrganizationWallet } from "../../api/Agent";
import { deleteVerificationRecords } from '../../api/verification';
import { pathRoutes } from "../../config/pathRoutes";

const DeleteOrganizations = () => {
const [loading, setLoading] = useState<boolean>(true);
Expand Down Expand Up @@ -306,13 +307,11 @@ const DeleteOrganizations = () => {
setError(null);
}}
/>

{ecosystemRoles.length > 0 &&
<h2 className="mb-4 dark:text-white">
You are Ecosystem Lead for <strong>{ecosystemRoles.join(', ')}</strong>. You cannot remove yourself from the ecosystem, delete the organization's wallet, and delete your organization.
</h2>
}

{organizationData && (
<div>
{cardData.map((card, index) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/organization/EditOrgdetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { EditOrgdetailsModalProps, ILogoImage, Organisation, Values } from
import { processImage } from '../../utils/processImage';
import FormikErrorMessage from '../../commonComponents/formikerror/index'
import CustomSpinner from '../CustomSpinner';

interface IUpdateOrgPayload {
orgId: string | undefined;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organization/OrganizationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
);
};

export default OrganizationDetails;
export default OrganizationDetails;
1 change: 0 additions & 1 deletion src/components/organization/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export interface ILedgerItem {
deletedAt: string | null;
}


export interface IOrgCount {
verificationRecordsCount: number;
connectionRecordsCount: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Card, Pagination } from 'flowbite-react';
import { Button, Pagination } from 'flowbite-react';
import { useEffect, useState } from 'react';
import type { ChangeEvent } from 'react';

Expand Down Expand Up @@ -33,7 +33,6 @@ const ReceivedInvitations = () => {
const [error, setError] = useState<string | null>(null);

const [currentPage, setCurrentPage] = useState(initialPageState);
const timestamp = Date.now();

const onPageChange = (page: number) => {
setCurrentPage({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { apiStatusCodes, storageKeys } from '../../../config/CommonConstant';
import { getFromLocalStorage, passwordEncryption } from '../../../api/Auth';
import { getFromLocalStorage } from '../../../api/Auth';
import {
createDid,
getOrganizationById,
Expand Down Expand Up @@ -93,6 +93,7 @@ const WalletSpinup = (props: {
fetchOrganizationDetails()
}, []);


const onRadioSelect = (type: string) => {
setAgentType(type);
};
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>
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,15 @@
---
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import LayoutSidebar from "../../../../../../../app/LayoutSidebar.astro";
import EmailCredDefSelection from "../../../../../../../components/Verification/EmailCredDefSelection";
import { pathRoutes } from "../../../../../../../config/pathRoutes";
import { checkUserSession } from "../../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
const route: string = pathRoutes.auth.sinIn
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailCredDefSelection client:load/>
</LayoutSidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import LayoutSidebar from "../../../../../../app/LayoutSidebar.astro";
import EmailSchemaSelection from "../../../../../../components/Verification/EmailSchemaSelection";
import { pathRoutes } from "../../../../../../config/pathRoutes";
import { checkUserSession } from "../../../../../../utils/check-session";
const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname});
const route: string = pathRoutes.auth.sinIn
if (!response.authorized) {
return Astro.redirect(response.redirect);
}
---

<LayoutSidebar notFoundPage={!response.permitted}>
<EmailSchemaSelection client:load/>
</LayoutSidebar>

0 comments on commit 7d6210d

Please sign in to comment.