@spinnaker/core 0.19.1 → 0.19.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spinnaker/core",
3
3
  "license": "Apache-2.0",
4
- "version": "0.19.1",
4
+ "version": "0.19.4",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
@@ -25,9 +25,9 @@
25
25
  "@uirouter/react-hybrid": "1.0.2",
26
26
  "@uirouter/rx": "0.6.5",
27
27
  "@uirouter/visualizer": "7.2.1",
28
- "angular": "1.6.10",
29
- "angular-messages": "1.6.10",
30
- "angular-sanitize": "1.6.10",
28
+ "angular": "1.8.0",
29
+ "angular-messages": "1.8.0",
30
+ "angular-sanitize": "1.8.0",
31
31
  "angular-spinner": "1.0.1",
32
32
  "angular-ui-bootstrap": "2.5.0",
33
33
  "angular-ui-sortable": "0.17.1",
@@ -120,5 +120,5 @@
120
120
  "shx": "0.3.3",
121
121
  "typescript": "4.3.5"
122
122
  },
123
- "gitHead": "8b967e5f649a2373d704ec1d7d9f790ab1e1802e"
123
+ "gitHead": "3d37fe6b9dfe120308bf0374e7f93146b745f272"
124
124
  }
@@ -1,4 +1,4 @@
1
- <dl class="dl-horizontal" ng-if="(config.application.attributes && config.application.attributes.email)">
1
+ <dl class="dl-horizontal" ng-if="(vm.application.attributes && vm.application.attributes.email)">
2
2
  <dt>Owner</dt>
3
3
  <dd>{{vm.application.attributes.email}}</dd>
4
4
  <dt ng-if="vm.application.attributes.appGroup">App Group <help-field key="application.group"></help-field></dt>
@@ -55,11 +55,11 @@
55
55
  <dd>{{vm.permissions}}</dd>
56
56
  </render-if-feature>
57
57
  </dl>
58
- <p ng-if="(!config.application.attributes || !config.application.attributes.email)">
58
+ <p ng-if="(!vm.application.attributes || !vm.application.attributes.email)">
59
59
  This application has not been configured.
60
60
  </p>
61
61
  <button class="btn btn-link" ng-click="vm.editApplication()">
62
62
  <span class="glyphicon glyphicon-cog"></span>
