@kando-env/kando-ui 1.0.11 → 1.0.14-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CovidView/views/components/Body.js +3 -3
- package/lib/CovidView/views/components/Map.js +4 -4
- package/lib/CovidView/views/components/MapStyle.scss +4 -0
- package/lib/CovidView/views/components/Sidebar.js +2 -2
- package/lib/CovidView/views/components/Summary.js +3 -3
- package/lib/CovidView/views/components/TrendGraphNVL/TrendGraphNVL.js +4 -4
- package/lib/CovidView/views/components/TrendGraphNVL/index.js +1 -1
- package/lib/CovidView/views/components/TrendPopupContent/TrendPopupContent.js +6 -10
- package/lib/CovidView/views/components/TrendPopupContent/index.js +1 -1
- package/lib/CovidView/views/components/areas/Area.js +3 -3
- package/lib/CovidView/views/components/areas/AreaPolygonWBE.js +2 -2
- package/lib/CovidView/views/components/areas/AreaPolygonsWBE.js +2 -2
- package/lib/CovidView/views/components/areas/AreasList.js +3 -3
- package/lib/CovidView/views/components/areas/Sort.js +3 -3
- package/lib/CovidView/views/covidView.js +2 -2
- package/lib/DashboardV2/AreaDashboard.js +4 -4
- package/lib/DashboardV2/Header/DoubleTabs/DoubleTabs.js +95 -0
- package/lib/DashboardV2/Header/DoubleTabs/DoubleTabs.stories.js +30 -0
- package/lib/DashboardV2/Header/DoubleTabs/styles.js +31 -0
- package/lib/DashboardV2/Header/Header.js +20 -0
- package/lib/DashboardV2/Header/Header.stories.js +28 -0
- package/lib/DashboardV2/Header/InfoBar/Breadcrumbs/Breadcrumbs.js +50 -0
- package/lib/DashboardV2/Header/InfoBar/Breadcrumbs/right-arrow-bold.svg +44 -0
- package/lib/DashboardV2/Header/InfoBar/Breadcrumbs/right-arrow-light.svg +44 -0
- package/lib/DashboardV2/Header/InfoBar/InfoBar.js +63 -0
- package/lib/DashboardV2/Header/Toolbar/Toolbar.js +114 -0
- package/lib/DashboardV2/Header/Toolbar/arrow.svg +44 -0
- package/lib/DashboardV2/Header/Toolbar/user.svg +3 -0
- package/lib/DashboardV2/SamplingParameters/NoResults/NoResults.js +18 -10
- package/lib/DashboardV2/SamplingParameters/NoResults/NoResults.stories.js +1 -1
- package/lib/DashboardV2/SamplingParameters/ParametersContainer/ParametersButtons/ParameterButton/ParameterButton.js +1 -1
- package/lib/DashboardV2/SamplingParameters/ParametersContainer/ParametersButtons/ParametersButtons.js +3 -7
- package/lib/DashboardV2/SamplingParameters/ParametersContainer/ParametersButtons/styles.js +1 -1
- package/lib/DashboardV2/SamplingParameters/ParametersContainer/ParametersContainer.js +3 -3
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/ExceptionBar/ExceptionBar.js +3 -7
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/ExceptionBar/ExceptionBar.stories.js +1 -1
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/ExceptionBar/styles.js +1 -1
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/ExpandableSamplingTable/ExpandableSamplingTable.js +14 -14
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/ExpandableSamplingTable/ExpandableSamplingTable.scss +20 -19
- package/lib/DashboardV2/SamplingParameters/SamplingContainer/SamplingContainer.js +1 -1
- package/lib/DashboardV2/SamplingParameters/SamplingParameters.js +7 -8
- package/lib/DashboardV2/SamplingParameters/SamplingParameters.stories.js +2 -3
- package/lib/DashboardV2/SamplingParameters/charts/ParametersChart.js +2 -2
- package/lib/DashboardV2/SamplingParameters/charts/SamplingChart.js +2 -2
- package/lib/DashboardV2/SamplingParameters/dataParser.js +2 -2
- package/lib/DashboardV2/SamplingParameters/styles/samplingParameters.js +13 -8
- package/lib/DashboardV2/SamplingParameters/styles/styles.js +5 -6
- package/lib/DashboardV2/SiteDashboard.js +14 -13
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/AreaBox.js +21 -19
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/Map/Map.js +2 -2
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/Map/Map.scss +9 -2
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/PieChart/PieChart.js +3 -3
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/styles.js +2 -2
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/Areas.js +18 -23
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/areas.mock.js +234 -0
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/Factories.js +21 -25
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/FactoryBox/FactoryBox.js +16 -44
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/FactoryBox/PieChart/PieChart.js +2 -2
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/FactoryBox/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/factories.mock.js +4296 -0
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/factoriesResponse.interface.js +5 -0
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Factories/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/MostPolluting.js +19 -18
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/MostPolluting.stories.js +75 -107
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/ShowMore/ShowMore.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/ShowMore/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Tabs/Tabs.js +22 -30
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Tabs/Tabs.stories.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Tabs/assets/index.js +5 -5
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/assets/index.js +6 -6
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/models.js +0 -1
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/MostSevereEvents.js +47 -24
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/MostSevereEvents.scss +12 -7
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/MostSevereEvents.stories.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/NoEvents/NoEvents.js +17 -9
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/NoEvents/NoEvents.stories.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/SevereEvent/SevereEvent.js +24 -39
- package/lib/DashboardV2/UtilityDashboard/MostSevereEvents/SevereEvent/SevereEvent.scss +54 -23
- package/lib/DashboardV2/UtilityDashboard/TopBar/MostCommon/Back/Back.js +5 -6
- package/lib/DashboardV2/UtilityDashboard/TopBar/MostCommon/MostCommon.js +7 -7
- package/lib/DashboardV2/UtilityDashboard/TopBar/MostCommon/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/PieChart/PieChart.js +7 -10
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/PollutedLine/PollutedLine.js +2 -2
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/QualitySummary.js +33 -21
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/qualitySummary.mock.js +29 -0
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/qualitySummaryResponse.interface.js +5 -0
- package/lib/DashboardV2/UtilityDashboard/TopBar/QualitySummary/styles.js +2 -2
- package/lib/DashboardV2/UtilityDashboard/TopBar/TopBar.js +2 -22
- package/lib/DashboardV2/UtilityDashboard/TopBar/UtilityInformation/UtilityInformation.js +52 -16
- package/lib/DashboardV2/UtilityDashboard/TopBar/UtilityInformation/UtilityInformationResponse.interface.js +5 -0
- package/lib/DashboardV2/UtilityDashboard/TopBar/UtilityInformation/styles.js +3 -3
- package/lib/DashboardV2/UtilityDashboard/TopBar/UtilityInformation/utilityInformation.mock.js +14 -0
- package/lib/DashboardV2/UtilityDashboard/TopBar/styles.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/UtilityDashboard.js +1 -1
- package/lib/DashboardV2/UtilityDashboard/UtilityDashboard.stories.js +63 -121
- package/lib/DashboardV2/UtilityDashboard/initMsw.js +16 -0
- package/lib/DashboardV2/WaterAuthorityDashboard.js +13 -5
- package/lib/DashboardV2/index.js +1 -1
- package/lib/DashboardV2/useApiWithDashboardQuery.js +57 -0
- package/lib/EventsView/views/components/Body.js +48 -26
- package/lib/EventsView/views/components/areas/AreaPolygon.js +2 -2
- package/lib/EventsView/views/components/areas/AreaPolygons.js +3 -3
- package/lib/EventsView/views/components/edges/Edge.js +2 -2
- package/lib/EventsView/views/components/edges/Edges.js +2 -2
- package/lib/EventsView/views/components/events/EventIndicator.js +2 -2
- package/lib/EventsView/views/components/events/EventPath.js +2 -2
- package/lib/EventsView/views/components/events/MoreInfo.js +2 -2
- package/lib/EventsView/views/components/events/Sidebar.js +2 -2
- package/lib/EventsView/views/components/events/event_info/EarlyWarnings.js +2 -2
- package/lib/EventsView/views/components/events/event_info/EventDetails.js +1 -1
- package/lib/EventsView/views/components/events/event_info/EventInfo.js +3 -3
- package/lib/EventsView/views/components/events/event_info/EventTimeRange.js +3 -3
- package/lib/EventsView/views/components/events/event_info/HistoricalInformation.js +1 -1
- package/lib/EventsView/views/components/events/event_info/MiniEventTree.js +3 -3
- package/lib/EventsView/views/components/events/event_info/MobileEventPath.js +1 -1
- package/lib/EventsView/views/components/events/event_info/PollutionDischarge.js +2 -2
- package/lib/EventsView/views/components/events/event_info/charts/EventDetailsLineChart.js +3 -3
- package/lib/EventsView/views/components/events/event_info/charts/EventDetailsPieChart.js +3 -3
- package/lib/EventsView/views/components/events/event_info/damage_type/DamageType.js +3 -3
- package/lib/EventsView/views/components/events/event_info/samplings/Sampling.js +1 -1
- package/lib/EventsView/views/components/events/event_info/samplings/Samplings.js +1 -1
- package/lib/EventsView/views/components/events/event_info/sources/Source.js +1 -1
- package/lib/EventsView/views/components/events/event_info/sources/Sources.js +2 -2
- package/lib/EventsView/views/components/events/events_list/EventItem.js +2 -2
- package/lib/EventsView/views/components/events/events_list/EventsList.js +3 -3
- package/lib/EventsView/views/components/events/events_list/Filter/Filter.js +3 -3
- package/lib/EventsView/views/components/events/events_list/Filter/FilterContainer.js +4 -4
- package/lib/EventsView/views/components/events/events_list/Filter/FilterItem.js +2 -2
- package/lib/EventsView/views/components/events/events_list/Filter/FiltersDropDown.js +2 -2
- package/lib/EventsView/views/components/events/events_list/Filter/OptionsDropDown.js +4 -4
- package/lib/EventsView/views/components/events/events_list/Sort.js +3 -3
- package/lib/EventsView/views/components/map/FloatingGraph.js +1 -1
- package/lib/EventsView/views/components/map/Map.js +7 -5
- package/lib/EventsView/views/components/map/Map.stories.js +32 -0
- package/lib/EventsView/views/components/map/mapStyle.scss +6 -0
- package/lib/EventsView/views/components/points/PointMarker.js +2 -2
- package/lib/EventsView/views/components/points/PointMarkers.js +1 -1
- package/lib/EventsView/views/eventsView.js +2 -2
- package/lib/Router.js +8 -4
- package/lib/fonts/Gilroy-ExtraBold.otf +0 -0
- package/lib/fonts/Gilroy-Light.otf +0 -0
- package/lib/fonts/Gilroy-Regular.otf +0 -0
- package/lib/fonts/Gilroy-SemiBold.otf +0 -0
- package/lib/index.js +1 -1
- package/lib/macros/getVersion.js +9 -0
- package/lib/shared/TimeRangeSelector/TimeRangeSelector.js +4 -3
- package/lib/shared/TimeRangeSelector/TimeRangeSelector.stories.js +35 -0
- package/lib/shared/TimeRangeSelector/index.js +1 -1
- package/lib/shared/TimeRangeSelector/styles.scss +6 -4
- package/lib/shared/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/shared/components/Breadcrumbs/index.js +1 -1
- package/lib/shared/components/ContentLoader/ContentLoader.js +1 -1
- package/lib/shared/components/DamageType/DamageType.js +3 -3
- package/lib/shared/components/DamageType/index.js +1 -1
- package/lib/shared/components/DischargeHeatmap/DischargeHeatmap.js +3 -3
- package/lib/shared/components/DischargeHeatmap/index.js +1 -1
- package/lib/shared/components/DoubleTabs/DoubleTabs.js +1 -1
- package/lib/shared/components/DoubleTabs/DoubleTabs.stories.js +1 -1
- package/lib/shared/components/DoubleTabs/styles.js +13 -8
- package/lib/shared/components/ErrorBoundary.js +6 -12
- package/lib/shared/components/Events/Events.js +3 -3
- package/lib/shared/components/Events/index.js +1 -1
- package/lib/shared/components/Graph/Graph.js +7 -11
- package/lib/shared/components/Graph/index.js +1 -1
- package/lib/shared/components/InfoBar/InfoBar.js +74 -0
- package/lib/shared/components/InfoBar/InfoBar.stories.js +31 -0
- package/lib/shared/components/KandoModal/KandoModal.js +3 -3
- package/lib/shared/components/KandoModal/index.js +1 -1
- package/lib/shared/components/KandoNavbar/KandoNavbar.js +20 -18
- package/lib/shared/components/KandoNavbar/index.js +1 -1
- package/lib/shared/components/LiveEvents/CarouselSlide.js +1 -1
- package/lib/shared/components/LiveEvents/LiveEvents.js +1 -1
- package/lib/shared/components/LiveEvents/index.js +1 -1
- package/lib/shared/components/LoaderByPercent/LoaderByPercent.js +1 -1
- package/lib/shared/components/Map/Map.js +3 -3
- package/lib/shared/components/Map/index.js +1 -1
- package/lib/shared/components/NarrowHeader.js +6 -12
- package/lib/shared/components/PointInfo/PointInfo.js +1 -1
- package/lib/shared/components/PointInfo/index.js +1 -1
- package/lib/shared/components/PopupModal/PopupModal.js +44 -0
- package/lib/shared/components/PopupModal/PopupModal.stories.js +52 -0
- package/lib/shared/components/Search/Search.js +8 -16
- package/lib/shared/components/Search/index.js +1 -1
- package/lib/shared/components/Sector/Sector.js +4 -8
- package/lib/shared/components/Sector/index.js +1 -1
- package/lib/shared/components/Select/Select.js +6 -10
- package/lib/shared/components/Select/Select.stories.js +1 -1
- package/lib/shared/components/Spinner/Spinner.js +1 -1
- package/lib/shared/components/Spinner/Spinner.stories.js +1 -1
- package/lib/shared/components/Spinner/index.js +1 -1
- package/lib/shared/components/Spinner/style/spinner.js +9 -7
- package/lib/shared/components/Toggle/Toggle.js +3 -3
- package/lib/shared/components/Toggle/index.js +1 -1
- package/lib/shared/components/TrendGraph/TrendGraph.js +8 -11
- package/lib/shared/components/TrendGraph/index.js +1 -1
- package/lib/shared/components/TrendGraphNVL/TrendGraphNVL.js +3 -3
- package/lib/shared/components/TrendGraphNVL/index.js +1 -1
- package/lib/shared/redux/WBE/reducer.js +3 -7
- package/lib/shared/redux/context/reducer.js +3 -7
- package/lib/shared/redux/dashboard/dashboardSlice.js +23 -0
- package/lib/shared/redux/edges/reducer.js +2 -2
- package/lib/shared/redux/events/reducer.js +7 -11
- package/lib/shared/redux/rootReducer.js +4 -1
- package/lib/shared/redux/rootStore.js +14 -5
- package/lib/shared/utilities/ErrorBoundary.js +6 -12
- package/lib/shared/utilities/KandoDate.js +4 -3
- package/lib/shared/utilities/KandoModal.js +3 -3
- package/lib/shared/utilities/TimeFormat.js +2 -2
- package/lib/shared/utilities/Truncate.js +3 -3
- package/lib/shared/utilities/custom_hooks/useApi.js +11 -5
- package/lib/shared/utilities/custom_hooks/useKandoFetch.js +2 -2
- package/lib/shared/utilities/custom_hooks/useMap.js +3 -3
- package/lib/shared/utilities/custom_hooks/useWindowSize.js +2 -2
- package/lib/shared/utilities/i18n.js +3 -3
- package/lib/styles.scss +38 -0
- package/package.json +17 -8
- package/lib/DashboardV2/UtilityDashboard/mocks/areas.mock.js +0 -320
- package/lib/DashboardV2/UtilityDashboard/mocks/events.mock.js +0 -345
- package/lib/DashboardV2/UtilityDashboard/mocks/factories.mock.js +0 -140
- package/lib/DashboardV2/UtilityDashboard/mocks/index.js +0 -29
- /package/lib/DashboardV2/UtilityDashboard/{TopBar/models.js → MostPolluting/Areas/areasResponse.interface.js} +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.TopBar = void 0;
|
|
9
9
|
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
11
|
|
|
14
12
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,31 +17,13 @@ var _QualitySummary = require("./QualitySummary/QualitySummary");
|
|
|
19
17
|
|
|
20
18
|
var _UtilityInformation = require("./UtilityInformation/UtilityInformation");
|
|
21
19
|
|
|
22
|
-
var _useApi3 = require("../../../shared/utilities/custom_hooks/useApi");
|
|
23
|
-
|
|
24
20
|
var Container = _styledComponents.default.div.withConfig({
|
|
25
21
|
displayName: "TopBar__Container",
|
|
26
22
|
componentId: "sc-yqrye7-0"
|
|
27
23
|
})(["display:grid;grid-template-columns:1fr 2fr 1fr;grid-gap:25px;@media (max-width:1200px){grid-gap:10px;grid-template-rows:1fr 1fr;grid-template-columns:initial;grid-template-areas:'info common' 'summary summary ';}@media (max-width:768px){grid-template-rows:1fr 1fr 1fr;grid-template-areas:'info ' 'common' 'summary ';}@media (max-width:576px){grid-template-rows:1fr 1fr 1fr 1fr;grid-template-areas:'info ' 'common' 'summary ' 'summary ';}"]);
|
|
28
24
|
|
|
29
25
|
var TopBar = function TopBar() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _useApi = (0, _useApi3.useApi)(endPoint),
|
|
33
|
-
_useApi2 = (0, _slicedToArray2.default)(_useApi, 3),
|
|
34
|
-
response = _useApi2[0],
|
|
35
|
-
isLoading = _useApi2[1],
|
|
36
|
-
Error = _useApi2[2];
|
|
37
|
-
|
|
38
|
-
if (!response || Error) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_UtilityInformation.UtilityInformation, {
|
|
43
|
-
info: response.data.utilityInfo
|
|
44
|
-
}), /*#__PURE__*/_react.default.createElement(_QualitySummary.QualitySummary, {
|
|
45
|
-
summary: response.data.summary
|
|
46
|
-
}), /*#__PURE__*/_react.default.createElement(_MostCommon.MostCommon, null));
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_UtilityInformation.UtilityInformation, null), /*#__PURE__*/_react.default.createElement(_QualitySummary.QualitySummary, null), /*#__PURE__*/_react.default.createElement(_MostCommon.MostCommon, null));
|
|
47
27
|
};
|
|
48
28
|
|
|
49
29
|
exports.TopBar = TopBar;
|
|
@@ -1,42 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.UtilityInformation = void 0;
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
15
|
|
|
12
16
|
var _styles = require("./styles");
|
|
13
17
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
var _PopupModal = require("../../../../shared/components/PopupModal/PopupModal");
|
|
19
|
+
|
|
20
|
+
var _PopupModal2 = require("../../../../shared/components/PopupModal/PopupModal.stories");
|
|
21
|
+
|
|
22
|
+
var _useApiWithDashboardQuery = require("../../../useApiWithDashboardQuery");
|
|
23
|
+
|
|
24
|
+
var _i18n = _interopRequireDefault(require("../../../../shared/utilities/i18n"));
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var UtilityInformation = function UtilityInformation() {
|
|
31
|
+
var _response$data;
|
|
32
|
+
|
|
33
|
+
var _useState = (0, _react.useState)(false),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
show = _useState2[0],
|
|
36
|
+
setShow = _useState2[1];
|
|
37
|
+
|
|
38
|
+
var _useApiWithDashboardQ = (0, _useApiWithDashboardQuery.useApiWithDashboardQuery)('/data/utility-information.json'),
|
|
39
|
+
_useApiWithDashboardQ2 = (0, _slicedToArray2.default)(_useApiWithDashboardQ, 3),
|
|
40
|
+
response = _useApiWithDashboardQ2[0],
|
|
41
|
+
isLoading = _useApiWithDashboardQ2[1],
|
|
42
|
+
error = _useApiWithDashboardQ2[2];
|
|
43
|
+
|
|
44
|
+
var utilityResponse = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data;
|
|
45
|
+
|
|
46
|
+
if (!utilityResponse) {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("div", null, "Loading...");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_PopupModal.PopupModal, {
|
|
51
|
+
show: show,
|
|
52
|
+
setShow: setShow
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_PopupModal2.OldMapStory, null)), /*#__PURE__*/_react.default.createElement(_styles.Title, {
|
|
22
54
|
className: "title"
|
|
23
|
-
},
|
|
55
|
+
}, _i18n.default.t('dashboard2.utility_information')), /*#__PURE__*/_react.default.createElement(_styles.ContentHolder, null, /*#__PURE__*/_react.default.createElement(_styles.ContentTop, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
24
56
|
className: "total-score"
|
|
25
|
-
},
|
|
57
|
+
}, _i18n.default.t('dashboard2.utility_Score'), /*#__PURE__*/_react.default.createElement("span", {
|
|
26
58
|
className: "score"
|
|
27
|
-
},
|
|
59
|
+
}, utilityResponse.total_areas + utilityResponse.total_factories + utilityResponse.total_wwtp)), /*#__PURE__*/_react.default.createElement(_styles.ShowMapLink, {
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
return setShow(!show);
|
|
62
|
+
}
|
|
63
|
+
}, "Show Map ", '>')), /*#__PURE__*/_react.default.createElement(_styles.ContentBottom, null, /*#__PURE__*/_react.default.createElement(_styles.Score, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
64
|
className: "subtitle"
|
|
29
65
|
}, "Areas"), /*#__PURE__*/_react.default.createElement("div", {
|
|
30
66
|
className: "number"
|
|
31
|
-
},
|
|
67
|
+
}, utilityResponse.total_areas)), /*#__PURE__*/_react.default.createElement(_styles.Score, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
32
68
|
className: "subtitle"
|
|
33
69
|
}, "Factories"), /*#__PURE__*/_react.default.createElement("div", {
|
|
34
70
|
className: "number"
|
|
35
|
-
},
|
|
71
|
+
}, utilityResponse.total_factories)), /*#__PURE__*/_react.default.createElement(_styles.Score, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
72
|
className: "subtitle"
|
|
37
73
|
}, "WWTPs"), /*#__PURE__*/_react.default.createElement("div", {
|
|
38
74
|
className: "number"
|
|
39
|
-
},
|
|
75
|
+
}, utilityResponse.total_wwtp)))));
|
|
40
76
|
};
|
|
41
77
|
|
|
42
78
|
exports.UtilityInformation = UtilityInformation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -38,10 +38,10 @@ var ContentTop = _styledComponents.default.div.withConfig({
|
|
|
38
38
|
|
|
39
39
|
exports.ContentTop = ContentTop;
|
|
40
40
|
|
|
41
|
-
var ShowMapLink = _styledComponents.default.
|
|
41
|
+
var ShowMapLink = _styledComponents.default.div.withConfig({
|
|
42
42
|
displayName: "styles__ShowMapLink",
|
|
43
43
|
componentId: "sc-1ikbh2k-3"
|
|
44
|
-
})(["font-weight:300;color:#f6004f;"]);
|
|
44
|
+
})(["font-weight:300;color:#f6004f;cursor:pointer;"]);
|
|
45
45
|
|
|
46
46
|
exports.ShowMapLink = ShowMapLink;
|
|
47
47
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.utilityInformationResponse = void 0;
|
|
7
|
+
var utilityInformationResponse = {
|
|
8
|
+
data: {
|
|
9
|
+
total_wwtp: 1,
|
|
10
|
+
total_factories: 256,
|
|
11
|
+
total_areas: 18
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.utilityInformationResponse = utilityInformationResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -13,7 +13,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _UtilityDashboard = require("./UtilityDashboard");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _qualitySummary = require("./TopBar/QualitySummary/qualitySummary.mock");
|
|
17
|
+
|
|
18
|
+
var _utilityInformation = require("./TopBar/UtilityInformation/utilityInformation.mock");
|
|
19
|
+
|
|
20
|
+
var _factories = require("./MostPolluting/Factories/factories.mock");
|
|
21
|
+
|
|
22
|
+
var _areas = require("./MostPolluting/Areas/areas.mock");
|
|
23
|
+
|
|
24
|
+
var _reactRedux = require("react-redux");
|
|
25
|
+
|
|
26
|
+
var _redux = require("redux");
|
|
17
27
|
|
|
18
28
|
var _default = {
|
|
19
29
|
title: 'UI/Widgets/UtilityDashboard',
|
|
@@ -21,136 +31,68 @@ var _default = {
|
|
|
21
31
|
argTypes: {}
|
|
22
32
|
};
|
|
23
33
|
exports.default = _default;
|
|
34
|
+
var state = {
|
|
35
|
+
nav_context_data: {
|
|
36
|
+
navContext: {
|
|
37
|
+
locale: 'en'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
global_data: {
|
|
41
|
+
waterAuthorityId: '24'
|
|
42
|
+
},
|
|
43
|
+
dashboard: {
|
|
44
|
+
period: '30d'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var store = (0, _redux.createStore)(function () {
|
|
48
|
+
return state;
|
|
49
|
+
}, state);
|
|
24
50
|
|
|
25
51
|
var Template = function Template(args) {
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
|
|
53
|
+
store: store
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_UtilityDashboard.UtilityDashboard, args));
|
|
27
55
|
};
|
|
28
56
|
|
|
29
57
|
var Default = Template.bind({});
|
|
30
58
|
exports.Default = Default;
|
|
31
59
|
Default.args = {};
|
|
32
60
|
Default.parameters = {
|
|
33
|
-
msw: [_msw.rest.get('/summary', function (req, res, ctx) {
|
|
34
|
-
return res(ctx.json(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
total: 25,
|
|
50
|
-
extreme: {
|
|
51
|
-
increasePercent: 0.4,
|
|
52
|
-
percent: 5
|
|
53
|
-
},
|
|
54
|
-
high: {
|
|
55
|
-
increasePercent: -0.1,
|
|
56
|
-
percent: 3
|
|
57
|
-
},
|
|
58
|
-
medium: {
|
|
59
|
-
increasePercent: 0.4,
|
|
60
|
-
percent: 17
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}));
|
|
65
|
-
}), _msw.rest.get('/areas', function (req, res, ctx) {
|
|
66
|
-
return res(ctx.json({
|
|
67
|
-
areasArr: _mocks.areasArr
|
|
68
|
-
}));
|
|
69
|
-
}), _msw.rest.get('/factories', function (req, res, ctx) {
|
|
70
|
-
return res(ctx.json({
|
|
71
|
-
factoriesArr: _mocks.factoriesArr
|
|
72
|
-
}));
|
|
73
|
-
}), _msw.rest.get('/wwtp', function (req, res, ctx) {
|
|
74
|
-
return res(ctx.json({
|
|
75
|
-
factoriesArr: _mocks.factoriesArr
|
|
76
|
-
}));
|
|
77
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
78
|
-
return res(ctx.json({
|
|
79
|
-
factoriesArr: _mocks.factoriesArr
|
|
80
|
-
}));
|
|
81
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
82
|
-
return res(ctx.json({
|
|
83
|
-
factoriesArr: _mocks.factoriesArr
|
|
84
|
-
}));
|
|
85
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
86
|
-
return res(ctx.json({
|
|
87
|
-
eventsArr: _mocks.eventsArr
|
|
88
|
-
}));
|
|
89
|
-
})]
|
|
61
|
+
msw: [_msw.rest.get('/quality-summary.json', function (req, res, ctx) {
|
|
62
|
+
return res(ctx.json(_qualitySummary.qualitySummaryResponse));
|
|
63
|
+
}), _msw.rest.get('/utility-information.json', function (req, res, ctx) {
|
|
64
|
+
return res(ctx.json(_utilityInformation.utilityInformationResponse));
|
|
65
|
+
}), _msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
66
|
+
return res(ctx.json(_areas.areasResponce));
|
|
67
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
68
|
+
return res(ctx.json(_factories.factoriesResponce));
|
|
69
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
70
|
+
// return res(
|
|
71
|
+
// ctx.json({
|
|
72
|
+
// eventsArr,
|
|
73
|
+
// }),
|
|
74
|
+
// );
|
|
75
|
+
// }),
|
|
76
|
+
]
|
|
90
77
|
};
|
|
91
78
|
var NoScore = Template.bind({});
|
|
92
79
|
exports.NoScore = NoScore;
|
|
93
80
|
NoScore.args = {};
|
|
94
81
|
NoScore.parameters = {
|
|
95
|
-
msw: [_msw.rest.get('/summary', function (req, res, ctx) {
|
|
96
|
-
return res(ctx.json(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
total: 25,
|
|
112
|
-
extreme: {
|
|
113
|
-
up: false,
|
|
114
|
-
increasePercent: 0.4,
|
|
115
|
-
percent: 5
|
|
116
|
-
},
|
|
117
|
-
high: {
|
|
118
|
-
up: true,
|
|
119
|
-
increasePercent: 0.1,
|
|
120
|
-
percent: 3
|
|
121
|
-
},
|
|
122
|
-
medium: {
|
|
123
|
-
up: false,
|
|
124
|
-
increasePercent: 0.4,
|
|
125
|
-
percent: 17
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}));
|
|
130
|
-
}), _msw.rest.get('/areas', function (req, res, ctx) {
|
|
131
|
-
return res(ctx.json({
|
|
132
|
-
areasArr: _mocks.areasArr,
|
|
133
|
-
factoriesArr: _mocks.factoriesArr
|
|
134
|
-
}));
|
|
135
|
-
}), _msw.rest.get('/factories', function (req, res, ctx) {
|
|
136
|
-
return res(ctx.json({
|
|
137
|
-
factoriesArr: _mocks.factoriesArr
|
|
138
|
-
}));
|
|
139
|
-
}), _msw.rest.get('/wwtp', function (req, res, ctx) {
|
|
140
|
-
return res(ctx.json({
|
|
141
|
-
factoriesArr: _mocks.factoriesArr
|
|
142
|
-
}));
|
|
143
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
144
|
-
return res(ctx.json({
|
|
145
|
-
factoriesArr: _mocks.factoriesArr
|
|
146
|
-
}));
|
|
147
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
148
|
-
return res(ctx.json({
|
|
149
|
-
factoriesArr: _mocks.factoriesArr
|
|
150
|
-
}));
|
|
151
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
152
|
-
return res(ctx.json({
|
|
153
|
-
eventsArr: _mocks.eventsArr
|
|
154
|
-
}));
|
|
155
|
-
})]
|
|
82
|
+
msw: [_msw.rest.get('/quality-summary.json', function (req, res, ctx) {
|
|
83
|
+
return res(ctx.json(_qualitySummary.qualitySummaryResponse));
|
|
84
|
+
}), _msw.rest.get('/utility-information.json', function (req, res, ctx) {
|
|
85
|
+
return res(ctx.json(_utilityInformation.utilityInformationResponse));
|
|
86
|
+
}), _msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
87
|
+
return res(ctx.json(_areas.areasResponce));
|
|
88
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
89
|
+
return res(ctx.json(_factories.factoriesResponce));
|
|
90
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
91
|
+
// return res(
|
|
92
|
+
// ctx.json({
|
|
93
|
+
// eventsArr,
|
|
94
|
+
// }),
|
|
95
|
+
// );
|
|
96
|
+
// }),
|
|
97
|
+
]
|
|
156
98
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _mockBus = require("../../../mock/mockBus");
|
|
4
|
+
|
|
5
|
+
var _areas = require("./MostPolluting/Areas/areas.mock");
|
|
6
|
+
|
|
7
|
+
var _qualitySummary = require("./TopBar/QualitySummary/qualitySummary.mock");
|
|
8
|
+
|
|
9
|
+
var _utilityInformation = require("./TopBar/UtilityInformation/utilityInformation.mock");
|
|
10
|
+
|
|
11
|
+
var _factories = require("./MostPolluting/Factories/factories.mock");
|
|
12
|
+
|
|
13
|
+
(0, _mockBus.addMock)('/areas/utilities.json', _areas.areasResponce);
|
|
14
|
+
(0, _mockBus.addMock)('/data/quality-summary.json', _qualitySummary.qualitySummaryResponse);
|
|
15
|
+
(0, _mockBus.addMock)('/data/utility-information.json', _utilityInformation.utilityInformationResponse);
|
|
16
|
+
(0, _mockBus.addMock)('/groups/utilities.json', _factories.factoriesResponce);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("
|
|
5
|
+
var _typeof = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -19,6 +19,12 @@ var _actions = require("../shared/redux/context/actions");
|
|
|
19
19
|
|
|
20
20
|
require("./styles.scss");
|
|
21
21
|
|
|
22
|
+
var _useQueryURL = _interopRequireDefault(require("../shared/utilities/custom_hooks/useQueryURL"));
|
|
23
|
+
|
|
24
|
+
var _InfoBar = require("../shared/components/InfoBar/InfoBar");
|
|
25
|
+
|
|
26
|
+
var _UtilityDashboard = require("./UtilityDashboard/UtilityDashboard");
|
|
27
|
+
|
|
22
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
29
|
|
|
24
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -30,15 +36,17 @@ var WaterAuthorityDashboard = function WaterAuthorityDashboard() {
|
|
|
30
36
|
name: 'dashboard_v2'
|
|
31
37
|
}));
|
|
32
38
|
}, []);
|
|
39
|
+
var query = (0, _useQueryURL.default)();
|
|
40
|
+
var waterAuthorityIdFromUrl = parseInt(query.get('water_authority_id') || '0');
|
|
33
41
|
var waterAuthorityId = (0, _reactRedux.useSelector)(function (state) {
|
|
34
42
|
return state.global_data.waterAuthorityId;
|
|
35
43
|
});
|
|
36
44
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_KandoNavbar.default, {
|
|
37
|
-
waterAuthorityId:
|
|
45
|
+
waterAuthorityId: waterAuthorityIdFromUrl,
|
|
38
46
|
hasSearch: true
|
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("h1", {
|
|
47
|
+
}), /*#__PURE__*/_react.default.createElement(_InfoBar.InfoBar, null), waterAuthorityId && /*#__PURE__*/_react.default.createElement("h1", {
|
|
40
48
|
className: "l2"
|
|
41
|
-
}, "Water Authority ID: ", waterAuthorityId, /*#__PURE__*/_react.default.createElement("br", null)));
|
|
49
|
+
}, "Water Authority ID: ", waterAuthorityId, /*#__PURE__*/_react.default.createElement("br", null)), /*#__PURE__*/_react.default.createElement(_UtilityDashboard.UtilityDashboard, null));
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
var _default = WaterAuthorityDashboard;
|
package/lib/DashboardV2/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useApiWithDashboardQuery = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _useApi = require("../shared/utilities/custom_hooks/useApi");
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _reactRedux = require("react-redux");
|
|
19
|
+
|
|
20
|
+
var _time = require("../shared/helpers/time");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Adds the redux state to these URL parameters and makes a request: locale, water_authority_id, period
|
|
24
|
+
*
|
|
25
|
+
* @param endPoint
|
|
26
|
+
* @param params
|
|
27
|
+
*/
|
|
28
|
+
var useApiWithDashboardQuery = function useApiWithDashboardQuery(endPoint, params) {
|
|
29
|
+
var _useState = (0, _react.useState)(''),
|
|
30
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
31
|
+
configuredEndpoint = _useState2[0],
|
|
32
|
+
setConfiguredEndpoint = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var locale = (0, _reactRedux.useSelector)(function (state) {
|
|
35
|
+
return state.nav_context_data.navContext.locale;
|
|
36
|
+
});
|
|
37
|
+
var waterAuthorityId = (0, _reactRedux.useSelector)(function (state) {
|
|
38
|
+
return state.global_data.waterAuthorityId;
|
|
39
|
+
});
|
|
40
|
+
var period = (0, _reactRedux.useSelector)(function (state) {
|
|
41
|
+
return state.dashboard.period;
|
|
42
|
+
});
|
|
43
|
+
(0, _react.useEffect)(function () {
|
|
44
|
+
if (!locale || !waterAuthorityId || !period) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
setConfiguredEndpoint(endPoint);
|
|
49
|
+
}, [locale, waterAuthorityId, period]);
|
|
50
|
+
return (0, _useApi.useApi)(configuredEndpoint, (0, _objectSpread2.default)({
|
|
51
|
+
locale: locale,
|
|
52
|
+
water_authority_id: waterAuthorityId,
|
|
53
|
+
period_days: (0, _time.rangeToDays)(period).toString()
|
|
54
|
+
}, params));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.useApiWithDashboardQuery = useApiWithDashboardQuery;
|