@spinnaker/core 0.19.4 → 0.21.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.
@@ -1,6 +1,8 @@
1
1
  export declare enum ManifestRenderers {
2
2
  HELM2 = "HELM2",
3
3
  HELM3 = "HELM3",
4
- KUSTOMIZE = "KUSTOMIZE"
4
+ KUSTOMIZE = "KUSTOMIZE",
5
+ KUSTOMIZE4 = "KUSTOMIZE4"
5
6
  }
6
7
  export declare const HELM_RENDERERS: Readonly<ManifestRenderers[]>;
8
+ export declare const KUSTOMIZE_RENDERERS: Readonly<ManifestRenderers[]>;
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.21.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": "966862b2caf82b5c9879cf418a7c79ec51152dfd"
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
  }
@@ -2,7 +2,7 @@ import { isNil } from 'lodash';
2
2
  import React from 'react';
3
3
 
4
4
  import type { IFormikStageConfigInjectedProps } from '../FormikStageConfig';
5
- import { HELM_RENDERERS, ManifestRenderers } from './ManifestRenderers';
5
+ import { HELM_RENDERERS, KUSTOMIZE_RENDERERS } from './ManifestRenderers';
6
6
  import { ExpectedArtifactService } from '../../../../artifact';
7
7
  import { StageConfigField } from '../common';
8
8
  import type { IExpectedArtifact } from '../../../../domain';
@@ -26,7 +26,7 @@ export function BakeManifestStageForm({ application, formik, pipeline }: IFormik
26
26
 
27
27
  // Clear renderer-specific fields when selected renderer changes
28
28
  React.useEffect(() => {
29
- if (stage.templateRenderer == ManifestRenderers.KUSTOMIZE && !isNil(stage.inputArtifacts)) {
29
+ if (KUSTOMIZE_RENDERERS.includes(stage.templateRenderer) && !isNil(stage.inputArtifacts)) {
30
30
  formik.setFieldValue('inputArtifacts', null);
31
31
  }
32
32
  if (HELM_RENDERERS.includes(stage.templateRenderer) && !isNil(stage.inputArtifact)) {
@@ -35,7 +35,7 @@ export function BakeManifestStageForm({ application, formik, pipeline }: IFormik
35
35
  }, [stage.templateRenderer]);
36
36
 
37
37
  const templateRenderers = React.useMemo(() => {
38
- return [...HELM_RENDERERS, ManifestRenderers.KUSTOMIZE];
38
+ return [...KUSTOMIZE_RENDERERS, ...HELM_RENDERERS];
39
39
  }, []);
40
40
 
41
41
  return (
@@ -56,7 +56,7 @@ export function BakeManifestStageForm({ application, formik, pipeline }: IFormik
56
56
  stringOptions={templateRenderers}
57
57
  />
58
58
  </StageConfigField>
59
- {stage.templateRenderer === ManifestRenderers.KUSTOMIZE && (
59
+ {KUSTOMIZE_RENDERERS.includes(stage.templateRenderer) && (
60
60
  <BakeKustomizeConfigForm pipeline={pipeline} application={application} formik={formik} />
61
61
  )}
62
62
  {HELM_RENDERERS.includes(stage.templateRenderer) && (
@@ -2,6 +2,11 @@ export enum ManifestRenderers {
2
2
  HELM2 = 'HELM2',
3
3
  HELM3 = 'HELM3',
4
4
  KUSTOMIZE = 'KUSTOMIZE',
5
+ KUSTOMIZE4 = 'KUSTOMIZE4',
5
6
  }
6
7
 
7
8
  export const HELM_RENDERERS: Readonly<ManifestRenderers[]> = [ManifestRenderers.HELM2, ManifestRenderers.HELM3];
9
+ export const KUSTOMIZE_RENDERERS: Readonly<ManifestRenderers[]> = [
10
+ ManifestRenderers.KUSTOMIZE,
11
+ ManifestRenderers.KUSTOMIZE4,
12
+ ];
@@ -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() {
@@ -7,7 +7,7 @@ import { OrchestratedItemRunningTime } from './OrchestratedItemRunningTime';
7
7
  import type { Application } from '../../../application/application.model';
8
8
  import { SETTINGS } from '../../../config/settings';
9
9
  import { ExecutionBarLabel } from '../../config/stages/common/ExecutionBarLabel';
10
- import type { IExecution, IExecutionStageSummary } from '../../../domain';
10
+ import type { IExecution, IExecutionStageSummary, IStage } from '../../../domain';
11
11
  import { logger } from '../../../utils';
12
12
  import { duration } from '../../../utils/timeFormatters';
13
13
 
@@ -94,7 +94,19 @@ export class ExecutionMarker extends React.Component<IExecutionMarkerProps, IExe
94
94
 
95
95
  public render() {
96
96
  const { stage, application, execution, active, previousStageActive, width } = this.props;
97
- const stageType = (stage.activeStageType || stage.type).toLowerCase(); // support groups
97
+ let stageType = (stage.activeStageType || stage.type).toLowerCase(); // support groups
98
+ stage.stages.forEach((childStage: IStage) => {
99
+ if (childStage.type == 'pipeline') {
100
+ const childPipeline = application.executions.data.find((p: any) => p.id === childStage.context.executionId);
101
+ if (childPipeline != undefined) {
102
+ childPipeline.stages.forEach((stageToCheck: IStage) => {
103
+ if (stageToCheck.type == 'manualJudgment' && stageToCheck.status == 'RUNNING') {
104
+ stageType = 'manualjudgment';
105
+ }
106
+ });
107
+ }
108
+ }
109
+ });
98
110
  const pipelineStatus = this.stageStatus(stage.status.toLowerCase());
99
111
  const markerClassName = [
100
112
  stage.type !== 'group' ? 'clickable' : '',