@widergy/utilitygo-smart-bill-web 2.0.2 → 2.1.1
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/CHANGELOG.md +20 -0
- package/dist/components/BillCalculation/components/Glossary/index.js +1 -4
- package/dist/components/BillCalculation/index.js +1 -1
- package/dist/components/BillCalculation/styles.module.scss +1 -1
- package/dist/components/BillCalculation/utils.js +2 -2
- package/dist/components/BillSummary/index.js +4 -4
- package/dist/components/ConsumptionComparison/index.js +3 -2
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +3 -8
- package/dist/components/MainBillData/components/BillAlert/index.js +9 -5
- package/dist/components/Period/index.js +7 -7
- package/dist/components/RateAndCategory/index.js +1 -1
- package/dist/shared/constants/aliases.js +509 -514
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [2.1.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v2.1.0...v2.1.1) (2023-06-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* delete auto-assign config ([f9501d3](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/f9501d3f6e7bc8fcc6b977d6ba68688786796e73))
|
|
7
|
+
* update energybot config ([e56852e](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/e56852e67e772a89aaeb39cb6a13f8774884a99d))
|
|
8
|
+
|
|
9
|
+
# [2.1.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v2.0.2...v2.1.0) (2023-05-19)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* small fixes ([7d68c4a](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/7d68c4a01c14148f2ce3cb510b3089a5c7eaac7d))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* standardizes smart bill flow ([d07a26f](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/d07a26f1cc03a0dbe72239db7fa9cc0d732727da))
|
|
20
|
+
|
|
1
21
|
## [2.0.2](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v2.0.1...v2.0.2) (2023-03-10)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -84,10 +84,7 @@ var Glossary = function Glossary(_ref) {
|
|
|
84
84
|
onClick: function onClick() {
|
|
85
85
|
return setOpen(true);
|
|
86
86
|
},
|
|
87
|
-
className: _stylesModule.default.desktopContainer
|
|
88
|
-
style: {
|
|
89
|
-
textDecorationColor: colors.secondary
|
|
90
|
-
}
|
|
87
|
+
className: _stylesModule.default.desktopContainer
|
|
91
88
|
}, /*#__PURE__*/_react.default.createElement(InfoIcon, {
|
|
92
89
|
style: {
|
|
93
90
|
fill: colors.tooltipIcon
|
|
@@ -76,7 +76,7 @@ var BillCalculation = function BillCalculation(_ref) {
|
|
|
76
76
|
}, title), isDesktopSize && /*#__PURE__*/_react.default.createElement(GlossaryRenderer, null)), detail.concepts.map(handleRenderConceptCard), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
77
|
className: "".concat(_stylesModule.default.totalAmountContainer, " ").concat(stylesConfig === null || stylesConfig === void 0 ? void 0 : stylesConfig.paymentTotal),
|
|
78
78
|
style: {
|
|
79
|
-
backgroundColor: colors.
|
|
79
|
+
backgroundColor: colors.secondary
|
|
80
80
|
}
|
|
81
81
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
82
82
|
alias: _aliases.BILL_CALC_TOTAL
|
|
@@ -22,8 +22,8 @@ var periodToTitleMapper = function periodToTitleMapper(billData, texts, periodFo
|
|
|
22
22
|
settlement = _texts$commons.settlement,
|
|
23
23
|
period = _texts$commons.period,
|
|
24
24
|
bimester = _texts$commons.bimester;
|
|
25
|
-
var
|
|
26
|
-
var issuedDateLabel = withBillCalcTitleDate ? " (".concat((0, _dayjs.default)(
|
|
25
|
+
var issuedDate = settlements === null || settlements === void 0 ? void 0 : (_settlements$current2 = settlements.current) === null || _settlements$current2 === void 0 ? void 0 : _settlements$current2.issued_on;
|
|
26
|
+
var issuedDateLabel = withBillCalcTitleDate ? " (".concat((0, _dayjs.default)(issuedDate, 'YYYY-MM-DD').format('MM/YYYY'), ")") : '';
|
|
27
27
|
if (periodFormatter) return periodFormatter({
|
|
28
28
|
startDate: settlements === null || settlements === void 0 ? void 0 : settlements.start_date,
|
|
29
29
|
endDate: settlements === null || settlements === void 0 ? void 0 : settlements.end_date
|
|
@@ -46,17 +46,17 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
46
46
|
var rate = billData === null || billData === void 0 ? void 0 : (_billData$client = billData.client) === null || _billData$client === void 0 ? void 0 : (_billData$client$rate = _billData$client.rate) === null || _billData$client$rate === void 0 ? void 0 : _billData$client$rate.purchased;
|
|
47
47
|
var category = billData === null || billData === void 0 ? void 0 : (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : (_billData$client2$rat = _billData$client2.rate) === null || _billData$client2$rat === void 0 ? void 0 : _billData$client2$rat.category;
|
|
48
48
|
var multipleSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
|
|
49
|
-
var
|
|
49
|
+
var issuedDate = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle2 = currentPeriod.settlements) === null || _currentPeriod$settle2 === void 0 ? void 0 : (_currentPeriod$settle3 = _currentPeriod$settle2.current) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.issued_on;
|
|
50
50
|
var _useScreenSize = (0, _hooks.useScreenSize)(),
|
|
51
51
|
isDesktopSize = _useScreenSize.isDesktopSize;
|
|
52
|
-
var withBanner =
|
|
52
|
+
var withBanner = showBillSummaryBanner(billData);
|
|
53
53
|
var RenderPeriod = function RenderPeriod() {
|
|
54
54
|
return /*#__PURE__*/_react.default.createElement(_Period.default, {
|
|
55
55
|
billData: billData,
|
|
56
56
|
alias: _aliases.SUMMARY_PERIOD,
|
|
57
57
|
currentPeriod: currentPeriod,
|
|
58
58
|
multipleSettlements: multipleSettlements,
|
|
59
|
-
|
|
59
|
+
issuedDate: issuedDate
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
var RenderConsumptionEnergyDetails = function RenderConsumptionEnergyDetails() {
|
|
@@ -75,7 +75,7 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
75
75
|
classes: {
|
|
76
76
|
container: _stylesModule.default.rateContainer,
|
|
77
77
|
purchasedRate: _stylesModule.default.purchasedRate,
|
|
78
|
-
category:
|
|
78
|
+
category: _stylesModule.default.category
|
|
79
79
|
},
|
|
80
80
|
showCategory: showCategory(billData)
|
|
81
81
|
});
|
|
@@ -37,11 +37,12 @@ var ConsumptionComparison = function ConsumptionComparison(_ref) {
|
|
|
37
37
|
config = contextApiInfo.config,
|
|
38
38
|
assets = contextApiInfo.assets;
|
|
39
39
|
var consumptionSimulatorFromBanner = config.externalLinks.consumptionSimulatorFromBanner;
|
|
40
|
+
var showConsumptionComparisonBanner = config.validations.showConsumptionComparisonBanner;
|
|
40
41
|
var texts = config.texts;
|
|
41
42
|
var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
42
43
|
var SimulatorBannerIcon = assets.SimulatorBannerIcon,
|
|
43
44
|
SimulatorBannerResponsiveIcon = assets.SimulatorBannerResponsiveIcon;
|
|
44
|
-
var withBanner =
|
|
45
|
+
var withBanner = showConsumptionComparisonBanner(billData);
|
|
45
46
|
var _useState = (0, _react.useState)((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint)),
|
|
46
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
48
|
isDesktopSize = _useState2[0],
|
|
@@ -82,7 +83,7 @@ var ConsumptionComparison = function ConsumptionComparison(_ref) {
|
|
|
82
83
|
}, /*#__PURE__*/_react.default.createElement(ComparisonTableRender, null)) : /*#__PURE__*/_react.default.createElement(ComparisonTableRender, null)), (savingsPercentage === 0 || savingsPercentage) && /*#__PURE__*/_react.default.createElement(_PercentageComparison.default, {
|
|
83
84
|
savingsPercentage: savingsPercentage,
|
|
84
85
|
multipleSettlements: multipleSettlements
|
|
85
|
-
})),
|
|
86
|
+
})), withBanner ? /*#__PURE__*/_react.default.createElement(_Banner.default, {
|
|
86
87
|
image: isDesktopSize ? SimulatorBannerIcon : SimulatorBannerResponsiveIcon,
|
|
87
88
|
styleBanner: _stylesModule.default.ConsumptionBannerIcon,
|
|
88
89
|
externalLink: consumptionSimulatorFromBanner
|
|
@@ -13,11 +13,9 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
var BillParticularConditions = function BillParticularConditions(_ref) {
|
|
15
15
|
var contextApiInfo = _ref.contextApiInfo,
|
|
16
|
-
particularConditions = _ref.particularConditions
|
|
17
|
-
onAcceptPress = _ref.onAcceptPress;
|
|
16
|
+
particularConditions = _ref.particularConditions;
|
|
18
17
|
var assets = contextApiInfo.assets,
|
|
19
18
|
config = contextApiInfo.config,
|
|
20
|
-
Button = contextApiInfo.Button,
|
|
21
19
|
Label = contextApiInfo.Label;
|
|
22
20
|
var texts = config.texts;
|
|
23
21
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -38,14 +36,11 @@ var BillParticularConditions = function BillParticularConditions(_ref) {
|
|
|
38
36
|
key: particularCondition,
|
|
39
37
|
className: _stylesModule.default.item
|
|
40
38
|
}, "* ".concat(particularCondition));
|
|
41
|
-
}))
|
|
42
|
-
onClick: onAcceptPress
|
|
43
|
-
}, texts.commons.accept));
|
|
39
|
+
})));
|
|
44
40
|
};
|
|
45
41
|
BillParticularConditions.propTypes = {
|
|
46
42
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
47
|
-
particularConditions: (0, _propTypes.arrayOf)(_propTypes.string)
|
|
48
|
-
onAcceptPress: _propTypes.func
|
|
43
|
+
particularConditions: (0, _propTypes.arrayOf)(_propTypes.string)
|
|
49
44
|
};
|
|
50
45
|
var _default = (0, _WithContextApi.default)()(BillParticularConditions);
|
|
51
46
|
exports.default = _default;
|
|
@@ -46,13 +46,17 @@ var BillAlert = function BillAlert(_ref) {
|
|
|
46
46
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
47
|
className: "".concat(_stylesModule.default.container, " ").concat(billAlertContainer)
|
|
48
48
|
}, /*#__PURE__*/_react.default.createElement(Dialog, {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
acceptButton: {
|
|
50
|
+
onClick: handleCloseDialog,
|
|
51
|
+
text: texts.commons.accept
|
|
52
|
+
},
|
|
53
53
|
classes: {
|
|
54
54
|
container: _stylesModule.default.dialogContainer
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
isOpen: dialogOpened,
|
|
57
|
+
onRequestClose: handleCloseDialog,
|
|
58
|
+
title: " ",
|
|
59
|
+
withCloseButton: true
|
|
56
60
|
}, /*#__PURE__*/_react.default.createElement(_BillParticularConditions.default, {
|
|
57
61
|
particularConditions: particularConditions,
|
|
58
62
|
onAcceptPress: handleCloseDialog
|
|
@@ -27,7 +27,7 @@ var Period = function Period(_ref) {
|
|
|
27
27
|
billData = _ref.billData,
|
|
28
28
|
currentPeriod = _ref.currentPeriod,
|
|
29
29
|
multipleSettlements = _ref.multipleSettlements,
|
|
30
|
-
|
|
30
|
+
issuedDate = _ref.issuedDate,
|
|
31
31
|
alias = _ref.alias;
|
|
32
32
|
var assets = contextApiInfo.assets,
|
|
33
33
|
config = contextApiInfo.config,
|
|
@@ -58,7 +58,7 @@ var Period = function Period(_ref) {
|
|
|
58
58
|
var endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
|
|
59
59
|
var periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
|
|
60
60
|
var settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
|
|
61
|
-
var issuedDateLabel = "".concat((0, _dayjs.default)(
|
|
61
|
+
var issuedDateLabel = "".concat((0, _dayjs.default)(issuedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
|
|
62
62
|
var issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
63
|
className: _stylesModule.default.issueDateContainer
|
|
64
64
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -70,7 +70,7 @@ var Period = function Period(_ref) {
|
|
|
70
70
|
var yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
|
|
71
71
|
var bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
|
|
72
72
|
return periodFormatter ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
-
className:
|
|
73
|
+
className: issuedDate ? _stylesModule.default.withIssuedDateContainer : _stylesModule.default.withOutIssuedDateContainer
|
|
74
74
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
75
|
className: _stylesModule.default.periodHeader
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -79,19 +79,19 @@ var Period = function Period(_ref) {
|
|
|
79
79
|
}, periodFormatter({
|
|
80
80
|
startDate: settlements === null || settlements === void 0 ? void 0 : settlements.start_date,
|
|
81
81
|
endDate: settlements === null || settlements === void 0 ? void 0 : settlements.end_date
|
|
82
|
-
})), !
|
|
82
|
+
})), !issuedDate && /*#__PURE__*/_react.default.createElement(Tooltip, {
|
|
83
83
|
content: texts.mainBillData.periodTooltip
|
|
84
84
|
}, /*#__PURE__*/_react.default.createElement(assets.QuestionsIcon, {
|
|
85
85
|
style: {
|
|
86
86
|
fill: colors.tooltipIcon
|
|
87
87
|
}
|
|
88
|
-
}))),
|
|
88
|
+
}))), issuedDate && /*#__PURE__*/_react.default.createElement("div", {
|
|
89
89
|
className: _stylesModule.default.issuedOnDateAndLabel
|
|
90
90
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
91
91
|
alias: _aliases.DETAIL
|
|
92
92
|
}, "".concat(issuedOnDate, ":")), /*#__PURE__*/_react.default.createElement(Label, {
|
|
93
93
|
alias: _aliases.ISSUED_DATE
|
|
94
|
-
}, issuedDateLabel)))) :
|
|
94
|
+
}, issuedDateLabel)))) : issuedDate ? /*#__PURE__*/_react.default.createElement("div", {
|
|
95
95
|
className: _stylesModule.default.withIssuedDateContainer
|
|
96
96
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
97
97
|
className: _stylesModule.default.header
|
|
@@ -145,7 +145,7 @@ Period.propTypes = {
|
|
|
145
145
|
billData: _billDataTypes.billDataTypes,
|
|
146
146
|
currentPeriod: _billDataTypes.periodTypes,
|
|
147
147
|
multipleSettlements: _propTypes.bool,
|
|
148
|
-
|
|
148
|
+
issuedDate: _propTypes.string,
|
|
149
149
|
alias: _propTypes.string
|
|
150
150
|
};
|
|
151
151
|
var _default = (0, _WithContextApi.default)()(Period);
|
|
@@ -42,7 +42,7 @@ var RatePrices = function RatePrices(_ref) {
|
|
|
42
42
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
43
43
|
}, showCategory ? /*#__PURE__*/_react.default.createElement("div", {
|
|
44
44
|
className: _stylesModule.default.multipleSettlementsContainer
|
|
45
|
-
}, /*#__PURE__*/_react.default.createElement(Title, null), /*#__PURE__*/_react.default.createElement(Category, null)) : /*#__PURE__*/_react.default.createElement(
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(Title, null), /*#__PURE__*/_react.default.createElement(Category, null)) : /*#__PURE__*/_react.default.createElement(Title, null), /*#__PURE__*/_react.default.createElement(Label, {
|
|
46
46
|
alias: _aliases.RATE,
|
|
47
47
|
className: "".concat(_stylesModule.default.purchasedRate, " ").concat(classes.purchasedRate)
|
|
48
48
|
}, (0, _utils.stringOrDash)(rate)));
|