@spinnaker/core 0.19.2 → 0.20.0

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.2",
4
+ "version": "0.20.0",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
@@ -74,7 +74,7 @@
74
74
  "react-virtualized": "9.18.5",
75
75
  "react-virtualized-select": "3.1.3",
76
76
  "react2angular": "3.2.1",
77
- "recoil": "0.0.10",
77
+ "recoil": "0.7.2",
78
78
  "rxjs": "6.6.7",
79
79
  "select2": "3.5.1",
80
80
  "select2-bootstrap-css": "1.4.6",
@@ -120,5 +120,5 @@
120
120
  "shx": "0.3.3",
121
121
  "typescript": "4.3.5"
122
122
  },
123
- "gitHead": "3ea12b48839ff145c4a602d489507f317b06f856"
123
+ "gitHead": "d5ceedd9f745e6f1156f6b5e25275cc311d4f0ab"
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>
@@ -1,7 +1,25 @@
1
1
  import { atom } from 'recoil';
2
- import { CollapsibleSectionStateCache } from '../../cache/collapsibleSectionStateCache';
2
+ import { CollapsibleSectionStateCache } from '../../cache';
3
3
 
4
4
  export const verticalNavExpandedAtom = atom({
5
5
  key: 'verticalNavExpanded',
6
6
  default: !CollapsibleSectionStateCache.isSet('verticalNav') || CollapsibleSectionStateCache.isExpanded('verticalNav'),
7
+ effects: [
8
+ ({ setSelf, trigger }) => {
9
+ if (trigger === 'get') {
10
+ // Avoid expensive initialization
11
+ setSelf(
12
+ !CollapsibleSectionStateCache.isSet('verticalNav') || CollapsibleSectionStateCache.isExpanded('verticalNav'),
13
+ );
14
+ }
15
+ CollapsibleSectionStateCache.onChange('verticalNav', (expanded: boolean) => {
16
+ setSelf(expanded);
17
+ });
18
+
19
+ return () => {
20
+ // clean up
21
+ CollapsibleSectionStateCache.onChange('verticalNav', null);
22
+ };
23
+ },
24
+ ],
7
25
  });
@@ -5,6 +5,7 @@ export class CollapsibleSectionStateCacheInternal {
5
5
  private cacheFactory = new CacheFactory();
6
6
  private cacheId = 'collapsibleSectionStateCache';
7
7
  private stateCache: Cache;
8
+ private handlers = new Map();
8
9
 
9
10
  constructor() {
10
11
  try {
@@ -31,6 +32,16 @@ export class CollapsibleSectionStateCacheInternal {
31
32
  public setExpanded(heading: string, expanded: boolean) {
32
33
  if (heading) {
33
34
  this.stateCache.put(heading, !!expanded);
35
+ const handler = this.handlers.get(heading);
36
+ if (handler) {
37
+ handler(!CollapsibleSectionStateCache.isSet(heading) || CollapsibleSectionStateCache.isExpanded(heading));
38
+ }
39
+ }
40
+ }
41
+
42
+ public onChange(heading: string, listener: Function) {
43
+ if (!this.handlers.get(heading)) {
44
+ this.handlers.set(heading, listener);
34
45
  }
35
46
  }
36
47
  }
@@ -34,6 +34,7 @@ export class BakeHelmConfigForm extends React.Component<IFormikStageConfigInject
34
34
  ArtifactTypePatterns.S3_OBJECT,
35
35
  ArtifactTypePatterns.HELM_CHART,
36
36
  ArtifactTypePatterns.HTTP_FILE,
37
+ ArtifactTypePatterns.ORACLE_OBJECT,
37
38
  );
38
39
 
39
40
  public componentDidMount() {
@@ -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