Skip to content

Commit 94ef49a

Browse files
barshathakurisamshara
authored andcommitted
feat: add new tabs for surge
1 parent b95d52f commit 94ef49a

File tree

10 files changed

+129
-6
lines changed

10 files changed

+129
-6
lines changed

app/src/App/routes/SurgeRoutes.tsx

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,60 @@ const surgeOverview = customWrapRoute({
6363
},
6464
});
6565

66+
const activeSurgeDeployments = customWrapRoute({
67+
parent: surgeLayout,
68+
path: 'active-surge-deployments',
69+
component: {
70+
render: () => import('#views/ActiveSurgeDeployments'),
71+
props: {},
72+
},
73+
context: {
74+
title: 'Active Surge Deployments',
75+
visibility: 'anything',
76+
},
77+
});
78+
79+
const rapidResponsePersonnel = customWrapRoute({
80+
parent: surgeOverview,
81+
path: 'rapid-response-personnel',
82+
component: {
83+
render: () => import('#views/SurgeOverview/RapidResponsePersonnel'),
84+
props: {},
85+
},
86+
context: {
87+
title: 'Rapid Response Personnel',
88+
visibility: 'anything',
89+
},
90+
});
91+
92+
const emergencyResponseUnit = customWrapRoute({
93+
parent: surgeOverview,
94+
path: 'emergency-response-unit',
95+
component: {
96+
render: () => import('#views/SurgeOverview/EmergencyResponseUnit'),
97+
props: {},
98+
},
99+
context: {
100+
title: 'Emergency Response Unit',
101+
visibility: 'anything',
102+
},
103+
});
104+
105+
const updateERUReadinessForm = customWrapRoute({
106+
parent: rootLayout,
107+
path: 'update-eru-readiness',
108+
component: {
109+
// TODO: Add ERUReadinessUpdateForm Route
110+
render: () => import('#views/Home'),
111+
props: {},
112+
},
113+
wrapperComponent: Auth,
114+
context: {
115+
title: 'ERU Readiness Update Form',
116+
visibility: 'anything',
117+
},
118+
});
119+
66120
const surgeOperationalToolbox = customWrapRoute({
67121
parent: surgeLayout,
68122
path: 'operational-toolbox',
@@ -1423,7 +1477,7 @@ const deploymentCatalogueIndex = customWrapRoute({
14231477
},
14241478
wrapperComponent: Auth,
14251479
context: {
1426-
title: 'Catalogue of surge services',
1480+
title: 'Catalogue of Surge Services',
14271481
visibility: 'anything',
14281482
},
14291483
});
@@ -1438,7 +1492,7 @@ const deploymentCatalogueChildren = customWrapRoute({
14381492
},
14391493
wrapperComponent: Auth,
14401494
context: {
1441-
title: 'Catalogue of surge services',
1495+
title: 'Catalogue of Surge Services',
14421496
visibility: 'anything',
14431497
},
14441498
});
@@ -1555,4 +1609,8 @@ export default {
15551609
deploymentCatalogueChildren,
15561610
deploymentOthers,
15571611
obsoleteUrlDeployments,
1612+
activeSurgeDeployments,
1613+
rapidResponsePersonnel,
1614+
emergencyResponseUnit,
1615+
updateERUReadinessForm,
15581616
};

app/src/components/Navbar/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"userMenuPERCatalogueItem":"PER Catalogue of Resources",
6969
"userMenuPERCatalogueItemDescription":"PER Catalogue of Resources contains resource relevant to strengthening resource and capacity.",
7070
"userMenuGoResourcesItem":"GO Resources",
71-
"userMenuGoResourcesItemDescription":"Find all relevant user guides, references videos, IFRC other resources, and GO contacts on this page."
71+
"userMenuGoResourcesItemDescription":"Find all relevant user guides, references videos, IFRC other resources, and GO contacts on this page.",
72+
"userMenuActiveSurgeDeployments": "Active Surge Deployments"
7273
}
7374
}

