Skip to content

Commit 2532c36

Browse files
authored
Merge pull request #61 from pranav-deshmukh/dev
Multi-user dpg demo; UI fixes
2 parents 58124dd + dba2f52 commit 2532c36

File tree

4 files changed

+99
-26
lines changed

4 files changed

+99
-26
lines changed

src/data/platform-demo.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export const SamplePlatformDemo = {
2+
demoID: '123e4567-e89b-12d3-a456-426614174000',
3+
demoName: 'View payment status',
4+
DPG: 'mifosx',
5+
demoDescription: 'Walkthrough for creating a client in Mifosx',
6+
createdAt: '2025-07-11T14:03:00Z',
7+
updatedAt: '2025-07-11T14:10:00Z',
8+
createdBy: 'yash.sharma',
9+
lastUpdatedBy: 'yash.sharma',
10+
demoTags: ['pilot', 'onboarding'],
11+
version: 'v1.0',
12+
steps: [
13+
{
14+
title: 'Login to Vnext',
15+
url: 'http://vnextadmin.mifos.gazelle.test/login',
16+
description:
17+
'Enter the sample credentials to login to MifosX, username: admin, paswword: superMegaPass',
18+
},
19+
{
20+
title: 'Select Account Lookup -> Associations',
21+
url: 'http://vnextadmin.mifos.gazelle.test/home',
22+
description:
23+
'If you have logged in correctly, yoy should be on vnext home page. Click on Account lookup on the navigation menu left side. Then select Associations',
24+
},
25+
{
26+
title: 'Do customer lookup to find Associations',
27+
url: 'http://vnextadmin.mifos.gazelle.test/account-lookup-associations',
28+
description:
29+
'You can now find the payeer and payee on the table and check which bank they belong to, Bluebank or Greenbank. Now you know the clients belong to which bank, and so we can got to mifos to find the transactions for the client',
30+
},
31+
{
32+
title: 'Login to mifos',
33+
url: 'http://mifos.mifos.gazelle.test/#/login',
34+
description:
35+
'Click on the Tenent dropdown, Select the bank of client you want to check.Enter the sample credentials to login to MifosX, username: mifos, password: password, click on login',
36+
},
37+
{
38+
title: 'Click Institution on the Navbar',
39+
url: 'http://mifos.mifos.gazelle.test/#/home',
40+
description: 'This will open a dropdown menu. Click on Clients',
41+
},
42+
{
43+
title: 'Select the required client',
44+
url: 'http://mifos.mifos.gazelle.test/#/clients',
45+
description:
46+
'You can see all the clients in the system. Click on the client you want to check the transactions for.',
47+
},
48+
{
49+
title: 'Click on the savings account you want to check',
50+
url: 'http://mifos.mifos.gazelle.test/#/clients',
51+
description:
52+
'Now you can see the clinet, scroll down to Saving Accounts section. Click on the account you want to check the transactions for.',
53+
},
54+
{
55+
title: 'Click on the transactions tab to view transactions',
56+
url: 'http://mifos.mifos.gazelle.test/#/clients',
57+
description:
58+
'You can see saving account details, click on the transactions tab. You can see the transactions for the client. Click on the transaction you want to check the status of.',
59+
},
60+
{
61+
title: 'View the transaction status',
62+
url: 'http://mifos.mifos.gazelle.test/#/clients',
63+
description:
64+
'You can undo the transaction, or go back to the previous page',
65+
},
66+
],
67+
};

