From 0f7c0331a36daddc986c6575426df431272ab725 Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Rivero Date: Mon, 13 Apr 2026 20:09:19 -0500 Subject: [PATCH 1/2] update org. unit levels for countries and projects --- src/components/steps/org-units/OrgUnitsStep.tsx | 3 ++- src/models/Config.ts | 6 +++--- .../country-indicator-report/CountryIndicatorReport.tsx | 3 ++- src/pages/report/MerReport.tsx | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/steps/org-units/OrgUnitsStep.tsx b/src/components/steps/org-units/OrgUnitsStep.tsx index 0375c292..72a117bd 100644 --- a/src/components/steps/org-units/OrgUnitsStep.tsx +++ b/src/components/steps/org-units/OrgUnitsStep.tsx @@ -5,6 +5,7 @@ import { Title, getValuesFromSelection } from "../utils/common"; import { MultiSelector } from "@eyeseetea/d2-ui-components"; import { getProjectFieldName } from "../../../utils/form"; import { useAppContext } from "../../../contexts/api-context"; +import { baseConfig } from "../../../models/Config"; interface OrganisationUnit { id: string; @@ -75,6 +76,6 @@ const styles = { locations: { paddingBottom: 10 }, }; -const selectableLevels = [2]; +const selectableLevels = [baseConfig.orgUnits.levelForCountries]; export default React.memo(OrgUnitsStep); diff --git a/src/models/Config.ts b/src/models/Config.ts index c7f42947..67f9c454 100644 --- a/src/models/Config.ts +++ b/src/models/Config.ts @@ -40,8 +40,8 @@ const yes = true as const; export const baseConfig = { orgUnits: { - levelForCountries: 2, - levelForProjects: 3, + levelForCountries: 3, + levelForProjects: 4, }, userRoles: { feedback: ["DM Feedback"], @@ -485,7 +485,7 @@ function getFundersAndLocations(metadata: Metadata) { id: oug.id, displayName: oug.displayName, countries: oug.organisationUnits - .filter(ou => ou.level === 2) + .filter(ou => ou.level === baseConfig.orgUnits.levelForCountries) .map(ou => ({ id: ou.id })), })) .sortBy(location => location.displayName) diff --git a/src/pages/country-indicator-report/CountryIndicatorReport.tsx b/src/pages/country-indicator-report/CountryIndicatorReport.tsx index 4a4edd4e..5e3cfe41 100644 --- a/src/pages/country-indicator-report/CountryIndicatorReport.tsx +++ b/src/pages/country-indicator-report/CountryIndicatorReport.tsx @@ -25,6 +25,7 @@ import { useConfirmChanges } from "../report/MerReport"; import { UniqueBeneficiariesSettings } from "../../domain/entities/UniqueBeneficiariesSettings"; import { getYearsFromProject } from "../project-indicators-validation/ProjectIndicatorsValidation"; import { useProjectStore } from "../../components/app/App"; +import { baseConfig } from "../../models/Config"; export const CountryIndicatorReport = React.memo(() => { const titlePage = i18n.t("Country Project & Indicators"); @@ -129,7 +130,7 @@ export const CountryIndicatorReport = React.memo(() => { diff --git a/src/pages/report/MerReport.tsx b/src/pages/report/MerReport.tsx index ccf4ba06..3e4f38a6 100644 --- a/src/pages/report/MerReport.tsx +++ b/src/pages/report/MerReport.tsx @@ -30,6 +30,7 @@ import { useAppHistory } from "../../utils/use-app-history"; import { ErrorMessage } from "./ErrorMessage"; import { useProjectStore } from "../../components/app/App"; import { AnalyticsInfo } from "../../domain/entities/AnalyticsInfo"; +import { baseConfig } from "../../models/Config"; type ProceedWarning = { type: "hidden" } | { type: "visible"; action: () => void }; @@ -269,7 +270,7 @@ function getTranslations() { }; } -const selectableLevels = [2]; +const selectableLevels = [baseConfig.orgUnits.levelForCountries]; const useStyles = makeStyles({ buttonsWrapper: { From 6bd5664867e5a0d6c31a1a3b9f5b9f0a31b0d801 Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Rivero Date: Tue, 21 Apr 2026 10:00:12 -0500 Subject: [PATCH 2/2] fix org unit level for country report --- src/pages/country-indicator-report/CountryIndicatorReport.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/country-indicator-report/CountryIndicatorReport.tsx b/src/pages/country-indicator-report/CountryIndicatorReport.tsx index 5e3cfe41..2d907741 100644 --- a/src/pages/country-indicator-report/CountryIndicatorReport.tsx +++ b/src/pages/country-indicator-report/CountryIndicatorReport.tsx @@ -130,7 +130,7 @@ export const CountryIndicatorReport = React.memo(() => {