Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/credebl/studio into fix-…
Browse files Browse the repository at this point in the history
…error-message
  • Loading branch information
16-karan committed Dec 29, 2023
2 parents 38b7019 + ff7404d commit 0f28e53
Show file tree
Hide file tree
Showing 23 changed files with 378 additions and 290 deletions.
51 changes: 51 additions & 0 deletions public/images/dark-dpg-alliance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions public/images/mobile_mockup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/api/issuance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import axios from 'axios';
import { apiRoutes } from '../config/apiRoutes';
import { storageKeys } from '../config/CommonConstant';
import {
Expand All @@ -14,8 +13,8 @@ export const getIssuedCredentials = async ({page,
sortBy,
sortingOrder}: IConnectionListAPIParameter) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortByValue=${sortingOrder}&sorting=${sortBy}`;

const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}?pageSize=${itemPerPage}&pageNumber=${page}&searchByText=${search}&sortBy=${sortingOrder}&sortField=${sortBy}`;
const axiosPayload = {
url,
config: await getHeaderConfigs(),
Expand Down
16 changes: 8 additions & 8 deletions src/commonComponents/PublicNavbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g

<a
href="https://docs.credebl.id/en/intro/what-is-credebl/"
class="text-gray-600 py-2 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-md px-4 lg:px-3 lg:py-2.5 ml-4 dark:text-white focus:outline-none "
class="text-gray-600 py-2 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-md px-4 lg:px-3 lg:py-2.5 ml-4 dark:text-white focus:outline-none hover:bg-gray-100 dark:hover:bg-gray-800"
>
Documentation
</a>
<a
href="/explore"
class="text-gray-600 py-2 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-md px-4 lg:px-3 lg:py-2.5 ml-4 dark:text-white focus:outline-none "
class="text-gray-600 py-2 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-md px-4 lg:px-3 lg:py-2.5 ml-4 dark:text-white focus:outline-none hover:bg-gray-100 dark:hover:bg-gray-800"
>
Explore Organizations
</a>
Expand All @@ -84,7 +84,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
>
<a href="https://github.com/credebl" class="hidden md:block">
<svg
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-white"
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-500"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
viewBox="0 0 20 20"
Expand All @@ -101,7 +101,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
target="_blank"
>
<svg
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-white"
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-500"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
Expand All @@ -122,7 +122,7 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g
height="18"
viewBox="0 0 20 18"
fill="currentColor"
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-white"
class="w-6 h-6 text-gray-700 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-500"
>
<path
d="M0.500972 0.0306835C0.484277 0.0511379 0.684618 0.352842 0.946175 0.710796C1.2133 1.06364 1.55833 1.52898 1.71415 1.73864C1.86997 1.9483 2.13709 2.30625 2.30404 2.53125C2.61569 2.94034 4.27963 5.16989 4.95856 6.08523C5.15891 6.35114 5.48724 6.79091 5.68202 7.05682C5.88236 7.32273 6.17731 7.71648 6.33313 7.92614C6.48895 8.1358 6.8952 8.68296 7.24023 9.13807C7.58526 9.59318 7.86351 9.99205 7.86351 10.0227C7.86351 10.0534 7.75778 10.1864 7.62422 10.3193C7.49066 10.4523 6.97311 10.9943 6.47782 11.5313C5.97697 12.0631 5.37038 12.7227 5.11995 12.9835C2.99411 15.2438 0.517667 17.9233 0.517667 17.954C0.517667 17.9795 0.868264 18 1.29677 18H2.07588L2.29848 17.775C2.42091 17.6523 2.60456 17.458 2.70473 17.3506C2.79933 17.2381 3.33357 16.6653 3.88451 16.0824C4.43545 15.4943 4.95856 14.9318 5.05317 14.8347C5.14221 14.7324 5.67089 14.1699 6.22183 13.5818C6.77277 12.9938 7.40718 12.3136 7.62978 12.0733C8.38106 11.2602 8.59253 11.0455 8.63149 11.0455C8.65375 11.0455 8.74835 11.158 8.84852 11.2909C8.94313 11.4239 9.19355 11.7614 9.40503 12.0426C9.6165 12.3239 9.9504 12.7739 10.1507 13.0398C10.3511 13.3057 10.6794 13.7455 10.8798 14.0114C11.0801 14.2773 11.798 15.2438 12.4769 16.1591C13.1559 17.0744 13.7569 17.8619 13.8125 17.9131C13.9016 17.9949 14.0964 18 16.7008 17.9898L19.5 17.9744L18.988 17.2841C18.5094 16.6347 18.1533 16.1591 17.4632 15.2386C17.3074 15.029 17.0069 14.625 16.7954 14.3438C16.5839 14.0625 15.9829 13.2494 15.4487 12.5438C14.5137 11.2909 14.2355 10.9176 13.512 9.94602C13.3228 9.69034 13.0334 9.30171 12.8665 9.0767C12.0317 7.96193 11.8147 7.66534 11.8147 7.62955C11.8147 7.60909 12.0317 7.35852 12.2988 7.07216C12.5715 6.79091 13.0668 6.26421 13.4007 5.90114C13.7402 5.54318 14.4024 4.83239 14.8755 4.32102C15.3485 3.81477 15.8159 3.31875 15.905 3.21648C15.9996 3.1142 16.5227 2.55682 17.0736 1.96875C18.2089 0.761932 18.643 0.296593 18.7877 0.122728L18.8934 0H18.0642L17.2406 0.0051136L15.7826 1.575C12.7886 4.79148 11.1191 6.56591 11.0634 6.58125C11.0356 6.59148 10.6182 6.075 10.1452 5.4358C9.67215 4.79659 9.11565 4.05511 8.9153 3.7892C8.45897 3.17045 7.95812 2.50568 7.35153 1.6875C7.08997 1.33466 6.70599 0.818184 6.49451 0.536934L6.10496 0.0255699L3.32244 0.0102272C1.79206 0.0051136 0.523232 0.0153427 0.500972 0.0306835Z"
Expand All @@ -132,13 +132,13 @@ const navbarClass = `bg-white dark:bg-gray-900 w-full z-20 top-0 left-0 border-g

<a
href={pathRoutes.auth.sinIn}
class="ml-3 hover:bg-secondary-700 bg-transparent ring-2 dark:ring-white text-black font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:text-white dark:hover:text-black"
class="ml-3 hover:bg-secondary-700 bg-transparent ring-2 text-black font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:text-white dark:hover:text-primary-700 dark:ring-white ring-primary-700"
>
Sign in
Sign In
</a>
<a
href={pathRoutes.auth.signUp}
class="text-white bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:bg-primary-600 dark:hover:bg-primary-700 focus:outline-none dark:focus:ring-primary-800"
class="text-white bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 mr-2 dark:bg-primary-600 dark:hover:bg-primary-700 focus:outline-none dark:focus:ring-primary-800 ring-2 ring-primary-700"
>
Sign Up
</a>
Expand Down
15 changes: 10 additions & 5 deletions src/commonComponents/SchemaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ interface IProps {
issuerDid: string,
attributes: [],
created: string,
isClickable?: boolean
onClickCallback: (schemaId: string, attributes: string[], issuerDid: string, created: string) => void;
limitedAttributes?: boolean
}
const SchemaCard = (props: IProps) => {

const attributes = props.limitedAttributes !== false ? props?.attributes?.slice(0, 3) : props?.attributes

return (
<Card onClick={() => {
props.onClickCallback(props.schemaId, props.attributes, props.issuerDid, props.created)
}}
id="schema-cards"
className='transform transition duration-500 hover:scale-105 hover:bg-gray-50 cursor-pointer h-full w-full overflow-hidden'>
className={`transform transition duration-500 ${props.isClickable !== false ? "hover:scale-105" : "hover:!cursor-default"} hover:bg-gray-50 cursor-pointer h-full w-full overflow-hidden`}>
<div className="flex justify-between items-baseline">
<div className='min-w-[8rem] max-w-100/10rem'>
<h5 className="text-xl font-bold leading-[1.1] text-gray-900 dark:text-white break-words truncate line-clamp-2 max-h-[43px] whitespace-normal" style={{ display: "-webkit-box" }}>
Expand Down Expand Up @@ -55,10 +60,10 @@ const SchemaCard = (props: IProps) => {
Attributes:
<div className="flex flex-wrap items-start">

{props.attributes && props.attributes.length > 0 && (
{attributes && attributes.length > 0 && (
<>
{props?.attributes?.slice(0, 3).map((element, index) => (
<div key={index}>
{attributes?.map((element) => (
<div key={element.attributeName}>
<span
style={{ display: 'block' }}
className="m-1 bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300"
Expand All @@ -67,7 +72,7 @@ const SchemaCard = (props: IProps) => {
</span>
</div>
))}
{props?.attributes?.length > 3 && <span>...</span>}
{props?.limitedAttributes !== false && props?.attributes?.length > 3 && <span>...</span>}
</>
)}
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/components/ColorModeSwitcher.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
<div
id="tooltip-toggle"
role="tooltip"
class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip"
class="inline-block absolute z-10 invisible px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip"
>
Toggle dark mode
<span class="dark:hidden inline-block"> Toggle dark mode</span>
<span class="dark:inline-block hidden"> Toggle light mode</span>
<div class="tooltip-arrow" data-popper-arrow></div>
</div>

Expand Down
107 changes: 67 additions & 40 deletions src/components/Ecosystem/EcosystemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const initialPageState = {
const EcosystemList = () => {
const [openModal, setOpenModal] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(true);
const [selectedOrgId, setSelectedOrgId] = useState<string>("");
const [message, setMessage] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
const [currentPage, setCurrentPage] = useState(initialPageState);
Expand All @@ -55,9 +56,9 @@ const EcosystemList = () => {
};

const fetchEcosystems = async () => {
setLoading(true);
const id = await getFromLocalStorage(storageKeys.ORG_ID);
// setOrgId(id);
setSelectedOrgId(id)
setLoading(true);
if (id) {
const response = await getEcosystems(
id,
Expand All @@ -70,7 +71,7 @@ const EcosystemList = () => {
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const ecosystemData = data?.data;
if (ecosystemData) {

setEcosystemList(ecosystemData);
} else {
await removeFromLocalStorage(storageKeys.ECOSYSTEM_ID);
Expand Down Expand Up @@ -132,9 +133,9 @@ const EcosystemList = () => {
const isEcosystemList = Boolean(ecosystemList && ecosystemList?.length > 0);
const showCreateButton = Boolean(
isEcosystemList &&
(isEcosystemData?.isMultiEcosystem || isEcosystemData?.isEcosystemLead),
(isEcosystemData?.isMultiEcosystem || isEcosystemData?.isEcosystemLead),
);

return (
<div className="px-4 pt-2">
<div className="mb-2 col-span-full xl:mb-2">
Expand All @@ -145,10 +146,10 @@ const EcosystemList = () => {
Ecosystems
</h1>
<div className="ml-auto">
<SearchInput
onInputChange={searchInputChange}
/>
</div>
<SearchInput
onInputChange={searchInputChange}
/>
</div>
{showCreateButton && (
<RoleViewButton
buttonTitle="Create"
Expand All @@ -174,8 +175,8 @@ const EcosystemList = () => {
)}
</div>
<div>
<div className="p-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800 min-h-100/18rem flex flex-col justify-between">
<div className="p-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800 flex flex-col justify-between">


<AlertComponent
message={message ?? error}
Expand Down Expand Up @@ -258,37 +259,63 @@ const EcosystemList = () => {
);
})}
</div>

) : (
ecosystemList && (
<EmptyListMessage
message={'No Ecosystem'}
description={'Get started by creating a new Ecosystem'}
buttonContent={'Create Ecosystem'}
onClick={createOrganizationModel}
svgComponent={
<svg
className="pr-2 mr-1"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="15"
fill="none"
viewBox="0 0 24 24"
>
<path
fill="#fff"
d="M21.89 9.89h-7.78V2.11a2.11 2.11 0 1 0-4.22 0v7.78H2.11a2.11 2.11 0 1 0 0 4.22h7.78v7.78a2.11 2.11 0 1 0 4.22 0v-7.78h7.78a2.11 2.11 0 1 0 0-4.22Z"
/>
</svg>
}
/>
)
<>
{ecosystemList && (
<EmptyListMessage
message={'No Ecosystem'}
description={'Get started by creating a new Ecosystem'}
buttonContent={'Create Ecosystem'}
onClick={createOrganizationModel}
svgComponent={
<svg
className="pr-2 mr-1"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="15"
fill="none"
viewBox="0 0 24 24"
>
<path
fill="#fff"
d="M21.89 9.89h-7.78V2.11a2.11 2.11 0 1 0-4.22 0v7.78H2.11a2.11 2.11 0 1 0 0 4.22h7.78v7.78a2.11 2.11 0 1 0 4.22 0v-7.78h7.78a2.11 2.11 0 1 0 0-4.22Z"
/>
</svg>
}
/>
)}
{
!selectedOrgId &&
<EmptyListMessage
message={'No Organization'}
description={'Get started by creating a new Organization'}
buttonContent={'Create Organization'}
onClick={createOrganizationModel}
svgComponent={
<svg
className="pr-2 mr-1"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="15"
fill="none"
viewBox="0 0 24 24"
>
<path
fill="#fff"
d="M21.89 9.89h-7.78V2.11a2.11 2.11 0 1 0-4.22 0v7.78H2.11a2.11 2.11 0 1 0 0 4.22h7.78v7.78a2.11 2.11 0 1 0 4.22 0v-7.78h7.78a2.11 2.11 0 1 0 0-4.22Z"
/>
</svg>
}
/>
}
</>

)}

<div
className={`flex items-center justify-end ${
isEcosystemList && 'mt-auto'
}`}
className={`flex items-center justify-end ${isEcosystemList && 'mt-auto'
}`}
>
{isEcosystemList && ecosystemList && ecosystemList?.length > 10 && (
<Pagination
Expand All @@ -305,7 +332,7 @@ const EcosystemList = () => {
setMessage(value);
if (value) {
setTimeout(() => {
window.location.reload();
window.location.reload();
}, 2000);
} else {
fetchEcosystems();
Expand All @@ -317,6 +344,6 @@ const EcosystemList = () => {
</div>
</div>

)
)
}
export default EcosystemList;
Loading

0 comments on commit 0f28e53

Please sign in to comment.