From a7f557aecf5aed2bdcfcb71a27e1afded1d39b06 Mon Sep 17 00:00:00 2001 From: Stefanos Hadjipetrou Date: Fri, 12 Jul 2024 13:55:20 +0300 Subject: [PATCH] feat: general optimisations --- .../mapping/expenditures/availability.json | 2 +- src/config/mapping/expenditures/bar.json | 2 +- src/config/mapping/expenditures/cycles.json | 2 +- src/config/mapping/expenditures/heatmap.json | 2 +- src/config/mapping/expenditures/table.json | 2 +- src/config/urls/index.json | 4 +- src/controllers/allocations.controller.ts | 2 +- src/controllers/grants.controller.ts | 33 +- .../locations-board-constituency-view.json | 1510 +++++++++++++++++ .../locations-portfolio-view.json | 1466 ++++++++++++++++ src/utils/filtering/geographies.ts | 24 +- 11 files changed, 3024 insertions(+), 25 deletions(-) create mode 100644 src/static-assets/locations-board-constituency-view.json create mode 100644 src/static-assets/locations-portfolio-view.json diff --git a/src/config/mapping/expenditures/availability.json b/src/config/mapping/expenditures/availability.json index 7495549..4f020fb 100644 --- a/src/config/mapping/expenditures/availability.json +++ b/src/config/mapping/expenditures/availability.json @@ -1,4 +1,4 @@ { "dataPath": "@odata.count", - "urlParams": "?$count=true&$top=0&$filter=financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isAnnualized eq true" + "urlParams": "?$count=true&$top=0&$filter=financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isLatestReported eq true" } diff --git a/src/config/mapping/expenditures/bar.json b/src/config/mapping/expenditures/bar.json index e5b5467..41075a1 100644 --- a/src/config/mapping/expenditures/bar.json +++ b/src/config/mapping/expenditures/bar.json @@ -4,5 +4,5 @@ "itemName": ".name", "indicatorName": "indicatorName", "value": "actual", - "urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isAnnualized eq true)/groupby((indicatorName,/name,/parent/name),aggregate(actualAmount with sum as actual))" + "urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isLatestReported eq true)/groupby((indicatorName,/name,/parent/name),aggregate(actualAmountCumulative with sum as actual))" } diff --git a/src/config/mapping/expenditures/cycles.json b/src/config/mapping/expenditures/cycles.json index 7c2c295..8f4a90e 100644 --- a/src/config/mapping/expenditures/cycles.json +++ b/src/config/mapping/expenditures/cycles.json @@ -2,5 +2,5 @@ "dataPath": "value", "cycleFrom": "implementationPeriod.periodFrom", "cycleTo": "implementationPeriod.periodTo", - "urlParams": "?$apply=filter(indicatorName eq 'Expenditure: Module-Intervention - Reference Rate' AND isAnnualized eq true)/groupby((implementationPeriod/periodFrom,implementationPeriod/periodTo))&$orderby=implementationPeriod/periodFrom asc" + "urlParams": "?$apply=filter(indicatorName eq 'Expenditure: Module-Intervention - Reference Rate' AND isLatestReported eq true)/groupby((implementationPeriod/periodFrom,implementationPeriod/periodTo))&$orderby=implementationPeriod/periodFrom asc" } diff --git a/src/config/mapping/expenditures/heatmap.json b/src/config/mapping/expenditures/heatmap.json index a521e5f..c6cfc8d 100644 --- a/src/config/mapping/expenditures/heatmap.json +++ b/src/config/mapping/expenditures/heatmap.json @@ -3,7 +3,7 @@ "budget": "value2", "expenditure": "value1", "cycle": "periodCovered", - "urlParams": "?$apply=filter(financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isAnnualized eq true)/groupby((,),aggregate(actualAmount with sum as value1,plannedAmount with sum as value2))", + "urlParams": "?$apply=filter(financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isLatestReported eq true)/groupby((,),aggregate(actualAmountCumulative with sum as value1,plannedAmountCumulative with sum as value2))", "url1Items": ["Malaria", "Tuberculosis"], "url2Items": ["HIV/AIDS", "Other"], "fields": { diff --git a/src/config/mapping/expenditures/table.json b/src/config/mapping/expenditures/table.json index 1ff5614..e87edaa 100644 --- a/src/config/mapping/expenditures/table.json +++ b/src/config/mapping/expenditures/table.json @@ -5,5 +5,5 @@ "indicatorName": "indicatorName", "cumulativeExpenditureValue": "actualCumulative", "periodExpenditureValue": "actual", - "urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isAnnualized eq true)/groupby((indicatorName,/name,/parent/name),aggregate(actualAmountCumulative with sum as actualCumulative,actualAmount with sum as actual))" + "urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isLatestReported eq true)/groupby((indicatorName,/name,/parent/name),aggregate(actualAmountCumulative with sum as actualCumulative,actualAmount with sum as actual))" } diff --git a/src/config/urls/index.json b/src/config/urls/index.json index 5e722fa..cfc7ec9 100644 --- a/src/config/urls/index.json +++ b/src/config/urls/index.json @@ -33,8 +33,8 @@ "filteroptionsreplenishmentperiods": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/replenishmentperiods", "multicountriescountriesdata": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/MultiCountries?$expand=MultiCountryComposition($select=GeographicArea;$expand=GeographicArea($select=GeographicAreaCode_ISO3))&$select=MultiCountryName,MultiCountryComposition", "FILTER_OPTIONS_GEOGRAPHIES": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/Geographies?$filter=level eq 'World'&$expand=children($expand=children($expand=children))", - "FILTER_OPTIONS_GEOGRAPHIES_BOARD_CONSTITUENCY_VIEW": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/Geographies_BoardConstituencyView?&$expand=children($expand=children($expand=children))", - "FILTER_OPTIONS_GEOGRAPHIES_PORTFOLIO_VIEW": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/Geographies_PortfolioView?&$expand=children($expand=children($expand=children))", + "FILTER_OPTIONS_GEOGRAPHIES_BOARD_CONSTITUENCY_VIEW": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/Geographies_BoardConstituencyView?&$filter=parentId ne null AND children/any(c: c ne null)&$expand=children($expand=children($expand=children))", + "FILTER_OPTIONS_GEOGRAPHIES_PORTFOLIO_VIEW": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/Geographies_PortfolioView?&$filter=parentId ne null AND children/any(c: c ne null)&$expand=children($expand=children($expand=children))", "FILTER_OPTIONS_COMPONENTS_GROUPED": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/ActivityAreasGrouped?$filter=parentId eq null", "FILTER_OPTIONS_COMPONENTS_UNGROUPED": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/ActivityAreas?$filter=type eq 'Component'", "FILTER_OPTIONS_REPLENISHMENT_PERIODS": "https://api-gf-api-gf-02.azurewebsites.net/v4/odata/allFinancialIndicators?$apply=filter(financialDataSet eq 'Pledges_Contributions')/groupby((periodCovered))&$orderby=periodCovered asc", diff --git a/src/controllers/allocations.controller.ts b/src/controllers/allocations.controller.ts index b1be246..9029662 100644 --- a/src/controllers/allocations.controller.ts +++ b/src/controllers/allocations.controller.ts @@ -401,7 +401,7 @@ export class AllocationsController { let filterString = filterFinancialIndicators( {...this.req.query, geographies: countryCode}, AllocationRadialFieldsMapping.urlParamsLocation, - ['geography/name', 'geography/code'], + 'geography/code', 'activityArea/name', ); diff --git a/src/controllers/grants.controller.ts b/src/controllers/grants.controller.ts index 727b86f..e06cdae 100644 --- a/src/controllers/grants.controller.ts +++ b/src/controllers/grants.controller.ts @@ -27,22 +27,31 @@ export class GrantsController { @param.path.string('pageSize') pageSize: string, ) { const mapper = mapTransform(GrantsListMapping.map); - const params = querystring.stringify( - { - ...getPage(filtering.page, parseInt(page, 10), parseInt(pageSize, 10)), - [filtering.page_size]: pageSize, - }, - '&', - filtering.param_assign_operator, - { - encodeURIComponent: (str: string) => str, - }, - ); + const params = + pageSize === 'all' + ? '' + : querystring.stringify( + { + ...getPage( + filtering.page, + parseInt(page, 10), + parseInt(pageSize, 10), + ), + [filtering.page_size]: pageSize, + }, + '&', + filtering.param_assign_operator, + { + encodeURIComponent: (str: string) => str, + }, + ); const filterString = filterGrants( this.req.query, GrantsListMapping.urlParams, ); - const url = `${urls.GRANTS}${filterString}&${params}`; + const url = `${urls.GRANTS}${filterString}${ + params.length > 0 ? `&${params}` : params + }`; return axios .get(url) diff --git a/src/static-assets/locations-board-constituency-view.json b/src/static-assets/locations-board-constituency-view.json new file mode 100644 index 0000000..1daaef3 --- /dev/null +++ b/src/static-assets/locations-board-constituency-view.json @@ -0,0 +1,1510 @@ +[ + { + "name": "Eastern Europe and Central Asia (EECA)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Albania", + "value": "ALB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Armenia", + "value": "ARM", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Azerbaijan", + "value": "AZE", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Belarus", + "value": "BLR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bulgaria", + "value": "BGR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Georgia", + "value": "GEO", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kazakhstan", + "value": "KAZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kosovo", + "value": "QNA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kyrgyzstan", + "value": "KGZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Moldova", + "value": "MDA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Montenegro", + "value": "MNE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry EECA ECOM", + "value": "MCECOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA ECUO", + "value": "MCECUO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA EHRN", + "value": "MCEHRN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA IHAU", + "value": "MCIHAU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA PAS", + "value": "MCPAS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV EECA APH", + "value": "MCEECAAPH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "North Macedonia", + "value": "MKD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Romania", + "value": "ROU", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Russian Federation", + "value": "RUS", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Serbia", + "value": "SRB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tajikistan", + "value": "TJK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Turkmenistan", + "value": "TKM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ukraine", + "value": "UKR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Uzbekistan", + "value": "UZB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "Eastern Mediterranean Region", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Afghanistan", + "value": "AFG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Djibouti", + "value": "DJI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Egypt", + "value": "EGY", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Iran (Islamic Republic)", + "value": "IRN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Iraq", + "value": "IRQ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Morocco", + "value": "MAR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry MENA HRA", + "value": "MCMENAHRA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry MENA Key Populations", + "value": "MCMENA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Middle East MER", + "value": "MCMER", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Pakistan", + "value": "PAK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Somalia", + "value": "SOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sudan", + "value": "SDN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tunisia", + "value": "TUN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "Eastern and Southern Africa (ESA)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Angola", + "value": "AGO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Botswana", + "value": "BWA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Burundi", + "value": "BDI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Comoros", + "value": "COM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Eritrea", + "value": "ERI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Eswatini", + "value": "SWZ", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ethiopia", + "value": "ETH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kenya", + "value": "KEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Lesotho", + "value": "LSO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Madagascar", + "value": "MDG", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Malawi", + "value": "MWI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mauritius", + "value": "MUS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mozambique", + "value": "MOZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry Africa ECSA-HC", + "value": "MCECSA-HC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa ANECCA", + "value": "MCANECCA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa IGAD", + "value": "MCIGAD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa KANCO", + "value": "MCKANCO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa ARASA", + "value": "MCARASA-ENDA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa E8", + "value": "MCE8", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa HIVOS", + "value": "MCHIVOS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa MOSASWA", + "value": "MCMOSASWA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa SADC", + "value": "MCSADC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa TIMS", + "value": "MCTIMS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa WHC", + "value": "MCWHC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Namibia", + "value": "NAM", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Rwanda", + "value": "RWA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "South Africa", + "value": "ZAF", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "South Sudan", + "value": "SSD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tanzania (United Republic)", + "value": "TZA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Uganda", + "value": "UGA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Zambia", + "value": "ZMB", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Zanzibar", + "value": "QNB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Subnational" + } + }, + { + "name": "Zimbabwe", + "value": "ZWE", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "Latin America and the Caribbean (LAC)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Belize", + "value": "BLZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bolivia (Plurinational State)", + "value": "BOL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Colombia", + "value": "COL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Costa Rica", + "value": "CRI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cuba", + "value": "CUB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Dominican Republic", + "value": "DOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ecuador", + "value": "ECU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "El Salvador", + "value": "SLV", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guatemala", + "value": "GTM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guyana", + "value": "GUY", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Haiti", + "value": "HTI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Honduras", + "value": "HND", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Jamaica", + "value": "JAM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry Americas CVC-COIN", + "value": "MCCVC/COIN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas EMMIE", + "value": "MCEMMIE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas ICW", + "value": "MCICW", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas ORAS-CONHU", + "value": "MCORAS-CONHU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas REDLACTRANS", + "value": "MCREDLACTRANS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas REDTRASEX", + "value": "MCREDTRASEX", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Caribbean CARICOM-PANCAP", + "value": "MCCARICOM/PANCAP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Caribbean MCC", + "value": "MCC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Central Americas REDCA", + "value": "MCREDCA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV Latin America ALEP", + "value": "MCALEP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB LAC PIH", + "value": "MCPIH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Nicaragua", + "value": "NIC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Panama", + "value": "PAN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Paraguay", + "value": "PRY", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Peru", + "value": "PER", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Suriname", + "value": "SUR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Venezuela", + "value": "VEN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "South East Asia (SEA)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Bangladesh", + "value": "BGD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bhutan", + "value": "BTN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "India", + "value": "IND", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Indonesia", + "value": "IDN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Korea (Democratic Peoples Republic)", + "value": "PRK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry Asia IHAA", + "value": "MCIHAA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry East Asia and Pacific RAI", + "value": "MCRAI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV SEA AFAO", + "value": "MCSEAAFAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry South Asia", + "value": "MCSA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry South-Eastern Asia AFAO", + "value": "MCAFAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB Asia TEAM", + "value": "MCASIATEAM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB Asia UNDP", + "value": "MCASIAUNDP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Myanmar", + "value": "MMR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Nepal", + "value": "NPL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sri Lanka", + "value": "LKA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Thailand", + "value": "THA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Timor-Leste", + "value": "TLS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "West Pacific Region (WPR)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Cambodia", + "value": "KHM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Fiji", + "value": "FJI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Lao (Peoples Democratic Republic)", + "value": "LAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Malaysia", + "value": "MYS", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mongolia", + "value": "MNG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry East Asia and Pacific APN", + "value": "MCAPN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry East Asia and Pacific HIVOS", + "value": "MCISEAN-HIVOS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Pacific", + "value": "MCWP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Papua New Guinea", + "value": "PNG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Philippines", + "value": "PHL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Solomon Islands", + "value": "SLB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Viet Nam", + "value": "VNM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "Western and Central Africa (WCA)", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Algeria", + "value": "DZA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Benin", + "value": "BEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Burkina Faso", + "value": "BFA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cabo Verde", + "value": "CPV", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cameroon", + "value": "CMR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Central African Republic", + "value": "CAF", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Chad", + "value": "TCD", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Congo", + "value": "COG", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Congo (Democratic Republic)", + "value": "COD", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Côte d'Ivoire", + "value": "CIV", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Gabon", + "value": "GAB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Gambia", + "value": "GMB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ghana", + "value": "GHA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guinea", + "value": "GIN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guinea-Bissau", + "value": "GNB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Liberia", + "value": "LBR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mali", + "value": "MLI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mauritania", + "value": "MRT", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry TB WC Africa NTP/SRL", + "value": "MCNTPSRL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry West Africa ALCO", + "value": "MCOCAL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry West Africa ITPC", + "value": "MCITPC-WA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Africa ANCS", + "value": "MCANCS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Africa HI", + "value": "MCHI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Niger", + "value": "NER", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Nigeria", + "value": "NGA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sao Tome and Principe", + "value": "STP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Senegal", + "value": "SEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sierra Leone", + "value": "SLE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Togo", + "value": "TGO", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + } + ] + } +] diff --git a/src/static-assets/locations-portfolio-view.json b/src/static-assets/locations-portfolio-view.json new file mode 100644 index 0000000..a83306b --- /dev/null +++ b/src/static-assets/locations-portfolio-view.json @@ -0,0 +1,1466 @@ +[ + { + "name": "Rest of Africa", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Algeria", + "value": "DZA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Angola", + "value": "AGO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Botswana", + "value": "BWA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Burundi", + "value": "BDI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Comoros", + "value": "COM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Djibouti", + "value": "DJI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Egypt", + "value": "EGY", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Eritrea", + "value": "ERI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Eswatini", + "value": "SWZ", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ethiopia", + "value": "ETH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kenya", + "value": "KEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Lesotho", + "value": "LSO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Madagascar", + "value": "MDG", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Malawi", + "value": "MWI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mauritius", + "value": "MUS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Morocco", + "value": "MAR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mozambique", + "value": "MOZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry Africa ECSA-HC", + "value": "MCECSA-HC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa ANECCA", + "value": "MCANECCA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa IGAD", + "value": "MCIGAD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Eastern Africa KANCO", + "value": "MCKANCO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa ARASA", + "value": "MCARASA-ENDA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa E8", + "value": "MCE8", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa HIVOS", + "value": "MCHIVOS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa MOSASWA", + "value": "MCMOSASWA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa SADC", + "value": "MCSADC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa TIMS", + "value": "MCTIMS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Southern Africa WHC", + "value": "MCWHC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry West Africa ITPC", + "value": "MCITPC-WA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Namibia", + "value": "NAM", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Rwanda", + "value": "RWA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Somalia", + "value": "SOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "South Africa", + "value": "ZAF", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "South Sudan", + "value": "SSD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sudan", + "value": "SDN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tanzania (United Republic)", + "value": "TZA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tunisia", + "value": "TUN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Uganda", + "value": "UGA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Zambia", + "value": "ZMB", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Zanzibar", + "value": "QNB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Subnational" + } + }, + { + "name": "Zimbabwe", + "value": "ZWE", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "Rest of the World", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Afghanistan", + "value": "AFG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Albania", + "value": "ALB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Armenia", + "value": "ARM", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Azerbaijan", + "value": "AZE", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bangladesh", + "value": "BGD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Belarus", + "value": "BLR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Belize", + "value": "BLZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bhutan", + "value": "BTN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bolivia (Plurinational State)", + "value": "BOL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Bulgaria", + "value": "BGR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cambodia", + "value": "KHM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Colombia", + "value": "COL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Costa Rica", + "value": "CRI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cuba", + "value": "CUB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Dominican Republic", + "value": "DOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ecuador", + "value": "ECU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "El Salvador", + "value": "SLV", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Fiji", + "value": "FJI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Georgia", + "value": "GEO", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guatemala", + "value": "GTM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guyana", + "value": "GUY", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Haiti", + "value": "HTI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Honduras", + "value": "HND", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "India", + "value": "IND", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Indonesia", + "value": "IDN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Iran (Islamic Republic)", + "value": "IRN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Iraq", + "value": "IRQ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Jamaica", + "value": "JAM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kazakhstan", + "value": "KAZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Korea (Democratic Peoples Republic)", + "value": "PRK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kosovo", + "value": "QNA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Kyrgyzstan", + "value": "KGZ", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Lao (Peoples Democratic Republic)", + "value": "LAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Malaysia", + "value": "MYS", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Moldova", + "value": "MDA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mongolia", + "value": "MNG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Montenegro", + "value": "MNE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry Americas CVC-COIN", + "value": "MCCVC/COIN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas EMMIE", + "value": "MCEMMIE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas ICW", + "value": "MCICW", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas ORAS-CONHU", + "value": "MCORAS-CONHU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas REDLACTRANS", + "value": "MCREDLACTRANS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Americas REDTRASEX", + "value": "MCREDTRASEX", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Asia IHAA", + "value": "MCIHAA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Caribbean CARICOM-PANCAP", + "value": "MCCARICOM/PANCAP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Caribbean MCC", + "value": "MCC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Central Americas REDCA", + "value": "MCREDCA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA ECOM", + "value": "MCECOM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA ECUO", + "value": "MCECUO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA EHRN", + "value": "MCEHRN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA IHAU", + "value": "MCIHAU", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry EECA PAS", + "value": "MCPAS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry East Asia and Pacific APN", + "value": "MCAPN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry East Asia and Pacific HIVOS", + "value": "MCISEAN-HIVOS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry East Asia and Pacific RAI", + "value": "MCRAI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV EECA APH", + "value": "MCEECAAPH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV Latin America ALEP", + "value": "MCALEP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry HIV SEA AFAO", + "value": "MCSEAAFAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry MENA HRA", + "value": "MCMENAHRA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry MENA Key Populations", + "value": "MCMENA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Middle East MER", + "value": "MCMER", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry South Asia", + "value": "MCSA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry South-Eastern Asia AFAO", + "value": "MCAFAO", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB Asia TEAM", + "value": "MCASIATEAM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB Asia UNDP", + "value": "MCASIAUNDP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry TB LAC PIH", + "value": "MCPIH", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Pacific", + "value": "MCWP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Myanmar", + "value": "MMR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Nepal", + "value": "NPL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Nicaragua", + "value": "NIC", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "North Macedonia", + "value": "MKD", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Pakistan", + "value": "PAK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Panama", + "value": "PAN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Papua New Guinea", + "value": "PNG", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Paraguay", + "value": "PRY", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Peru", + "value": "PER", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Philippines", + "value": "PHL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Romania", + "value": "ROU", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Russian Federation", + "value": "RUS", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Serbia", + "value": "SRB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Solomon Islands", + "value": "SLB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sri Lanka", + "value": "LKA", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Suriname", + "value": "SUR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Tajikistan", + "value": "TJK", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Thailand", + "value": "THA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Timor-Leste", + "value": "TLS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Turkmenistan", + "value": "TKM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ukraine", + "value": "UKR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Uzbekistan", + "value": "UZB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Venezuela", + "value": "VEN", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Viet Nam", + "value": "VNM", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + } + ] + }, + { + "name": "West and Central Africa", + "value": null, + "extraInfo": { + "isDonor": false, + "isRecipient": false, + "level": null + }, + "items": [ + { + "name": "Benin", + "value": "BEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Burkina Faso", + "value": "BFA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cabo Verde", + "value": "CPV", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Cameroon", + "value": "CMR", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Central African Republic", + "value": "CAF", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Chad", + "value": "TCD", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Congo", + "value": "COG", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Congo (Democratic Republic)", + "value": "COD", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Côte d'Ivoire", + "value": "CIV", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Gabon", + "value": "GAB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Gambia", + "value": "GMB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Ghana", + "value": "GHA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guinea", + "value": "GIN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Guinea-Bissau", + "value": "GNB", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Liberia", + "value": "LBR", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mali", + "value": "MLI", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Mauritania", + "value": "MRT", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Multicountry TB WC Africa NTP/SRL", + "value": "MCNTPSRL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry West Africa ALCO", + "value": "MCOCAL", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Africa ANCS", + "value": "MCANCS", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Multicountry Western Africa HI", + "value": "MCHI", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Multicountry" + } + }, + { + "name": "Niger", + "value": "NER", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Nigeria", + "value": "NGA", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sao Tome and Principe", + "value": "STP", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Senegal", + "value": "SEN", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Sierra Leone", + "value": "SLE", + "extraInfo": { + "isDonor": false, + "isRecipient": true, + "level": "Country" + } + }, + { + "name": "Togo", + "value": "TGO", + "extraInfo": { + "isDonor": true, + "isRecipient": true, + "level": "Country" + } + } + ] + } +] diff --git a/src/utils/filtering/geographies.ts b/src/utils/filtering/geographies.ts index 04440fd..a3aafd9 100644 --- a/src/utils/filtering/geographies.ts +++ b/src/utils/filtering/geographies.ts @@ -1,23 +1,37 @@ import _ from 'lodash'; -import locations from '../../static-assets/locations.json'; +import locationsBoardConstituencyView from '../../static-assets/locations-board-constituency-view.json'; +import locationsPortfolioView from '../../static-assets/locations-portfolio-view.json'; +import locationsStandardView from '../../static-assets/locations.json'; + +interface Item { + name: string; + value: string | null; + items?: Item[]; +} export function getGeographyValues(geos: string[]) { const values: string[] = []; - locations.forEach(region => { + [ + ...locationsStandardView, + ...locationsPortfolioView, + ...locationsBoardConstituencyView, + ].forEach((region: Item) => { const fRegion = _.find(geos, (g: string) => g === region.name); if (fRegion) { - region.items.forEach(item => { + region.items?.forEach(item => { if (item.items) { item.items.forEach(subItem => { values.push(`'${subItem.value}'`); }); + } else { + values.push(`'${item.value}'`); } }); } else { - region.items.forEach(item => { + region.items?.forEach(item => { const fItem = _.find(geos, (g: string) => g === item.name); if (fItem) { - item.items.forEach(subItem => { + item.items?.forEach(subItem => { values.push(`'${subItem.value}'`); }); }