@datarailsshared/dr_renderer 1.2.363 → 1.2.365

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.
@@ -1,7 +0,0 @@
1
- function backendSortingKeysAreNotEmpty(keys) {
2
- return !!keys && (!!keys.row_keys && !!keys.row_keys.length || !!keys.col_keys && !!keys.col_keys.length);
3
- }
4
-
5
- module.exports = {
6
- backendSortingKeysAreNotEmpty: backendSortingKeysAreNotEmpty,
7
- }
@@ -1,34 +0,0 @@
1
- describe('dr-renderer-helpers', () => {
2
- const drRendererHelpers = require('../src/dr-renderer-helpers');
3
-
4
- describe('backendSortingKeysAreNotEmpty', () => {
5
- it('should return true if keys are not empty', () => {
6
- const keys = {
7
- row_keys: [1, 2, 3],
8
- col_keys: [1, 2, 3]
9
- };
10
- expect(drRendererHelpers.backendSortingKeysAreNotEmpty(keys)).toBe(true);
11
- });
12
-
13
- it('should return true if one of the keys is not empty', () => {
14
- const keys = {
15
- row_keys: [1, 2, 3],
16
- col_keys: []
17
- };
18
- expect(drRendererHelpers.backendSortingKeysAreNotEmpty(keys)).toBe(true);
19
- });
20
-
21
- it('should return false if keys are empty', () => {
22
- const keys = {
23
- row_keys: [],
24
- col_keys: [],
25
- };
26
- expect(drRendererHelpers.backendSortingKeysAreNotEmpty(keys)).toBe(false);
27
- });
28
-
29
- it('should return false if keys are null', () => {
30
- const keys = null;
31
- expect(drRendererHelpers.backendSortingKeysAreNotEmpty(keys)).toBe(false);
32
- });
33
- });
34
- });
@@ -1,133 +0,0 @@
1
- [{
2
- "id": 2,
3
- "name": "New Dynamic Range",
4
- "fields": [
5
- {
6
- "field": 161918,
7
- "name": "Account level 1",
8
- "format": null,
9
- "sorting": null,
10
- "type": "Text"
11
- },
12
- {
13
- "field": 161919,
14
- "name": "Account level 2",
15
- "format": null,
16
- "sorting": null,
17
- "type": "Text"
18
- },
19
- {
20
- "field": 161917,
21
- "name": "Account Name",
22
- "format": null,
23
- "sorting": null,
24
- "type": "Text"
25
- },
26
- {
27
- "field": 161925,
28
- "name": "Amount",
29
- "format": null,
30
- "sorting": null,
31
- "type": "Float"
32
- },
33
- {
34
- "field": 161924,
35
- "name": "Reporting Date",
36
- "format": null,
37
- "sorting": null,
38
- "type": "Date"
39
- },
40
- {
41
- "field": 161928,
42
- "name": "System_Date",
43
- "format": null,
44
- "sorting": null,
45
- "type": "Date"
46
- }
47
- ],
48
- "filters": [
49
- {
50
- "field": 161918,
51
- "name": "Account level 1",
52
- "values": [
53
- "Expenses",
54
- "Income"
55
- ],
56
- "is_excluded": false,
57
- "allow_nulls": true,
58
- "type": "Text",
59
- "override_global_filter": false
60
- },
61
- {
62
- "field": 161919,
63
- "name": "Account level 2",
64
- "values": [
65
- "Auto"
66
- ],
67
- "is_excluded": true,
68
- "allow_nulls": false,
69
- "type": "Text",
70
- "override_global_filter": false
71
- },
72
- {
73
- "field": 161917,
74
- "name": "Account Name",
75
- "values": {
76
- "type": "advanced",
77
- "val": [
78
- {
79
- "operator": null,
80
- "condition": "contains",
81
- "value": "a"
82
- }
83
- ]
84
- },
85
- "is_excluded": false,
86
- "allow_nulls": false,
87
- "type": "Text",
88
- "override_global_filter": false
89
- },
90
- {
91
- "field": 161924,
92
- "name": "Reporting Date",
93
- "values": [
94
- 1646006400,
95
- 1643587200
96
- ],
97
- "is_excluded": false,
98
- "allow_nulls": false,
99
- "type": "Date",
100
- "override_global_filter": false
101
- },
102
- {
103
- "field": 161928,
104
- "name": "System_Date",
105
- "values": {
106
- "datetype": "list",
107
- "val": [
108
- 1677542400
109
- ]
110
- },
111
- "is_excluded": true,
112
- "allow_nulls": false,
113
- "type": "Date",
114
- "override_global_filter": false
115
- },
116
- {
117
- "field": 161923,
118
- "name": "Posting Date",
119
- "values": {
120
- "datetype": "range",
121
- "val": {
122
- "fromdate": 1641859200,
123
- "todate": 1653696000
124
- }
125
- },
126
- "is_excluded": false,
127
- "allow_nulls": false,
128
- "type": "Date",
129
- "override_global_filter": false
130
- }
131
- ],
132
- "table_id": 7199
133
- }]
@@ -1,412 +0,0 @@
1
- [
2
- {
3
- "id": 171,
4
- "name": "Unit_tests_function",
5
- "value_field": 161925,
6
- "aggfun": "SUM",
7
- "template_id": 7199,
8
- "filters": [
9
- {
10
- "field": 161918,
11
- "name": "Account level 1",
12
- "values": [
13
- "Expenses",
14
- "Income"
15
- ],
16
- "is_excluded": false,
17
- "show_in_graph": true,
18
- "allow_nulls ": true,
19
- "type": "Text",
20
- "override_global_filter": true
21
- },
22
- {
23
- "field": 161919,
24
- "name": "Account level 2",
25
- "values": {
26
- "type": "advanced",
27
- "val": [
28
- {
29
- "operator": null,
30
- "condition": "contains",
31
- "value": "a"
32
- }
33
- ]
34
- },
35
- "is_excluded": false,
36
- "show_in_graph": false,
37
- "type": "Text",
38
- "override_global_filter": false
39
- },
40
- {
41
- "field": 161923,
42
- "name": "Posting Date",
43
- "values": [
44
- 1653696000,
45
- 1653350400,
46
- 1645660800
47
- ],
48
- "is_excluded": false,
49
- "show_in_graph": false,
50
- "type": "Date",
51
- "override_global_filter": false
52
- },
53
- {
54
- "field": 161924,
55
- "name": "Reporting Date",
56
- "values": {
57
- "datetype": "range",
58
- "val": {
59
- "fromdate": 1643587200,
60
- "todate": 1653955200
61
- }
62
- },
63
- "is_excluded": false,
64
- "show_in_graph": false,
65
- "type": "Date",
66
- "override_global_filter": false
67
- },
68
- {
69
- "field": 161908,
70
- "name": "Submission_Date",
71
- "values": [
72
- 1676200849
73
- ],
74
- "is_excluded": true,
75
- "show_in_graph": false,
76
- "type": "Date",
77
- "override_global_filter": false
78
- },
79
- {
80
- "field": 161928,
81
- "name": "System_Date",
82
- "values": {
83
- "datetype": "list",
84
- "val": [
85
- 1677542400
86
- ]
87
- },
88
- "is_excluded": true,
89
- "allow_nulls": true,
90
- "type": "Date",
91
- "override_global_filter": false
92
- }
93
- ],
94
- "vals": [
95
- {
96
- "id": 161925,
97
- "name": "Amount",
98
- "type": "Float",
99
- "aggregator": "SUM"
100
- }
101
- ],
102
- "fields": [
103
- {
104
- "type": "Integer",
105
- "id": 161904,
106
- "name": "Doc_ID",
107
- "trim": false,
108
- "letter_case": null,
109
- "sorting": null
110
- },
111
- {
112
- "type": "Integer",
113
- "id": 161905,
114
- "name": "Doc_version",
115
- "trim": false,
116
- "letter_case": null,
117
- "sorting": null
118
- },
119
- {
120
- "type": "Text",
121
- "id": 161906,
122
- "name": "Tab_name",
123
- "trim": false,
124
- "letter_case": null,
125
- "sorting": null
126
- },
127
- {
128
- "type": "Text",
129
- "id": 161907,
130
- "name": "Label",
131
- "trim": false,
132
- "letter_case": null,
133
- "sorting": null
134
- },
135
- {
136
- "type": "Date",
137
- "id": 161908,
138
- "name": "Submission_Date",
139
- "trim": false,
140
- "letter_case": null,
141
- "sorting": null
142
- },
143
- {
144
- "type": "Text",
145
- "id": 161909,
146
- "name": "User",
147
- "trim": false,
148
- "letter_case": null,
149
- "sorting": null
150
- },
151
- {
152
- "type": "Boolean",
153
- "id": 161910,
154
- "name": "Latest_In_Dim",
155
- "trim": false,
156
- "letter_case": null,
157
- "sorting": null
158
- },
159
- {
160
- "type": "Text",
161
- "id": 161911,
162
- "name": "DataMapper_Name",
163
- "trim": false,
164
- "letter_case": null,
165
- "sorting": null
166
- },
167
- {
168
- "type": "Integer",
169
- "id": 161912,
170
- "name": "Parent_Id",
171
- "trim": false,
172
- "letter_case": null,
173
- "sorting": null
174
- },
175
- {
176
- "type": "Text",
177
- "id": 161913,
178
- "name": "Parent_Name",
179
- "trim": false,
180
- "letter_case": null,
181
- "sorting": null
182
- },
183
- {
184
- "type": "Integer",
185
- "id": 161914,
186
- "name": "FileBox_ID",
187
- "trim": false,
188
- "letter_case": null,
189
- "sorting": null
190
- },
191
- {
192
- "type": "Text",
193
- "id": 161915,
194
- "name": "FileBox_Name",
195
- "trim": false,
196
- "letter_case": null,
197
- "sorting": null
198
- },
199
- {
200
- "type": "Float",
201
- "id": 161916,
202
- "name": "Account #",
203
- "trim": true,
204
- "letter_case": null,
205
- "sorting": null
206
- },
207
- {
208
- "type": "Text",
209
- "id": 161917,
210
- "name": "Account Name",
211
- "trim": true,
212
- "letter_case": null,
213
- "sorting": null
214
- },
215
- {
216
- "type": "Text",
217
- "id": 161918,
218
- "name": "Account level 1",
219
- "trim": true,
220
- "letter_case": null,
221
- "sorting": null
222
- },
223
- {
224
- "type": "Text",
225
- "id": 161919,
226
- "name": "Account level 2",
227
- "trim": true,
228
- "letter_case": null,
229
- "sorting": null
230
- },
231
- {
232
- "type": "Text",
233
- "id": 161920,
234
- "name": "Department",
235
- "trim": true,
236
- "letter_case": null,
237
- "sorting": null
238
- },
239
- {
240
- "type": "Text",
241
- "id": 161921,
242
- "name": "Sub Department",
243
- "trim": true,
244
- "letter_case": null,
245
- "sorting": null
246
- },
247
- {
248
- "type": "Text",
249
- "id": 161922,
250
- "name": "Scenario",
251
- "trim": true,
252
- "letter_case": null,
253
- "sorting": null
254
- },
255
- {
256
- "type": "Date",
257
- "id": 161923,
258
- "name": "Posting Date",
259
- "trim": true,
260
- "letter_case": null,
261
- "sorting": null
262
- },
263
- {
264
- "type": "Date",
265
- "id": 161924,
266
- "name": "Reporting Date",
267
- "trim": true,
268
- "letter_case": null,
269
- "sorting": null
270
- },
271
- {
272
- "type": "Text",
273
- "id": 161926,
274
- "name": "P&L",
275
- "trim": true,
276
- "letter_case": null,
277
- "sorting": null
278
- },
279
- {
280
- "type": "Text",
281
- "id": 161927,
282
- "name": "5550",
283
- "trim": true,
284
- "letter_case": null,
285
- "sorting": null
286
- },
287
- {
288
- "type": "Date",
289
- "id": 161928,
290
- "name": "System_Date",
291
- "trim": false,
292
- "letter_case": null,
293
- "sorting": null
294
- },
295
- {
296
- "type": "Integer",
297
- "id": 161929,
298
- "name": "System_Year",
299
- "trim": false,
300
- "letter_case": null,
301
- "sorting": null
302
- },
303
- {
304
- "type": "Text",
305
- "id": 161930,
306
- "name": "System_Quarter",
307
- "trim": false,
308
- "letter_case": null,
309
- "sorting": null
310
- },
311
- {
312
- "type": "Text",
313
- "id": 161931,
314
- "name": "System_Month",
315
- "trim": false,
316
- "letter_case": null,
317
- "sorting": null
318
- },
319
- {
320
- "type": "Integer",
321
- "id": 161932,
322
- "name": "System_Month_Num",
323
- "trim": false,
324
- "letter_case": null,
325
- "sorting": null
326
- },
327
- {
328
- "type": "Integer",
329
- "id": 161933,
330
- "name": "System_Week",
331
- "trim": false,
332
- "letter_case": null,
333
- "sorting": null
334
- },
335
- {
336
- "type": "Integer",
337
- "id": 161934,
338
- "name": "System_Day",
339
- "trim": false,
340
- "letter_case": null,
341
- "sorting": null
342
- },
343
- {
344
- "type": "Text",
345
- "id": 161935,
346
- "name": "System_Date_Tag",
347
- "trim": false,
348
- "letter_case": null,
349
- "sorting": null
350
- },
351
- {
352
- "type": "Text",
353
- "id": 161936,
354
- "name": "DT_scenario",
355
- "trim": false,
356
- "letter_case": null,
357
- "sorting": null
358
- }
359
- ],
360
- "calculated_value_names": [],
361
- "calculated_values": [
362
- {
363
- "calc_id": 23,
364
- "name": "Test value",
365
- "field": 161925,
366
- "side": "legend"
367
- }
368
- ],
369
- "default_agg_datefield": 161923,
370
- "default_agg_config": {
371
- "YTD": {
372
- "aggregate_by": "month",
373
- "fnc": "sum",
374
- "is_end_of_period": true
375
- },
376
- "QTD": {
377
- "aggregate_by": "month",
378
- "fnc": "sum",
379
- "is_end_of_period": true
380
- },
381
- "RM": {
382
- "rolling_month_before": 0,
383
- "is_end_of_period": true
384
- },
385
- "SA": {
386
- "aggregate_by": "month",
387
- "fnc": "sum",
388
- "is_end_of_period": true
389
- },
390
- "YTG": {
391
- "aggregate_by": "month",
392
- "fnc": "sum",
393
- "is_end_of_period": true
394
- },
395
- "QTG": {
396
- "aggregate_by": "month",
397
- "fnc": "sum",
398
- "is_end_of_period": true
399
- },
400
- "MTD": {
401
- "aggregate_by": "day",
402
- "fnc": "sum",
403
- "is_end_of_period": true
404
- },
405
- "MTG": {
406
- "aggregate_by": "day",
407
- "fnc": "sum",
408
- "is_end_of_period": true
409
- }
410
- }
411
- }
412
- ]