@dhis2/analytics 29.2.0 → 29.3.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/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -10
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +3 -1
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +15 -5
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +110 -14
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +4 -6
- package/build/cjs/components/PeriodDimension/__tests__/PeriodDimension.spec.js +19 -6
- package/build/cjs/components/PeriodDimension/__tests__/fixedPeriods.spec.js +1 -1
- package/build/cjs/components/PeriodDimension/__tests__/utils.spec.js +1 -1
- package/build/cjs/components/PeriodDimension/useDataOutputPeriodTypes.js +153 -0
- package/build/cjs/components/PeriodDimension/utils/enabledPeriodTypes.js +179 -0
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +24 -42
- package/build/cjs/components/PeriodDimension/utils/index.js +7 -4
- package/build/cjs/index.js +8 -0
- package/build/cjs/locales/en/translations.json +8 -3
- package/build/cjs/locales/fr/translations.json +20 -20
- package/build/cjs/visualizations/util/getFilterText.js +1 -1
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -10
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +4 -2
- package/build/es/components/PeriodDimension/PeriodDimension.js +15 -5
- package/build/es/components/PeriodDimension/PeriodTransfer.js +115 -19
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +4 -6
- package/build/es/components/PeriodDimension/__tests__/PeriodDimension.spec.js +19 -6
- package/build/es/components/PeriodDimension/__tests__/fixedPeriods.spec.js +1 -1
- package/build/es/components/PeriodDimension/__tests__/utils.spec.js +1 -1
- package/build/es/components/PeriodDimension/useDataOutputPeriodTypes.js +147 -0
- package/build/es/components/PeriodDimension/utils/enabledPeriodTypes.js +168 -0
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +25 -43
- package/build/es/components/PeriodDimension/utils/index.js +6 -3
- package/build/es/index.js +1 -0
- package/build/es/locales/en/translations.json +8 -3
- package/build/es/locales/fr/translations.json +20 -20
- package/build/es/visualizations/util/getFilterText.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.filterEnabledRelativePeriodTypes = exports.filterEnabledFixedPeriodTypes = exports.applyPeriodNameOverrides = exports.applyFixedPeriodTypeDisplayLabels = exports.applyDisplayLabelOverrides = exports.SERVER_PT_TO_MULTI_CALENDAR_PT = exports.RP_CATEGORY_TO_FP_DEPENDENCIES = void 0;
|
|
7
|
+
// Mapping from server period type names to multi-calendar-dates constants
|
|
8
|
+
const SERVER_PT_TO_MULTI_CALENDAR_PT = exports.SERVER_PT_TO_MULTI_CALENDAR_PT = {
|
|
9
|
+
Daily: 'DAILY',
|
|
10
|
+
Weekly: 'WEEKLY',
|
|
11
|
+
WeeklyWednesday: 'WEEKLYWED',
|
|
12
|
+
WeeklyThursday: 'WEEKLYTHU',
|
|
13
|
+
WeeklyFriday: 'WEEKLYFRI',
|
|
14
|
+
WeeklySaturday: 'WEEKLYSAT',
|
|
15
|
+
WeeklySunday: 'WEEKLYSUN',
|
|
16
|
+
BiWeekly: 'BIWEEKLY',
|
|
17
|
+
Monthly: 'MONTHLY',
|
|
18
|
+
BiMonthly: 'BIMONTHLY',
|
|
19
|
+
Quarterly: 'QUARTERLY',
|
|
20
|
+
QuarterlyNov: 'QUARTERLYNOV',
|
|
21
|
+
SixMonthly: 'SIXMONTHLY',
|
|
22
|
+
SixMonthlyApril: 'SIXMONTHLYAPR',
|
|
23
|
+
SixMonthlyNov: 'SIXMONTHLYNOV',
|
|
24
|
+
Yearly: 'YEARLY',
|
|
25
|
+
FinancialFeb: 'FYFEB',
|
|
26
|
+
FinancialApril: 'FYAPR',
|
|
27
|
+
FinancialJuly: 'FYJUL',
|
|
28
|
+
FinancialAug: 'FYAUG',
|
|
29
|
+
FinancialSep: 'FYSEP',
|
|
30
|
+
FinancialOct: 'FYOCT',
|
|
31
|
+
FinancialNov: 'FYNOV'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Mapping from relative period categories to their corresponding fixed period types
|
|
35
|
+
const RP_CATEGORY_TO_FP_DEPENDENCIES = exports.RP_CATEGORY_TO_FP_DEPENDENCIES = {
|
|
36
|
+
DAILY: ['Daily'],
|
|
37
|
+
WEEKLY: ['Weekly', 'WeeklyWednesday', 'WeeklyThursday', 'WeeklyFriday', 'WeeklySaturday', 'WeeklySunday'],
|
|
38
|
+
BIWEEKLY: ['BiWeekly'],
|
|
39
|
+
MONTHLY: ['Monthly'],
|
|
40
|
+
BIMONTHLY: ['BiMonthly'],
|
|
41
|
+
QUARTERLY: ['Quarterly', 'QuarterlyNov'],
|
|
42
|
+
SIXMONTHLY: ['SixMonthly', 'SixMonthlyApril', 'SixMonthlyNov'],
|
|
43
|
+
YEARLY: ['Yearly']
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Filter fixed period types based on enabled server period types
|
|
48
|
+
* @param {Array} allFixedPeriodOptions - All available fixed period options
|
|
49
|
+
* @param {Array} enabledServerPeriodTypes - Enabled period types from server
|
|
50
|
+
* @returns {Array} Filtered fixed period options
|
|
51
|
+
*/
|
|
52
|
+
const filterEnabledFixedPeriodTypes = (allFixedPeriodOptions, enabledServerPeriodTypes) => {
|
|
53
|
+
if (!enabledServerPeriodTypes || enabledServerPeriodTypes.length === 0) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
const enabledServerPtNames = new Set(enabledServerPeriodTypes.map(pt => pt.name));
|
|
57
|
+
const enabledMultiCalendarPts = new Set();
|
|
58
|
+
|
|
59
|
+
// Map server PT names to multi-calendar-dates constants
|
|
60
|
+
enabledServerPtNames.forEach(serverPtName => {
|
|
61
|
+
const multiCalendarPt = SERVER_PT_TO_MULTI_CALENDAR_PT[serverPtName];
|
|
62
|
+
if (multiCalendarPt) {
|
|
63
|
+
enabledMultiCalendarPts.add(multiCalendarPt);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Filter fixed period options to only include enabled ones
|
|
68
|
+
return allFixedPeriodOptions.filter(option => enabledMultiCalendarPts.has(option.id));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Apply displayLabel overrides to fixed period type names
|
|
73
|
+
* v43-only: in v44 the API provides these names directly
|
|
74
|
+
*/
|
|
75
|
+
exports.filterEnabledFixedPeriodTypes = filterEnabledFixedPeriodTypes;
|
|
76
|
+
const applyFixedPeriodTypeDisplayLabels = (filteredFixedOptions, enabledServerPeriodTypes) => {
|
|
77
|
+
if (!enabledServerPeriodTypes) {
|
|
78
|
+
return filteredFixedOptions;
|
|
79
|
+
}
|
|
80
|
+
const displayLabelMap = new Map();
|
|
81
|
+
enabledServerPeriodTypes.forEach(pt => {
|
|
82
|
+
if (pt.displayLabel) {
|
|
83
|
+
const multiCalendarPt = SERVER_PT_TO_MULTI_CALENDAR_PT[pt.name];
|
|
84
|
+
if (multiCalendarPt) {
|
|
85
|
+
displayLabelMap.set(multiCalendarPt, pt.displayLabel);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
if (displayLabelMap.size === 0) {
|
|
90
|
+
return filteredFixedOptions;
|
|
91
|
+
}
|
|
92
|
+
return filteredFixedOptions.map(option => {
|
|
93
|
+
const displayLabel = displayLabelMap.get(option.id);
|
|
94
|
+
return displayLabel ? {
|
|
95
|
+
...option,
|
|
96
|
+
name: displayLabel
|
|
97
|
+
} : option;
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Filter relative period categories based on enabled server period types
|
|
103
|
+
* @param {Array} allRelativePeriodOptions - All available relative period options
|
|
104
|
+
* @param {Array} enabledServerPeriodTypes - Enabled period types from server
|
|
105
|
+
* @param {string|null} financialYearStart - Financial year start setting (if enabled)
|
|
106
|
+
* @returns {Array} Filtered relative period options
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* Apply metaData name overrides to a list of periods
|
|
110
|
+
* v43-only: in v44 the API provides these names directly
|
|
111
|
+
*/
|
|
112
|
+
exports.applyFixedPeriodTypeDisplayLabels = applyFixedPeriodTypeDisplayLabels;
|
|
113
|
+
const applyPeriodNameOverrides = (periods, metaData) => {
|
|
114
|
+
if (!metaData) {
|
|
115
|
+
return periods;
|
|
116
|
+
}
|
|
117
|
+
return periods.map(period => metaData[period.id] ? {
|
|
118
|
+
...period,
|
|
119
|
+
name: metaData[period.id].name
|
|
120
|
+
} : period);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Apply display label overrides to relative period options
|
|
125
|
+
* v43-only: in v44 the API provides these names directly
|
|
126
|
+
*/
|
|
127
|
+
exports.applyPeriodNameOverrides = applyPeriodNameOverrides;
|
|
128
|
+
const applyDisplayLabelOverrides = (filteredRelativeOptions, {
|
|
129
|
+
financialYearDisplayLabel,
|
|
130
|
+
weeklyDisplayLabel,
|
|
131
|
+
metaData
|
|
132
|
+
}) => {
|
|
133
|
+
const overrides = {};
|
|
134
|
+
if (financialYearDisplayLabel) {
|
|
135
|
+
overrides['FINANCIAL'] = {
|
|
136
|
+
name: financialYearDisplayLabel
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (weeklyDisplayLabel) {
|
|
140
|
+
overrides['WEEKLY'] = {
|
|
141
|
+
name: weeklyDisplayLabel
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
if (Object.keys(overrides).length === 0) {
|
|
145
|
+
return filteredRelativeOptions;
|
|
146
|
+
}
|
|
147
|
+
return filteredRelativeOptions.map(option => {
|
|
148
|
+
const override = overrides[option.id];
|
|
149
|
+
if (!override) {
|
|
150
|
+
return option;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
...option,
|
|
154
|
+
name: override.name,
|
|
155
|
+
getPeriods: () => applyPeriodNameOverrides(option.getPeriods(), metaData)
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
exports.applyDisplayLabelOverrides = applyDisplayLabelOverrides;
|
|
160
|
+
const filterEnabledRelativePeriodTypes = (allRelativePeriodOptions, enabledServerPeriodTypes, financialYearStart = null) => {
|
|
161
|
+
if (!enabledServerPeriodTypes || enabledServerPeriodTypes.length === 0) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
const enabledServerPtNames = new Set(enabledServerPeriodTypes.map(pt => pt.name));
|
|
165
|
+
return allRelativePeriodOptions.filter(option => {
|
|
166
|
+
// Special handling for financial years
|
|
167
|
+
if (option.id === 'FINANCIAL') {
|
|
168
|
+
return financialYearStart !== null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Check if any of the required FP dependencies are enabled
|
|
172
|
+
const requiredFpTypes = RP_CATEGORY_TO_FP_DEPENDENCIES[option.id];
|
|
173
|
+
if (!requiredFpTypes) {
|
|
174
|
+
return true; // Show if no dependency mapping (shouldn't happen)
|
|
175
|
+
}
|
|
176
|
+
return requiredFpTypes.some(fpType => enabledServerPtNames.has(fpType));
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
exports.filterEnabledRelativePeriodTypes = filterEnabledRelativePeriodTypes;
|
|
@@ -164,40 +164,10 @@ const getYearlyPeriodType = (fnFilter, periodSettings) => {
|
|
|
164
164
|
});
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
-
const
|
|
167
|
+
const getFinancialPeriodType = (periodType, fnFilter, periodSettings) => {
|
|
168
168
|
return config => {
|
|
169
169
|
return getPeriods({
|
|
170
|
-
periodType
|
|
171
|
-
config,
|
|
172
|
-
fnFilter,
|
|
173
|
-
periodSettings
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
const getFinancialNovemberPeriodType = (fnFilter, periodSettings) => {
|
|
178
|
-
return config => {
|
|
179
|
-
return getPeriods({
|
|
180
|
-
periodType: 'FYNOV',
|
|
181
|
-
config,
|
|
182
|
-
fnFilter,
|
|
183
|
-
periodSettings
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
const getFinancialJulyPeriodType = (fnFilter, periodSettings) => {
|
|
188
|
-
return config => {
|
|
189
|
-
return getPeriods({
|
|
190
|
-
periodType: 'FYJUL',
|
|
191
|
-
config,
|
|
192
|
-
fnFilter,
|
|
193
|
-
periodSettings
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
const getFinancialAprilPeriodType = (fnFilter, periodSettings) => {
|
|
198
|
-
return config => {
|
|
199
|
-
return getPeriods({
|
|
200
|
-
periodType: 'FYAPR',
|
|
170
|
+
periodType,
|
|
201
171
|
config,
|
|
202
172
|
fnFilter,
|
|
203
173
|
periodSettings
|
|
@@ -278,21 +248,33 @@ const getOptions = periodSettings => {
|
|
|
278
248
|
getPeriods: getYearlyPeriodType(filterFuturePeriods, periodSettings),
|
|
279
249
|
name: _index.default.t('Yearly')
|
|
280
250
|
}, {
|
|
281
|
-
id: _index2.
|
|
282
|
-
getPeriods:
|
|
283
|
-
name: _index.default.t('Financial year (Start
|
|
251
|
+
id: _index2.FYFEB,
|
|
252
|
+
getPeriods: getFinancialPeriodType('FYFEB', filterFuturePeriods, periodSettings),
|
|
253
|
+
name: _index.default.t('Financial year (Start February)')
|
|
284
254
|
}, {
|
|
285
|
-
id: _index2.
|
|
286
|
-
getPeriods:
|
|
287
|
-
name: _index.default.t('Financial year (Start
|
|
255
|
+
id: _index2.FYAPR,
|
|
256
|
+
getPeriods: getFinancialPeriodType('FYAPR', filterFuturePeriods, periodSettings),
|
|
257
|
+
name: _index.default.t('Financial year (Start April)')
|
|
288
258
|
}, {
|
|
289
259
|
id: _index2.FYJUL,
|
|
290
|
-
getPeriods:
|
|
260
|
+
getPeriods: getFinancialPeriodType('FYJUL', filterFuturePeriods, periodSettings),
|
|
291
261
|
name: _index.default.t('Financial year (Start July)')
|
|
292
262
|
}, {
|
|
293
|
-
id: _index2.
|
|
294
|
-
getPeriods:
|
|
295
|
-
name: _index.default.t('Financial year (Start
|
|
263
|
+
id: _index2.FYAUG,
|
|
264
|
+
getPeriods: getFinancialPeriodType('FYAUG', filterFuturePeriods, periodSettings),
|
|
265
|
+
name: _index.default.t('Financial year (Start August)')
|
|
266
|
+
}, {
|
|
267
|
+
id: _index2.FYSEP,
|
|
268
|
+
getPeriods: getFinancialPeriodType('FYSEP', filterFuturePeriods, periodSettings),
|
|
269
|
+
name: _index.default.t('Financial year (Start September)')
|
|
270
|
+
}, {
|
|
271
|
+
id: _index2.FYOCT,
|
|
272
|
+
getPeriods: getFinancialPeriodType('FYOCT', filterFuturePeriods, periodSettings),
|
|
273
|
+
name: _index.default.t('Financial year (Start October)')
|
|
274
|
+
}, {
|
|
275
|
+
id: _index2.FYNOV,
|
|
276
|
+
getPeriods: getFinancialPeriodType('FYNOV', filterFuturePeriods, periodSettings),
|
|
277
|
+
name: _index.default.t('Financial year (Start November)')
|
|
296
278
|
}];
|
|
297
279
|
};
|
|
298
280
|
const getFixedPeriodsOptionsById = (id, periodSettings) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.filterPeriodTypesById = exports.YEARLY = exports.WEEKS_THIS_YEAR = exports.WEEKLYWED = exports.WEEKLYTHU = exports.WEEKLYSUN = exports.WEEKLYSAT = exports.WEEKLY = exports.SIXMONTHLYAPR = exports.SIXMONTHLY = exports.QUARTERLY = exports.MONTHLY = exports.FYOCT = exports.FYNOV = exports.FYJUL = exports.FYAPR = exports.FINANCIAL = exports.DAILY = exports.BIWEEKLY = exports.BIMONTHLY = void 0;
|
|
6
|
+
exports.filterPeriodTypesById = exports.YEARLY = exports.WEEKS_THIS_YEAR = exports.WEEKLYWED = exports.WEEKLYTHU = exports.WEEKLYSUN = exports.WEEKLYSAT = exports.WEEKLY = exports.SIXMONTHLYAPR = exports.SIXMONTHLY = exports.QUARTERLY = exports.MONTHLY = exports.FYSEP = exports.FYOCT = exports.FYNOV = exports.FYJUL = exports.FYFEB = exports.FYAUG = exports.FYAPR = exports.FINANCIAL = exports.DAILY = exports.BIWEEKLY = exports.BIMONTHLY = void 0;
|
|
7
7
|
const DAILY = exports.DAILY = 'DAILY';
|
|
8
8
|
const WEEKLY = exports.WEEKLY = 'WEEKLY';
|
|
9
9
|
const WEEKLYWED = exports.WEEKLYWED = 'WEEKLYWED';
|
|
@@ -19,9 +19,12 @@ const SIXMONTHLY = exports.SIXMONTHLY = 'SIXMONTHLY';
|
|
|
19
19
|
const SIXMONTHLYAPR = exports.SIXMONTHLYAPR = 'SIXMONTHLYAPR';
|
|
20
20
|
const YEARLY = exports.YEARLY = 'YEARLY';
|
|
21
21
|
const FINANCIAL = exports.FINANCIAL = 'FINANCIAL';
|
|
22
|
-
const
|
|
23
|
-
const FYOCT = exports.FYOCT = 'FYOCT';
|
|
24
|
-
const FYJUL = exports.FYJUL = 'FYJUL';
|
|
22
|
+
const FYFEB = exports.FYFEB = 'FYFEB';
|
|
25
23
|
const FYAPR = exports.FYAPR = 'FYAPR';
|
|
24
|
+
const FYJUL = exports.FYJUL = 'FYJUL';
|
|
25
|
+
const FYAUG = exports.FYAUG = 'FYAUG';
|
|
26
|
+
const FYSEP = exports.FYSEP = 'FYSEP';
|
|
27
|
+
const FYOCT = exports.FYOCT = 'FYOCT';
|
|
28
|
+
const FYNOV = exports.FYNOV = 'FYNOV';
|
|
26
29
|
const filterPeriodTypesById = (allPeriodTypes = [], excludedPeriodTypes = []) => allPeriodTypes.filter(period => !excludedPeriodTypes.includes(period.id));
|
|
27
30
|
exports.filterPeriodTypesById = filterPeriodTypesById;
|
package/build/cjs/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var _exportNames = {
|
|
|
7
7
|
DataDimension: true,
|
|
8
8
|
PeriodDimension: true,
|
|
9
9
|
FixedPeriodSelect: true,
|
|
10
|
+
useDataOutputPeriodTypes: true,
|
|
10
11
|
OrgUnitDimension: true,
|
|
11
12
|
DynamicDimension: true,
|
|
12
13
|
ALL_DYNAMIC_DIMENSION_ITEMS: true,
|
|
@@ -1912,6 +1913,12 @@ Object.defineProperty(exports, "useCachedDataQuery", {
|
|
|
1912
1913
|
return _CachedDataQueryProvider.useCachedDataQuery;
|
|
1913
1914
|
}
|
|
1914
1915
|
});
|
|
1916
|
+
Object.defineProperty(exports, "useDataOutputPeriodTypes", {
|
|
1917
|
+
enumerable: true,
|
|
1918
|
+
get: function () {
|
|
1919
|
+
return _useDataOutputPeriodTypes.useDataOutputPeriodTypes;
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1915
1922
|
Object.defineProperty(exports, "valueTypeDisplayNames", {
|
|
1916
1923
|
enumerable: true,
|
|
1917
1924
|
get: function () {
|
|
@@ -1934,6 +1941,7 @@ require("./locales/index.js");
|
|
|
1934
1941
|
var _DataDimension = _interopRequireDefault(require("./components/DataDimension/DataDimension.js"));
|
|
1935
1942
|
var _PeriodDimension = _interopRequireDefault(require("./components/PeriodDimension/PeriodDimension.js"));
|
|
1936
1943
|
var _FixedPeriodSelect = _interopRequireDefault(require("./components/PeriodDimension/FixedPeriodSelect.js"));
|
|
1944
|
+
var _useDataOutputPeriodTypes = require("./components/PeriodDimension/useDataOutputPeriodTypes.js");
|
|
1937
1945
|
var _OrgUnitDimension = _interopRequireDefault(require("./components/OrgUnitDimension/OrgUnitDimension.js"));
|
|
1938
1946
|
var _DynamicDimension = _interopRequireWildcard(require("./components/DynamicDimension/DynamicDimension.js"));
|
|
1939
1947
|
var _DimensionsPanel = _interopRequireDefault(require("./components/DimensionsPanel/DimensionsPanel.js"));
|
|
@@ -256,6 +256,8 @@
|
|
|
256
256
|
"Select year": "Select year",
|
|
257
257
|
"Period": "Period",
|
|
258
258
|
"Selected Periods": "Selected Periods",
|
|
259
|
+
"No period types available": "No period types available",
|
|
260
|
+
"No period types are enabled in the system. Please contact your system administrator.": "No period types are enabled in the system. Please contact your system administrator.",
|
|
259
261
|
"Relative periods": "Relative periods",
|
|
260
262
|
"Fixed periods": "Fixed periods",
|
|
261
263
|
"No periods selected": "No periods selected",
|
|
@@ -272,10 +274,13 @@
|
|
|
272
274
|
"Six-monthly": "Six-monthly",
|
|
273
275
|
"Six-monthly April": "Six-monthly April",
|
|
274
276
|
"Yearly": "Yearly",
|
|
275
|
-
"Financial year (Start
|
|
276
|
-
"Financial year (Start October)": "Financial year (Start October)",
|
|
277
|
-
"Financial year (Start July)": "Financial year (Start July)",
|
|
277
|
+
"Financial year (Start February)": "Financial year (Start February)",
|
|
278
278
|
"Financial year (Start April)": "Financial year (Start April)",
|
|
279
|
+
"Financial year (Start July)": "Financial year (Start July)",
|
|
280
|
+
"Financial year (Start August)": "Financial year (Start August)",
|
|
281
|
+
"Financial year (Start September)": "Financial year (Start September)",
|
|
282
|
+
"Financial year (Start October)": "Financial year (Start October)",
|
|
283
|
+
"Financial year (Start November)": "Financial year (Start November)",
|
|
279
284
|
"Today": "Today",
|
|
280
285
|
"Yesterday": "Yesterday",
|
|
281
286
|
"Last 3 days": "Last 3 days",
|
|
@@ -127,16 +127,16 @@
|
|
|
127
127
|
"Add to {{axisName}}": "Ajouter à {{axisName}} ",
|
|
128
128
|
"Not available for {{visualizationType}}": "Non disponible pour {{visualizationType}}",
|
|
129
129
|
"Remove Assigned Categories": "Supprimer les Catégories Attribuées",
|
|
130
|
-
"Add Assigned Categories": "Ajouter des
|
|
130
|
+
"Add Assigned Categories": "Ajouter des catégories attribuées",
|
|
131
131
|
"Remove": "Supprimer",
|
|
132
|
-
"Filter dimensions": "
|
|
132
|
+
"Filter dimensions": "Filtrer les dimensions",
|
|
133
133
|
"Main dimensions": "Dimensions principales",
|
|
134
134
|
"Your dimensions": "Vos dimensions",
|
|
135
135
|
"Dimension recommended with selected data": "Dimension recommandée avec les données sélectionnées",
|
|
136
136
|
"All items": "Tous les items",
|
|
137
|
-
"Automatically include all items": "Inclure tous les
|
|
138
|
-
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "Sélectionner tous {{- dimensionTitle}}les
|
|
139
|
-
"Manually select items...": "Sélection
|
|
137
|
+
"Automatically include all items": "Inclure tous les items automatiquement",
|
|
138
|
+
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "Sélectionner tous {{- dimensionTitle}}les items. Avec cette option, les nouveaux items ajoutés à l'avenir seront automatiquement inclus.",
|
|
139
|
+
"Manually select items...": "Sélection manuelle des items...",
|
|
140
140
|
"Nothing found in {{- dimensionTitle}}": "Rien n'a été trouvé dans {{- dimensionTitle}}",
|
|
141
141
|
"Search": "Chercher",
|
|
142
142
|
"Delete {{fileType}}": "Supprimer {{fileType}}",
|
|
@@ -165,14 +165,14 @@
|
|
|
165
165
|
"visualization": "visualisation",
|
|
166
166
|
"Untitled {{visualizationType}}, {{date}}": "Sans titre {{visualizationType}}, {{date}}",
|
|
167
167
|
"Back to all interpretations": "Retour à toutes les interprétations",
|
|
168
|
-
"Could not load interpretation details": "",
|
|
169
|
-
"The request to fetch interpretation comments failed": "",
|
|
168
|
+
"Could not load interpretation details": "Impossible de charger les détails de l'interprétation",
|
|
169
|
+
"The request to fetch interpretation comments failed": "La requête pour récupérer les commentaires d'interprétation a échoué.",
|
|
170
170
|
"Edit": "Modifier",
|
|
171
171
|
"Write a reply": "Ecrire une réponse",
|
|
172
|
-
"Could not post reply": "",
|
|
172
|
+
"Could not post reply": "Impossible de publier les réponses",
|
|
173
173
|
"Post reply": "Publier une réponse",
|
|
174
|
-
"Could not delete comment": "",
|
|
175
|
-
"Could not update comment": "
|
|
174
|
+
"Could not delete comment": "Impossible de supprimer le commentaire",
|
|
175
|
+
"Could not update comment": "Impossible d'actualiser le commentaire",
|
|
176
176
|
"Enter comment text": "Saisir le texte du commentaire",
|
|
177
177
|
"Update": "Mettre à jour",
|
|
178
178
|
"Viewing interpretation: {{- visualisationName}}": "Affichage de l'interprétation : {{- visualisationName}}",
|
|
@@ -180,12 +180,12 @@
|
|
|
180
180
|
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "L'interprétation n'a pas pu être affichée. Veuillez réessayer ou contacter votre administrateur système.",
|
|
181
181
|
"Hide interpretation": "Masquer l'interprétation",
|
|
182
182
|
"Write an interpretation": "Ecrire une interprétation",
|
|
183
|
-
"Could not post interpretation": "",
|
|
183
|
+
"Could not post interpretation": "Impossible de publier l'interprétation",
|
|
184
184
|
"Other people viewing this interpretation in the future may see more data.": "Les personnes qui consulteront cette interprétation à l'avenir pourront voir un plus grand nombre de données.",
|
|
185
185
|
"Post interpretation": "Publier une interprétation",
|
|
186
186
|
"Interpretations": "Interprétations",
|
|
187
|
-
"Error loading interpretations": "",
|
|
188
|
-
"Could not load interpretations": "",
|
|
187
|
+
"Error loading interpretations": "Erreur lors du chargement des interprétations",
|
|
188
|
+
"Could not load interpretations": "Impossible de charger les interprétations",
|
|
189
189
|
"Reply": "Répondre",
|
|
190
190
|
"{{count}} replies": "{{count}} réponses",
|
|
191
191
|
"{{count}} replies_plural": "{{count}} réponses",
|
|
@@ -195,10 +195,10 @@
|
|
|
195
195
|
"See interpretation": "Afficher l'interprétation",
|
|
196
196
|
"Open in app": "Ouvrir dans l'application",
|
|
197
197
|
"Share": "Partager",
|
|
198
|
-
"Could not delete interpretation": "",
|
|
198
|
+
"Could not delete interpretation": "Impossible de supprimer l'interprétation",
|
|
199
199
|
"Manage sharing": "Gérer le partage",
|
|
200
|
-
"Could not update interpretation text": "",
|
|
201
|
-
"Could not update interpretation": "
|
|
200
|
+
"Could not update interpretation text": "Impossible d'actualiser le texte de l'interprétation",
|
|
201
|
+
"Could not update interpretation": "Impossible d'actualiser l'interprétation",
|
|
202
202
|
"Enter interpretation text": "Saisir le texte de l'interprétation",
|
|
203
203
|
"Not available offline": "Non disponible hors ligne",
|
|
204
204
|
"Anyone": "Toute personne",
|
|
@@ -213,8 +213,8 @@
|
|
|
213
213
|
"Open": "Ouvrir",
|
|
214
214
|
"Couldn't load items": "Impossible de charger les éléments",
|
|
215
215
|
"There was a problem loading items. Try again or contact your system administrator.": "Un problème est survenu lors du chargement des éléments. Veuillez réessayer ou contacter votre administrateur système.",
|
|
216
|
-
"No items found. Create a new to get started.": "Aucun
|
|
217
|
-
"No items found. Try adjusting your search or filter options to find what you're looking for.": "Aucun
|
|
216
|
+
"No items found. Create a new to get started.": "Aucun items trouvé. Créez en un nouveau pour commencer.",
|
|
217
|
+
"No items found. Try adjusting your search or filter options to find what you're looking for.": "Aucun items trouvé. Essayez d'ajuster vos options de recherche ou de filtrage pour trouver ce que vous cherchez.",
|
|
218
218
|
"Create new": "Créer nouveau",
|
|
219
219
|
"Open a visualization": "Ouvrir une visualisation",
|
|
220
220
|
"Loading visualizations": "Télécharger des visualisations",
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
"Empty parentheses": "Parenthèses vides",
|
|
390
390
|
"Missing right parenthesis )": "Parenthèse droite manquante )",
|
|
391
391
|
"Missing left parenthesis (": "Parenthèse gauche manquante (",
|
|
392
|
-
"Extra Small": "
|
|
392
|
+
"Extra Small": "Très petit",
|
|
393
393
|
"Small": "Petit",
|
|
394
394
|
"Regular": "Normal",
|
|
395
395
|
"Large": "Grand",
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
"Line": "Ligne",
|
|
458
458
|
"Line list": "Liste des lignes",
|
|
459
459
|
"Year over year (line)": "Année après année (ligne)",
|
|
460
|
-
"Pie": "
|
|
460
|
+
"Pie": "Camembert",
|
|
461
461
|
"Radar": "Radar",
|
|
462
462
|
"Scatter": "Dispersion",
|
|
463
463
|
"Single value": "Valeur unique",
|
|
@@ -28,7 +28,7 @@ function _default(filters, metaData) {
|
|
|
28
28
|
const relativePeriodNames = (0, _relativePeriods.getRelativePeriodsName)();
|
|
29
29
|
titleFragments.push((0, _dimensionGetItemIds.dimensionGetItemIds)(filter).map(id => {
|
|
30
30
|
var _metaData$items$id;
|
|
31
|
-
return
|
|
31
|
+
return ((_metaData$items$id = metaData.items[id]) === null || _metaData$items$id === void 0 ? void 0 : _metaData$items$id.name) || relativePeriodNames[id] || id;
|
|
32
32
|
}).join(', '));
|
|
33
33
|
} else {
|
|
34
34
|
const filterItems = metaData.dimensions[filter.dimension];
|
|
@@ -4,19 +4,15 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import i18n from '../../locales/index.js';
|
|
6
6
|
import styles from './styles/PeriodFilter.style.js';
|
|
7
|
-
import { getFixedPeriodsOptions } from './utils/fixedPeriods.js';
|
|
8
|
-
import { filterPeriodTypesById } from './utils/index.js';
|
|
9
|
-
const EXCLUDED_PERIOD_TYPES_PROP_DEFAULT = [];
|
|
10
7
|
const FixedPeriodFilter = ({
|
|
11
|
-
|
|
12
|
-
excludedPeriodTypes = EXCLUDED_PERIOD_TYPES_PROP_DEFAULT,
|
|
8
|
+
availableOptions,
|
|
13
9
|
currentPeriodType,
|
|
14
10
|
currentYear,
|
|
15
11
|
onSelectPeriodType,
|
|
16
12
|
onSelectYear,
|
|
17
13
|
dataTest
|
|
18
14
|
}) => {
|
|
19
|
-
const onlyAllowedTypeIsSelected =
|
|
15
|
+
const onlyAllowedTypeIsSelected = availableOptions.length === 1 && availableOptions[0].id === currentPeriodType;
|
|
20
16
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
21
17
|
"data-test": dataTest,
|
|
22
18
|
className: `jsx-${styles.__hash}` + " " + "leftSection"
|
|
@@ -30,7 +26,7 @@ const FixedPeriodFilter = ({
|
|
|
30
26
|
disabled: onlyAllowedTypeIsSelected,
|
|
31
27
|
className: "filterElement",
|
|
32
28
|
dataTest: `${dataTest}-period-type`
|
|
33
|
-
},
|
|
29
|
+
}, availableOptions.map(option => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
34
30
|
key: option.id,
|
|
35
31
|
value: option.id,
|
|
36
32
|
label: option.name,
|
|
@@ -53,12 +49,11 @@ const FixedPeriodFilter = ({
|
|
|
53
49
|
}, styles));
|
|
54
50
|
};
|
|
55
51
|
FixedPeriodFilter.propTypes = {
|
|
52
|
+
availableOptions: PropTypes.array.isRequired,
|
|
56
53
|
currentPeriodType: PropTypes.string.isRequired,
|
|
57
54
|
currentYear: PropTypes.string.isRequired,
|
|
58
55
|
onSelectPeriodType: PropTypes.func.isRequired,
|
|
59
56
|
onSelectYear: PropTypes.func.isRequired,
|
|
60
|
-
|
|
61
|
-
dataTest: PropTypes.string,
|
|
62
|
-
excludedPeriodTypes: PropTypes.arrayOf(PropTypes.string)
|
|
57
|
+
dataTest: PropTypes.string
|
|
63
58
|
};
|
|
64
59
|
export default FixedPeriodFilter;
|
|
@@ -8,7 +8,7 @@ import React, { Component } from 'react';
|
|
|
8
8
|
import i18n from '../../locales/index.js';
|
|
9
9
|
import FixedPeriodFilter from './FixedPeriodFilter.js';
|
|
10
10
|
import styles from './styles/FixedPeriodSelect.style.js';
|
|
11
|
-
import { parsePeriodCode, getFixedPeriodsOptionsById as getPeriodById, getYearOffsetFromNow } from './utils/fixedPeriods.js';
|
|
11
|
+
import { parsePeriodCode, getFixedPeriodsOptionsById as getPeriodById, getFixedPeriodsOptions, getYearOffsetFromNow } from './utils/fixedPeriods.js';
|
|
12
12
|
class FixedPeriodSelect extends Component {
|
|
13
13
|
constructor(...args) {
|
|
14
14
|
super(...args);
|
|
@@ -61,13 +61,15 @@ class FixedPeriodSelect extends Component {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
|
+
const allOptions = getFixedPeriodsOptions();
|
|
65
|
+
const availableOptions = this.props.allowedPeriodTypes ? allOptions.filter(option => this.props.allowedPeriodTypes.includes(option.id)) : allOptions;
|
|
64
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
67
|
"data-test": this.props.dataTest,
|
|
66
68
|
className: `jsx-${styles.__hash}` + " " + (this.props.className || "")
|
|
67
69
|
}, /*#__PURE__*/React.createElement("div", {
|
|
68
70
|
className: `jsx-${styles.__hash}` + " " + "row"
|
|
69
71
|
}, /*#__PURE__*/React.createElement(FixedPeriodFilter, {
|
|
70
|
-
|
|
72
|
+
availableOptions: availableOptions,
|
|
71
73
|
currentPeriodType: this.state.periodType,
|
|
72
74
|
currentYear: this.state.year,
|
|
73
75
|
onSelectPeriodType: this.onSelectPeriodType,
|
|
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { DIMENSION_ID_PERIOD } from '../../modules/predefinedDimensions.js';
|
|
5
5
|
import PeriodTransfer from './PeriodTransfer.js';
|
|
6
|
+
import { useDataOutputPeriodTypes } from './useDataOutputPeriodTypes.js';
|
|
7
|
+
import { applyPeriodNameOverrides } from './utils/enabledPeriodTypes.js';
|
|
6
8
|
const userSettingsQuery = {
|
|
7
9
|
userSettings: {
|
|
8
10
|
resource: 'userSettings',
|
|
@@ -20,10 +22,15 @@ const PeriodDimension = ({
|
|
|
20
22
|
infoBoxMessage,
|
|
21
23
|
height
|
|
22
24
|
}) => {
|
|
25
|
+
const config = useConfig();
|
|
23
26
|
const {
|
|
24
27
|
systemInfo
|
|
25
|
-
} =
|
|
26
|
-
const
|
|
28
|
+
} = config;
|
|
29
|
+
const userSettingsResult = useDataQuery(userSettingsQuery);
|
|
30
|
+
const {
|
|
31
|
+
supportsEnabledPeriodTypes,
|
|
32
|
+
enabledPeriodTypesData
|
|
33
|
+
} = useDataOutputPeriodTypes();
|
|
27
34
|
const {
|
|
28
35
|
calendar = 'gregory'
|
|
29
36
|
} = systemInfo;
|
|
@@ -33,7 +40,7 @@ const PeriodDimension = ({
|
|
|
33
40
|
keyUiLocale: locale
|
|
34
41
|
} = {}
|
|
35
42
|
} = {}
|
|
36
|
-
} =
|
|
43
|
+
} = userSettingsResult;
|
|
37
44
|
const periodsSettings = {
|
|
38
45
|
calendar,
|
|
39
46
|
locale
|
|
@@ -44,15 +51,18 @@ const PeriodDimension = ({
|
|
|
44
51
|
items: periods
|
|
45
52
|
});
|
|
46
53
|
};
|
|
54
|
+
const selectedPeriodsWithCustomDisplayNames = applyPeriodNameOverrides(selectedPeriods, enabledPeriodTypesData === null || enabledPeriodTypesData === void 0 ? void 0 : enabledPeriodTypesData.metaData);
|
|
47
55
|
return /*#__PURE__*/React.createElement(PeriodTransfer, {
|
|
48
56
|
onSelect: selectPeriods,
|
|
49
|
-
selectedItems:
|
|
57
|
+
selectedItems: selectedPeriodsWithCustomDisplayNames,
|
|
50
58
|
infoBoxMessage: infoBoxMessage,
|
|
51
59
|
rightFooter: rightFooter,
|
|
52
60
|
dataTest: 'period-dimension',
|
|
53
61
|
excludedPeriodTypes: excludedPeriodTypes,
|
|
54
62
|
periodsSettings: periodsSettings,
|
|
55
|
-
height: height
|
|
63
|
+
height: height,
|
|
64
|
+
enabledPeriodTypesData: enabledPeriodTypesData,
|
|
65
|
+
supportsEnabledPeriodTypes: supportsEnabledPeriodTypes
|
|
56
66
|
});
|
|
57
67
|
};
|
|
58
68
|
PeriodDimension.propTypes = {
|