Skip to content

Commit 40c14bf

Browse files
Merge branch 'main' of https://github.com/credebl/studio into 291-send-invitation-design
Signed-off-by: @nishad.shirsat <[email protected]>
2 parents 4a8e5f8 + 4a4ac78 commit 40c14bf

File tree

17 files changed

+582
-374
lines changed

17 files changed

+582
-374
lines changed

package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/organization.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const getOrgDashboard = async (orgId: string) => {
130130
}
131131

132132
try {
133-
return axiosGet(axiosPayload);
133+
return await axiosGet(axiosPayload);
134134
}
135135
catch (error) {
136136
const err = error as Error
@@ -235,7 +235,7 @@ export const getOrganizationUsers = async () => {
235235
}
236236

237237
try {
238-
return axiosGet(axiosPayload);
238+
return await axiosGet(axiosPayload);
239239
}
240240
catch (error) {
241241
const err = error as Error
@@ -270,3 +270,36 @@ export const editOrganizationUserRole = async (userId: number, roles: number[])
270270
}
271271
}
272272

273+
//Create Connection
274+
275+
276+
export const createConnection = async (orgName: string) => {
277+
278+
const url = apiRoutes.connection.create
279+
280+
const orgId = await getFromLocalStorage(storageKeys.ORG_ID)
281+
282+
const data = {
283+
label: orgName,
284+
multiUseInvitation: true,
285+
autoAcceptConnection: true,
286+
orgId: Number(orgId)
287+
}
288+
const payload = data
289+
290+
const axiosPayload = {
291+
url,
292+
payload,
293+
config: await getHeaderConfigs()
294+
}
295+
296+
try {
297+
return await axiosPost(axiosPayload);
298+
}
299+
catch (error) {
300+
const err = error as Error
301+
return err?.message
302+
}
303+
}
304+
305+

src/app/NavBarSidebar.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ import SignOutButton from '../components/SignOutButton/index'
289289
</div>
290290
</a> -->
291291
<a
292-
href="./invitations"
292+
href={pathRoutes.users.invitations}
293293
class="block p-4 text-center rounded-lg hover:bg-gray-100 dark:hover:bg-gray-600"
294294
>
295295
<svg
296296
class="mx-auto mb-1 text-gray-500 w-7 h-7 dark:text-gray-400"
297297
xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
298-
  <path d="M9.978 13.2329L19.37 6.56494C19.312 6.50191 19.2498 6.44278 19.184 6.38794L11.2 0.650939C10.8566 0.392942 10.4392 0.252371 10.0097 0.25003C9.58011 0.247688 9.16123 0.383702 8.815 0.637939L0.8 6.39994C0.726113 6.46135 0.65692 6.52821 0.593 6.59994L9.978 13.2329Z" fill="#6B7280"/>
299-
  <path d="M11.181 14.8639C10.8416 15.1166 10.4292 15.2521 10.006 15.2499C9.57095 15.2509 9.14735 15.1106 8.799 14.8499L0 8.62694V17.9999C0 18.5304 0.210714 19.0391 0.585786 19.4142C0.960859 19.7892 1.46957 19.9999 2 19.9999H18C18.5304 19.9999 19.0391 19.7892 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 17.9999V8.57294L11.181 14.8639Z" fill="#6B7280"/>
298+
<path d="M9.978 13.2329L19.37 6.56494C19.312 6.50191 19.2498 6.44278 19.184 6.38794L11.2 0.650939C10.8566 0.392942 10.4392 0.252371 10.0097 0.25003C9.58011 0.247688 9.16123 0.383702 8.815 0.637939L0.8 6.39994C0.726113 6.46135 0.65692 6.52821 0.593 6.59994L9.978 13.2329Z" fill="#6B7280"/>
299+
<path d="M11.181 14.8639C10.8416 15.1166 10.4292 15.2521 10.006 15.2499C9.57095 15.2509 9.14735 15.1106 8.799 14.8499L0 8.62694V17.9999C0 18.5304 0.210714 19.0391 0.585786 19.4142C0.960859 19.7892 1.46957 19.9999 2 19.9999H18C18.5304 19.9999 19.0391 19.7892 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 17.9999V8.57294L11.181 14.8639Z" fill="#6B7280"/>
300300
</svg>
301301

302302
<div class="text-sm font-medium text-gray-900 dark:text-white">
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { ReactElement } from "react";
2+
3+
export const EmptyListMessage = ({ message, description, buttonContent, svgComponent, onClick }
4+
: {
5+
message: string,
6+
description: string,
7+
buttonContent?: string,
8+
svgComponent?: ReactElement,
9+
10+
onClick?: () => void,
11+
}) => {
12+
return (
13+
<div className='flex mt-20 justify-start items-center flex-col'>
14+
<p className='text-2xl font-bold mb-4'>{message}</p>
15+
<p className='text-lg mb-4'>{description}</p>
16+
{
17+
buttonContent
18+
&& <button
19+
className='group flex h-min p-3 mt-10 items-center justify-center p-0.5 font-medium focus:z-10 border border-transparent enabled:hover:bg-cyan-800 dark:enabled:hover:bg-cyan-700 text-base font- text-center text-white bg-primary-700 rounded-lg hover:bg-accent-00 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800&quot;'
20+
onClick={onClick}>
21+
{svgComponent}
22+
<span className="ml-2">{buttonContent}</span>
23+
</button>
24+
}
25+
26+
</div>
27+
)
28+
};
29+

src/components/InputCopy/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRef, useState } from 'react';
1+
import { ChangeEventHandler, MouseEvent, MouseEventHandler, useRef, useState } from 'react';
22