app/src/components/Navbar/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ function Navbar(props: Props) {
367367
<div className={styles.description}>
368368
{strings.userMenuSurge}
369369
</div>
370+
<DropdownMenuItem
371+
type="link"
372+
to="activeSurgeDeployments"
373+
variant="tertiary"
374+
>
375+
{strings.userMenuActiveSurgeDeployments}
376+
</DropdownMenuItem>
370377
<DropdownMenuItem
371378
type="link"
372379
to="surgeOverview"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// eslint-disable-next-line import/prefer-default-export
2+
export function Component() {
3+
return (
4+
<>Active Surge Deployments</>
5+
);
6+
}
7+
8+
Component.displayName = 'Active Surge Deployments';

app/src/views/Surge/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"deploymentsThisYearTitle": "Deployments This Year",
88
"surgeOverviewTab": "Surge Overview",
99
"operationalToolboxTab": "Operational Toolbox",
10-
"surgeCatalogueTab": "Catalogue of Surge services"
10+
"surgeCatalogueTab": "Catalogue of Surge Services",
11+
"activeSurgeDeploymentsTab": "Active Surge Deployments"
1112
}
1213
}

app/src/views/Surge/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ export function Component() {
6565
)}
6666
>
6767
<NavigationTabList>
68+
<NavigationTab
69+
to="activeSurgeDeployments"
70+
>
71+
{strings.activeSurgeDeploymentsTab}
72+
</NavigationTab>
6873
<NavigationTab
6974
to="surgeOverview"
75+
parentRoute
7076
>
7177
{strings.surgeOverviewTab}
7278
</NavigationTab>
@@ -77,7 +83,6 @@ export function Component() {
7783
</NavigationTab>
7884
<NavigationTab
7985
to="surgeCatalogueLayout"
80-
parentRoute
8186
>
8287
{strings.surgeCatalogueTab}
8388
</NavigationTab>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Link from '#components/Link';
2+
3+
// eslint-disable-next-line import/prefer-default-export
4+
export function Component() {
5+
return (
6+
<Link
7+
to="updateERUReadinessForm"
8+
variant="primary"
9+
>
10+
Update ERU Readiness
11+
</Link>
12+
);
13+
}
14+
15+
Component.displayName = 'EmergencyResponseUnit';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// eslint-disable-next-line import/prefer-default-export
2+
export function Component() {
3+
return (
4+
<>
5+
Rapid Response Personnel
6+
</>
7+
);
8+
}
9+
10+
Component.displayName = 'RapidResponsePersonnel';

app/src/views/SurgeOverview/i18n.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"namespace": "surgeOverview",
33
"strings": {
44
"topFiveNationalSociety": "Top 5 NS Deploying Rapid Response Personnel ({year})",
5-
"ongoingDeployments": "Ongoing Deployments Over The Last Year"
5+
"ongoingDeployments": "Ongoing Deployments Over The Last Year",
6+
"rapidResponsePersonnelTitle": "Rapid Response Personnel",
7+
"emergencyResponseUnitTitle": "Emergency Response Unit"
68
}
79
}

app/src/views/SurgeOverview/index.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import {
22
useCallback,
33
useMemo,
44
} from 'react';
5+
import { Outlet } from 'react-router-dom';
56
import {
67
BarChart,
78
Container,
9+
NavigationTabList,
810
TimeSeriesChart,
911
} from '@ifrc-go/ui';
1012
import { useTranslation } from '@ifrc-go/ui/hooks';
@@ -14,6 +16,7 @@ import {
1416
resolveToString,
1517
} from '@ifrc-go/ui/utils';
1618

19+
import NavigationTab from '#components/NavigationTab';
1720
import { useRequest } from '#utils/restRequest';
1821
import { type GoApiResponse } from '#utils/restRequest';
1922

@@ -96,6 +99,19 @@ export function Component() {
9699

97100
return (
98101
<div className={styles.surgeOverview}>
102+
<NavigationTabList variant="secondary">
103+
<NavigationTab
104+
to="rapidResponsePersonnel"
105+
>
106+
{strings.rapidResponsePersonnelTitle}
107+
</NavigationTab>
108+
<NavigationTab
109+
to="emergencyResponseUnit"
110+
>
111+
{strings.emergencyResponseUnitTitle}
112+
</NavigationTab>
113+
</NavigationTabList>
114+
<Outlet />
99115
<SurgeMap />
100116
<div className={styles.charts}>
101117
<Container

0 commit comments

Comments
 (0)