@dhis2/analytics 24.5.0 → 24.6.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/CHANGELOG.md CHANGED
@@ -1,9 +1,16 @@
1
- # [24.5.0](https://github.com/dhis2/analytics/compare/v24.4.2...v24.5.0) (2023-02-02)
1
+ # [24.6.0](https://github.com/dhis2/analytics/compare/v24.5.0...v24.6.0) (2023-02-13)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * use multi-calendar-dates library to generate fixed periods ([acc3801](https://github.com/dhis2/analytics/commit/acc380156092f888cfa55f70b4bade1c6516d034))
6
+ * single value background color change based upon legend (DHIS2-13702) ([#1402](https://github.com/dhis2/analytics/issues/1402)) ([ad437c6](https://github.com/dhis2/analytics/commit/ad437c6a1fcbcb71cee7b6945c6bc83ed2bc3bb3))
7
+
8
+ # [24.5.0](https://github.com/dhis2/analytics/compare/v24.4.2...v24.5.0) (2023-02-06)
9
+
10
+
11
+ ### Features
12
+
13
+ * [reverted] use multi-calendar-dates library to generate fixed periods ([acc3801](https://github.com/dhis2/analytics/commit/acc380156092f888cfa55f70b4bade1c6516d034)). This work was added to "next" release channel, but was reverted afterwards because of the restrictions "next" channel puts on what can be released from master afterwards. It will be added to "alpha" channel instead until it's ready for the main channel.
7
14
 
8
15
  ## [24.4.2](https://github.com/dhis2/analytics/compare/v24.4.1...v24.4.2) (2023-01-25)
9
16
 
@@ -7,10 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _style = _interopRequireDefault(require("styled-jsx/style"));
9
9
 
10
- var _appRuntime = require("@dhis2/app-runtime");
11
-
12
- var _multiCalendarDates = require("@dhis2/multi-calendar-dates");
13
-
14
10
  var _ui = require("@dhis2/ui");
15
11
 
16
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -53,17 +49,9 @@ const PeriodTransfer = _ref => {
53
49
  rightFooter,
54
50
  excludedPeriodTypes
55
51
  } = _ref;
56
- const {
57
- systemInfo = {}
58
- } = (0, _appRuntime.useConfig)();
59
- const {
60
- calendar = 'gregory'
61
- } = systemInfo;
62
52
  const defaultRelativePeriodType = excludedPeriodTypes.includes(_index2.MONTHLY) ? (0, _relativePeriods.getRelativePeriodsOptionsById)(_index2.QUARTERLY) : (0, _relativePeriods.getRelativePeriodsOptionsById)(_index2.MONTHLY);
63
- const defaultFixedPeriodType = excludedPeriodTypes.includes(_index2.MONTHLY) ? (0, _fixedPeriods.getFixedPeriodsOptionsById)(_index2.QUARTERLY, calendar) : (0, _fixedPeriods.getFixedPeriodsOptionsById)(_index2.MONTHLY, calendar); // use ".eraYear" rather than ".year" because in Ethiopian calendar, eraYear is what our users expect to see (for other calendars, it doesn't matter)
64
- // there is still a pending decision in Temporal regarding which era to use by default: https://github.com/js-temporal/temporal-polyfill/blob/9350ee7dd0d29f329fc097debf923a517c32f813/lib/calendar.ts#L1964
65
-
66
- const defaultFixedPeriodYear = (0, _multiCalendarDates.getNowInCalendar)(calendar).eraYear;
53
+ const defaultFixedPeriodType = excludedPeriodTypes.includes(_index2.MONTHLY) ? (0, _fixedPeriods.getFixedPeriodsOptionsById)(_index2.QUARTERLY) : (0, _fixedPeriods.getFixedPeriodsOptionsById)(_index2.MONTHLY);
54
+ const defaultFixedPeriodYear = new Date().getFullYear();
67
55
 
68
56
  const fixedPeriodConfig = year => ({
69
57
  offset: year - defaultFixedPeriodYear,
@@ -85,7 +73,7 @@ const PeriodTransfer = _ref => {
85
73
  const onIsRelativeClick = state => {
86
74
  if (state !== isRelative) {
87
75
  setIsRelative(state);
88
- setAllPeriods(state ? (0, _relativePeriods.getRelativePeriodsOptionsById)(relativeFilter.periodType).getPeriods() : (0, _fixedPeriods.getFixedPeriodsOptionsById)(fixedFilter.periodType, calendar).getPeriods(fixedPeriodConfig(Number(fixedFilter.year))));
76
+ setAllPeriods(state ? (0, _relativePeriods.getRelativePeriodsOptionsById)(relativeFilter.periodType).getPeriods() : (0, _fixedPeriods.getFixedPeriodsOptionsById)(fixedFilter.periodType).getPeriods(fixedPeriodConfig(Number(fixedFilter.year))));
89
77
  }
90
78
  };
91
79
 
@@ -138,7 +126,7 @@ const PeriodTransfer = _ref => {
138
126
 
139
127
  const onSelectFixedPeriods = filter => {
140
128
  setFixedFilter(filter);
141
- setAllPeriods((0, _fixedPeriods.getFixedPeriodsOptionsById)(filter.periodType, calendar).getPeriods(fixedPeriodConfig(Number(filter.year)), calendar));
129
+ setAllPeriods((0, _fixedPeriods.getFixedPeriodsOptionsById)(filter.periodType).getPeriods(fixedPeriodConfig(Number(filter.year))));
142
130
  };
143
131
 
144
132
  const renderEmptySelection = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", {