@kando-env/kando-ui 1.0.12 → 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 +8 -11
- 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,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,17 +1,15 @@
|
|
|
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
|
|
9
9
|
});
|
|
10
10
|
exports.MostPolluting = void 0;
|
|
11
11
|
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("
|
|
13
|
-
|
|
14
|
-
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
13
|
|
|
16
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
15
|
|
|
@@ -27,9 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
25
|
|
|
28
26
|
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
27
|
|
|
30
|
-
var MostPolluting = function MostPolluting(
|
|
31
|
-
(0, _objectDestructuringEmpty2.default)(_ref);
|
|
32
|
-
|
|
28
|
+
var MostPolluting = function MostPolluting() {
|
|
33
29
|
var _useState = (0, _react.useState)(0),
|
|
34
30
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
31
|
selectedTabIndex = _useState2[0],
|
|
@@ -38,20 +34,25 @@ var MostPolluting = function MostPolluting(_ref) {
|
|
|
38
34
|
var options = [/*#__PURE__*/_react.default.createElement(_Factories.Factories, {
|
|
39
35
|
others: true,
|
|
40
36
|
title: "WWTPs",
|
|
41
|
-
endPoint: "/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_react.default.createElement(_Areas.Areas, {
|
|
46
|
-
endPoint: "/areas"
|
|
37
|
+
endPoint: "/groups/utilities.json",
|
|
38
|
+
requestParams: {
|
|
39
|
+
type: 'WastewaterTreatmentPlant'
|
|
40
|
+
}
|
|
41
|
+
}), /*#__PURE__*/_react.default.createElement(_Areas.Areas, {
|
|
42
|
+
endPoint: "/areas/utilities.json"
|
|
47
43
|
}), /*#__PURE__*/_react.default.createElement(_Factories.Factories, {
|
|
48
|
-
endPoint: "/
|
|
44
|
+
endPoint: "/groups/utilities.json",
|
|
45
|
+
requestParams: {
|
|
46
|
+
type: 'Factory'
|
|
47
|
+
}
|
|
49
48
|
}), /*#__PURE__*/_react.default.createElement(_Factories.Factories, {
|
|
50
49
|
others: true,
|
|
51
50
|
title: "Collectors",
|
|
52
|
-
endPoint: "/
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
endPoint: "/groups/utilities.json",
|
|
52
|
+
requestParams: {
|
|
53
|
+
type: 'Collectors'
|
|
54
|
+
}
|
|
55
|
+
}) // <Factories others={true} title="Pumping stations" endPoint="/groups/utilities.json" requestParams={{type:'PumpStation'}}/> ,
|
|
55
56
|
];
|
|
56
57
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Tabs.Tabs, {
|
|
57
58
|
selected: selectedTabIndex,
|
|
@@ -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,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _MostPolluting = require("./MostPolluting");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _factories = require("./Factories/factories.mock");
|
|
17
|
+
|
|
18
|
+
var _areas = require("./Areas/areas.mock");
|
|
19
|
+
|
|
20
|
+
var _redux = require("redux");
|
|
21
|
+
|
|
22
|
+
var _reactRedux = require("react-redux");
|
|
17
23
|
|
|
18
24
|
var _default = {
|
|
19
25
|
title: 'UI/components/utility-dashboard/MostPolluting',
|
|
@@ -21,128 +27,90 @@ var _default = {
|
|
|
21
27
|
argTypes: {}
|
|
22
28
|
};
|
|
23
29
|
exports.default = _default;
|
|
30
|
+
var state = {
|
|
31
|
+
nav_context_data: {
|
|
32
|
+
navContext: {
|
|
33
|
+
locale: 'en'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
global_data: {
|
|
37
|
+
waterAuthorityId: '24'
|
|
38
|
+
},
|
|
39
|
+
dashboard: {
|
|
40
|
+
period: '30d'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var store = (0, _redux.createStore)(function () {
|
|
44
|
+
return state;
|
|
45
|
+
}, state);
|
|
24
46
|
|
|
25
47
|
var Template = function Template(args) {
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
|
|
49
|
+
store: store
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_MostPolluting.MostPolluting, args));
|
|
27
51
|
};
|
|
28
52
|
|
|
29
53
|
var Default = Template.bind({});
|
|
30
54
|
exports.Default = Default;
|
|
31
55
|
Default.parameters = {
|
|
32
|
-
msw: [_msw.rest.get('/areas', function (req, res, ctx) {
|
|
33
|
-
return res(ctx.json(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}));
|
|
45
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
46
|
-
return res(ctx.json({
|
|
47
|
-
factoriesArr: _mocks.factoriesArr
|
|
48
|
-
}));
|
|
49
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
50
|
-
return res(ctx.json({
|
|
51
|
-
factoriesArr: _mocks.factoriesArr
|
|
52
|
-
}));
|
|
53
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
54
|
-
return res(ctx.json({
|
|
55
|
-
eventsArr: _mocks.eventsArr
|
|
56
|
-
}));
|
|
57
|
-
})]
|
|
56
|
+
msw: [_msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
57
|
+
return res(ctx.json(_areas.areasResponce));
|
|
58
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
59
|
+
return res(ctx.json(_factories.factoriesResponce));
|
|
60
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
61
|
+
// return res(
|
|
62
|
+
// ctx.json({
|
|
63
|
+
// eventsArr
|
|
64
|
+
// }),
|
|
65
|
+
// );
|
|
66
|
+
// }),
|
|
67
|
+
]
|
|
58
68
|
};
|
|
59
69
|
var Only8 = Template.bind({});
|
|
60
70
|
exports.Only8 = Only8;
|
|
61
71
|
Only8.parameters = {
|
|
62
|
-
msw: [_msw.rest.get('/areas', function (req, res, ctx) {
|
|
63
|
-
return res(ctx.json(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}));
|
|
75
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
76
|
-
return res(ctx.json({
|
|
77
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 8)
|
|
78
|
-
}));
|
|
79
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
80
|
-
return res(ctx.json({
|
|
81
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 8)
|
|
82
|
-
}));
|
|
83
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
84
|
-
return res(ctx.json({
|
|
85
|
-
eventsArr: _mocks.eventsArr.slice(0, 8)
|
|
86
|
-
}));
|
|
87
|
-
})]
|
|
72
|
+
msw: [_msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
73
|
+
return res(ctx.json(_areas.areasResponce));
|
|
74
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
75
|
+
return res(ctx.json(_factories.factoriesResponce.slice(0, 8)));
|
|
76
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
77
|
+
// return res(
|
|
78
|
+
// ctx.json({
|
|
79
|
+
// eventsArr: eventsArr.slice(0, 8),
|
|
80
|
+
// }),
|
|
81
|
+
// );
|
|
82
|
+
// }),
|
|
83
|
+
]
|
|
88
84
|
};
|
|
89
85
|
var Only9 = Template.bind({});
|
|
90
86
|
exports.Only9 = Only9;
|
|
91
87
|
Only9.parameters = {
|
|
92
|
-
msw: [_msw.rest.get('/areas', function (req, res, ctx) {
|
|
93
|
-
return res(ctx.json(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}));
|
|
105
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
106
|
-
return res(ctx.json({
|
|
107
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 9)
|
|
108
|
-
}));
|
|
109
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
110
|
-
return res(ctx.json({
|
|
111
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 9)
|
|
112
|
-
}));
|
|
113
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
114
|
-
return res(ctx.json({
|
|
115
|
-
eventsArr: _mocks.eventsArr.slice(0, 9)
|
|
116
|
-
}));
|
|
117
|
-
})]
|
|
88
|
+
msw: [_msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
89
|
+
return res(ctx.json(_areas.areasResponce));
|
|
90
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
91
|
+
return res(ctx.json(_factories.factoriesResponce.slice(0, 9)));
|
|
92
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
93
|
+
// return res(
|
|
94
|
+
// ctx.json({
|
|
95
|
+
// eventsArr: eventsArr.slice(0, 9),
|
|
96
|
+
// }),
|
|
97
|
+
// );
|
|
98
|
+
// }),
|
|
99
|
+
]
|
|
118
100
|
};
|
|
119
101
|
var Only2 = Template.bind({});
|
|
120
102
|
exports.Only2 = Only2;
|
|
121
103
|
Only2.parameters = {
|
|
122
|
-
msw: [_msw.rest.get('/areas', function (req, res, ctx) {
|
|
123
|
-
return res(ctx.json(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}));
|
|
135
|
-
}), _msw.rest.get('/pumping', function (req, res, ctx) {
|
|
136
|
-
return res(ctx.json({
|
|
137
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 2)
|
|
138
|
-
}));
|
|
139
|
-
}), _msw.rest.get('/collectors', function (req, res, ctx) {
|
|
140
|
-
return res(ctx.json({
|
|
141
|
-
factoriesArr: _mocks.factoriesArr.slice(0, 2)
|
|
142
|
-
}));
|
|
143
|
-
}), _msw.rest.get('/events', function (req, res, ctx) {
|
|
144
|
-
return res(ctx.json({
|
|
145
|
-
eventsArr: _mocks.eventsArr.slice(0, 2)
|
|
146
|
-
}));
|
|
147
|
-
})]
|
|
104
|
+
msw: [_msw.rest.get('/areas/utilities.json', function (req, res, ctx) {
|
|
105
|
+
return res(ctx.json(_areas.areasResponce));
|
|
106
|
+
}), _msw.rest.get('/factories/utilities.json', function (req, res, ctx) {
|
|
107
|
+
return res(ctx.json(_factories.factoriesResponce.slice(0, 2)));
|
|
108
|
+
}) // rest.get('/events', (req, res, ctx) => {
|
|
109
|
+
// return res(
|
|
110
|
+
// ctx.json({
|
|
111
|
+
// eventsArr: eventsArr.slice(0, 2),
|
|
112
|
+
// }),
|
|
113
|
+
// );
|
|
114
|
+
// }),
|
|
115
|
+
]
|
|
148
116
|
};
|
|
@@ -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
|
|
@@ -35,9 +35,12 @@ var Tabs = function Tabs(_ref) {
|
|
|
35
35
|
onClick: function onClick() {
|
|
36
36
|
return _onClick(0);
|
|
37
37
|
}
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_assets.MatashSvg, {
|
|
39
39
|
width: "15px",
|
|
40
|
-
height: "15px"
|
|
40
|
+
height: "15px",
|
|
41
|
+
style: {
|
|
42
|
+
marginRight: "4px"
|
|
43
|
+
}
|
|
41
44
|
}), "WWTPs"), /*#__PURE__*/_react.default.createElement(Tab, {
|
|
42
45
|
className: (0, _classnames.default)({
|
|
43
46
|
active: selected === 1
|
|
@@ -45,9 +48,12 @@ var Tabs = function Tabs(_ref) {
|
|
|
45
48
|
onClick: function onClick() {
|
|
46
49
|
return _onClick(1);
|
|
47
50
|
}
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_assets.ShapeSvg, {
|
|
49
52
|
width: "15px",
|
|
50
|
-
height: "15px"
|
|
53
|
+
height: "15px",
|
|
54
|
+
style: {
|
|
55
|
+
marginRight: "4px"
|
|
56
|
+
}
|
|
51
57
|
}), "Areas"), /*#__PURE__*/_react.default.createElement(Tab, {
|
|
52
58
|
className: (0, _classnames.default)({
|
|
53
59
|
active: selected === 2
|
|
@@ -55,9 +61,12 @@ var Tabs = function Tabs(_ref) {
|
|
|
55
61
|
onClick: function onClick() {
|
|
56
62
|
return _onClick(2);
|
|
57
63
|
}
|
|
58
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_assets.PlantSvg, {
|
|
59
65
|
width: "15px",
|
|
60
|
-
height: "15px"
|
|
66
|
+
height: "15px",
|
|
67
|
+
style: {
|
|
68
|
+
marginRight: "4px"
|
|
69
|
+
}
|
|
61
70
|
}), "Factories"), /*#__PURE__*/_react.default.createElement(Tab, {
|
|
62
71
|
className: (0, _classnames.default)({
|
|
63
72
|
active: selected === 3
|
|
@@ -65,30 +74,13 @@ var Tabs = function Tabs(_ref) {
|
|
|
65
74
|
onClick: function onClick() {
|
|
66
75
|
return _onClick(3);
|
|
67
76
|
}
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_assets.WaterSvg, {
|
|
69
78
|
width: "15px",
|
|
70
|
-
height: "15px"
|
|
79
|
+
height: "15px",
|
|
80
|
+
style: {
|
|
81
|
+
marginRight: "4px"
|
|
82
|
+
}
|
|
71
83
|
}), "Collectors"));
|
|
72
84
|
};
|
|
73
85
|
|
|
74
|
-
exports.Tabs = Tabs;
|
|
75
|
-
|
|
76
|
-
var _StyledMatashSvg = (0, _styledComponents.default)(_assets.MatashSvg).withConfig({
|
|
77
|
-
displayName: "Tabs___StyledMatashSvg",
|
|
78
|
-
componentId: "sc-syuz9a-2"
|
|
79
|
-
})(["margin-right:4px;"]);
|
|
80
|
-
|
|
81
|
-
var _StyledShapeSvg = (0, _styledComponents.default)(_assets.ShapeSvg).withConfig({
|
|
82
|
-
displayName: "Tabs___StyledShapeSvg",
|
|
83
|
-
componentId: "sc-syuz9a-3"
|
|
84
|
-
})(["margin-right:4px;"]);
|
|
85
|
-
|
|
86
|
-
var _StyledPlantSvg = (0, _styledComponents.default)(_assets.PlantSvg).withConfig({
|
|
87
|
-
displayName: "Tabs___StyledPlantSvg",
|
|
88
|
-
componentId: "sc-syuz9a-4"
|
|
89
|
-
})(["margin-right:4px;"]);
|
|
90
|
-
|
|
91
|
-
var _StyledWaterSvg = (0, _styledComponents.default)(_assets.WaterSvg).withConfig({
|
|
92
|
-
displayName: "Tabs___StyledWaterSvg",
|
|
93
|
-
componentId: "sc-syuz9a-5"
|
|
94
|
-
})(["margin-right:4px;"]);
|
|
86
|
+
exports.Tabs = Tabs;
|
|
@@ -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
|
|
@@ -34,12 +34,12 @@ Object.defineProperty(exports, "WaterSvg", {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
var _home = require("
|
|
37
|
+
var _home = require("@svgr/webpack?-svgo!./home.svg");
|
|
38
38
|
|
|
39
|
-
var _matash = require("
|
|
39
|
+
var _matash = require("@svgr/webpack?-svgo!./matash.svg");
|
|
40
40
|
|
|
41
|
-
var _plant = require("
|
|
41
|
+
var _plant = require("@svgr/webpack?-svgo!./plant.svg");
|
|
42
42
|
|
|
43
|
-
var _shape = require("
|
|
43
|
+
var _shape = require("@svgr/webpack?-svgo!./shape.svg");
|
|
44
44
|
|
|
45
|
-
var _water = require("
|
|
45
|
+
var _water = require("@svgr/webpack?-svgo!./water.svg");
|
|
@@ -40,14 +40,14 @@ Object.defineProperty(exports, "ShowMoreIcon", {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
var _gas = require("
|
|
43
|
+
var _gas = require("@svgr/webpack?-svgo!./gas.svg");
|
|
44
44
|
|
|
45
|
-
var _downArrow = require("
|
|
45
|
+
var _downArrow = require("@svgr/webpack?-svgo!./down-arrow.svg");
|
|
46
46
|
|
|
47
|
-
var _shop = require("
|
|
47
|
+
var _shop = require("@svgr/webpack?-svgo!./shop.svg");
|
|
48
48
|
|
|
49
|
-
var _metal = require("
|
|
49
|
+
var _metal = require("@svgr/webpack?-svgo!./metal.svg");
|
|
50
50
|
|
|
51
|
-
var _leather = require("
|
|
51
|
+
var _leather = require("@svgr/webpack?-svgo!./leather.svg");
|
|
52
52
|
|
|
53
|
-
var _showMore = require("
|
|
53
|
+
var _showMore = require("@svgr/webpack?-svgo!./show-more.svg");
|
|
@@ -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,17 +1,15 @@
|
|
|
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
|
|
9
9
|
});
|
|
10
10
|
exports.MostSevereEvents = void 0;
|
|
11
11
|
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("
|
|
13
|
-
|
|
14
|
-
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("/Users/adam/clients/kando/kando-ui/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
13
|
|
|
16
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
15
|
|
|
@@ -23,21 +21,21 @@ var _useApi3 = require("../../../shared/utilities/custom_hooks/useApi");
|
|
|
23
21
|
|
|
24
22
|
var _NoEvents = _interopRequireDefault(require("./NoEvents/NoEvents"));
|
|
25
23
|
|
|
24
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
25
|
+
|
|
26
|
+
var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
|
|
27
|
+
|
|
26
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); }
|
|
27
29
|
|
|
28
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; }
|
|
29
31
|
|
|
30
|
-
var MostSevereEvents = function MostSevereEvents(
|
|
31
|
-
(0, _objectDestructuringEmpty2.default)(_ref);
|
|
32
|
-
|
|
32
|
+
var MostSevereEvents = function MostSevereEvents() {
|
|
33
33
|
var _useState = (0, _react.useState)([]),
|
|
34
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
35
|
eventsArr = _useState2[0],
|
|
36
36
|
setEventsArr = _useState2[1];
|
|
37
37
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var _useApi = (0, _useApi3.useApi)(endPoint),
|
|
38
|
+
var _useApi = (0, _useApi3.useApi)('/data/events/931'),
|
|
41
39
|
_useApi2 = (0, _slicedToArray2.default)(_useApi, 3),
|
|
42
40
|
response = _useApi2[0],
|
|
43
41
|
isLoading = _useApi2[1],
|
|
@@ -46,17 +44,41 @@ var MostSevereEvents = function MostSevereEvents(_ref) {
|
|
|
46
44
|
(0, _react.useEffect)(function () {
|
|
47
45
|
var _response$data;
|
|
48
46
|
|
|
49
|
-
if (response
|
|
47
|
+
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.eventsArr) && !Error) {
|
|
50
48
|
if (Array.isArray(response.data.eventsArr)) {
|
|
51
|
-
var arr = response.data.eventsArr.filter(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
var arr = response.data.eventsArr // .filter(// |TODO: filter only high and extreme
|
|
50
|
+
// (event) =>
|
|
51
|
+
// event.severity === 'high' ||
|
|
52
|
+
// event.severity === 'extreme',
|
|
53
|
+
// )
|
|
54
|
+
.sort(function (a, b) {
|
|
55
|
+
return -Date.parse(a.first_seen_time) + Date.parse(b.first_seen_time);
|
|
56
|
+
});
|
|
56
57
|
setEventsArr(arr);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}, [response]);
|
|
61
|
+
|
|
62
|
+
var parseEventData = function parseEventData(event) {
|
|
63
|
+
var lastseen = event.observations.sort(function (obs1, obs2) {
|
|
64
|
+
return obs1.last_seen_time - obs2.last_seen_time;
|
|
65
|
+
}).slice(-1)[0];
|
|
66
|
+
var firstseen = event.observations.sort(function (obs1, obs2) {
|
|
67
|
+
return obs1.start_time - obs2.start_time;
|
|
68
|
+
})[0];
|
|
69
|
+
var diff = lastseen.last_seen_time - firstseen.start_time;
|
|
70
|
+
|
|
71
|
+
_dayjs.default.extend(_utc.default);
|
|
72
|
+
|
|
73
|
+
var mappedEvent = {
|
|
74
|
+
lastseen: lastseen,
|
|
75
|
+
firstseen: firstseen,
|
|
76
|
+
//@ts-ignore
|
|
77
|
+
total: _dayjs.default.utc(diff * 1000).format('HH:mm:ss')
|
|
78
|
+
};
|
|
79
|
+
return mappedEvent;
|
|
80
|
+
};
|
|
81
|
+
|
|
60
82
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
83
|
className: "most-severe-events"
|
|
62
84
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -68,14 +90,15 @@ var MostSevereEvents = function MostSevereEvents(_ref) {
|
|
|
68
90
|
}, "All Events ", '>')), response && eventsArr.length === 0 ? /*#__PURE__*/_react.default.createElement(_NoEvents.default, null) : /*#__PURE__*/_react.default.createElement("div", {
|
|
69
91
|
className: "events-container"
|
|
70
92
|
}, eventsArr.map(function (event, index) {
|
|
93
|
+
var data = parseEventData(event);
|
|
71
94
|
return /*#__PURE__*/_react.default.createElement(_SevereEvent.SevereEvent, {
|
|
72
|
-
key: index
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
key: index // damages={event.damages}
|
|
96
|
+
,
|
|
97
|
+
total: data.total,
|
|
98
|
+
firstseen: data.firstseen,
|
|
99
|
+
lastseen: data.lastseen // etaWWTP={event.etaWWTP}
|
|
100
|
+
// msg={event.msg}
|
|
101
|
+
|
|
79
102
|
});
|
|
80
103
|
})));
|
|
81
104
|
};
|
|
@@ -21,14 +21,19 @@
|
|
|
21
21
|
display: grid;
|
|
22
22
|
grid-template-columns: repeat(auto-fill, 446px);
|
|
23
23
|
grid-gap: 24px;
|
|
24
|
-
grid-template-rows:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
grid-auto-rows: 400px;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
}
|
|
24
|
+
grid-template-rows: 191px;
|
|
25
|
+
height: 191px;
|
|
26
|
+
|
|
30
27
|
overflow: hidden;
|
|
31
|
-
height: 315px;
|
|
32
28
|
align-items: center;
|
|
29
|
+
|
|
30
|
+
@media (max-width: 500px) {
|
|
31
|
+
grid-gap: 10px;
|
|
32
|
+
|
|
33
|
+
grid-template-columns: repeat(1, 324px);
|
|
34
|
+
grid-template-rows: 215px 215px;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
height: 440px;
|
|
37
|
+
}
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -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
|