]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13890 Make bitbucket/github tutorial ending a stand-alone step for increased...
authorMathieu Suen <mathieu.suen@sonarsource.com>
Fri, 13 Aug 2021 14:04:43 +0000 (16:04 +0200)
committersonartech <sonartech@sonarsource.com>
Sat, 14 Aug 2021 20:02:57 +0000 (20:02 +0000)
47 files changed:
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-test.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/components/YamlFileStep.tsx
server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/YamlFileStep-test.tsx
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/YamlFileStep-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/AnalysisCommand-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GitHubActionTutorial-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GitHubActionTutorial-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/CFamily-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/DotNet-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Gradle-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/JavaMaven-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Others-test.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/DotNet-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Others-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/JenkinsfileStep.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsfileStep-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/DotNet.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/Gradle.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/Maven.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/Other.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CFamilly-test.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNet-test.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Gradle-test.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Maven-test.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Other-test.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CFamilly-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Maven-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Other-test.tsx.snap

index 1c53cd067bed8d72f840e30770514284dd77875a..b5a79c1d5002b78c7e1bacc23c9081249c5438b5 100644 (file)
@@ -32,7 +32,7 @@ import { PreambuleYaml } from './PreambuleYaml';
 
 export interface AnalysisCommandProps {
   appState: T.AppState;
-  buildTool?: BuildTools;
+  buildTool: BuildTools;
   component: T.Component;
 }
 
index 982c7cc4b6afea8008db3e7638970699df4b262c..b41b7749e4186b0de82f1ef2d2780d83673b444f 100644 (file)
@@ -24,6 +24,8 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../types/alm-settings';
+import AllSetStep from '../components/AllSetStep';
+import FinishButton from '../components/FinishButton';
 import Step from '../components/Step';
 import YamlFileStep from '../components/YamlFileStep';
 import AnalysisCommand from './AnalysisCommand';
@@ -31,7 +33,8 @@ import RepositoryVariables from './RepositoryVariables';
 
 export enum Steps {
   REPOSITORY_VARIABLES = 1,
-  YAML = 2
+  YAML = 2,
+  ALL_SET = 3
 }
 
 export interface BitbucketPipelinesTutorialProps {
@@ -66,16 +69,27 @@ export default function BitbucketPipelinesTutorial(props: BitbucketPipelinesTuto
         stepTitle={translate('onboarding.tutorial.with.bitbucket_pipelines.create_secret.title')}
       />
       <Step
+        finished={step > Steps.YAML}
         onOpen={() => setStep(Steps.YAML)}
         open={step === Steps.YAML}
         renderForm={() => (
-          <YamlFileStep alm={AlmKeys.BitbucketCloud}>
-            {buildTool => <AnalysisCommand buildTool={buildTool} component={component} />}
+          <YamlFileStep>
+            {buildTool => (
+              <>
+                <AnalysisCommand buildTool={buildTool} component={component} />
+                <FinishButton onClick={() => setStep(Steps.ALL_SET)} />
+              </>
+            )}
           </YamlFileStep>
         )}
         stepNumber={Steps.YAML}
         stepTitle={translate('onboarding.tutorial.with.bitbucket_pipelines.yaml.title')}
       />
+      <AllSetStep
+        alm={almBinding?.alm || AlmKeys.BitbucketCloud}
+        open={step === Steps.ALL_SET}
+        stepNumber={Steps.ALL_SET}
+      />
     </>
   );
 }