src/data/sample-platform-demos.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ export const SamplePlatformDemoData = [
1919
},
2020
{
2121
demoID: 'f8a62029-2a91-4ab5-9d8d-f2b674acbf03',
22-
demoName: 'Approve Loan Application',
22+
demoName: 'View Payment Status',
2323
DPG: 'MifosFusion',
24-
demoDescription:
25-
'Review and approve submitted loan applications after verifying eligibility.',
24+
demoDescription: 'Review the payments.',
2625
createdAt: new Date('2025-07-12T14:45:00Z'),
27-
platforms: ['MifosX', 'Vnext'],
26+
platforms: ['MifosX', 'Vnext', 'PHEE'],
2827
},
2928
{
3029
demoID: 'ec54c928-1234-4bc7-9caa-36b9f5e9b004',

src/lib/demofileparser/getBaseUrl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const mapUrl = new Map<string, string>([
2-
['https://sandbox.mifos.community', 'MifosX'],
2+
['http://mifos.mifos.gazelle.test', 'MifosX'],
33
['https://ops.mifos.gazelle.test', 'PHEE'],
4+
['http://vnextadmin.mifos.gazelle.test', 'Vnext'],
45
]);
56

67
export const getUniqueBaseUrls = (

src/pages/demo/demo-page.tsx

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from 'lucide-react';
1010
// import { useLocation } from 'react-router-dom';
1111
// import { fetchDemoData } from '@/lib/api/fetchDemoData';
12-
import { SampleDemoJsonFile } from '@/data/sampleDemoFile';
12+
import { SamplePlatformDemo } from '@/data/platform-demo';
1313
import { Button } from '@/components/ui/button';
1414
import { getUniqueBaseUrls, mapUrl } from '@/lib/demofileparser/getBaseUrl';
1515

@@ -30,13 +30,16 @@ export const DemoPage = () => {
3030
const [demoData, setDemoData] = useState<Demo | null>(null);
3131
const [isLoading, setIsLoading] = useState(true);
3232
const [activeBaseUrl, setActiveBaseUrl] = useState<string>('');
33+
const firstStepUrl = SamplePlatformDemo?.steps[0].url;
3334
const [baseUrls, setBaseUrls] = useState<Map<string, string>>(
34-
new Map([
35-
[
36-
SampleDemoJsonFile?.steps[0].url || '',
37-
SampleDemoJsonFile?.steps[0].url || '',
38-
],
39-
])
35+
firstStepUrl
36+
? new Map([[firstStepUrl, firstStepUrl]])
37+
: new Map([
38+
[
39+
SamplePlatformDemo?.steps[0].url || '',
40+
SamplePlatformDemo?.steps[0].url || '',
41+
],
42+
])
4043
);
4144

4245
// const location = useLocation();
@@ -47,10 +50,11 @@ export const DemoPage = () => {
4750
// .then(setDemoData)
4851
// .finally(() => setIsLoading(false));
4952
setIsLoading(false);
50-
setDemoData(SampleDemoJsonFile);
51-
setIframeUrl(SampleDemoJsonFile?.steps[0].url ?? '');
52-
const initialUrl = SampleDemoJsonFile?.steps[0].url ?? '';
53+
setDemoData(SamplePlatformDemo);
54+
setIframeUrl(SamplePlatformDemo?.steps[0].url ?? '');
55+
const initialUrl = SamplePlatformDemo?.steps[0].url ?? '';
5356
const parsedUrl = new URL(initialUrl);
57+
handleStepTransition(0, parsedUrl.href);
5458
const initialBaseUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
5559
setActiveBaseUrl(initialBaseUrl);
5660
}, []);
@@ -115,8 +119,8 @@ export const DemoPage = () => {
115119

116120
const handleReset = () => {
117121
setIsAutoPlay(false);
118-
handleStepTransition(0, 'https://sandbox.mifos.community');
119-
setActiveBaseUrl('https://sandbox.mifos.community');
122+
handleStepTransition(0, firstStepUrl);
123+
setActiveBaseUrl('');
120124
};
121125

122126
if (isLoading) {
@@ -374,20 +378,22 @@ export const DemoPage = () => {
374378
</div>
375379
</div>
376380
<div className="w-full h-full flex">
377-
{Array.from(baseUrls.keys()).map((baseUrl, idx) => (
378-
<Button
379-
key={idx}
380-
className={`h-full max-w-40 rounded-none flex-1 transition-all duration-200 cursor-pointer
381+
{Array.from(baseUrls.keys())
382+
.filter(baseUrl => baseUrl && mapUrl.has(baseUrl))
383+
.map((baseUrl, idx) => (
384+
<Button
385+
key={idx}
386+
className={`h-full max-w-40 rounded-none flex-1 transition-all duration-200 cursor-pointer
381387
${
382388
iframeUrl?.startsWith(baseUrl)
383389
? 'bg-blue-400 hover:bg-blue-500 text-white shadow-sm dark:bg-blue-600'
384390
: 'bg-gray-200 hover:bg-gray-300 text-gray-500 dark:bg-slate-400 dark:text-gray-600'
385391
} font-semibold`}
386-
onClick={() => setActiveBaseUrl(baseUrl)}
387-
>
388-
{mapUrl.get(baseUrl)}
389-
</Button>
390-
))}
392+
onClick={() => setActiveBaseUrl(baseUrl)}
393+
>
394+
{mapUrl.get(baseUrl)}
395+
</Button>
396+
))}
391397
</div>
392398

393399
<button

0 commit comments

Comments
 (0)