From 8145b322da9d831954555143d6b2a39b45e2fba3 Mon Sep 17 00:00:00 2001 From: okorie2 Date: Sun, 14 May 2023 22:12:43 +0100 Subject: [PATCH 1/4] feat: add static text to CMS --- .../Charts/Eligibility/DotChart/index.tsx | 2 +- src/app/components/Charts/GeoMap/index.tsx | 2 +- .../TimeCycle/components/tooltip/index.tsx | 3 +- .../Charts/Investments/TimeCycle/index.tsx | 5 ++- .../Charts/common/dialogBox/index.tsx | 21 ++++++++--- .../PageHeader/components/filterbar/index.tsx | 4 +- .../components/Table/Expandable/Toolbar.tsx | 5 ++- src/app/components/Table/Expandable/index.tsx | 5 ++- .../components/allocationsperiods/index.tsx | 5 ++- .../components/donormaptypes/index.tsx | 5 ++- .../components/donormapviews/index.tsx | 5 ++- .../components/eligibilityadvanced/index.tsx | 7 +++- .../components/eligibilityyear/index.tsx | 11 ++++-- .../filters/common/expandedgroup/index.tsx | 6 ++- .../ToolBoxPanel/components/filters/index.tsx | 7 ++-- .../components/grantperiods/index.tsx | 4 +- .../components/iconbuttons/index.tsx | 11 ++++-- .../components/pf-reportingperiods/index.tsx | 6 ++- .../components/resultsyear/index.tsx | 11 ++++-- .../components/subtoolboxpanel/index.tsx | 9 +++-- src/app/components/ToolBoxPanel/index.tsx | 5 ++- src/app/hooks/useCMSData.tsx | 37 +++++++++++++++++++ .../sub-modules/overview/index.tsx | 25 ++++++++++--- src/app/modules/documents-module/index.tsx | 6 ++- .../grants-module/components/List/index.tsx | 11 ++++-- .../results-module/components/List/index.tsx | 7 +++- src/app/modules/results-module/datalist.tsx | 5 ++- src/app/modules/results-module/index.tsx | 4 +- .../sub-modules/allocations/geomap/index.tsx | 19 ++++++++-- .../sub-modules/allocations/index.tsx | 12 ++++-- .../sub-modules/allocations/table/index.tsx | 5 ++- .../sub-modules/budgets/flow/index.tsx | 12 +++--- .../sub-modules/budgets/geomap/index.tsx | 13 +++++-- .../sub-modules/budgets/time-cycle/index.tsx | 4 +- .../sub-modules/eligibility/index.tsx | 5 ++- .../table/data-wrappers/generic.tsx | 5 ++- .../sub-modules/eligibility/table/index.tsx | 5 ++- .../investments/disbursed/index.tsx | 13 +++++-- .../sub-modules/investments/geomap/index.tsx | 14 +++++-- .../sub-modules/investments/table/index.tsx | 5 ++- .../investments/time-cycle/index.tsx | 16 ++++++-- .../pledgescontributions/geomap/index.tsx | 7 ++-- .../pledgescontributions/table/index.tsx | 5 ++- .../pledgescontributions/time-cycle/index.tsx | 9 ++++- .../pledgescontributions/treemap/index.tsx | 5 ++- .../cms/componentsDialogBox.ts | 10 +++++ .../action-reducers/cms/componentsSidebar.ts | 10 +++++ .../action-reducers/cms/componentsTable.ts | 10 +++++ src/app/state/api/interfaces/index.ts | 5 +++ src/app/state/store/index.ts | 7 ++++ 50 files changed, 329 insertions(+), 101 deletions(-) create mode 100644 src/app/state/api/action-reducers/cms/componentsDialogBox.ts create mode 100644 src/app/state/api/action-reducers/cms/componentsSidebar.ts create mode 100644 src/app/state/api/action-reducers/cms/componentsTable.ts diff --git a/src/app/components/Charts/Eligibility/DotChart/index.tsx b/src/app/components/Charts/Eligibility/DotChart/index.tsx index 376329d4c..5c8cf9ed1 100644 --- a/src/app/components/Charts/Eligibility/DotChart/index.tsx +++ b/src/app/components/Charts/Eligibility/DotChart/index.tsx @@ -156,7 +156,7 @@ export function DotChart(props: DotChartProps) { } `} > - Eligibility + {get(cmsData, "componentsChartsEligibility.eligibility", "")}
- Country Detail Page + {get(cmsData, "componentsChartsGeomap.countryDetail", "")}
)} diff --git a/src/app/components/Charts/Investments/TimeCycle/components/tooltip/index.tsx b/src/app/components/Charts/Investments/TimeCycle/components/tooltip/index.tsx index 96733070f..0196df863 100644 --- a/src/app/components/Charts/Investments/TimeCycle/components/tooltip/index.tsx +++ b/src/app/components/Charts/Investments/TimeCycle/components/tooltip/index.tsx @@ -27,7 +27,8 @@ export function InvestmentsTimeCycleTooltip(props: any) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Year {props.indexValue} + {get(cmsData, "componentsChartsInvestments.year", "")}{" "} + {props.indexValue}
- {get(cmsData, "componentsChartsInvestments.totalAmount", "")}:{" "} + {get(cmsData, "componentsChartsInvestments.totalAmount", "")}{" "} {formatFinancialValue(totalInvestmentValue)} @@ -185,7 +185,8 @@ export function InvestmentsTimeCycle(props: InvestmentsTimeCycleProps) { } `} > - Investments - {props.type || "Disbursement"} + {get(cmsData, "componentsChartsInvestments.investments", "")}{" "} + {props.type || "Disbursement"}
{formatFinancialValue(totalInvestmentValue)} diff --git a/src/app/components/Charts/common/dialogBox/index.tsx b/src/app/components/Charts/common/dialogBox/index.tsx index 56054cb1f..d8b250920 100644 --- a/src/app/components/Charts/common/dialogBox/index.tsx +++ b/src/app/components/Charts/common/dialogBox/index.tsx @@ -4,6 +4,8 @@ import { overlaycss, modalContainercss, } from "app/components/Charts/common/dialogBox/style"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; interface Props { display: { @@ -27,7 +29,7 @@ export default function ReRouteDialogBox(props: Props) { const clearDataPathSteps = useStoreActions( (actions) => actions.DataPathSteps.clear ); - + const cmsData = useCMSData({ returnData: true }); const handleYesClick = () => { clearDataPathSteps(); if (props.handleClick) { @@ -47,21 +49,28 @@ export default function ReRouteDialogBox(props: Props) { margin: 0; `} > - You are navigating to a {props.display.pageType || "grant"} page. + {get(cmsData, "componentsDialogBox.navigating", "")}{" "} + {props.display.pageType || "grant"}{" "} + {get(cmsData, "componentsDialogBox.page", "")}

- New pathway will be formed according to your new search. + {get(cmsData, "componentsDialogBox.info", "")}

- Continue to {props.display.pageType || "grant"} page? + + {" "} + {get(cmsData, "componentsDialogBox.continueToPage", "")}{" "} + {props.display.pageType || "grant"}{" "} + {get(cmsData, "componentsDialogBox.pageRequest", "")} +

- No + {get(cmsData, "componentsDialogBox.no", "")}
diff --git a/src/app/components/PageHeader/components/filterbar/index.tsx b/src/app/components/PageHeader/components/filterbar/index.tsx index 480ce3eed..36ebc8aab 100644 --- a/src/app/components/PageHeader/components/filterbar/index.tsx +++ b/src/app/components/PageHeader/components/filterbar/index.tsx @@ -105,7 +105,9 @@ export function MobileFilterBar() { return (
-
Your selections
+
+ {get(cmsData, "componentsPageHeader.mobileFilterBar", "")} +
{chips.map((chip: any) => { return ; diff --git a/src/app/components/Table/Expandable/Toolbar.tsx b/src/app/components/Table/Expandable/Toolbar.tsx index dcb1c48c5..2a9fd2ba1 100644 --- a/src/app/components/Table/Expandable/Toolbar.tsx +++ b/src/app/components/Table/Expandable/Toolbar.tsx @@ -16,6 +16,7 @@ import ViewColumnIcon from "@material-ui/icons/ViewColumnOutlined"; import { CommonPropTypes } from "react-csv/components/CommonPropTypes"; import { TableToolbarCols } from "app/components/Table/Expandable/data"; import { Checkbox, FormControlLabel, FormGroup } from "@material-ui/core"; +import { useCMSData } from "app/hooks/useCMSData"; interface TableToolbarProps { title: string; @@ -29,7 +30,7 @@ export function TableToolbar(props: TableToolbarProps) { const location = useLocation(); const params = useParams<{ code?: string }>(); const vizData = useGetAllVizData(); - + const cmsData = useCMSData({ returnData: true }); const searchInputRef = React.useRef(null); const [anchorEl, setAnchorEl] = React.useState( null @@ -249,7 +250,7 @@ export function TableToolbar(props: TableToolbarProps) { margin-bottom: 20px; `} > - Show columns + {get(cmsData, "componentsTable.showColumns", "")}
{props.columns.map((c, index) => ( diff --git a/src/app/components/Table/Expandable/index.tsx b/src/app/components/Table/Expandable/index.tsx index 55a229c89..26920e39f 100644 --- a/src/app/components/Table/Expandable/index.tsx +++ b/src/app/components/Table/Expandable/index.tsx @@ -21,6 +21,8 @@ import { ExpandableTableRowDocProps, ExpandableTableRowProps, } from "app/components/Table/Expandable/data"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; const useRowStyles = makeStyles({ root: { @@ -200,6 +202,7 @@ function Row(props: { export function ExpandableTable(props: ExpandableTableProps) { const [toolbarCols, setToolbarCols] = React.useState([]); + const cmsData = useCMSData({ returnData: true }); function onColumnViewSelectionChange(e: React.ChangeEvent) { const updatedToolbarCols = [...toolbarCols]; @@ -219,7 +222,7 @@ export function ExpandableTable(props: ExpandableTableProps) { return ( get(state.AllocationsPeriods.data, "data", []) as string[] ); @@ -22,7 +25,7 @@ export function AllocationsPeriods() { return ( ({ diff --git a/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx b/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx index f5cde4a61..d8443dbba 100644 --- a/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx +++ b/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx @@ -1,8 +1,11 @@ import React from "react"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; export function ToolBoxPanelDonorMapTypes() { + const cmsData = useCMSData({ returnData: true }); const checked = useStoreState( (state) => state.ToolBoxPanelDonorMapTypeState.value ); @@ -12,7 +15,7 @@ export function ToolBoxPanelDonorMapTypes() { return ( state.ToolBoxPanelDonorMapViewState.value ); @@ -12,7 +15,7 @@ export function ToolBoxPanelDonorViews() { return ( state.ToolBoxPanelEligibilityAdvancedCheckboxState.value ); @@ -46,7 +49,7 @@ export function ToolBoxPanelEligibilityAdvanced() { } `} > - Advanced + {get(cmsData, "componentsSidebar.advancedLabel", "")} } - label="Show disease burden and income level" + label={get(cmsData, "componentsSidebar.showDiseaseLabel", "")} />
); diff --git a/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx b/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx index 64fecfdf6..35bb46fc0 100644 --- a/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx +++ b/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx @@ -2,8 +2,10 @@ import React from "react"; import get from "lodash/get"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; +import { useCMSData } from "app/hooks/useCMSData"; export function EligibilityYear() { + const cmsData = useCMSData({ returnData: true }); const dataYearOptions = useStoreState( (state) => get(state.EligibilityYears.data, "data", []) as string[] ); @@ -15,13 +17,14 @@ export function EligibilityYear() { (actions) => actions.ToolBoxPanelEligibilityYearState.setValue ); - React.useEffect(() => setSelectedYear(get(dataYearOptions, "[0]", "2020")), [ - dataYearOptions, - ]); + React.useEffect( + () => setSelectedYear(get(dataYearOptions, "[0]", "2020")), + [dataYearOptions] + ); return ( ({ diff --git a/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx b/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx index 2715af402..91d557a1f 100644 --- a/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx +++ b/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx @@ -21,6 +21,8 @@ import { FilterOptionProps, } from "app/components/ToolBoxPanel/components/filters/data"; import { appColors } from "app/theme"; +import { get } from "lodash"; +import { useCMSData } from "app/hooks/useCMSData"; interface ExpandedFilterGroupProps extends FilterGroupModel, FilterGroupProps { goBack: () => void; @@ -29,7 +31,7 @@ interface ExpandedFilterGroupProps extends FilterGroupModel, FilterGroupProps { export function ExpandedFilterGroup(props: ExpandedFilterGroupProps) { const [value, setValue] = React.useState(""); const [allSelected, setAllSelected] = React.useState(false); - + const cmsData = useCMSData({ returnData: true }); const [optionsToShow, setOptionsToShow] = React.useState(props.options); const [expandedGroup] = useRecoilState(filterExpandedGroup); const { @@ -461,7 +463,7 @@ export function ExpandedFilterGroup(props: ExpandedFilterGroupProps) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Apply + {get(cmsData, "componentsSidebar.applyButton", "")} )} diff --git a/src/app/components/ToolBoxPanel/components/filters/index.tsx b/src/app/components/ToolBoxPanel/components/filters/index.tsx index 029834e93..36e7d27dc 100644 --- a/src/app/components/ToolBoxPanel/components/filters/index.tsx +++ b/src/app/components/ToolBoxPanel/components/filters/index.tsx @@ -12,6 +12,7 @@ import { defaultAppliedFilters } from "app/state/api/action-reducers/sync/filter import { FilterGroupProps } from "app/components/ToolBoxPanel/components/filters/data"; import { FilterGroup } from "app/components/ToolBoxPanel/components/filters/common/group"; import { ExpandedFilterGroup } from "app/components/ToolBoxPanel/components/filters/common/expandedgroup"; +import { useCMSData } from "app/hooks/useCMSData"; interface ToolBoxPanelFiltersProps { groups: FilterGroupProps[]; @@ -19,7 +20,7 @@ interface ToolBoxPanelFiltersProps { export function ToolBoxPanelFilters(props: ToolBoxPanelFiltersProps) { const filterOptions = useFilterOptions({ returnFilterOptions: true }); - + const cmsData = useCMSData({ returnData: true }); const [expandedGroup, setExpandedGroup] = useRecoilState(filterExpandedGroup); const actions = useStoreActions((store) => store.AppliedFiltersState); const data = useStoreState((state) => state.AppliedFiltersState); @@ -95,7 +96,7 @@ export function ToolBoxPanelFilters(props: ToolBoxPanelFiltersProps) { } `} > - Filters + {get(cmsData, "componentsSidebar.filters", "")} {props.groups.map((group: FilterGroupProps) => ( diff --git a/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx b/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx index 8620f1951..5e648de2f 100644 --- a/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx +++ b/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx @@ -4,6 +4,7 @@ import find from "lodash/find"; import { useStoreState } from "app/state/store/hooks"; import { useParams, useHistory } from "react-router-dom"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; +import { useCMSData } from "app/hooks/useCMSData"; interface GrantDetailPeriod { number: number; @@ -14,6 +15,7 @@ interface GrantDetailPeriod { export function GrantImplementationPeriods() { const history = useHistory(); const params = useParams<{ code: string; period: string; vizType: string }>(); + const cmsData = useCMSData({ returnData: true }); const periods = useStoreState( (state) => @@ -42,7 +44,7 @@ export function GrantImplementationPeriods() { return ( ({ diff --git a/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx b/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx index 01dcbab33..fde90ddde 100644 --- a/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx +++ b/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx @@ -17,6 +17,7 @@ import { exportView } from "app/utils/exportView"; import { CopyToClipboard } from "react-copy-to-clipboard"; import { useGetAllVizData } from "app/hooks/useGetAllVizData"; import { CloudDownloadIcon } from "app/assets/icons/CloudDownload"; +import { useCMSData } from "app/hooks/useCMSData"; const locationsToNotShowImageExport = [ "/viz/disbursements/map", @@ -108,6 +109,8 @@ export function ToolBoxPanelIconButtons(props: ToolBoxPanelIconButtonsProps) { const location = useLocation(); const csvLinkRef = React.useRef(); const params = useParams<{ code?: string }>(); + const cmsData = useCMSData({ returnData: true }); + const vizData = useGetAllVizData(); const [openSnackbar, setOpenSnackbar] = React.useState(false); const [allAvailableGrants, setAllAvailableGrants] = React.useState([]); @@ -172,7 +175,7 @@ export function ToolBoxPanelIconButtons(props: ToolBoxPanelIconButtonsProps) { font-size: 12px !important; `} > - CSV + {get(cmsData, "componentsSidebar.csvIcon", "")} , ]; @@ -215,7 +218,7 @@ export function ToolBoxPanelIconButtons(props: ToolBoxPanelIconButtonsProps) { padding: 6px 12px !important; `} > - CSV + {get(cmsData, "componentsSidebar.csvIcon", "")} , ]; @@ -253,7 +256,7 @@ export function ToolBoxPanelIconButtons(props: ToolBoxPanelIconButtonsProps) { padding: 6px 12px !important; `} > - PNG + {get(cmsData, "componentsSidebar.pngIcon", "")} ); @@ -284,7 +287,7 @@ export function ToolBoxPanelIconButtons(props: ToolBoxPanelIconButtonsProps) { padding: 6px 12px !important; `} > - SVG + {get(cmsData, "componentsSidebar.svgIcon", "")} ); diff --git a/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx b/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx index 621f4ec9c..0b2286a62 100644 --- a/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx +++ b/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx @@ -5,6 +5,8 @@ import useMeasure from "react-use/lib/useMeasure"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; import Draggable, { DraggableEvent, DraggableData } from "react-draggable"; import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; export interface PerformanceFrameworkReportingPeriodsProps { periods: string[][]; @@ -14,7 +16,7 @@ export function PerformanceFrameworkReportingPeriods( props: PerformanceFrameworkReportingPeriodsProps ) { const [ref, { width }] = useMeasure(); - + const cmsData = useCMSData({ returnData: true }); const setSelected = useStoreActions( (store) => store.ToolBoxPanelPFPeriodState.setValue ); @@ -53,7 +55,7 @@ export function PerformanceFrameworkReportingPeriods( } `} > - Reporting Period + {get(cmsData, "componentsSidebar.reportingPeriodLabel", "")}
get(state.ResultsYears.data, "data", []) as string[] ); @@ -15,13 +17,14 @@ export function ResultsYear() { (actions) => actions.ToolBoxPanelResultsYearState.setValue ); - React.useEffect(() => setSelectedYear(get(dataYearOptions, "[0]", "2020")), [ - dataYearOptions, - ]); + React.useEffect( + () => setSelectedYear(get(dataYearOptions, "[0]", "2020")), + [dataYearOptions] + ); return ( ({ diff --git a/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx b/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx index 04b22bb09..0c4231ca9 100644 --- a/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx +++ b/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx @@ -26,6 +26,7 @@ import { } from "app/components/ToolBoxPanel/utils/getControlItems"; import { useRecoilState } from "recoil"; import { filterExpandedGroup } from "app/state/recoil/atoms"; +import { useCMSData } from "app/hooks/useCMSData"; interface SubToolBoxPanelProps { filterGroups: FilterGroupProps[]; @@ -40,6 +41,8 @@ export function SubToolBoxPanel(props: SubToolBoxPanelProps) { vizType: string; subType?: string; }>(); + const cmsData = useCMSData({ returnData: true }); + const isMobile = useMediaQuery("(max-width: 767px)"); const [selectedView, setSelectedView] = React.useState(""); const [controlItems, setControlItems] = React.useState<{ @@ -197,7 +200,7 @@ export function SubToolBoxPanel(props: SubToolBoxPanelProps) { )} {controlItems.views.length > 0 && !isMobile && ( 0 && ( (null); + const cmsData = useCMSData({ returnData: true }); const [expandedGroup] = useRecoilState(filterExpandedGroup); @@ -184,7 +187,7 @@ export function ToolBoxPanel(props: ToolBoxPanelProps) { font-family: GothamNarrow-Bold; `} > - Toolbox + {get(cmsData, "componentsSidebar.toolbox", "")}
state.cms.componentsAppBar.data ); + const componentsTableCMSAction = useStoreActions( + (actions) => actions.cms.componentsTable.fetch + ); + const componentsTableCMSData = useStoreState( + (state) => state.cms.componentsTable.data + ); + const componentsDialogBoxCMSAction = useStoreActions( + (actions) => actions.cms.componentsDialogBox.fetch + ); + const componentsDialogBoxCMSData = useStoreState( + (state) => state.cms.componentsDialogBox.data + ); const componentsChartsBudgetsCMSAction = useStoreActions( (actions) => actions.cms.componentsChartsBudgets.fetch ); @@ -122,6 +134,13 @@ export function useCMSData(props: UseCMSDataProps) { const componentsSlideInPanelCMSData = useStoreState( (state) => state.cms.componentsSlideInPanel.data ); + const componentsSidebarCMSAction = useStoreActions( + (actions) => actions.cms.componentsSidebar.fetch + ); + const componentsSidebarCMSData = useStoreState( + (state) => state.cms.componentsSidebar.data + ); + // MODULES const modulesAboutCMSAction = useStoreActions( (actions) => actions.cms.modulesAbout.fetch @@ -170,6 +189,8 @@ export function useCMSData(props: UseCMSDataProps) { if (props.loadData) { // COMPONENTS componentsAppBarCMSAction({ isCMSfetch: true }); + componentsTableCMSAction({ isCMSfetch: true }); + componentsDialogBoxCMSAction({ isCMSfetch: true }); componentsChartsBudgetsCMSAction({ isCMSfetch: true }); componentsChartsCommonCMSAction({ isCMSfetch: true }); componentsChartsEligibilityCMSAction({ isCMSfetch: true }); @@ -187,6 +208,7 @@ export function useCMSData(props: UseCMSDataProps) { componentsPerformanceFrameworkComponentsCMSAction({ isCMSfetch: true }); componentsSearchCMSAction({ isCMSfetch: true }); componentsSlideInPanelCMSAction({ isCMSfetch: true }); + componentsSidebarCMSAction({ isCMSfetch: true }); // MODULES modulesAboutCMSAction({ isCMSfetch: true }); modulesCommonCMSAction({ isCMSfetch: true }); @@ -207,6 +229,14 @@ export function useCMSData(props: UseCMSDataProps) { key: "componentsAppBar", data: componentsAppBarCMSData || {}, }, + { + key: "componentsTable", + data: componentsTableCMSData || {}, + }, + { + key: "componentsDialogBox", + data: componentsDialogBoxCMSData || {}, + }, { key: "componentsChartsBudgets", data: componentsChartsBudgetsCMSData || {}, @@ -275,6 +305,10 @@ export function useCMSData(props: UseCMSDataProps) { key: "componentsSlideInPanel", data: componentsSlideInPanelCMSData || {}, }, + { + key: "componentsSidebar", + data: componentsSidebarCMSData || {}, + }, // MODULES { key: "modulesAbout", @@ -340,6 +374,8 @@ export function useCMSData(props: UseCMSDataProps) { }, [ // COMPONENTS componentsAppBarCMSData, + componentsTableCMSData, + componentsDialogBoxCMSData, componentsChartsBudgetsCMSData, componentsChartsCommonCMSData, componentsChartsEligibilityCMSData, @@ -357,6 +393,7 @@ export function useCMSData(props: UseCMSDataProps) { componentsPerformanceFrameworkComponentsCMSData, componentsSearchCMSData, componentsSlideInPanelCMSData, + componentsSidebarCMSData, // MODULES modulesAboutCMSData, modulesCommonCMSData, diff --git a/src/app/modules/country-detail-module/sub-modules/overview/index.tsx b/src/app/modules/country-detail-module/sub-modules/overview/index.tsx index 5139c6c05..00100e59d 100644 --- a/src/app/modules/country-detail-module/sub-modules/overview/index.tsx +++ b/src/app/modules/country-detail-module/sub-modules/overview/index.tsx @@ -154,7 +154,14 @@ export function LocationDetailOverviewModule(props: Props) { } `} > - Coordinating Mechanism Contacts + + {" "} + {get( + cmsData, + "modulesCountryDetail.mechanismContactsLabel", + "" + )} + @@ -279,7 +286,12 @@ export function LocationDetailOverviewModule(props: Props) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Principal Recipients in {locationInfoData.locationName} + {get( + cmsData, + "modulesCountryDetail.PrincipalRecipientsLabel", + "" + )}{" "} + {locationInfoData.locationName}
-

Country overview description

+

+ {" "} + {get(cmsData, "modulesCountryDetail.countryOverviewTitle", "")} +

{parse(countrySummaryCMSData)} {notesDisclaimersCMSData && parse(notesDisclaimersCMSData)}
@@ -399,14 +414,14 @@ export function LocationDetailOverviewModule(props: Props) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Investment + {get(cmsData, "modulesCountryDetail.investments", "")}
- Comparison between disbursed, commited and signed amounts + {get(cmsData, "modulesCountryDetail.radialVizDescription", "")}
diff --git a/src/app/modules/documents-module/index.tsx b/src/app/modules/documents-module/index.tsx index f0be10dc7..7f263f72c 100644 --- a/src/app/modules/documents-module/index.tsx +++ b/src/app/modules/documents-module/index.tsx @@ -16,12 +16,14 @@ import { PageTopSpacer } from "app/modules/common/page-top-spacer"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { ExpandableTableRowProps } from "app/components/Table/Expandable/data"; import { pathnameToFilterGroups } from "app/components/ToolBoxPanel/components/filters/data"; +import { useCMSData } from "app/hooks/useCMSData"; export default function DocumentsModule() { useTitle("The Data Explorer - Documents"); const vizWrapperRef = React.useRef(null); const [search, setSearch] = React.useState(""); const isMobile = useMediaQuery("(max-width: 767px)"); + const cmsData = useCMSData({ returnData: true }); const [openToolboxPanel, setOpenToolboxPanel] = React.useState(!isMobile); const addDataPathSteps = useStoreActions( @@ -125,7 +127,9 @@ export default function DocumentsModule() { `} > - + @@ -224,7 +227,7 @@ export function GrantsList(props: GrantsListProps) {
{item.title}
- Principal Recipient:{" "} + {get(cmsData, "modulesGrants.principalRecipient", "")}:{" "} {item.recipientName} {item.recipientShortName && ` (${item.recipientShortName})`} @@ -280,7 +283,7 @@ export function GrantsList(props: GrantsListProps) { sans-serif; `} > - Disbursed ·{" "} + {get(cmsData, "modulesGrants.disbursed", "")}·{" "} {((item.disbursed * 100) / item.committed).toFixed(2)}%
{formatFinancialValue(item.disbursed)}
@@ -319,7 +322,7 @@ export function GrantsList(props: GrantsListProps) { sans-serif; `} > - Committed + {get(cmsData, "modulesGrants.committed", "")}
{formatFinancialValue(item.committed)}
@@ -338,7 +341,7 @@ export function GrantsList(props: GrantsListProps) { sans-serif; `} > - Signed + {get(cmsData, "modulesGrants.signed", "")}
{formatFinancialValue(item.signed)}
diff --git a/src/app/modules/results-module/components/List/index.tsx b/src/app/modules/results-module/components/List/index.tsx index c7af566a0..ae43dc05e 100644 --- a/src/app/modules/results-module/components/List/index.tsx +++ b/src/app/modules/results-module/components/List/index.tsx @@ -16,6 +16,8 @@ import { ResultsListProps, ResultListItemModel, } from "app/modules/results-module/data"; +import { get } from "lodash"; +import { useCMSData } from "app/hooks/useCMSData"; export function ResultsList(props: ResultsListProps) { return ( @@ -33,6 +35,7 @@ export function ResultsList(props: ResultsListProps) { function ResultsListItem(props: ResultListItemModel) { const history = useHistory(); + const cmsData = useCMSData({ returnData: true }); const [expand, setExpand] = React.useState(false); const isMobile = useMediaQuery("(max-width: 767px)"); const isLocationDetail = history.location.pathname.indexOf("/location/") > -1; @@ -100,7 +103,7 @@ function ResultsListItem(props: ResultListItemModel) { } > -
See more
+
{get(cmsData, "ModulesResult.seeMore", "")}
)} @@ -116,7 +119,7 @@ function ResultsListItem(props: ResultListItemModel) { }} > -
See more
+
{get(cmsData, "ModulesResult.seeMore", "")}
{props.geoLocations.map( diff --git a/src/app/modules/results-module/datalist.tsx b/src/app/modules/results-module/datalist.tsx index 162309d6e..82587fa0e 100644 --- a/src/app/modules/results-module/datalist.tsx +++ b/src/app/modules/results-module/datalist.tsx @@ -5,6 +5,8 @@ import { Search } from "app/modules/grants-module/components/Search"; import { ResultListItemModel } from "app/modules/results-module/data"; import { NoDataLabel } from "app/components/Charts/common/nodatalabel"; import { ResultsList } from "app/modules/results-module/components/List"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; export const DataList = (props: { isLoading: boolean; @@ -15,6 +17,7 @@ export const DataList = (props: { openToolboxPanel: boolean; pushValue: number; }) => { + const cmsData = useCMSData({ returnData: true }); return ( <> {props.isLoading && } @@ -52,7 +55,7 @@ export const DataList = (props: { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Year {props.selectedYear} + {get(cmsData, "ModulesResult.year", "")} {props.selectedYear}
diff --git a/src/app/modules/results-module/index.tsx b/src/app/modules/results-module/index.tsx index 99de08412..cf007e90d 100644 --- a/src/app/modules/results-module/index.tsx +++ b/src/app/modules/results-module/index.tsx @@ -17,11 +17,13 @@ import { PageTopSpacer } from "app/modules/common/page-top-spacer"; import { ResultListItemModel } from "app/modules/results-module/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { pathnameToFilterGroups } from "app/components/ToolBoxPanel/components/filters/data"; +import { useCMSData } from "app/hooks/useCMSData"; export default function ResultsModule() { useTitle("The Data Explorer - Results"); const location = useLocation(); const vizWrapperRef = React.useRef(null); + const cmsData = useCMSData({ returnData: true }); const [search, setSearch] = React.useState(""); const isMobile = useMediaQuery("(max-width: 767px)"); const [openToolboxPanel, setOpenToolboxPanel] = React.useState(!isMobile); @@ -145,7 +147,7 @@ export default function ResultsModule() { `} > - + store.AllocationsGeomap.fetch); const data = useStoreState( @@ -153,7 +155,10 @@ export function AllocationsGeoMap(props: Props) { `} >
- Allocations | {selectedPeriod} + + {get(cmsData, "componentsChartsInvestments.notAvailable", "")}{" "} + {selectedPeriod} +
-
0 USD
+
+ {get( + cmsData, + "componentsChartsInvestments.defaultFinancialValue", + "" + )} +
{formatFinancialValue(maxValue)}
@@ -209,7 +220,9 @@ export function AllocationsGeoMap(props: Props) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} /> -
N/A
+
+ {get(cmsData, "componentsChartsInvestments.notAvailable", "")} +
)} diff --git a/src/app/modules/viz-module/sub-modules/allocations/index.tsx b/src/app/modules/viz-module/sub-modules/allocations/index.tsx index dfaa4bdd1..8e4d4ff90 100644 --- a/src/app/modules/viz-module/sub-modules/allocations/index.tsx +++ b/src/app/modules/viz-module/sub-modules/allocations/index.tsx @@ -30,6 +30,7 @@ import { getKeysPercentages, AllocationsTreemapDataItem, } from "app/modules/viz-module/sub-modules/allocations/data"; +import { useCMSData } from "app/hooks/useCMSData"; interface AllocationsModuleProps { code?: string; @@ -39,7 +40,7 @@ interface AllocationsModuleProps { export function AllocationsModule(props: AllocationsModuleProps) { useTitle(`The Data Explorer -${props.code ? " Location" : ""} Allocations`); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const selectedPeriod = useStoreState( @@ -480,7 +481,11 @@ export function AllocationsModule(props: AllocationsModuleProps) { { const name = node.split("-")[0]; const code = getIso3FromName(name); @@ -539,7 +544,8 @@ export function AllocationsModule(props: AllocationsModuleProps) { } `} > - Allocations | {selectedPeriod} + {get(cmsData, "componentsChartsInvestments.allocations", "")}{" "} + {selectedPeriod}
{formatFinancialValue(total)}
diff --git a/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx b/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx index e6446f260..82a438d1e 100644 --- a/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx @@ -9,6 +9,7 @@ import useUpdateEffect from "react-use/lib/useUpdateEffect"; import { SimpleTableRow } from "app/components/Table/Simple/data"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; +import { useCMSData } from "app/hooks/useCMSData"; interface AllocationsTableProps { code?: string; @@ -18,7 +19,7 @@ interface AllocationsTableProps { export function AllocationsTableModule(props: AllocationsTableProps) { useTitle(`The Data Explorer -${props.code ? " Location" : ""} Allocations`); - + const cmsData = useCMSData({ returnData: true }); const [search, setSearch] = React.useState(""); const [sortBy, setSortBy] = React.useState("name ASC"); @@ -86,7 +87,7 @@ export function AllocationsTableModule(props: AllocationsTableProps) { return ( (null); @@ -158,7 +160,7 @@ export function BudgetsFlowModule(props: BudgetsFlowModuleProps) { vizComponent = ( { @@ -239,7 +241,7 @@ export function BudgetsFlowModule(props: BudgetsFlowModuleProps) { margin-top: -9px; `} > - Budget + {get(cmsData, "componentsChartsBudgets.budget", "")}

- Budgets + + {get(cmsData, "componentsChartsBudgets.geomapLabelBudgets", "")} +
-
0 USD
+
+ {get(cmsData, "componentsChartsBudgets.geomapDefaultValue", "")} +
{formatFinancialValue(maxValue)}
@@ -246,7 +251,7 @@ export function BudgetsGeoMap(props: Props) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - N/A + {get(cmsData, "componentsChartsBudgets.notAvailable", "")} diff --git a/src/app/modules/viz-module/sub-modules/budgets/time-cycle/index.tsx b/src/app/modules/viz-module/sub-modules/budgets/time-cycle/index.tsx index b9d7b4579..91d944985 100644 --- a/src/app/modules/viz-module/sub-modules/budgets/time-cycle/index.tsx +++ b/src/app/modules/viz-module/sub-modules/budgets/time-cycle/index.tsx @@ -146,7 +146,7 @@ export function BudgetsTimeCycleModule(props: BudgetsTimeCycleModuleProps) { vizComponent = ( { diff --git a/src/app/modules/viz-module/sub-modules/eligibility/index.tsx b/src/app/modules/viz-module/sub-modules/eligibility/index.tsx index c10560d47..6f14764a4 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/index.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/index.tsx @@ -11,10 +11,11 @@ import { PageLoader } from "app/modules/common/page-loader"; import { DotChart } from "app/components/Charts/Eligibility/DotChart"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { DotChartModel } from "app/components/Charts/Eligibility/DotChart/data"; +import { useCMSData } from "app/hooks/useCMSData"; export function EligibilityModule() { useTitle("The Data Explorer - Eligibility"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const dataPathSteps = useStoreState((state) => state.DataPathSteps.steps); @@ -71,7 +72,7 @@ export function EligibilityModule() { return ( ); diff --git a/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx b/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx index 1c0d422a0..6a5a85c6b 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx @@ -14,6 +14,7 @@ import { SimpleTableRow } from "app/components/Table/Simple/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { DotChartModel } from "app/components/Charts/Eligibility/DotChart/data"; import { EligibilityTable } from "app/modules/viz-module/sub-modules/eligibility/table"; +import { useCMSData } from "app/hooks/useCMSData"; function getTableData(data: DotChartModel[]): SimpleTableRow[] { const updatedTableData: SimpleTableRow[] = []; @@ -34,7 +35,7 @@ function getTableData(data: DotChartModel[]): SimpleTableRow[] { export function GenericEligibilityWrapper() { useTitle("The Data Explorer - Eligibility"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const [search, setSearch] = React.useState(""); @@ -170,7 +171,7 @@ export function GenericEligibilityWrapper() { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - Year {selectedYear} + {get(cmsData, "componentsChartsEligibility.year", "")} {selectedYear}
diff --git a/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx b/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx index 3f2d7e435..333d99dab 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx @@ -7,6 +7,8 @@ import { SimpleTableRow, SimpleTableColumn, } from "app/components/Table/Simple/data"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; interface EligibilityTableProps { search: string; @@ -19,6 +21,7 @@ interface EligibilityTableProps { } export function EligibilityTable(props: EligibilityTableProps) { + const cmsData = useCMSData({ returnData: true }); if (props.isLoading) { return ; } @@ -28,7 +31,7 @@ export function EligibilityTable(props: EligibilityTableProps) { search={props.search} sortBy={props.sortBy} rows={props.data} - title="Eligibility" + title={get(cmsData, "componentsTable.eligibiltyTitle", "")} columns={props.columns} onSearchChange={props.setSearch} onSortByChange={props.setSortBy} diff --git a/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx b/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx index 414fa02ac..882db09f1 100644 --- a/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx @@ -18,6 +18,8 @@ import ReRouteDialogBox from "app/components/Charts/common/dialogBox"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { DisbursementsTreemap } from "app/components/Charts/Investments/Disbursements"; import { DisbursementsTreemapDataItem } from "app/components/Charts/Investments/Disbursements/data"; +import { get } from "lodash"; +import { useCMSData } from "app/hooks/useCMSData"; interface InvestmentsDisbursedModuleProps { data: DisbursementsTreemapDataItem[]; @@ -72,7 +74,7 @@ export function InvestmentsDisbursedModule( const isMobile = useMediaQuery("(max-width: 767px)"); const history = useHistory(); - + const cmsData = useCMSData({ returnData: true }); const [treemapData, setTreemapData] = React.useState< DisbursementsTreemapDataItem[] >(props.data); @@ -289,7 +291,8 @@ export function InvestmentsDisbursedModule( } `} > - Investments - {props.type || "Disbursement"} + {get(cmsData, "componentsChartsInvestments.investments", "")}{" "} + {props.type || "Disbursement"}
{formatFinancialValue(totalValue)} @@ -298,7 +301,11 @@ export function InvestmentsDisbursedModule( )} {isMobile && ( - Total amount: {formatFinancialValue(totalValue)} + + {" "} + {get(cmsData, "componentsChartsInvestments.totalAmount", "")}{" "} + {formatFinancialValue(totalValue)} + )} diff --git a/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx index 84c265d83..dcc0e3506 100644 --- a/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx @@ -14,6 +14,7 @@ import { PageLoader } from "app/modules/common/page-loader"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { InvestmentsGeoMapPinMarker } from "app/components/Charts/GeoMap/data"; +import { useCMSData } from "app/hooks/useCMSData"; interface Props { code?: string; @@ -23,7 +24,7 @@ interface Props { export function InvestmentsGeoMap(props: Props) { useTitle("The Data Explorer - Investments/Map"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); // api call & data @@ -227,7 +228,14 @@ export function InvestmentsGeoMap(props: Props) { justify-content: space-between; `} > -
0 USD
+
+ {" "} + {get( + cmsData, + "componentsChartsInvestments.defaultFinancialValue", + "" + )} +
{formatFinancialValue(maxValue)}
@@ -268,7 +276,7 @@ export function InvestmentsGeoMap(props: Props) { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - N/A + {get(cmsData, "componentsChartsInvestments.notAvailable", "")} diff --git a/src/app/modules/viz-module/sub-modules/investments/table/index.tsx b/src/app/modules/viz-module/sub-modules/investments/table/index.tsx index 6e96c6d54..cdc97f727 100644 --- a/src/app/modules/viz-module/sub-modules/investments/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/table/index.tsx @@ -4,6 +4,8 @@ import React from "react"; import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow } from "app/components/Table/Simple/data"; +import { useCMSData } from "app/hooks/useCMSData"; +import { get } from "lodash"; interface InvestmentsTableProps { search: string; @@ -15,13 +17,14 @@ interface InvestmentsTableProps { } export function InvestmentsTable(props: InvestmentsTableProps) { + const csmData = useCMSData({ returnData: true }); if (props.isLoading) { return ; } return ( []; @@ -41,7 +43,7 @@ export function InvestmentsTimeCycleModule( props: InvestmentsTimeCycleModuleProps ) { const history = useHistory(); - + const cmsData = useCMSData({ returnData: true }); const [xsTooltipData, setXsTooltipData] = React.useState(null); @@ -152,7 +154,11 @@ export function InvestmentsTimeCycleModule( { if (props.setDrilldownVizSelected) { @@ -178,7 +184,11 @@ export function InvestmentsTimeCycleModule( { const idSplits = node.split("-"); diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx index 25ac7dd19..464efeaef 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx @@ -15,10 +15,11 @@ import { PageLoader } from "app/modules/common/page-loader"; import { GeoMapPinMarker } from "app/components/Charts/GeoMap/data"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; +import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsGeoMap() { useTitle("The Data Explorer - Pledges & Contributions GeoMap"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const valueType = useStoreState( @@ -185,7 +186,7 @@ export function PledgesContributionsGeoMap() { justify-content: space-between; `} > -
0 USD
+
{get(cmsData, "componentsChartsGeomap.minRange")}
{formatFinancialValue(maxValue)}
@@ -226,7 +227,7 @@ export function PledgesContributionsGeoMap() { font-family: "GothamNarrow-Bold", "Helvetica Neue", sans-serif; `} > - N/A + {get(cmsData, "componentsChartsGeomap.notAvailable")} diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx index d1b4be068..71fb34c52 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx @@ -13,10 +13,11 @@ import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow } from "app/components/Table/Simple/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; +import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsTable() { useTitle("The Data Explorer - Pledges & Contributions Table"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const [page, setPage] = React.useState(0); @@ -125,7 +126,7 @@ export function PledgesContributionsTable() { return ( <> {}} /> diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx index 8d0d04547..521202307 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx @@ -18,10 +18,11 @@ import { BudgetsTreemap } from "app/components/Charts/Budgets/Treemap"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { BudgetsTreemapDataItem } from "app/components/Charts/Budgets/Treemap/data"; import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsTreemap() { useTitle("The Data Explorer - Pledges & Contributions/Treemap"); - + const cmsData = useCMSData({ returnData: true }); const history = useHistory(); const [vizSelected, setVizSelected] = React.useState( @@ -160,7 +161,7 @@ export function PledgesContributionsTreemap() { } `} > - Donors {valueType}s + {get(cmsData, "componentsChartsPledges.donors", "")} {valueType}s
{formatFinancialValue(totalBudget)} diff --git a/src/app/state/api/action-reducers/cms/componentsDialogBox.ts b/src/app/state/api/action-reducers/cms/componentsDialogBox.ts new file mode 100644 index 000000000..f5dae9379 --- /dev/null +++ b/src/app/state/api/action-reducers/cms/componentsDialogBox.ts @@ -0,0 +1,10 @@ +import { APIModel } from "app/state/api"; +import { CMSApiCallModel } from "app/state/api/interfaces"; + +const componentsDialogBox: CMSApiCallModel = { + ...APIModel( + `${process.env.REACT_APP_CMS_API}/singletons/get/componentsDialogBox?token=${process.env.REACT_APP_CMS_TOKEN}` + ), +}; + +export default componentsDialogBox; diff --git a/src/app/state/api/action-reducers/cms/componentsSidebar.ts b/src/app/state/api/action-reducers/cms/componentsSidebar.ts new file mode 100644 index 000000000..80e7f26c3 --- /dev/null +++ b/src/app/state/api/action-reducers/cms/componentsSidebar.ts @@ -0,0 +1,10 @@ +import { APIModel } from "app/state/api"; +import { CMSApiCallModel } from "app/state/api/interfaces"; + +const componentsSidebar: CMSApiCallModel = { + ...APIModel( + `${process.env.REACT_APP_CMS_API}/singletons/get/componentsSidebar?token=${process.env.REACT_APP_CMS_TOKEN}` + ), +}; + +export default componentsSidebar; diff --git a/src/app/state/api/action-reducers/cms/componentsTable.ts b/src/app/state/api/action-reducers/cms/componentsTable.ts new file mode 100644 index 000000000..923606dd3 --- /dev/null +++ b/src/app/state/api/action-reducers/cms/componentsTable.ts @@ -0,0 +1,10 @@ +import { APIModel } from "app/state/api"; +import { CMSApiCallModel } from "app/state/api/interfaces"; + +const componentsTable: CMSApiCallModel = { + ...APIModel( + `${process.env.REACT_APP_CMS_API}/singletons/get/componentsTable?token=${process.env.REACT_APP_CMS_TOKEN}` + ), +}; + +export default componentsTable; diff --git a/src/app/state/api/interfaces/index.ts b/src/app/state/api/interfaces/index.ts index dcf49b921..fce3ff012 100644 --- a/src/app/state/api/interfaces/index.ts +++ b/src/app/state/api/interfaces/index.ts @@ -259,6 +259,9 @@ export interface StoreModel { // CMS cms: { componentsAppBar: CMSApiCallModel; + componentsTable: CMSApiCallModel; + componentsDialogBox: CMSApiCallModel; + componentsChartsBudgets: CMSApiCallModel; componentsChartsCommon: CMSApiCallModel; componentsChartsEligibility: CMSApiCallModel; @@ -276,6 +279,8 @@ export interface StoreModel { componentsPerformanceFrameworkComponents: CMSApiCallModel; componentsSearch: CMSApiCallModel; componentsSlideInPanel: CMSApiCallModel; + componentsSidebar: CMSApiCallModel; + modulesLanding: CMSApiCallModel; modulesAbout: CMSApiCallModel; modulesCommon: CMSApiCallModel; diff --git a/src/app/state/store/index.ts b/src/app/state/store/index.ts index 1df7443f3..780de4ece 100644 --- a/src/app/state/store/index.ts +++ b/src/app/state/store/index.ts @@ -170,6 +170,9 @@ import { DataPathStepsState, } from "../api/action-reducers/sync/dataPath"; import PledgesContributionsTable from "../api/action-reducers/viz/pledgesContributionsTable"; +import componentsSidebar from "../api/action-reducers/cms/componentsSidebar"; +import componentsTable from "../api/action-reducers/cms/componentsTable"; +import componentsDialogBox from "../api/action-reducers/cms/componentsDialogBox"; const storeContent: StoreModel = { // data viz api @@ -337,6 +340,9 @@ const storeContent: StoreModel = { // CMS API cms: { componentsAppBar: persist(componentsAppBar), + componentsTable: persist(componentsTable), + componentsDialogBox: persist(componentsDialogBox), + componentsChartsBudgets: persist(componentsChartsBudgets), componentsChartsCommon: persist(componentsChartsCommon), componentsChartsEligibility: persist(componentsChartsEligibility), @@ -358,6 +364,7 @@ const storeContent: StoreModel = { ), componentsSearch: persist(componentsSearch), componentsSlideInPanel: persist(componentsSlideInPanel), + componentsSidebar: persist(componentsSidebar), modulesLanding: persist(modulesLanding), modulesAbout: persist(modulesAbout), modulesCommon: persist(modulesCommon), From 26e6624f67a5de594db837bd70f4328f298cd9f1 Mon Sep 17 00:00:00 2001 From: Stefanos Hadjipetrou Date: Fri, 19 May 2023 13:01:57 +0300 Subject: [PATCH 2/4] chore: adjust imports --- src/app/components/Charts/common/dialogBox/index.tsx | 4 ++-- src/app/components/Table/Expandable/Toolbar.tsx | 2 +- src/app/components/Table/Expandable/index.tsx | 4 ++-- .../ToolBoxPanel/components/allocationsperiods/index.tsx | 2 +- .../ToolBoxPanel/components/donormaptypes/index.tsx | 4 ++-- .../ToolBoxPanel/components/donormapviews/index.tsx | 4 ++-- .../ToolBoxPanel/components/eligibilityadvanced/index.tsx | 4 ++-- .../ToolBoxPanel/components/eligibilityyear/index.tsx | 2 +- .../components/filters/common/expandedgroup/index.tsx | 6 +++--- .../components/ToolBoxPanel/components/filters/data.ts | 2 +- .../components/ToolBoxPanel/components/filters/index.tsx | 2 +- .../ToolBoxPanel/components/grantperiods/index.tsx | 2 +- .../ToolBoxPanel/components/iconbuttons/index.tsx | 2 +- .../ToolBoxPanel/components/pf-reportingperiods/index.tsx | 6 +++--- .../ToolBoxPanel/components/resultsyear/index.tsx | 2 +- .../ToolBoxPanel/components/subtoolboxpanel/index.tsx | 6 +++--- src/app/components/ToolBoxPanel/index.tsx | 4 ++-- src/app/modules/documents-module/index.tsx | 2 +- src/app/modules/grants-module/components/List/index.tsx | 6 +++--- src/app/modules/results-module/components/List/index.tsx | 4 ++-- src/app/modules/results-module/datalist.tsx | 4 ++-- src/app/modules/results-module/index.tsx | 2 +- .../viz-module/sub-modules/allocations/geomap/index.tsx | 2 +- .../modules/viz-module/sub-modules/allocations/index.tsx | 2 +- .../viz-module/sub-modules/allocations/table/index.tsx | 2 +- .../modules/viz-module/sub-modules/budgets/flow/index.tsx | 4 ++-- .../viz-module/sub-modules/budgets/geomap/index.tsx | 2 +- .../modules/viz-module/sub-modules/eligibility/index.tsx | 2 +- .../eligibility/table/data-wrappers/generic.tsx | 2 +- .../viz-module/sub-modules/eligibility/table/index.tsx | 4 ++-- .../sub-modules/investments/disbursed/index.tsx | 4 ++-- .../viz-module/sub-modules/investments/geomap/index.tsx | 2 +- .../viz-module/sub-modules/investments/table/index.tsx | 4 ++-- .../sub-modules/investments/time-cycle/index.tsx | 8 +++----- .../sub-modules/pledgescontributions/geomap/index.tsx | 2 +- .../sub-modules/pledgescontributions/table/index.tsx | 2 +- .../sub-modules/pledgescontributions/time-cycle/index.tsx | 2 +- .../sub-modules/pledgescontributions/treemap/index.tsx | 4 ++-- 38 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/app/components/Charts/common/dialogBox/index.tsx b/src/app/components/Charts/common/dialogBox/index.tsx index d8b250920..05acc9754 100644 --- a/src/app/components/Charts/common/dialogBox/index.tsx +++ b/src/app/components/Charts/common/dialogBox/index.tsx @@ -1,11 +1,11 @@ import React from "react"; +import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreActions } from "app/state/store/hooks"; import { overlaycss, modalContainercss, } from "app/components/Charts/common/dialogBox/style"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; interface Props { display: { diff --git a/src/app/components/Table/Expandable/Toolbar.tsx b/src/app/components/Table/Expandable/Toolbar.tsx index 2a9fd2ba1..d80766361 100644 --- a/src/app/components/Table/Expandable/Toolbar.tsx +++ b/src/app/components/Table/Expandable/Toolbar.tsx @@ -6,6 +6,7 @@ import { exportCSV } from "app/utils/exportCSV"; import Toolbar from "@material-ui/core/Toolbar"; import Popover from "@material-ui/core/Popover"; import CloseIcon from "@material-ui/icons/Close"; +import { useCMSData } from "app/hooks/useCMSData"; import SearchIcon from "@material-ui/icons/Search"; import IconButton from "@material-ui/core/IconButton"; import { useStoreState } from "app/state/store/hooks"; @@ -16,7 +17,6 @@ import ViewColumnIcon from "@material-ui/icons/ViewColumnOutlined"; import { CommonPropTypes } from "react-csv/components/CommonPropTypes"; import { TableToolbarCols } from "app/components/Table/Expandable/data"; import { Checkbox, FormControlLabel, FormGroup } from "@material-ui/core"; -import { useCMSData } from "app/hooks/useCMSData"; interface TableToolbarProps { title: string; diff --git a/src/app/components/Table/Expandable/index.tsx b/src/app/components/Table/Expandable/index.tsx index 26920e39f..1a0e5f08f 100644 --- a/src/app/components/Table/Expandable/index.tsx +++ b/src/app/components/Table/Expandable/index.tsx @@ -1,8 +1,10 @@ import React from "react"; +import get from "lodash/get"; import filter from "lodash/filter"; import { appColors } from "app/theme"; import findIndex from "lodash/findIndex"; import Table from "@material-ui/core/Table"; +import { useCMSData } from "app/hooks/useCMSData"; import Collapse from "@material-ui/core/Collapse"; import TableRow from "@material-ui/core/TableRow"; import TableHead from "@material-ui/core/TableHead"; @@ -21,8 +23,6 @@ import { ExpandableTableRowDocProps, ExpandableTableRowProps, } from "app/components/Table/Expandable/data"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; const useRowStyles = makeStyles({ root: { diff --git a/src/app/components/ToolBoxPanel/components/allocationsperiods/index.tsx b/src/app/components/ToolBoxPanel/components/allocationsperiods/index.tsx index 381b82191..10d9ccb6d 100644 --- a/src/app/components/ToolBoxPanel/components/allocationsperiods/index.tsx +++ b/src/app/components/ToolBoxPanel/components/allocationsperiods/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; export function AllocationsPeriods() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx b/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx index d8443dbba..2594268d6 100644 --- a/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx +++ b/src/app/components/ToolBoxPanel/components/donormaptypes/index.tsx @@ -1,8 +1,8 @@ import React from "react"; +import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export function ToolBoxPanelDonorMapTypes() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/donormapviews/index.tsx b/src/app/components/ToolBoxPanel/components/donormapviews/index.tsx index 8693d4f01..6ac229c52 100644 --- a/src/app/components/ToolBoxPanel/components/donormapviews/index.tsx +++ b/src/app/components/ToolBoxPanel/components/donormapviews/index.tsx @@ -1,8 +1,8 @@ import React from "react"; +import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export function ToolBoxPanelDonorViews() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/eligibilityadvanced/index.tsx b/src/app/components/ToolBoxPanel/components/eligibilityadvanced/index.tsx index 25700bb48..931fd4846 100644 --- a/src/app/components/ToolBoxPanel/components/eligibilityadvanced/index.tsx +++ b/src/app/components/ToolBoxPanel/components/eligibilityadvanced/index.tsx @@ -1,10 +1,10 @@ import React from "react"; +import get from "lodash/get"; import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; import Checkbox from "@material-ui/core/Checkbox"; import FormControlLabel from "@material-ui/core/FormControlLabel"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export function ToolBoxPanelEligibilityAdvanced() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx b/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx index 35bb46fc0..dc7608bfd 100644 --- a/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx +++ b/src/app/components/ToolBoxPanel/components/eligibilityyear/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; export function EligibilityYear() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx b/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx index 91d557a1f..9ce58f4ed 100644 --- a/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx +++ b/src/app/components/ToolBoxPanel/components/filters/common/expandedgroup/index.tsx @@ -1,11 +1,14 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */ import React from "react"; +import get from "lodash/get"; import find from "lodash/find"; import remove from "lodash/remove"; import isEqual from "lodash/isEqual"; +import { appColors } from "app/theme"; import { useRecoilState } from "recoil"; import findIndex from "lodash/findIndex"; +import { useCMSData } from "app/hooks/useCMSData"; import Checkbox from "@material-ui/core/Checkbox"; import { ResetIcon } from "app/assets/icons/Reset"; import { SearchIcon } from "app/assets/icons/Search"; @@ -20,9 +23,6 @@ import { FilterGroupProps, FilterOptionProps, } from "app/components/ToolBoxPanel/components/filters/data"; -import { appColors } from "app/theme"; -import { get } from "lodash"; -import { useCMSData } from "app/hooks/useCMSData"; interface ExpandedFilterGroupProps extends FilterGroupModel, FilterGroupProps { goBack: () => void; diff --git a/src/app/components/ToolBoxPanel/components/filters/data.ts b/src/app/components/ToolBoxPanel/components/filters/data.ts index dd1942ecb..c7356fb22 100644 --- a/src/app/components/ToolBoxPanel/components/filters/data.ts +++ b/src/app/components/ToolBoxPanel/components/filters/data.ts @@ -1,4 +1,4 @@ -import { filter } from "lodash"; +import filter from "lodash/filter"; export interface FilterGroupOptionModel { label: string; diff --git a/src/app/components/ToolBoxPanel/components/filters/index.tsx b/src/app/components/ToolBoxPanel/components/filters/index.tsx index 36e7d27dc..1fe38e71e 100644 --- a/src/app/components/ToolBoxPanel/components/filters/index.tsx +++ b/src/app/components/ToolBoxPanel/components/filters/index.tsx @@ -4,6 +4,7 @@ import isEqual from "lodash/isEqual"; import { appColors } from "app/theme"; import { useRecoilState } from "recoil"; import Button from "@material-ui/core/Button"; +import { useCMSData } from "app/hooks/useCMSData"; import { ResetIcon } from "app/assets/icons/Reset"; import { filterExpandedGroup } from "app/state/recoil/atoms"; import { useFilterOptions } from "app/hooks/useFilterOptions"; @@ -12,7 +13,6 @@ import { defaultAppliedFilters } from "app/state/api/action-reducers/sync/filter import { FilterGroupProps } from "app/components/ToolBoxPanel/components/filters/data"; import { FilterGroup } from "app/components/ToolBoxPanel/components/filters/common/group"; import { ExpandedFilterGroup } from "app/components/ToolBoxPanel/components/filters/common/expandedgroup"; -import { useCMSData } from "app/hooks/useCMSData"; interface ToolBoxPanelFiltersProps { groups: FilterGroupProps[]; diff --git a/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx b/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx index 5e648de2f..9f33a9e6a 100644 --- a/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx +++ b/src/app/components/ToolBoxPanel/components/grantperiods/index.tsx @@ -1,10 +1,10 @@ import React from "react"; import get from "lodash/get"; import find from "lodash/find"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState } from "app/state/store/hooks"; import { useParams, useHistory } from "react-router-dom"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; interface GrantDetailPeriod { number: number; diff --git a/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx b/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx index fde90ddde..55a2d71b0 100644 --- a/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx +++ b/src/app/components/ToolBoxPanel/components/iconbuttons/index.tsx @@ -4,6 +4,7 @@ import get from "lodash/get"; import { CSVLink } from "react-csv"; import { appColors } from "app/theme"; import Snackbar from "@material-ui/core/Snackbar"; +import { useCMSData } from "app/hooks/useCMSData"; import MenuItem from "@material-ui/core/MenuItem"; import { useStoreState } from "app/state/store/hooks"; import IconButton from "@material-ui/core/IconButton"; @@ -17,7 +18,6 @@ import { exportView } from "app/utils/exportView"; import { CopyToClipboard } from "react-copy-to-clipboard"; import { useGetAllVizData } from "app/hooks/useGetAllVizData"; import { CloudDownloadIcon } from "app/assets/icons/CloudDownload"; -import { useCMSData } from "app/hooks/useCMSData"; const locationsToNotShowImageExport = [ "/viz/disbursements/map", diff --git a/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx b/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx index 0b2286a62..cc68a32bc 100644 --- a/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx +++ b/src/app/components/ToolBoxPanel/components/pf-reportingperiods/index.tsx @@ -1,12 +1,12 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */ import React from "react"; +import get from "lodash/get"; +import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; import useMeasure from "react-use/lib/useMeasure"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; import Draggable, { DraggableEvent, DraggableData } from "react-draggable"; -import { appColors } from "app/theme"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export interface PerformanceFrameworkReportingPeriodsProps { periods: string[][]; diff --git a/src/app/components/ToolBoxPanel/components/resultsyear/index.tsx b/src/app/components/ToolBoxPanel/components/resultsyear/index.tsx index 44abca9d4..c676d4077 100644 --- a/src/app/components/ToolBoxPanel/components/resultsyear/index.tsx +++ b/src/app/components/ToolBoxPanel/components/resultsyear/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import get from "lodash/get"; +import { useCMSData } from "app/hooks/useCMSData"; import { useStoreState, useStoreActions } from "app/state/store/hooks"; import { ToolBoxPanelAggregateBy } from "app/components/ToolBoxPanel/components/aggregateby"; -import { useCMSData } from "app/hooks/useCMSData"; export function ResultsYear() { const cmsData = useCMSData({ returnData: true }); diff --git a/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx b/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx index 0c4231ca9..eec3c1ff7 100644 --- a/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx +++ b/src/app/components/ToolBoxPanel/components/subtoolboxpanel/index.tsx @@ -1,9 +1,12 @@ import React from "react"; import get from "lodash/get"; import find from "lodash/find"; +import { useRecoilState } from "recoil"; import { useUpdateEffect } from "react-use"; import { useMediaQuery } from "@material-ui/core"; +import { useCMSData } from "app/hooks/useCMSData"; import { useParams, useHistory } from "react-router-dom"; +import { filterExpandedGroup } from "app/state/recoil/atoms"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; import { ResultsYear } from "app/components/ToolBoxPanel/components/resultsyear"; import { ToolBoxPanelFilters } from "app/components/ToolBoxPanel/components/filters"; @@ -24,9 +27,6 @@ import { ViewModel, getControlItems, } from "app/components/ToolBoxPanel/utils/getControlItems"; -import { useRecoilState } from "recoil"; -import { filterExpandedGroup } from "app/state/recoil/atoms"; -import { useCMSData } from "app/hooks/useCMSData"; interface SubToolBoxPanelProps { filterGroups: FilterGroupProps[]; diff --git a/src/app/components/ToolBoxPanel/index.tsx b/src/app/components/ToolBoxPanel/index.tsx index cc2d5af71..dab4dbc0d 100644 --- a/src/app/components/ToolBoxPanel/index.tsx +++ b/src/app/components/ToolBoxPanel/index.tsx @@ -1,10 +1,12 @@ /* eslint-disable no-nested-ternary */ /* eslint-disable jsx-a11y/click-events-have-key-events */ import React from "react"; +import get from "lodash/get"; import { appColors } from "app/theme"; import Fab from "@material-ui/core/Fab"; import { useRecoilState } from "recoil"; import { useHistory } from "react-router-dom"; +import { useCMSData } from "app/hooks/useCMSData"; import { FiltersIcon } from "app/assets/icons/Filters"; import { useUnmount, useUpdateEffect } from "react-use"; import { isTouchDevice } from "app/utils/isTouchDevice"; @@ -15,8 +17,6 @@ import { useMediaQuery, IconButton, Slide } from "@material-ui/core"; import { FilterGroupProps } from "app/components/ToolBoxPanel/components/filters/data"; import { SubToolBoxPanel } from "app/components/ToolBoxPanel/components/subtoolboxpanel"; import { ToolBoxPanelIconButtons } from "app/components/ToolBoxPanel/components/iconbuttons"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export interface ToolBoxPanelProps { open: boolean; diff --git a/src/app/modules/documents-module/index.tsx b/src/app/modules/documents-module/index.tsx index 7f263f72c..6279b2944 100644 --- a/src/app/modules/documents-module/index.tsx +++ b/src/app/modules/documents-module/index.tsx @@ -7,6 +7,7 @@ import { useTitle, useDebounce, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; import { PageHeader } from "app/components/PageHeader"; import { ToolBoxPanel } from "app/components/ToolBoxPanel"; import { PageLoader } from "app/modules/common/page-loader"; @@ -16,7 +17,6 @@ import { PageTopSpacer } from "app/modules/common/page-top-spacer"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { ExpandableTableRowProps } from "app/components/Table/Expandable/data"; import { pathnameToFilterGroups } from "app/components/ToolBoxPanel/components/filters/data"; -import { useCMSData } from "app/hooks/useCMSData"; export default function DocumentsModule() { useTitle("The Data Explorer - Documents"); diff --git a/src/app/modules/grants-module/components/List/index.tsx b/src/app/modules/grants-module/components/List/index.tsx index e5fe52b94..adf8841aa 100644 --- a/src/app/modules/grants-module/components/List/index.tsx +++ b/src/app/modules/grants-module/components/List/index.tsx @@ -1,7 +1,10 @@ import React from "react"; +import get from "lodash/get"; +import { appColors } from "app/theme"; import { Link } from "react-router-dom"; import Grid from "@material-ui/core/Grid"; import { useMediaQuery } from "@material-ui/core"; +import { useCMSData } from "app/hooks/useCMSData"; import { RatingIcon } from "app/assets/icons/Rating"; import { LocationIcon } from "app/assets/icons/Location"; import { ComponentIcon } from "app/assets/icons/Component"; @@ -14,9 +17,6 @@ import { GrantsListProps, GrantListItemModel, } from "app/modules/grants-module/data"; -import { appColors } from "app/theme"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export function GrantsList(props: GrantsListProps) { const isMobile = useMediaQuery("(max-width: 767px)"); diff --git a/src/app/modules/results-module/components/List/index.tsx b/src/app/modules/results-module/components/List/index.tsx index ae43dc05e..7d29f690a 100644 --- a/src/app/modules/results-module/components/List/index.tsx +++ b/src/app/modules/results-module/components/List/index.tsx @@ -1,8 +1,10 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */ import React from "react"; +import get from "lodash/get"; import Grid from "@material-ui/core/Grid"; import { useHistory } from "react-router-dom"; +import { useCMSData } from "app/hooks/useCMSData"; import { useMediaQuery } from "@material-ui/core"; import { ComponentIcon } from "app/assets/icons/Component"; import { TriangleXSIcon } from "app/assets/icons/TriangleXS"; @@ -16,8 +18,6 @@ import { ResultsListProps, ResultListItemModel, } from "app/modules/results-module/data"; -import { get } from "lodash"; -import { useCMSData } from "app/hooks/useCMSData"; export function ResultsList(props: ResultsListProps) { return ( diff --git a/src/app/modules/results-module/datalist.tsx b/src/app/modules/results-module/datalist.tsx index 82587fa0e..dd5adc5da 100644 --- a/src/app/modules/results-module/datalist.tsx +++ b/src/app/modules/results-module/datalist.tsx @@ -1,12 +1,12 @@ import React from "react"; +import get from "lodash/get"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { Search } from "app/modules/grants-module/components/Search"; import { ResultListItemModel } from "app/modules/results-module/data"; import { NoDataLabel } from "app/components/Charts/common/nodatalabel"; import { ResultsList } from "app/modules/results-module/components/List"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; export const DataList = (props: { isLoading: boolean; diff --git a/src/app/modules/results-module/index.tsx b/src/app/modules/results-module/index.tsx index cf007e90d..80e0ac990 100644 --- a/src/app/modules/results-module/index.tsx +++ b/src/app/modules/results-module/index.tsx @@ -9,6 +9,7 @@ import useMediaQuery from "@material-ui/core/useMediaQuery"; import { useTitle, useDebounce, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageHeader } from "app/components/PageHeader"; import { ToolBoxPanel } from "app/components/ToolBoxPanel"; import { DataList } from "app/modules/results-module/datalist"; @@ -17,7 +18,6 @@ import { PageTopSpacer } from "app/modules/common/page-top-spacer"; import { ResultListItemModel } from "app/modules/results-module/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { pathnameToFilterGroups } from "app/components/ToolBoxPanel/components/filters/data"; -import { useCMSData } from "app/hooks/useCMSData"; export default function ResultsModule() { useTitle("The Data Explorer - Results"); diff --git a/src/app/modules/viz-module/sub-modules/allocations/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/allocations/geomap/index.tsx index e004a53c6..fcc5d15f3 100644 --- a/src/app/modules/viz-module/sub-modules/allocations/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/allocations/geomap/index.tsx @@ -6,12 +6,12 @@ import { FeatureCollection } from "geojson"; import useTitle from "react-use/lib/useTitle"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { GeoMap } from "app/components/Charts/GeoMap"; import { PageLoader } from "app/modules/common/page-loader"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { AllocationsGeoMapPinMarker } from "app/components/Charts/GeoMap/data"; -import { useCMSData } from "app/hooks/useCMSData"; interface Props { code?: string; diff --git a/src/app/modules/viz-module/sub-modules/allocations/index.tsx b/src/app/modules/viz-module/sub-modules/allocations/index.tsx index 8e4d4ff90..31a95090c 100644 --- a/src/app/modules/viz-module/sub-modules/allocations/index.tsx +++ b/src/app/modules/viz-module/sub-modules/allocations/index.tsx @@ -12,6 +12,7 @@ import ReactApexCharts from "react-apexcharts"; import { useTitle, useMeasure } from "react-use"; import useMediaQuery from "@material-ui/core/useMediaQuery"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { isTouchDevice } from "app/utils/isTouchDevice"; import { getIso3FromName } from "app/utils/getIso3FromName"; import { PageLoader } from "app/modules/common/page-loader"; @@ -30,7 +31,6 @@ import { getKeysPercentages, AllocationsTreemapDataItem, } from "app/modules/viz-module/sub-modules/allocations/data"; -import { useCMSData } from "app/hooks/useCMSData"; interface AllocationsModuleProps { code?: string; diff --git a/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx b/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx index 82a438d1e..913da6dce 100644 --- a/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/allocations/table/index.tsx @@ -2,6 +2,7 @@ import React from "react"; import get from "lodash/get"; import filter from "lodash/filter"; import useTitle from "react-use/lib/useTitle"; +import { useCMSData } from "app/hooks/useCMSData"; import useDebounce from "react-use/lib/useDebounce"; import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; @@ -9,7 +10,6 @@ import useUpdateEffect from "react-use/lib/useUpdateEffect"; import { SimpleTableRow } from "app/components/Table/Simple/data"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; -import { useCMSData } from "app/hooks/useCMSData"; interface AllocationsTableProps { code?: string; diff --git a/src/app/modules/viz-module/sub-modules/budgets/flow/index.tsx b/src/app/modules/viz-module/sub-modules/budgets/flow/index.tsx index 7e7700f11..ae9111dd2 100644 --- a/src/app/modules/viz-module/sub-modules/budgets/flow/index.tsx +++ b/src/app/modules/viz-module/sub-modules/budgets/flow/index.tsx @@ -1,5 +1,6 @@ /* third-party */ import React from "react"; +import get from "lodash/get"; import find from "lodash/find"; import sumBy from "lodash/sumBy"; import filter from "lodash/filter"; @@ -10,6 +11,7 @@ import { TreeMapNodeDatum } from "@nivo/treemap"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { getNameFromIso3 } from "app/utils/getIso3FromName"; import { BudgetsFlow } from "app/components/Charts/Budgets/Flow"; @@ -17,8 +19,6 @@ import ReRouteDialogBox from "app/components/Charts/common/dialogBox"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { BudgetsTreemap } from "app/components/Charts/Budgets/Treemap"; import { BudgetsTreemapDataItem } from "app/components/Charts/Budgets/Treemap/data"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; interface BudgetsFlowModuleProps { nodes: { diff --git a/src/app/modules/viz-module/sub-modules/budgets/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/budgets/geomap/index.tsx index 3c1f9c968..498363187 100644 --- a/src/app/modules/viz-module/sub-modules/budgets/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/budgets/geomap/index.tsx @@ -10,12 +10,12 @@ import { useHistory } from "react-router-dom"; import useMediaQuery from "@material-ui/core/useMediaQuery"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { GeoMap } from "app/components/Charts/GeoMap"; import { PageLoader } from "app/modules/common/page-loader"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { AllocationsGeoMapPinMarker } from "app/components/Charts/GeoMap/data"; -import { useCMSData } from "app/hooks/useCMSData"; interface Props { code?: string; diff --git a/src/app/modules/viz-module/sub-modules/eligibility/index.tsx b/src/app/modules/viz-module/sub-modules/eligibility/index.tsx index 6f14764a4..05eed75d7 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/index.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/index.tsx @@ -7,11 +7,11 @@ import { useHistory } from "react-router-dom"; import useTitle from "react-use/lib/useTitle"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { DotChart } from "app/components/Charts/Eligibility/DotChart"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { DotChartModel } from "app/components/Charts/Eligibility/DotChart/data"; -import { useCMSData } from "app/hooks/useCMSData"; export function EligibilityModule() { useTitle("The Data Explorer - Eligibility"); diff --git a/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx b/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx index 6a5a85c6b..1e1cc5b66 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/table/data-wrappers/generic.tsx @@ -9,12 +9,12 @@ import TablePagination from "@material-ui/core/TablePagination"; import { useDebounce, useTitle, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow } from "app/components/Table/Simple/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { DotChartModel } from "app/components/Charts/Eligibility/DotChart/data"; import { EligibilityTable } from "app/modules/viz-module/sub-modules/eligibility/table"; -import { useCMSData } from "app/hooks/useCMSData"; function getTableData(data: DotChartModel[]): SimpleTableRow[] { const updatedTableData: SimpleTableRow[] = []; diff --git a/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx b/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx index 333d99dab..bcbf3cb05 100644 --- a/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/eligibility/table/index.tsx @@ -1,14 +1,14 @@ /* third-party */ import React from "react"; +import get from "lodash/get"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow, SimpleTableColumn, } from "app/components/Table/Simple/data"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; interface EligibilityTableProps { search: string; diff --git a/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx b/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx index 882db09f1..55ca7afcd 100644 --- a/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/disbursed/index.tsx @@ -1,5 +1,6 @@ /* third-party */ import React from "react"; +import get from "lodash/get"; import find from "lodash/find"; import maxBy from "lodash/maxBy"; import sumBy from "lodash/sumBy"; @@ -12,14 +13,13 @@ import { useHistory } from "react-router-dom"; import useMediaQuery from "@material-ui/core/useMediaQuery"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { getNameFromIso3 } from "app/utils/getIso3FromName"; import ReRouteDialogBox from "app/components/Charts/common/dialogBox"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { DisbursementsTreemap } from "app/components/Charts/Investments/Disbursements"; import { DisbursementsTreemapDataItem } from "app/components/Charts/Investments/Disbursements/data"; -import { get } from "lodash"; -import { useCMSData } from "app/hooks/useCMSData"; interface InvestmentsDisbursedModuleProps { data: DisbursementsTreemapDataItem[]; diff --git a/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx index dcc0e3506..b8c5de5e2 100644 --- a/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/geomap/index.tsx @@ -9,12 +9,12 @@ import useTitle from "react-use/lib/useTitle"; import { useHistory } from "react-router-dom"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { GeoMap } from "app/components/Charts/GeoMap"; import { PageLoader } from "app/modules/common/page-loader"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { InvestmentsGeoMapPinMarker } from "app/components/Charts/GeoMap/data"; -import { useCMSData } from "app/hooks/useCMSData"; interface Props { code?: string; diff --git a/src/app/modules/viz-module/sub-modules/investments/table/index.tsx b/src/app/modules/viz-module/sub-modules/investments/table/index.tsx index cdc97f727..b65ae9edc 100644 --- a/src/app/modules/viz-module/sub-modules/investments/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/table/index.tsx @@ -1,11 +1,11 @@ /* third-party */ import React from "react"; +import get from "lodash/get"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow } from "app/components/Table/Simple/data"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; interface InvestmentsTableProps { search: string; diff --git a/src/app/modules/viz-module/sub-modules/investments/time-cycle/index.tsx b/src/app/modules/viz-module/sub-modules/investments/time-cycle/index.tsx index 234f02a4b..63e25149c 100644 --- a/src/app/modules/viz-module/sub-modules/investments/time-cycle/index.tsx +++ b/src/app/modules/viz-module/sub-modules/investments/time-cycle/index.tsx @@ -1,21 +1,19 @@ /* third-party */ import React from "react"; +import get from "lodash/get"; import find from "lodash/find"; import uniqueId from "lodash/uniqueId"; import { useHistory } from "react-router-dom"; import { TreeMapNodeDatum } from "@nivo/treemap"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; +import ReRouteDialogBox from "app/components/Charts/common/dialogBox"; import { BudgetsTreemap } from "app/components/Charts/Budgets/Treemap"; import { getIso3FromName, getNameFromIso3 } from "app/utils/getIso3FromName"; import { InvestmentsTimeCycle } from "app/components/Charts/Investments/TimeCycle"; import { BudgetsTreemapDataItem } from "app/components/Charts/Budgets/Treemap/data"; -import { DisbursementsTreemap } from "app/components/Charts/Investments/Disbursements"; -import { DisbursementsTreemapDataItem } from "app/components/Charts/Investments/Disbursements/data"; -import ReRouteDialogBox from "app/components/Charts/common/dialogBox"; -import { useCMSData } from "app/hooks/useCMSData"; -import { get } from "lodash"; interface InvestmentsTimeCycleModuleProps { data: Record[]; diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx index 464efeaef..c84789f0b 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/geomap/index.tsx @@ -10,12 +10,12 @@ import { useHistory } from "react-router-dom"; import useTitle from "react-use/lib/useTitle"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { GeoMap } from "app/components/Charts/GeoMap"; import { PageLoader } from "app/modules/common/page-loader"; import { GeoMapPinMarker } from "app/components/Charts/GeoMap/data"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; -import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsGeoMap() { useTitle("The Data Explorer - Pledges & Contributions GeoMap"); diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx index 71fb34c52..9301daadb 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/table/index.tsx @@ -9,11 +9,11 @@ import TablePagination from "@material-ui/core/TablePagination"; import { useDebounce, useTitle, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { SimpleTable } from "app/components/Table/Simple"; import { PageLoader } from "app/modules/common/page-loader"; import { SimpleTableRow } from "app/components/Table/Simple/data"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; -import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsTable() { useTitle("The Data Explorer - Pledges & Contributions Table"); diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/time-cycle/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/time-cycle/index.tsx index bf511ad8c..c8fcabda0 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/time-cycle/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/time-cycle/index.tsx @@ -7,6 +7,7 @@ import { useHistory } from "react-router-dom"; import { useTitle, useUnmount, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { useCMSData } from "app/hooks/useCMSData"; import { Dropdown } from "app/components/Dropdown"; import { PageLoader } from "app/modules/common/page-loader"; import { BudgetsTreemap } from "app/components/Charts/Budgets/Treemap"; @@ -14,7 +15,6 @@ import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { DrillDownArrowSelector } from "app/components/DrilldownArrowSelector"; import { PledgesContributionsTimeCycle } from "app/components/Charts/PledgesContributions/TimeCycle"; import { PledgesContributionsTreemapDataItem } from "app/components/Charts/PledgesContributions/TimeCycle/data"; -import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsTimeCycleModule() { useTitle("The Data Explorer - Pledges & Contributions/Time cycle"); diff --git a/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx b/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx index 521202307..0228c01d3 100644 --- a/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx +++ b/src/app/modules/viz-module/sub-modules/pledgescontributions/treemap/index.tsx @@ -12,13 +12,13 @@ import { TreeMapNodeDatum } from "@nivo/treemap"; import { useTitle, useUpdateEffect } from "react-use"; import { useStoreActions, useStoreState } from "app/state/store/hooks"; /* project */ +import { appColors } from "app/theme"; +import { useCMSData } from "app/hooks/useCMSData"; import { PageLoader } from "app/modules/common/page-loader"; import { formatFinancialValue } from "app/utils/formatFinancialValue"; import { BudgetsTreemap } from "app/components/Charts/Budgets/Treemap"; import { getAPIFormattedFilters } from "app/utils/getAPIFormattedFilters"; import { BudgetsTreemapDataItem } from "app/components/Charts/Budgets/Treemap/data"; -import { appColors } from "app/theme"; -import { useCMSData } from "app/hooks/useCMSData"; export function PledgesContributionsTreemap() { useTitle("The Data Explorer - Pledges & Contributions/Treemap"); From 44277844ce3d52e6b25608174859bcc6b6ef90a3 Mon Sep 17 00:00:00 2001 From: Stefanos Hadjipetrou Date: Fri, 19 May 2023 13:09:11 +0300 Subject: [PATCH 3/4] chore: add runner debug var to github action --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cfe1175ef..e36518f9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,3 +39,4 @@ jobs: "@semantic-release/github" env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + RUNNER_DEBUG: 1 From a832015b2b4d58cf89243e5a7b050687410bddba Mon Sep 17 00:00:00 2001 From: Stefanos Hadjipetrou Date: Fri, 19 May 2023 13:15:54 +0300 Subject: [PATCH 4/4] chore: add version to release notes generator --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e36518f9c..32a387a61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: ] extra_plugins: | "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" + "@semantic-release/release-notes-generator@10.0.3" "@semantic-release/github" env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}