index 1bad0d829df55f821ede8d3abfb0a9cbafe42261..8200ad279049d601c43a7dd0b433be3ed9e13c56 100644 (file)
@@ -32,6 +32,7 @@ import BitbucketPipelinesTutorial, {
 
 it('should render correctly', () => {
   expect(shallowRender()).toMatchSnapshot('default');
+  expect(shallowRender({ almBinding: undefined })).toMatchSnapshot('no binding');
   expect(renderStepContent(shallowRender())).toMatchSnapshot('repo variable step content');
   expect(renderStepContent(shallowRender(), 1)).toMatchSnapshot('yaml file step content');
 });
index 45e2b22a3674e96f53474a0d77e0393e6ae12a4f..819ee58c0154753dba38b50812cc04ca590d890d 100644 (file)
@@ -11,12 +11,44 @@ exports[`should render correctly: default 1`] = `
     stepTitle="onboarding.tutorial.with.bitbucket_pipelines.create_secret.title"
   />
   <Step
+    finished={false}
     onOpen={[Function]}
     open={false}
     renderForm={[Function]}
     stepNumber={2}
     stepTitle="onboarding.tutorial.with.bitbucket_pipelines.yaml.title"
   />
+  <AllSetStep
+    alm="github"
+    open={false}
+    stepNumber={3}
+  />
+</Fragment>
+`;
+
+exports[`should render correctly: no binding 1`] = `
+<Fragment>
+  <Step
+    finished={false}
+    onOpen={[Function]}
+    open={true}
+    renderForm={[Function]}
+    stepNumber={1}
+    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.create_secret.title"
+  />
+  <Step
+    finished={false}
+    onOpen={[Function]}
+    open={false}
+    renderForm={[Function]}
+    stepNumber={2}
+    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.yaml.title"
+  />
+  <AllSetStep
+    alm="bitbucketcloud"
+    open={false}
+    stepNumber={3}
+  />
 </Fragment>
 `;
 
@@ -73,9 +105,7 @@ exports[`should render correctly: repo variable step content 1`] = `
 `;
 
 exports[`should render correctly: yaml file step content 1`] = `
-<Connect(withCLanguageFeature(YamlFileStep))
-  alm="bitbucketcloud"
->
+<Connect(withCLanguageFeature(YamlFileStep))>
   [Function]
 </Connect(withCLanguageFeature(YamlFileStep))>
 `;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx b/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx
new file mode 100644 (file)
index 0000000..491637b
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import * as React from 'react';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
+import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { rawSizes } from '../../../app/theme';
+
+export interface FinishButtonProps {
+  onClick: () => void;
+}
+
+export default function FinishButton(props: FinishButtonProps) {
+  return (
+    <Button className="big-spacer-top big-spacer-bottom" onClick={props.onClick}>
+      {translate('tutorials.finish')}
+      <ChevronRightIcon size={rawSizes.baseFontSizeRaw} />
+    </Button>
+  );
+}
index 1c28586d3e81d32338930420a63f2be64af3885e..f9a6c4828c26a828b94e0298fc9ed9f57231f017 100644 (file)
  */
 import * as React from 'react';
 import { translate } from 'sonar-ui-common/helpers/l10n';
-import { AlmKeys } from '../../../types/alm-settings';
 import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
 import RenderOptions from '../components/RenderOptions';
 import { BuildTools } from '../types';
-import AllSet from './AllSet';
 
 export interface YamlFileStepProps {
-  alm: AlmKeys;
-  children?: (buildTool?: BuildTools) => React.ReactElement<{}>;
+  children?: (buildTool: BuildTools) => React.ReactElement<{}>;
   hasCLanguageFeature: boolean;
 }
 
@@ -38,7 +35,7 @@ export interface AnalysisCommandProps {
 }
 
 export function YamlFileStep(props: YamlFileStepProps) {
-  const { alm, children, hasCLanguageFeature } = props;
+  const { children, hasCLanguageFeature } = props;
 
   const buildTools = [BuildTools.Maven, BuildTools.Gradle, BuildTools.DotNet];
   if (hasCLanguageFeature) {
@@ -62,14 +59,8 @@ export function YamlFileStep(props: YamlFileStepProps) {
             optionLabelKey="onboarding.build"
           />
         </li>
-        {children && children(buildToolSelected)}
+        {children && buildToolSelected && children(buildToolSelected)}
       </ol>
-      {buildToolSelected !== undefined && (
-        <>
-          <hr className="huge-spacer-top huge-spacer-bottom" />
-          <AllSet alm={alm} />
-        </>
-      )}
     </>
   );
 }
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx
new file mode 100644 (file)
index 0000000..f14de7b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import FinishButton, { FinishButtonProps } from '../FinishButton';
+
+it('should render correctly', () => {
+  expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<FinishButtonProps> = {}) {
+  return shallow<FinishButtonProps>(<FinishButton onClick={jest.fn()} {...props} />);
+}
index 936287cac5538b95921ac9e7a506c81c5fb9ec68..b657844f5a9f5b1231b64b9105e5ffc245491b31 100644 (file)
@@ -19,7 +19,8 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
-import { AlmKeys } from '../../../../types/alm-settings';
+import { BuildTools } from '../../types';
+import RenderOptions from '../RenderOptions';
 import { YamlFileStep, YamlFileStepProps } from '../YamlFileStep';
 
 it('should render correctly', () => {
@@ -27,8 +28,14 @@ it('should render correctly', () => {
   expect(shallowRender({ hasCLanguageFeature: true })).toMatchSnapshot('C available');
 });
 
+it('should render child correctly', () => {
+  const children = jest.fn();
+  const wrapper = shallowRender({ children });
+  expect(wrapper).toMatchSnapshot('C unavailable');
+  wrapper.find(RenderOptions).simulate('check', BuildTools.DotNet);
+  expect(children).toBeCalledWith(BuildTools.DotNet);
+});
+
 function shallowRender(props: Partial<YamlFileStepProps> = {}) {
-  return shallow<YamlFileStepProps>(
-    <YamlFileStep alm={AlmKeys.GitHub} hasCLanguageFeature={false} {...props} />
-  );
+  return shallow<YamlFileStepProps>(<YamlFileStep hasCLanguageFeature={false} {...props} />);
 }
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap
new file mode 100644 (file)
index 0000000..fe4e121
--- /dev/null
@@ -0,0 +1,13 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<Button
+  className="big-spacer-top big-spacer-bottom"
+  onClick={[MockFunction]}
+>
+  tutorials.finish
+  <ChevronRightIcon
+    size={13}
+  />
+</Button>
+`;
index c33c7635df3aec9fd0b54bd31404f969c9fb89d5..5b13369d15c8907dfbb0e0bd8b1bc1b771d8a878 100644 (file)
@@ -1,5 +1,30 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
+exports[`should render child correctly: C unavailable 1`] = `
+<Fragment>
+  <ol
+    className="list-styled big-spacer-top big-spacer-bottom"
+  >
+    <li>
+      onboarding.build
+      <RenderOptions
+        name="language"
+        onCheck={[Function]}
+        optionLabelKey="onboarding.build"
+        options={
+          Array [
+            "maven",
+            "gradle",
+            "dotnet",
+            "other",
+          ]
+        }
+      />
+    </li>
+  </ol>
+</Fragment>
+`;
+
 exports[`should render correctly: C available 1`] = `
 <Fragment>
   <ol
index 40e2333e4e708f5bc8f7db050db54747884ee210..e21a74c8dc1065fb40c3ce591a2f6a14fc9f612c 100644 (file)
@@ -28,8 +28,9 @@ import Others from './commands/Others';
 
 export interface AnalysisCommandProps {
   appState: T.AppState;
-  buildTool?: BuildTools;
+  buildTool: BuildTools;
   component: T.Component;
+  onDone: () => void;
 }
 
 export function AnalysisCommand(props: AnalysisCommandProps) {
@@ -45,15 +46,25 @@ export function AnalysisCommand(props: AnalysisCommandProps) {
 
   switch (buildTool) {
     case BuildTools.Maven:
-      return <JavaMaven branchesEnabled={branchesEnabled} component={component} />;
+      return (
+        <JavaMaven branchesEnabled={branchesEnabled} component={component} onDone={props.onDone} />
+      );
     case BuildTools.Gradle:
-      return <Gradle branchesEnabled={branchesEnabled} component={component} />;
+      return (
+        <Gradle branchesEnabled={branchesEnabled} component={component} onDone={props.onDone} />
+      );
     case BuildTools.DotNet:
-      return <DotNet branchesEnabled={branchesEnabled} component={component} />;
+      return (
+        <DotNet branchesEnabled={branchesEnabled} component={component} onDone={props.onDone} />
+      );
     case BuildTools.CFamily:
-      return <CFamily branchesEnabled={branchesEnabled} component={component} />;
+      return (
+        <CFamily branchesEnabled={branchesEnabled} component={component} onDone={props.onDone} />
+      );
     case BuildTools.Other:
-      return <Others branchesEnabled={branchesEnabled} component={component} />;
+      return (
+        <Others branchesEnabled={branchesEnabled} component={component} onDone={props.onDone} />
+      );
   }
   return null;
 }
index 88bdaf9e8978df6ae095c22805b76fd20a2f1970..03647bf12c0161627e8690779d01058fcea9b6e7 100644 (file)
@@ -24,6 +24,7 @@ import {
   AlmSettingsInstance,
   ProjectAlmBindingResponse
 } from '../../../types/alm-settings';
+import AllSetStep from '../components/AllSetStep';
 import Step from '../components/Step';
 import YamlFileStep from '../components/YamlFileStep';
 import AnalysisCommand from './AnalysisCommand';
@@ -31,7 +32,8 @@ import SecretStep from './SecretStep';
 
 export enum Steps {
   CREATE_SECRET = 1,
-  YAML = 2
+  YAML = 2,
+  ALL_SET = 3
 }
 
 export interface GitHubActionTutorialProps {
@@ -66,16 +68,28 @@ export default function GitHubActionTutorial(props: GitHubActionTutorialProps) {
         stepTitle={translate('onboarding.tutorial.with.github_action.create_secret.title')}
       />
       <Step
+        finished={step > Steps.YAML}
         onOpen={() => setStep(Steps.YAML)}
         open={step === Steps.YAML}
         renderForm={() => (
-          <YamlFileStep alm={AlmKeys.GitHub}>
-            {buildTool => <AnalysisCommand buildTool={buildTool} component={component} />}
+          <YamlFileStep>
+            {buildTool => (
+              <AnalysisCommand
+                buildTool={buildTool}
+                component={component}
+                onDone={() => setStep(Steps.ALL_SET)}
+              />
+            )}
           </YamlFileStep>
         )}
         stepNumber={Steps.YAML}
         stepTitle={translate('onboarding.tutorial.with.github_action.yaml.title')}
       />
+      <AllSetStep
+        alm={almBinding?.alm || AlmKeys.GitHub}
+        open={step === Steps.ALL_SET}
+        stepNumber={Steps.ALL_SET}
+      />
     </>
   );
 }
index 461b5ac519ce5989e4b997ea8ba9e28ca3db17e8..1013f5cee2181d8e47bbe54b61c64997bd7b714a 100644 (file)
@@ -36,6 +36,12 @@ it.each([
 
 function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
   return shallow<AnalysisCommandProps>(
-    <AnalysisCommand appState={mockAppState()} component={mockComponent()} {...props} />
+    <AnalysisCommand
+      appState={mockAppState()}
+      component={mockComponent()}
+      buildTool={BuildTools.DotNet}
+      onDone={jest.fn()}
+      {...props}
+    />
   );
 }
index d0fb0ccadcebad4fdd72902046850fdebd3ae93f..891c84a1e1dd6d48419c166bc47819d5598c1d9c 100644 (file)
@@ -30,6 +30,7 @@ import GitHubActionTutorial, { GitHubActionTutorialProps } from '../GitHubAction
 
 it('should render correctly', () => {
   expect(shallowRender()).toMatchSnapshot('default');
+  expect(shallowRender({ almBinding: undefined })).toMatchSnapshot('no binding');
   expect(renderStepContent(shallowRender())).toMatchSnapshot('secrets step content');
   expect(renderStepContent(shallowRender(), 1)).toMatchSnapshot('yaml file step content');
 });
index 99f415c28cbf36d729f88e5d429d9ae5551dad5f..9d88eb179df37d572000ceeeb14f2c5dd5823217 100644 (file)
@@ -24,6 +24,7 @@ exports[`should render correctly for "cfamily" 1`] = `
       "tags": Array [],
     }
   }
+  onDone={[MockFunction]}
 />
 `;
 
@@ -51,6 +52,7 @@ exports[`should render correctly for "dotnet" 1`] = `
       "tags": Array [],
     }
   }
+  onDone={[MockFunction]}
 />
 `;
 
@@ -78,6 +80,7 @@ exports[`should render correctly for "gradle" 1`] = `
       "tags": Array [],
     }
   }
+  onDone={[MockFunction]}
 />
 `;
 
@@ -105,6 +108,7 @@ exports[`should render correctly for "maven" 1`] = `
       "tags": Array [],
     }
   }
+  onDone={[MockFunction]}
 />
 `;
 
@@ -132,6 +136,7 @@ exports[`should render correctly for "other" 1`] = `
       "tags": Array [],
     }
   }
+  onDone={[MockFunction]}
 />
 `;
 
index a4e2065b68b3ac40968aa85a5c5c43ec3790d106..bea7818d24e3d648466eed8af20b903448120af9 100644 (file)
@@ -11,12 +11,44 @@ exports[`should render correctly: default 1`] = `
     stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
   />
   <Step
+    finished={false}
     onOpen={[Function]}
     open={false}
     renderForm={[Function]}
     stepNumber={2}
     stepTitle="onboarding.tutorial.with.github_action.yaml.title"
   />
+  <AllSetStep
+    alm="github"
+    open={false}
+    stepNumber={3}
+  />
+</Fragment>
+`;
+
+exports[`should render correctly: no binding 1`] = `
+<Fragment>
+  <Step
+    finished={false}
+    onOpen={[Function]}
+    open={true}
+    renderForm={[Function]}
+    stepNumber={1}
+    stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
+  />
+  <Step
+    finished={false}
+    onOpen={[Function]}
+    open={false}
+    renderForm={[Function]}
+    stepNumber={2}
+    stepTitle="onboarding.tutorial.with.github_action.yaml.title"
+  />
+  <AllSetStep
+    alm="github"
+    open={false}
+    stepNumber={3}
+  />
 </Fragment>
 `;
 
@@ -73,9 +105,7 @@ exports[`should render correctly: secrets step content 1`] = `
 `;
 
 exports[`should render correctly: yaml file step content 1`] = `
-<Connect(withCLanguageFeature(YamlFileStep))
-  alm="github"
->
+<Connect(withCLanguageFeature(YamlFileStep))>
   [Function]
 </Connect(withCLanguageFeature(YamlFileStep))>
 `;
index f673d58461b5ce60269268b7be4109117d39e647..4f2a13aeae782376cb0f10b4812bdafb857e5550 100644 (file)
@@ -22,12 +22,14 @@ import { translate } from 'sonar-ui-common/helpers/l10n';
 import { CompilationInfo } from '../../components/CompilationInfo';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
+import FinishButton from '../../components/FinishButton';
 import RenderOptions from '../../components/RenderOptions';
 import { OSs } from '../../types';
 
 export interface CFamilyProps {
   branchesEnabled?: boolean;
   component: T.Component;
+  onDone: () => void;
 }
 
 const STEPS = {
@@ -155,6 +157,7 @@ export default function CFamily(props: CFamilyProps) {
             yamlTemplate={cfamilyYamlTemplate(!!branchesEnabled, os)}
           />
           <CompilationInfo className="abs-width-800" />
+          <FinishButton onClick={props.onDone} />
         </>
       )}
     </>
index c99e812057fe6c39e0d50a3ced382fb25b78f0cb..003e26868a34bd2c7d1bf78677be5eefbee7bd6d 100644 (file)
  */
 import * as React from 'react';
 import CreateYmlFile from '../../components/CreateYmlFile';
+import FinishButton from '../../components/FinishButton';
 
 export interface DotNetProps {
   branchesEnabled?: boolean;
   component: T.Component;
+  onDone: () => void;
 }
 
 const dotnetYamlTemplate = (projectKey: string, branchesEnabled: boolean) => `name: Build
@@ -74,9 +76,12 @@ jobs:
 export default function DotNet(props: DotNetProps) {
   const { component, branchesEnabled } = props;
   return (
-    <CreateYmlFile
-      yamlFileName=".github/workflows/build.yml"
-      yamlTemplate={dotnetYamlTemplate(component.key, !!branchesEnabled)}
-    />
+    <>
+      <CreateYmlFile
+        yamlFileName=".github/workflows/build.yml"
+        yamlTemplate={dotnetYamlTemplate(component.key, !!branchesEnabled)}
+      />
+      <FinishButton onClick={props.onDone} />
+    </>
   );
 }
index 42cffc2d98c2388b86e83fbfb752cf62f6fc9a0a..af28cb252619f29d68080b627ef761aea736260d 100644 (file)
@@ -23,11 +23,13 @@ import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboa
 import { translate } from 'sonar-ui-common/helpers/l10n';
 import CodeSnippet from '../../../common/CodeSnippet';
 import CreateYmlFile from '../../components/CreateYmlFile';
+import FinishButton from '../../components/FinishButton';
 import { buildGradleSnippet } from '../../utils';
 
 export interface GradleProps {
   branchesEnabled?: boolean;
   component: T.Component;
+  onDone: () => void;
 }
 const gradleYamlTemplate = (branchesEnabled: boolean) => `name: Build
 on:
@@ -91,6 +93,7 @@ export default function Gradle(props: GradleProps) {
         yamlFileName=".github/workflows/build.yml"
         yamlTemplate={gradleYamlTemplate(!!branchesEnabled)}
       />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index 54d21e2232cc14de681219fc6bf55db69bd1fd8d..879f9df33343590e389e1127702cd6cc13cac1cd 100644 (file)
@@ -23,11 +23,13 @@ import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboa
 import { translate } from 'sonar-ui-common/helpers/l10n';
 import CodeSnippet from '../../../common/CodeSnippet';
 import CreateYmlFile from '../../components/CreateYmlFile';
+import FinishButton from '../../components/FinishButton';
 import { mavenPomSnippet } from '../../utils';
 
 export interface JavaMavenProps {
   branchesEnabled?: boolean;
   component: T.Component;
+  onDone: () => void;
 }
 
 const mavenYamlTemplte = (branchesEnabled: boolean) => `name: Build
@@ -90,6 +92,7 @@ export default function JavaMaven(props: JavaMavenProps) {
         yamlFileName=".github/workflows/build.yml"
         yamlTemplate={mavenYamlTemplte(!!branchesEnabled)}
       />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index ea4f93e419f2ca8de75eaa6157defe9de39cf3b6..425f10557f9170c18383fcc3cd568e75649ad8db 100644 (file)
 import * as React from 'react';
 import CreateYmlFile from '../../components/CreateYmlFile';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
+import FinishButton from '../../components/FinishButton';
 
 export interface OthersProps {
   branchesEnabled?: boolean;
   component: T.Component;
+  onDone: () => void;
 }
 
 const yamlTemplate = (branchesEnabled: boolean) => {
@@ -79,6 +81,7 @@ export default function Others(props: OthersProps) {
         yamlFileName=".github/workflows/build.yml"
         yamlTemplate={yamlTemplate(!!branchesEnabled)}
       />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index c809742bb894b6aa9315cfcd8bfefc886049191f..f851057286e87c5ea5c018e8e57ffc0eba8d21f8 100644 (file)
@@ -43,6 +43,6 @@ it.each([
 
 function shallowRender(props: Partial<CFamilyProps> = {}) {
   return shallow<CFamilyProps>(
-    <CFamily branchesEnabled={true} component={mockComponent()} {...props} />
+    <CFamily branchesEnabled={true} component={mockComponent()} {...props} onDone={jest.fn()} />
   );
 }
index 64f0b1e4517f116a5cfd5acd29ebbe568617c25d..c44d6ee550faa3ac38011f6907625bfcdb4eca55 100644 (file)
@@ -29,6 +29,6 @@ it('should render correctly', () => {
 
 function shallowRender(props: Partial<DotNetProps> = {}) {
   return shallow<DotNetProps>(
-    <DotNet branchesEnabled={true} component={mockComponent()} {...props} />
+    <DotNet branchesEnabled={true} component={mockComponent()} {...props} onDone={jest.fn()} />
   );
 }
index cc1adcff93c418a86aa5474eaf25cb22af6d0539..50431d5dc81c0bb3eae42c790e24cb55be3ba20b 100644 (file)
@@ -29,6 +29,6 @@ it('should render correctly', () => {
 
 function shallowRender(props: Partial<GradleProps> = {}) {
   return shallow<GradleProps>(
-    <Gradle branchesEnabled={true} component={mockComponent()} {...props} />
+    <Gradle branchesEnabled={true} component={mockComponent()} {...props} onDone={jest.fn()} />
   );
 }
index 809996402a827ff9c9d8e2dbdb910c7b9a52d8d1..6b0aecdff161837a2a7614e87d58a71134092141 100644 (file)
@@ -29,6 +29,6 @@ it('should render correctly', () => {
 
 function shallowRender(props: Partial<JavaMavenProps> = {}) {
   return shallow<JavaMavenProps>(
-    <JavaMaven branchesEnabled={true} component={mockComponent()} {...props} />
+    <JavaMaven branchesEnabled={true} component={mockComponent()} {...props} onDone={jest.fn()} />
   );
 }
index 8130c93369e2a98622e2907a417ecced7e0df48c..cb799f321c1b850961d933a8752c7bc0d18379a9 100644 (file)
@@ -29,6 +29,6 @@ it('should render correctly', () => {
 
 function shallowRender(props: Partial<OthersProps> = {}) {
   return shallow<OthersProps>(
-    <Others branchesEnabled={true} component={mockComponent()} {...props} />
+    <Others branchesEnabled={true} component={mockComponent()} {...props} onDone={jest.fn()} />
   );
 }
index 6e48693b2a4981d8cdc2a559f53cf3928581cd41..964c6787a55cf092ebed847ab33b86fe460e21cb 100644 (file)
@@ -129,6 +129,9 @@ jobs:
   <CompilationInfo
     className="abs-width-800"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -221,6 +224,9 @@ jobs:
   <CompilationInfo
     className="abs-width-800"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -322,5 +328,8 @@ jobs:
   <CompilationInfo
     className="abs-width-800"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
index afb06fa5683bd33ea88c72880532f92d0897209c..3e0e44b10decb1e87ab6b0bf68ac01a9dd5b6f81 100644 (file)
@@ -1,9 +1,10 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
 exports[`should render correctly 1`] = `
-<CreateYmlFile
-  yamlFileName=".github/workflows/build.yml"
-  yamlTemplate="name: Build
+<Fragment>
+  <CreateYmlFile
+    yamlFileName=".github/workflows/build.yml"
+    yamlTemplate="name: Build
 on:
   push:
     branches:
@@ -49,13 +50,18 @@ jobs:
           .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\" /d:sonar.host.url=\\"\${{ secrets.SONAR_HOST_URL }}\\"
           dotnet build
           .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner end /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\""
-/>
+  />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
+</Fragment>
 `;
 
 exports[`should render correctly: without branch enabled 1`] = `
-<CreateYmlFile
-  yamlFileName=".github/workflows/build.yml"
-  yamlTemplate="name: Build
+<Fragment>
+  <CreateYmlFile
+    yamlFileName=".github/workflows/build.yml"
+    yamlTemplate="name: Build
 on:
   push:
     branches:
@@ -100,5 +106,9 @@ jobs:
           .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\" /d:sonar.host.url=\\"\${{ secrets.SONAR_HOST_URL }}\\"
           dotnet build
           .\\\\.sonar\\\\scanner\\\\dotnet-sonarscanner end /d:sonar.login=\\"\${{ secrets.SONAR_TOKEN }}\\""
-/>
+  />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
+</Fragment>
 `;
index d6ebf7d8b7edc1b6b89bc1c35f139211be3bbaec..c37eb9b781996afa9f5c1278a8637feb1e6bb5ee 100644 (file)
@@ -80,6 +80,9 @@ jobs:
           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
         run: ./gradlew build sonarqube --info"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -162,5 +165,8 @@ jobs:
           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
         run: ./gradlew build sonarqube --info"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
index 6aa14eb97deed0e73ba10fd3ed382061dadf73a0..2def81470d02b4eceecf7d978039940e3c6c1ec1 100644 (file)
@@ -69,6 +69,9 @@ jobs:
           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
         run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -140,5 +143,8 @@ jobs:
           SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
         run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
index 1f02cbc2cc75c88bffdbce12ac4967b1ed171c18..6ecc6c79c53b4f226efd00354f8377bcc0cbb536 100644 (file)
@@ -56,6 +56,9 @@ jobs:
       #   env:
       #     SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -111,5 +114,8 @@ jobs:
       #   env:
       #     SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
   />
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
index 6e8e84e2b0b1c1aac0e08595953d4050127e6119..a6ab708384f9b72dd3890ad17b862f2dc67881db 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
-import { Button } from 'sonar-ui-common/components/controls/buttons';
-import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
 import { Alert } from 'sonar-ui-common/components/ui/Alert';
 import { translate } from 'sonar-ui-common/helpers/l10n';
-import { rawSizes } from '../../../app/theme';
 import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
 import RenderOptions from '../components/RenderOptions';
 import Step from '../components/Step';
@@ -44,6 +41,7 @@ export interface JenkinsfileStepProps {
 }
 
 export interface LanguageProps {
+  onDone: () => void;
   component: T.Component;
   baseUrl: string;
 }
@@ -89,14 +87,12 @@ export function JenkinsfileStep(props: JenkinsfileStepProps) {
               )}
             </li>
             {buildTool !== undefined &&
-              React.createElement(BUILDTOOL_COMPONENT_MAP[buildTool], { component, baseUrl })}
+              React.createElement(BUILDTOOL_COMPONENT_MAP[buildTool], {
+                component,
+                baseUrl,
+                onDone: props.onDone
+              })}
           </ol>
-          {buildTool !== undefined && (
-            <Button className="big-spacer-top" onClick={props.onDone}>
-              {translate('tutorials.finish')}
-              <ChevronRightIcon size={rawSizes.baseFontSizeRaw} />
-            </Button>
-          )}
         </div>
       )}
       stepNumber={3}
index 62c25169a1a2d66c96e081aefa4bb2dc36b846e5..f99f6e725271c55b54d32a4b2999547502c544e4 100644 (file)
@@ -48,17 +48,9 @@ exports[`should render correctly for .NET 1`] = `
           "tags": Array [],
         }
       }
+      onDone={[MockFunction]}
     />
   </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    tutorials.finish
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
 </div>
 `;
 
@@ -110,17 +102,9 @@ exports[`should render correctly for Gradle 1`] = `
           "tags": Array [],
         }
       }
+      onDone={[MockFunction]}
     />
   </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    tutorials.finish
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
 </div>
 `;
 
@@ -172,17 +156,9 @@ exports[`should render correctly for Maven 1`] = `
           "tags": Array [],
         }
       }
+      onDone={[MockFunction]}
     />
   </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    tutorials.finish
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
 </div>
 `;
 
@@ -234,17 +210,9 @@ exports[`should render correctly for Other 1`] = `
           "tags": Array [],
         }
       }