33
interface InputProps {
44
field: {
@@ -14,7 +14,8 @@ const InputCopy = ({ field, ...props }: InputProps) => {
1414
const inputRef = useRef<HTMLInputElement>(null);
1515
const [isCopied, setIsCopied] = useState(false);
1616

17-
function copyTextVal() {
17+
function copyTextVal(event: React.MouseEvent<HTMLButtonElement>) {
18+
event.preventDefault()
1819
const copyText = inputRef?.current;
1920

2021
const copiedText: string = copyText?.value as string

src/components/Resources/Schema/Schemas.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import SearchInput from '../../SearchInput';
1212
import { getAllSchemas } from '../../../api/Schema';
1313
import { getFromLocalStorage } from '../../../api/Auth';
1414
import { pathRoutes } from '../../../config/pathRoutes';
15+
import { EmptyListMessage } from '../../EmptyListComponent';
1516

1617
const SchemaList = () => {
1718
const [schemaList, setSchemaList] = useState([])
@@ -57,7 +58,9 @@ const SchemaList = () => {
5758
}
5859
};
5960

60-
61+
const createSchema = () => {
62+
window.location.href = `${pathRoutes.organizations.createSchema}?OrgId=${orgId}`
63+
}
6164

6265
useEffect(() => {
6366
getSchemaList(schemaListAPIParameter)
@@ -102,9 +105,7 @@ const SchemaList = () => {
102105
</div>
103106
<Button
104107
id='createSchemaButton'
105-
onClick={() => {
106-
window.location.href = `${pathRoutes.organizations.createSchema}?OrgId=${orgId}`
107-
}}
108+
onClick={createSchema}
108109
className='text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800'
109110
><svg className="pr-2" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 24 24">
110111
<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"/>
@@ -127,16 +128,17 @@ const SchemaList = () => {
127128
</Alert>
128129
}
129130
{loading
130-
? <div className="flex items-center justify-center mb-4">
131+
? (<div className="flex items-center justify-center mb-4">
131132
<Spinner
132133
color="info"
133134
/>
134-
</div>
135+
</div>)
135136
:
137+
schemaList && schemaList.length > 0 ? (
138+
136139
<div className='Flex-wrap' style={{ display: 'flex', flexDirection: 'column' }}>
137140
<div className="mt-1 grid w-full grid-cols-1 gap-4 mt-0 mb-4 xl:grid-cols-2 2xl:grid-cols-3">
138-
{schemaList && schemaList.length > 0 &&
139-
schemaList.map((element, key) => (
141+
{ schemaList.map((element, key) => (
140142
<div className='p-2' key={key}>
141143
<SchemaCard schemaName={element['name']} version={element['version']} schemaId={element['schemaLedgerId']} issuerDid={element['issuerId']} attributes={element['attributes']} created={element['createDateTime']} />
142144
</div>
@@ -155,7 +157,15 @@ const SchemaList = () => {
155157
totalPages={0}
156158
/>
157159
</div>
158-
</div>
160+
</div> ) : (<EmptyListMessage
161+
message={'No Schemas'}
162+
description={'Get started by creating a new Schema'}
163+
buttonContent={'Create Schema'}
164+
svgComponent={<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="none" viewBox="0 0 24 24">
165+
<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" />
166+
</svg>}
167+
onClick={createSchema}
168+
/>)
159169
}
160170
</div>
161171
</div>

src/components/organization/DedicatedIllustrate.tsx

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
import DedicatedIcon from '../../assets/dedicated.svg';
22

3-
4-
53
const DedicatedIllustrate = () => {
64

75
return (
8-
<div className='mt-4 ml-4'>
9-
<img src={DedicatedIcon} alt="dedicated" width={270} />
6+
<div className='mt-4 flex flex-row flex-wrap'>
7+
<div>
8+
<img src={DedicatedIcon} alt="dedicated" width={270} />
9+
</div>
10+
<div className='ml-8 max-w-xs'>
11+
<h3 className="mb-2 text-xl font-bold text-gray-900 dark:text-white">
12+
Complete Control and Maximum Privacy
13+
</h3>
14+
<ul className="list-disc">
15+
<li>
16+
<p className='mb-1 text-base font-normal text-gray-900 dark:text-white'>
17+
Our dedicated agent is exclusively managed by your organization, giving you full control. Customize and configure it to meet your specific needs with ease.
18+
</p>
19+
</li>
20+
<li>
21+
<p className='mb-1 text-base font-normal text-gray-900 dark:text-white'>
22+
Rest assured, all data and operations stay within your organization's infrastructure, guaranteeing maximum privacy and autonomy.
23+
</p>
24+
</li>
25+
<li>
26+
<p className='mb-1 text-base font-normal text-gray-900 dark:text-white'>
27+
Experience the power of complete control and privacy with our dedicated agent.
28+
</p>
29+
</li>
30+
</ul>
31+
32+
</div>
1033
</div>
1134
)
1235

src/components/organization/OrgDropDown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ const OrgDropDown = () => {
8383
) : (
8484
<CustomAvatar size="20" name={activeOrg?.name} round />
8585
)}
86-
<text className="ml-2 dark: text-white">{activeOrg?.name}</text>
86+
<text className="ml-2 text-white dark:text-white">{activeOrg?.name}</text>
8787
</>
8888
:
89-
<text className='dark:text-white'>
89+
<text className='text-white dark:text-white'>
9090
Select organization
9191
</text>
9292
}

0 commit comments

Comments
 (0)