@datarailsshared/dr_renderer 1.2.462 → 1.3.16

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 +1,7 @@
1
1
  version: 2.1
2
2
 
3
3
  orbs:
4
- datarails-cicd-orb: datarails/datarails-cicd-orb@dev:primary
4
+ datarails-cicd-orb: datarails-ns/datarails-cicd-orb@dev:primary
5
5
 
6
6
  defaults: &defaults
7
7
  working_directory: ~/repo
@@ -24,7 +24,7 @@ jobs:
24
24
  postfix="-$CIRCLE_BRANCH"
25
25
  fi
26
26
 
27
- VERSION="1.2.$CIRCLE_BUILD_NUM$postfix"
27
+ VERSION="1.3.$CIRCLE_BUILD_NUM$postfix"
28
28
  sed -i s/{{cicd_version}}/$VERSION/g ./package.json
29
29
  cat ./package.json
30
30
  - run:
@@ -40,8 +40,8 @@ jobs:
40
40
  name: Publish package
41
41
  command: npm publish . --access=public
42
42
  - datarails-cicd-orb/add-ssh-id:
43
- private_key_env_var: bitbucket_deploy_private_encoded
44
- public_key_env_var: bitbucket_deploy_pub_encoded
43
+ private_key_env_var: github_deploy_private_encoded
44
+ public_key_env_var: github_deploy_pub_encoded
45
45
  is_public_key_encoded: true
46
46
  is_private_key_encoded: true
47
47
  - run:
@@ -52,14 +52,20 @@ jobs:
52
52
  postfix="-$CIRCLE_BRANCH"
53
53
  fi
54
54
 
55
- VERSION="1.2.$CIRCLE_BUILD_NUM$postfix"
55
+ VERSION="1.3.$CIRCLE_BUILD_NUM$postfix"
56
56
  git config --global user.email noreplay@circleci.com
57
57
  git config --global user.name circleci
58
58
  git config --global -l
59
59
  git tag -a "$CIRCLE_BRANCH/$VERSION" -m "circleci build"
60
- ssh -o "StrictHostKeyChecking no" -T git@bitbucket.org
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
61
68
  git push --tags origin
62
- echo 555
63
69
  workflows:
64
70
  version: 2
65
71
  npm-publish:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.462",
3
+ "version": "1.3.16",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -2242,7 +2242,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2242
2242
  return newOptions;
2243
2243
  }
2244
2244
 
2245
- const rangeArr = [range.low, range.medium, Math.max(range.high || 100, 100)];
2245
+ const rangeArr = [1 * range.low, 1 * range.medium, Math.max(1 * range.high || 100, 100)];
2246
2246
 
2247
2247
  newOptions.segments.forEach((segment, i) => {
2248
2248
  segment.from = (rangeArr[i - 1] + 1) || segment.from;
@@ -2253,7 +2253,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2253
2253
  newOptions.goal = highchartsRenderer.objectCopyJsonMethod(GAUGE_OPTIONS_DEFAULT.goal);
2254
2254
  }
2255
2255
 
2256
- newOptions.goal.value = range.max || newOptions.goal.value;
2256
+ newOptions.goal.value = 1 * range.max || newOptions.goal.value;
2257
2257
 
2258
2258
  delete newOptions.range;
2259
2259
 
@@ -8771,6 +8771,37 @@ describe('highcharts_renderer', () => {
8771
8771
  }]);
8772
8772
  });
8773
8773
 
8774
+ it('should prepopulate segments with the old range data (string)', () => {
8775
+ const res = highchartsRenderer.transformOldGaugeOptions({
8776
+ opt1: 1,
8777
+ opt2: '2',
8778
+ range: {
8779
+ low: '20',
8780
+ medium: '30',
8781
+ high: '70',
8782
+ max: '200'
8783
+ }
8784
+ });
8785
+ expect(res.segments).toEqual([{
8786
+ from: 0,
8787
+ to: 20,
8788
+ color: GAUGE_OPTIONS_DEFAULT.segments[0].color,
8789
+ title: GAUGE_OPTIONS_DEFAULT.segments[0].title,
8790
+ },
8791
+ {
8792
+ from: 21,
8793
+ to: 30,
8794
+ color: GAUGE_OPTIONS_DEFAULT.segments[1].color,
8795
+ title: GAUGE_OPTIONS_DEFAULT.segments[1].title
8796
+ },
8797
+ {
8798
+ from: 31,
8799
+ to: 100,
8800
+ color: GAUGE_OPTIONS_DEFAULT.segments[2].color,
8801
+ title: GAUGE_OPTIONS_DEFAULT.segments[2].title
8802
+ }]);
8803
+ });
8804
+
8774
8805
  it('should remove old range object', () => {
8775
8806
  const res = highchartsRenderer.transformOldGaugeOptions({
8776
8807
  opt1: 1,