@datarailsshared/dr_renderer 1.2.14 → 1.2.15
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/.circleci/config.yml +50 -6
- package/babel.config.js +3 -0
- package/jest.config.js +27 -0
- package/package.json +24 -3
- package/src/dataformatter.js +16 -5
- package/src/dr_pivottable.js +591 -62
- package/src/highcharts_renderer.js +4033 -1015
- package/src/index.js +8 -2
- package/src/novix_renderer.js +118 -43
- package/src/pivot.css +142 -17
- package/src/pivottable.js +55 -4
- package/src/published_items_renderer.js +387 -0
- package/tests/highcharts_renderer.test.js +48 -0
package/.circleci/config.yml
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
version: 2
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
orbs:
|
|
4
|
+
datarails-cicd-orb: datarails-ns/datarails-cicd-orb@dev:primary
|
|
6
5
|
|
|
7
6
|
defaults: &defaults
|
|
8
7
|
working_directory: ~/repo
|
|
@@ -20,22 +19,67 @@ jobs:
|
|
|
20
19
|
- run:
|
|
21
20
|
name: Prepare publish version
|
|
22
21
|
command: |
|
|
23
|
-
|
|
22
|
+
postfix=""
|
|
23
|
+
if [[ "${CIRCLE_BRANCH}" != prod ]] ; then
|
|
24
|
+
postfix="-$CIRCLE_BRANCH"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
VERSION="1.2.$CIRCLE_BUILD_NUM$postfix"
|
|
24
28
|
sed -i s/{{cicd_version}}/$VERSION/g ./package.json
|
|
25
29
|
cat ./package.json
|
|
26
30
|
- run:
|
|
27
31
|
name: Authenticate with registry
|
|
28
32
|
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
|
|
33
|
+
- run:
|
|
34
|
+
name: Install dependencies
|
|
35
|
+
command: npm install
|
|
36
|
+
- run:
|
|
37
|
+
name: Run npm test
|
|
38
|
+
command: npm test
|
|
29
39
|
- run:
|
|
30
40
|
name: Publish package
|
|
31
41
|
command: npm publish . --access=public
|
|
42
|
+
- datarails-cicd-orb/add-ssh-id:
|
|
43
|
+
private_key_env_var: github_deploy_private_encoded
|
|
44
|
+
public_key_env_var: github_deploy_pub_encoded
|
|
45
|
+
is_public_key_encoded: true
|
|
46
|
+
is_private_key_encoded: true
|
|
47
|
+
- run:
|
|
48
|
+
name: prepare git tag
|
|
49
|
+
command: |
|
|
50
|
+
postfix=""
|
|
51
|
+
if [[ "${CIRCLE_BRANCH}" != prod ]] ; then
|
|
52
|
+
postfix="-$CIRCLE_BRANCH"
|
|
53
|
+
fi
|
|
32
54
|
|
|
55
|
+
VERSION="1.2.$CIRCLE_BUILD_NUM$postfix"
|
|
56
|
+
git config --global user.email noreplay@circleci.com
|
|
57
|
+
git config --global user.name circleci
|
|
58
|
+
git config --global -l
|
|
59
|
+
git tag -a "$CIRCLE_BRANCH/$VERSION" -m "circleci build"
|
|
60
|
+
# Test SSH connection to GitHub
|
|
61
|
+
output=$(ssh -o "StrictHostKeyChecking no" -T git@github.com 2>&1 || true)
|
|
62
|
+
echo "$output"
|
|
63
|
+
if ! echo "$output" | grep -q "Hi.*You've successfully authenticated"; then
|
|
64
|
+
echo "Failed to authenticate with GitHub"
|
|
65
|
+
exit 1
|
|
66
|
+
fi
|
|
67
|
+
# Push the tag after successful authentication
|
|
68
|
+
git push --tags origin
|
|
33
69
|
workflows:
|
|
34
70
|
version: 2
|
|
35
71
|
npm-publish:
|
|
36
72
|
jobs:
|
|
37
73
|
- deploy:
|
|
74
|
+
context:
|
|
75
|
+
- metadata
|
|
38
76
|
filters:
|
|
39
77
|
branches:
|
|
40
78
|
only:
|
|
41
79
|
- /prod.*/
|
|
80
|
+
- /tigers/
|
|
81
|
+
- /bratans/
|
|
82
|
+
- /dragons/
|
|
83
|
+
- /tigers/
|
|
84
|
+
- /wizards/
|
|
85
|
+
- /rocket/
|
package/babel.config.js
ADDED
package/jest.config.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
clearMocks: true,
|
|
3
|
+
setupFilesAfterEnv: ['regenerator-runtime/runtime'],
|
|
4
|
+
testPathIgnorePatterns: [
|
|
5
|
+
"/node_modules/",
|
|
6
|
+
],
|
|
7
|
+
transformIgnorePatterns: [
|
|
8
|
+
"<rootDir>/node_modules/(?!jquery|lodash|moment/)",
|
|
9
|
+
],
|
|
10
|
+
collectCoverage: true,
|
|
11
|
+
collectCoverageFrom: [
|
|
12
|
+
'**/*.js',
|
|
13
|
+
'!**/*.config.js',
|
|
14
|
+
'!**/build/**',
|
|
15
|
+
'!**/coverage/**',
|
|
16
|
+
'!**/node_modules/**',
|
|
17
|
+
'!**/vendor/**'
|
|
18
|
+
],
|
|
19
|
+
// coverageThreshold: {
|
|
20
|
+
// "global": {
|
|
21
|
+
// "branches": 100,
|
|
22
|
+
// "functions": 100,
|
|
23
|
+
// "lines": 100,
|
|
24
|
+
// "statements": 100
|
|
25
|
+
// }
|
|
26
|
+
// },
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datarailsshared/dr_renderer",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
4
4
|
"description": "DataRails charts and tables renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datarails",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"tables"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"login": "npm login"
|
|
12
|
+
"login": "npm login",
|
|
13
|
+
"test": "jest --coverage"
|
|
13
14
|
},
|
|
14
15
|
"author": "Sergey Spivakov",
|
|
15
16
|
"repository": {
|
|
@@ -17,6 +18,21 @@
|
|
|
17
18
|
"url": "git+https://bitbucket.org/datarails/dr_renderer.git"
|
|
18
19
|
},
|
|
19
20
|
"license": "",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"jquery": "^3.6.0",
|
|
23
|
+
"lodash": "^4.17.20",
|
|
24
|
+
"regenerator-runtime": "^0.13.5"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/core": "^7.20.12",
|
|
28
|
+
"@babel/preset-env": "^7.20.2",
|
|
29
|
+
"@testing-library/dom": "^7.2.1",
|
|
30
|
+
"@testing-library/jest-dom": "^5.5.0",
|
|
31
|
+
"babel-jest": "^25.5.1",
|
|
32
|
+
"jest": "^25.3.0",
|
|
33
|
+
"moment": "^2.29.1",
|
|
34
|
+
"serve": "^11.3.0"
|
|
35
|
+
},
|
|
20
36
|
"bugs": {
|
|
21
37
|
"url": ""
|
|
22
38
|
},
|
|
@@ -24,5 +40,10 @@
|
|
|
24
40
|
"whitelistedNonPeerDependencies": [],
|
|
25
41
|
"main": "src/index.js",
|
|
26
42
|
"module": "src/index.js",
|
|
27
|
-
"sideEffects": false
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"jest": {
|
|
45
|
+
"setupFiles": [
|
|
46
|
+
"./setup-jest.js"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
28
49
|
}
|
package/src/dataformatter.js
CHANGED
|
@@ -497,6 +497,13 @@ var DataFormatterImpl = function () {
|
|
|
497
497
|
var minutes = n.getMinutes();
|
|
498
498
|
var seconds = n.getSeconds();
|
|
499
499
|
|
|
500
|
+
var padStartTime = function(time) {
|
|
501
|
+
if (time < 10) {
|
|
502
|
+
return '0' + time;
|
|
503
|
+
}
|
|
504
|
+
return time;
|
|
505
|
+
}
|
|
506
|
+
|
|
500
507
|
// Build res
|
|
501
508
|
var res = pattern.replace(/((?:am\/pm)|(?:a\/p))|(?:(h[^ydsap]*?)mm)|(?:mm([^ydh]*?s))|(?:(h[^ydsap]*?)m)|(?:m([^ydh]*?s))/gi, function (a, ampm, fmin, fmin2, mmin, mmin2) {
|
|
502
509
|
|
|
@@ -506,11 +513,11 @@ var DataFormatterImpl = function () {
|
|
|
506
513
|
}
|
|
507
514
|
|
|
508
515
|
if (fmin) {
|
|
509
|
-
return fmin + _this3.applyNumberPattern(minutes, '00');
|
|
516
|
+
return fmin + _this3.applyNumberPattern(padStartTime(minutes), '00');
|
|
510
517
|
}
|
|
511
518
|
|
|
512
519
|
if (fmin2) {
|
|
513
|
-
return _this3.applyNumberPattern(minutes, '00') + fmin2;
|
|
520
|
+
return _this3.applyNumberPattern(padStartTime(minutes), '00') + fmin2;
|
|
514
521
|
}
|
|
515
522
|
|
|
516
523
|
if (mmin) {
|
|
@@ -527,7 +534,7 @@ var DataFormatterImpl = function () {
|
|
|
527
534
|
return res.replace(/(ss)|(s)|(hh)|(h)|(dddd)|(ddd)|(dd)|(d)|(mmmmm)|(mmmm)|(mmm)|(mm)|(m)|(yyyy)|(yy)|(\[\])/gi, function (a, ss, s, hh, h, dddd, ddd, dd, d, mmmmm, mmmm, mmm, mm, m, yyyy, yy, ampm) {
|
|
528
535
|
|
|
529
536
|
if (ss) {
|
|
530
|
-
return _this3.applyNumberPattern(seconds, '00');
|
|
537
|
+
return _this3.applyNumberPattern(padStartTime(seconds), '00');
|
|
531
538
|
}
|
|
532
539
|
|
|
533
540
|
if (s) {
|
|
@@ -535,7 +542,7 @@ var DataFormatterImpl = function () {
|
|
|
535
542
|
}
|
|
536
543
|
|
|
537
544
|
if (hh) {
|
|
538
|
-
return _this3.applyNumberPattern(foundAMPM ? hours % 12 : hours, '00');
|
|
545
|
+
return _this3.applyNumberPattern(padStartTime(foundAMPM ? hours % 12 : hours), '00');
|
|
539
546
|
}
|
|
540
547
|
|
|
541
548
|
if (h) {
|
|
@@ -858,7 +865,7 @@ var DataFormatterImpl = function () {
|
|
|
858
865
|
// Standard condition for negative number
|
|
859
866
|
case sectionIndex === 1:
|
|
860
867
|
condition = 'type == "Number" && parseFloat(n) < 0';
|
|
861
|
-
shouldAbsNumber =
|
|
868
|
+
shouldAbsNumber = !!section.match(/\(.*\)/);
|
|
862
869
|
break;
|
|
863
870
|
|
|
864
871
|
}
|
|
@@ -1003,6 +1010,10 @@ var DataFormatterImpl = function () {
|
|
|
1003
1010
|
|
|
1004
1011
|
// Call function
|
|
1005
1012
|
result = this.memoized[pattern].call(this, n, type);
|
|
1013
|
+
|
|
1014
|
+
if (result.value === result.pattern && !(String(n) === '0' && result.value.includes('0'))) {
|
|
1015
|
+
result.value = n;
|
|
1016
|
+
}
|
|
1006
1017
|
}
|
|
1007
1018
|
catch (e) {
|
|
1008
1019
|
|