@spinnaker/core 0.19.4 → 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.4",
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": "3d37fe6b9dfe120308bf0374e7f93146b745f272"
123
+ "gitHead": "d5ceedd9f745e6f1156f6b5e25275cc311d4f0ab"
124
124
  }
@@ -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() {