63
- {{ (!config.application.attributes || !config.application.attributes.email) ? "Create Application" : "Edit Application
63
+ {{ (!vm.application.attributes || !vm.application.attributes.email) ? "Create Application" : "Edit Application
64
64
  Attributes"}}
65
65
  </button>
@@ -19,13 +19,10 @@ bootstrapModule.config([
19
19
  },
20
20
  ]);
21
21
 
22
- // Angular 1.6 defaults preAssignBindingsEnabled to false, reset to true to mimic 1.5 behavior.
23
- // See https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
24
22
  bootstrapModule.config([
25
23
  '$compileProvider',
26
24
  ($compileProvider: ICompileProvider) => {
27
25
  $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|mailto|slack|ssh):/);
28
- $compileProvider.preAssignBindingsEnabled(true);
29
26
  },
30
27
  ]);
31
28
 
@@ -6,15 +6,19 @@ describe('Directives: checkmap', function () {
6
6
  beforeEach(window.module(require('./checkmap.directive').name));
7
7
 
8
8
  beforeEach(
9
- window.inject(function ($rootScope, $compile) {
9
+ window.inject(function ($rootScope, $compile, $rootElement, $document) {
10
10
  this.scope = $rootScope.$new();
11
11
  this.compile = $compile;
12
+ this.rootElement = $rootElement;
13
+ this.document = $document;
12
14
  }),
13
15
  );
14
16
 
15
17
  it('updates selections when changed', function () {
16
18
  var scope = this.scope,
17
- compile = this.compile;
19
+ compile = this.compile,
20
+ rootElement = this.rootElement,
21
+ document = this.document;
18
22
 
19
23
  scope.itemMap = {
20
24
  alphabet: ['a', 'b', 'c', 'd'],
@@ -24,6 +28,11 @@ describe('Directives: checkmap', function () {
24
28
 
25
29
  var checkmap = compile('<checkmap item-map="itemMap" selected-items="selectedItems"></checkmap>')(scope);
26
30
 
31
+ //Angular 1.7 introduced changes to how checkboxes listen to change events. This primarily impacted tests where components which need to be clicked now need to be appended to the document
32
+ // See https://docs.angularjs.org/guide/migration#-input-radio-and-input-checkbox-
33
+ rootElement.append(checkmap);
34
+ document.find('body').append(rootElement);
35
+
27
36
  scope.$apply();
28
37
 
29
38
  // Initial state check.
@@ -28,19 +28,6 @@ angular
28
28
  function ($scope) {
29
29
  this.backingModel = [];
30
30
 
31
- // Set default values for optional fields
32
- this.onChange = this.onChange || angular.noop;
33
- this.keyLabel = this.keyLabel || 'Key';
34
- this.valueLabel = this.valueLabel || 'Value';
35
- this.addButtonLabel = this.addButtonLabel || 'Add Field';
36
- this.allowEmpty = this.allowEmpty || false;
37
- this.labelsLeft = this.labelsLeft || false;
38
- this.tableClass = this.label ? '' : 'no-border-top';
39
- this.columnCount = this.labelsLeft ? 5 : 3;
40
- this.model = this.model || {};
41
- this.isParameterized = isString(this.model);
42
- this.hiddenKeys = this.hiddenKeys || [];
43
-
44
31
  const modelKeys = () => Object.keys(this.model);
45
32
 
46
33
  this.addField = () => {
@@ -74,7 +61,22 @@ angular
74
61
  }
75
62
  };
76
63
 
64
+ // In Angular 1.7 Directive bindings were removed in the constructor, default values now must be instantiated within $onInit
65
+ // See https://docs.angularjs.org/guide/migration#-compile- and https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
77
66
  this.$onInit = () => {
67
+ // Set default values for optional fields
68
+ this.onChange = this.onChange || angular.noop;
69
+ this.keyLabel = this.keyLabel || 'Key';
70
+ this.valueLabel = this.valueLabel || 'Value';
71
+ this.addButtonLabel = this.addButtonLabel || 'Add Field';
72
+ this.allowEmpty = this.allowEmpty || false;
73
+ this.labelsLeft = this.labelsLeft || false;
74
+ this.tableClass = this.label ? '' : 'no-border-top';
75
+ this.columnCount = this.labelsLeft ? 5 : 3;
76
+ this.model = this.model || {};
77
+ this.isParameterized = isString(this.model);
78
+ this.hiddenKeys = this.hiddenKeys || [];
79
+
78
80
  if (this.model && !this.isParameterized) {
79
81
  modelKeys().forEach((key) => {
80
82
  this.backingModel.push({ key: key, value: this.model[key] });
@@ -5,13 +5,6 @@ describe('Component: mapEditor', function () {
5
5
 
6
6
  beforeEach(window.module(require('./mapEditor.component').name));
7
7
 
8
- // https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
9
- beforeEach(
10
- window.module(($compileProvider) => {
11
- $compileProvider.preAssignBindingsEnabled(true);
12
- }),
13
- );
14
-
15
8
  beforeEach(
16
9
  window.inject(function ($rootScope, $compile) {
17
10
  scope = $rootScope.$new();
@@ -25,7 +25,11 @@ module(CORE_PIPELINE_CONFIG_STAGES_COMMON_STAGECONFIGFIELD_STAGECONFIGFIELD_DIRE
25
25
  fieldColumns: '@',
26
26
  },
27
27
  controller: function () {
28
- this.fieldColumns = this.fieldColumns || 8;
28
+ // In Angular 1.7 Directive bindings were removed in the constructor, default values now must be instantiated within $onInit
29
+ // See https://docs.angularjs.org/guide/migration#-compile- and https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
30
+ this.$onInit = () => {
31
+ this.fieldColumns = this.fieldColumns || 8;
32
+ };
29
33
  },
30
34
  };
31
35
  });
@@ -9,13 +9,6 @@ describe('Directives: stageConfigField', function () {
9
9
 
10
10
  beforeEach(window.module(require('./stageConfigField.directive').name));
11
11
 
12
- // https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
13
- beforeEach(
14
- window.module(($compileProvider) => {
15
- $compileProvider.preAssignBindingsEnabled(true);
16
- }),
17
- );
18
-
19
12
  beforeEach(
20
13
  window.inject(function ($rootScope, $compile) {
21
14
  scope = $rootScope.$new();
@@ -4,11 +4,15 @@ import { robotToHuman } from '../../robotToHumanFilter/robotToHuman.filter';
4
4
  import type { IValidator } from './validation';
5
5
 
6
6
  const THIS_FIELD = 'This field';
7
+ // RCF 5322 Email Validation Regex taken from https://emailregex.com/
8
+ const VALID_EMAIL_REGEX = new RegExp(
9
+ '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$',
10
+ );
7
11
 
8
12
  const emailValue = (message?: string): IValidator => {
9
13
  return function emailValue(val: string, label = THIS_FIELD) {
10
14
  message = message || `${label} is not a valid email address.`;
11
- return val && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(val) && message;
15
+ return val && !VALID_EMAIL_REGEX.test(val) && message;
12
16
  };
13
17
  };
14
18
 
@@ -7,13 +7,6 @@ describe('Directives: projectCluster', function () {
7
7
 
8
8
  var $compile, $scope;
9
9
 
10
- // https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
11
- beforeEach(
12
- window.module(($compileProvider) => {
13
- $compileProvider.preAssignBindingsEnabled(true);
14
- }),
15
- );
16
-
17
10
  beforeEach(
18
11
  window.inject(function ($rootScope, _$compile_) {
19
12
  $scope = $rootScope.$new();