Skip to content

Commit

Permalink
Add export and view all activities in country threeW activities tab
Browse files Browse the repository at this point in the history
  • Loading branch information
puranban committed Dec 5, 2023
1 parent a1aafe8 commit 58d6723
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 46 deletions.
20 changes: 2 additions & 18 deletions src/views/CountryOngoingActivities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,9 @@ import styles from './styles.module.css';

// eslint-disable-next-line import/prefer-default-export
export function Component() {
const {
countryId,
countryResponse,
countryResponsePending,
} = useOutletContext<CountryOutletContext>();
const outletContext = useOutletContext<CountryOutletContext>();
const strings = useTranslation(i18n);

const outletContext = useMemo<CountryOutletContext>(
() => ({
countryId,
countryResponse,
countryResponsePending,
}),
[
countryId,
countryResponse,
countryResponsePending,
],
);
const { countryId } = outletContext;

return (
<div className={styles.countryOngoingActivities}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"namespace": "emergencyActivities",
"namespace": "countryResponseActivities",
"strings": {
"severityLow": "Less than 2",
"severityMedium": "2 to 4",
"severityHigh": "5 to 9",
"severitySevere": "10 or more",
"numberOfProjects": "Number of Projects"
"countryResponseActivitiesSeverityLow": "Less than 2",
"countryResponseActivitiesSeverityMedium": "2 to 4",
"countryResponseActivitiesSeverityHigh": "5 to 9",
"countryResponseActivitiesSeveritySevere": "10 or more",
"countryResponseActivitiesNumberOfProjects": "Number of Projects"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ function ResponseActivitiesMap(props: Props) {
} = props;

const strings = useTranslation(i18n);
const {
// countryId,
countryResponse,
} = useOutletContext<CountryOutletContext>();
const { countryResponse } = useOutletContext<CountryOutletContext>();

const bounds = useMemo(
() => (countryResponse ? getBbox(countryResponse?.bbox) : undefined),
Expand Down Expand Up @@ -153,23 +150,23 @@ function ResponseActivitiesMap(props: Props) {
footer={(
<div className={styles.legend}>
<div className={styles.label}>
{strings.numberOfProjects}
{strings.countryResponseActivitiesNumberOfProjects}
</div>
<LegendItem
color={COLOR_SEVERITY_LOW}
label={strings.severityLow}
label={strings.countryResponseActivitiesSeverityLow}
/>
<LegendItem
color={COLOR_SEVERITY_MEDIUM}
label={strings.severityMedium}
label={strings.countryResponseActivitiesSeverityMedium}
/>
<LegendItem
color={COLOR_SEVERITY_HIGH}
label={strings.severityHigh}
label={strings.countryResponseActivitiesSeverityHigh}
/>
<LegendItem
color={COLOR_SEVERITY_SEVERE}
label={strings.severitySevere}
label={strings.countryResponseActivitiesSeveritySevere}
/>
</div>
)}
Expand Down
5 changes: 2 additions & 3 deletions src/views/CountryOngoingActivitiesThreeWActivities/i18n.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"namespace": "countryOngoingActivitiesThreeWActivities",
"strings": {
"pageTitle": "Country Ongoing 3W Activities",

"addThreeWActivity": "Add 3W Activity",
"chartDescription": "The data represents the added projects and may not reflect all of the ongoing projects.",
"uniqueEruAndNationalSocietyCount": "Active National Societies / ERUs",
Expand All @@ -22,6 +20,7 @@
"emergencyProjectPeopleReached": "Services Provided to People in Need",
"responseActivities": "Response Activities",
"activitiesBySector": "Activities by Sector",
"dataNotAvailable": "No Activities"
"dataNotAvailable": "No Activities",
"threeWViewAllActivityLabel": "View all Activities"
}
}
Loading

0 comments on commit 58d6723

Please sign in to comment.