@datarailsshared/dr_renderer 1.2.8 → 1.2.9
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 +53 -8
- package/README.md +5 -6
- package/babel.config.js +3 -0
- package/jest.config.js +27 -0
- package/package.json +25 -3
- package/src/charts/dr_gauge_chart.js +566 -0
- package/src/dataformatter.d.ts +13 -0
- package/src/dataformatter.js +60 -7
- package/src/dr-renderer-helpers.js +58 -0
- package/src/dr_chart_tooltip.js +277 -0
- package/src/dr_pivottable.js +606 -145
- package/src/graph-table-renderer.js +147 -0
- package/src/highcharts_renderer.js +5779 -2021
- package/src/index.js +8 -2
- package/src/novix_renderer.js +125 -48
- package/src/pivot.css +142 -17
- package/src/pivottable.js +84 -7
- package/src/published_items_renderer.js +365 -0
- package/src/seriesPointStyles-helper.js +43 -0
- package/tests/dr-renderer-helpers.test.js +150 -0
- package/tests/dr_chart_tooltip.test.js +739 -0
- package/tests/dr_gauge_chart.test.js +1931 -0
- package/tests/highcharts_renderer.test.js +9389 -0
- package/tests/mock/add-in-dynamic-ranges.json +127 -0
- package/tests/mock/add-in-functions.json +410 -0
- package/tests/mock/add-in-tables.json +347 -0
- package/tests/mock/tables.json +2258 -0
- package/tests/mock/widgets.json +403 -0
- package/tests/seriesPointStyles-helper.test.js +114 -0
- package/tsconfig.json +15 -0
- package/types/graph-table-renderer.d.ts +79 -0
- package/types/index.d.ts +1 -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,21 +19,67 @@ jobs:
|
|
|
20
19
|
- run:
|
|
21
20
|
name: Prepare publish version
|
|
22
21
|
command: |
|
|
23
|
-
|
|
22
|
+
postfix=""
|
|
23
|
+
if [[ "${CIRCLE_BRANCH}" != master ]] ; then
|
|
24
|
+
postfix="-$CIRCLE_BRANCH"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
VERSION="1.2.$CIRCLE_BUILD_NUM$postfix"
|
|
28
|
+
sed -i s/{{cicd_version}}/$VERSION/g ./package.json
|
|
24
29
|
cat ./package.json
|
|
25
30
|
- run:
|
|
26
31
|
name: Authenticate with registry
|
|
27
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
|
|
28
39
|
- run:
|
|
29
40
|
name: Publish package
|
|
30
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
|
|
31
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 origin "$CIRCLE_BRANCH/$VERSION"
|
|
32
69
|
workflows:
|
|
33
70
|
version: 2
|
|
34
|
-
|
|
71
|
+
npm-publish:
|
|
35
72
|
jobs:
|
|
36
73
|
- deploy:
|
|
74
|
+
context:
|
|
75
|
+
- metadata
|
|
37
76
|
filters:
|
|
38
77
|
branches:
|
|
39
78
|
only:
|
|
40
|
-
- /
|
|
79
|
+
- /master/
|
|
80
|
+
- /tigers/
|
|
81
|
+
- /bratans/
|
|
82
|
+
- /dragons/
|
|
83
|
+
- /tigers/
|
|
84
|
+
- /wizards/
|
|
85
|
+
- /rocket/
|
package/README.md
CHANGED
|
@@ -13,12 +13,11 @@ This project was generated by amazing Datarails R&D team
|
|
|
13
13
|
let default_colors = ["#106bd0", "#00cee8", "#95c8d8", "#89cff0", "#FE746D", "#6ADC4C", "#9B9AD9", "#ff8000", "#C11B12", "#5a41f9"];
|
|
14
14
|
let hr = dr_renderer.getInitHighchartsRenderer($, document, default_colors, Highcharts);
|
|
15
15
|
|
|
16
|
+
## Development
|
|
17
|
+
### Types
|
|
18
|
+
To be able to compile types with `npm run build:types` you need to install typescript globally:
|
|
19
|
+
|
|
20
|
+
```npm i -g typescript```
|
|
16
21
|
|
|
17
22
|
## Publish to npm
|
|
18
23
|
Just merge to prod branch
|
|
19
|
-
|
|
20
|
-
~~First of all change version in `package.json`.~~
|
|
21
|
-
|
|
22
|
-
~~For login run `npm login`~~
|
|
23
|
-
|
|
24
|
-
~~For publish run `npm publish . --access=public`~~
|
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.9",
|
|
4
4
|
"description": "DataRails charts and tables renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datarails",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"tables"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"login": "npm login"
|
|
12
|
+
"login": "npm login",
|
|
13
|
+
"test": "jest --coverage",
|
|
14
|
+
"build:types": "tsc --build --verbose"
|
|
13
15
|
},
|
|
14
16
|
"author": "Sergey Spivakov",
|
|
15
17
|
"repository": {
|
|
@@ -17,6 +19,21 @@
|
|
|
17
19
|
"url": "git+https://bitbucket.org/datarails/dr_renderer.git"
|
|
18
20
|
},
|
|
19
21
|
"license": "",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"jquery": "^3.6.0",
|
|
24
|
+
"lodash": "^4.17.20",
|
|
25
|
+
"regenerator-runtime": "^0.13.5"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.20.12",
|
|
29
|
+
"@babel/preset-env": "^7.20.2",
|
|
30
|
+
"@testing-library/dom": "^7.2.1",
|
|
31
|
+
"@testing-library/jest-dom": "^5.5.0",
|
|
32
|
+
"babel-jest": "^25.5.1",
|
|
33
|
+
"jest": "^25.3.0",
|
|
34
|
+
"moment": "^2.29.1",
|
|
35
|
+
"serve": "^11.3.0"
|
|
36
|
+
},
|
|
20
37
|
"bugs": {
|
|
21
38
|
"url": ""
|
|
22
39
|
},
|
|
@@ -24,5 +41,10 @@
|
|
|
24
41
|
"whitelistedNonPeerDependencies": [],
|
|
25
42
|
"main": "src/index.js",
|
|
26
43
|
"module": "src/index.js",
|
|
27
|
-
"sideEffects": false
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"jest": {
|
|
46
|
+
"setupFiles": [
|
|
47
|
+
"./setup-jest.js"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
28
50
|
}
|