+      onDone={[MockFunction]}
     />
   </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    tutorials.finish
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
 </div>
 `;
 
index e1af3004dff98a0ed7f42cd29762fe68bf42198b..40572ef286f2071acd86e4b652b34ad1ed2bf5c2 100644 (file)
@@ -21,15 +21,12 @@ import * as React from 'react';
 import { translate } from 'sonar-ui-common/helpers/l10n';
 import { CompilationInfo } from '../../components/CompilationInfo';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
+import FinishButton from '../../components/FinishButton';
 import RenderOptions from '../../components/RenderOptions';
 import { OSs } from '../../types';
+import { LanguageProps } from '../JenkinsfileStep';
 import CreateJenkinsfileBulletPoint from './CreateJenkinsfileBulletPoint';
 
-export interface CFamillyProps {
-  component: T.Component;
-  baseUrl: string;
-}
-
 const YAML_MAP: Record<OSs, (baseUrl: string) => string> = {
   [OSs.Linux]: baseUrl => `node {
   stage('SCM') {
@@ -104,7 +101,8 @@ const YAML_MAP: Record<OSs, (baseUrl: string) => string> = {
 }`
 };
 
-export default function CFamilly({ baseUrl, component }: CFamillyProps) {
+export default function CFamilly(props: LanguageProps) {
+  const { baseUrl, component } = props;
   const [os, setOs] = React.useState<OSs>();
   return (
     <>
@@ -120,11 +118,14 @@ export default function CFamilly({ baseUrl, component }: CFamillyProps) {
         />
       </li>
       {os && (
-        <CreateJenkinsfileBulletPoint
-          alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
-          snippet={YAML_MAP[os](baseUrl)}>
-          <CompilationInfo />
-        </CreateJenkinsfileBulletPoint>
+        <>
+          <CreateJenkinsfileBulletPoint
+            alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
+            snippet={YAML_MAP[os](baseUrl)}>
+            <CompilationInfo />
+          </CreateJenkinsfileBulletPoint>
+          <FinishButton onClick={props.onDone} />
+        </>
       )}
     </>
   );
index 194a04cd58b2319de73a91b1f87c62db78c1875a..2664493f4d12bdd45c7e65ee17ef244d5b71818c 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import { translate } from 'sonar-ui-common/helpers/l10n';
+import FinishButton from '../../components/FinishButton';
 import RenderOptions from '../../components/RenderOptions';
 import { OSs } from '../../types';
 import { LanguageProps } from '../JenkinsfileStep';
@@ -39,7 +40,8 @@ const DotOS: { [key in keyof typeof DotNetFlavor]: OSDotNet } = {
   linux_core: OSs.Linux
 };
 
-export default function DotNet({ component }: LanguageProps) {
+export default function DotNet(props: LanguageProps) {
+  const { component } = props;
   const [flavorComponent, setFlavorComponet] = React.useState<keyof typeof DotNetFlavor>();
   const DotNetTutorial = flavorComponent && DotNetFlavor[flavorComponent];
   return (
@@ -55,7 +57,10 @@ export default function DotNet({ component }: LanguageProps) {
         />
       </li>
       {DotNetTutorial && flavorComponent && (
-        <DotNetTutorial component={component} os={DotOS[flavorComponent]} />
+        <>
+          <DotNetTutorial component={component} os={DotOS[flavorComponent]} />
+          <FinishButton onClick={props.onDone} />
+        </>
       )}
     </>
   );
index 887737f269dbcdbbe909cd27f3796cf4cab5d5fb..afb53dcee7e69cc50538d7a32f2d9d42baa3bfe7 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import CodeSnippet from '../../../common/CodeSnippet';
+import FinishButton from '../../components/FinishButton';
 import SentenceWithFilename from '../../components/SentenceWithFilename';
 import { buildGradleSnippet } from '../../utils';
 import { LanguageProps } from '../JenkinsfileStep';
@@ -35,7 +36,8 @@ const JENKINSFILE_SNIPPET = `node {
   }
 }`;
 
-export default function Gradle({ component }: LanguageProps) {
+export default function Gradle(props: LanguageProps) {
+  const { component } = props;
   return (
     <>
       <li className="abs-width-600">
@@ -46,6 +48,7 @@ export default function Gradle({ component }: LanguageProps) {
         <CodeSnippet snippet={buildGradleSnippet(component.key)} />
       </li>
       <CreateJenkinsfileBulletPoint snippet={JENKINSFILE_SNIPPET} />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index b4d5fc5f17848a74cbf30c5fb8355e08a80d01eb..48f0cbd398c4c7082dfd662b8f3a0fde6cfa33e8 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import CodeSnippet from '../../../common/CodeSnippet';
+import FinishButton from '../../components/FinishButton';
 import SentenceWithFilename from '../../components/SentenceWithFilename';
 import { mavenPomSnippet } from '../../utils';
 import { LanguageProps } from '../JenkinsfileStep';
@@ -36,7 +37,8 @@ const JENKINSFILE_SNIPPET = `node {
   }
 }`;
 
-export default function Maven({ component }: LanguageProps) {
+export default function Maven(props: LanguageProps) {
+  const { component } = props;
   return (
     <>
       <li className="abs-width-600">
@@ -50,6 +52,7 @@ export default function Maven({ component }: LanguageProps) {
         alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.maven.step3"
         snippet={JENKINSFILE_SNIPPET}
       />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index 0656f5d30205ec9a45f8a0122dc50dc570165b68..d79d6034a770d3530127998f54c973d865843558 100644 (file)
@@ -19,6 +19,7 @@
  */
 import * as React from 'react';
 import DefaultProjectKey from '../../components/DefaultProjectKey';
+import FinishButton from '../../components/FinishButton';
 import { LanguageProps } from '../JenkinsfileStep';
 import CreateJenkinsfileBulletPoint from './CreateJenkinsfileBulletPoint';
 
@@ -34,7 +35,8 @@ const JENKINSFILE_SNIPPET = `node {
   }
 }`;
 
-export default function Other({ component }: LanguageProps) {
+export default function Other(props: LanguageProps) {
+  const { component } = props;
   return (
     <>
       <DefaultProjectKey component={component} />
@@ -42,6 +44,7 @@ export default function Other({ component }: LanguageProps) {
         alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
         snippet={JENKINSFILE_SNIPPET}
       />
+      <FinishButton onClick={props.onDone} />
     </>
   );
 }
index fe4bfbb201cae09a838ccc590690f22fe7eb0136..850cc51fb3162038cc5a49e745a766557797ddce 100644 (file)
@@ -22,7 +22,8 @@ import * as React from 'react';
 import { mockComponent } from '../../../../../helpers/testMocks';
 import RenderOptions from '../../../components/RenderOptions';
 import { OSs } from '../../../types';
-import CFamilly, { CFamillyProps } from '../CFamilly';
+import { LanguageProps } from '../../JenkinsfileStep';
+import CFamilly from '../CFamilly';
 
 it('should render correctly for', () => {
   expect(shallowRender()).toMatchSnapshot();
@@ -34,8 +35,8 @@ it.each([[OSs.Linux], [OSs.MacOS], [OSs.Windows]])('should render correctly for
   expect(wrapper).toMatchSnapshot(os);
 });
 
-function shallowRender(props: Partial<CFamillyProps> = {}) {
-  return shallow<CFamillyProps>(
-    <CFamilly component={mockComponent()} baseUrl="nice_url_sample" {...props} />
+function shallowRender(props: Partial<LanguageProps> = {}) {
+  return shallow<LanguageProps>(
+    <CFamilly onDone={jest.fn()} component={mockComponent()} baseUrl="nice_url_sample" {...props} />
   );
 }
index 778c46cb5df8a8468ae7499856fc36f1cbd8c2b1..34fb78850397559a7b65054e4f368534f4e86f6f 100644 (file)
@@ -28,5 +28,7 @@ it('should render correctly', () => {
 });
 
 function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(<DotNet component={mockComponent()} baseUrl="" {...props} />);
+  return shallow<LanguageProps>(
+    <DotNet onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
+  );
 }
index d516ed091df9a85c903145dd36a8331c9928ad6b..6f3821676f0b3a879fce7770417ba474f21f429d 100644 (file)
@@ -28,5 +28,7 @@ it('should render correctly', () => {
 });
 
 function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(<Gradle component={mockComponent()} baseUrl="" {...props} />);
+  return shallow<LanguageProps>(
+    <Gradle onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
+  );
 }
index 7bbf42c309ec5c0ffdf425ea2a6f9726f345ce6c..4eb619ffd6445d28e113e39146ecbe5b23e7186a 100644 (file)
@@ -28,5 +28,7 @@ it('should render correctly', () => {
 });
 
 function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(<Maven component={mockComponent()} baseUrl="" {...props} />);
+  return shallow<LanguageProps>(
+    <Maven onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
+  );
 }
index 1e1a8f71392d4d42b3e7d77d91b379fa5211d571..0916d828d7afe48186721bc1a045abd85e06c7d0 100644 (file)
@@ -28,5 +28,7 @@ it('should render correctly', () => {
 });
 
 function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(<Other component={mockComponent()} baseUrl="" {...props} />);
+  return shallow<LanguageProps>(
+    <Other onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
+  );
 }
index fb390f35e1742a39d0dc30e080acbc683cbb82f5..8cd9fedca983c1d715b200e5adf1f1bf95dfb99d 100644 (file)
@@ -110,6 +110,9 @@ exports[`should render correctly for linux: linux 1`] = `
   >
     <CompilationInfo />
   </CreateJenkinsfileBulletPoint>
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -183,6 +186,9 @@ exports[`should render correctly for mac: mac 1`] = `
   >
     <CompilationInfo />
   </CreateJenkinsfileBulletPoint>
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;
 
@@ -262,5 +268,8 @@ exports[`should render correctly for win: win 1`] = `
   >
     <CompilationInfo />
   </CreateJenkinsfileBulletPoint>
+  <FinishButton
+    onClick={[MockFunction]}
+  />
 </Fragment>
 `;