]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19905 Migrating bitbucket and gitlab tutorial pages to MIUI
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Tue, 18 Jul 2023 09:44:01 +0000 (11:44 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 21 Jul 2023 20:03:16 +0000 (20:03 +0000)
17 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/RepositoryVariables.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-it.tsx
server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx
server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx
server/sonar-web/src/main/js/components/tutorials/components/GradleBuild.tsx
server/sonar-web/src/main/js/components/tutorials/components/TokenStepGenerator.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/GitHubActionTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/GitLabCITutorial.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index b30644f81f0474abcda39e8bde12bb7fd8521754..684de937492431f00fa5eda7f393ad5feef3e754 100644 (file)
@@ -27,12 +27,12 @@ import { Component } from '../../../types/types';
 import { CompilationInfo } from '../components/CompilationInfo';
 import CreateYmlFile from '../components/CreateYmlFile';
 import { BuildTools } from '../types';
+import { PreambuleYaml } from './PreambuleYaml';
 import cFamilyExample from './commands/CFamily';
 import dotNetExample from './commands/DotNet';
 import gradleExample from './commands/Gradle';
 import mavenExample from './commands/Maven';
 import othersExample from './commands/Others';
-import { PreambuleYaml } from './PreambuleYaml';
 
 export interface AnalysisCommandProps extends WithAvailableFeaturesProps {
   buildTool: BuildTools;
@@ -70,7 +70,7 @@ export function AnalysisCommand(props: AnalysisCommandProps) {
     <>
       <PreambuleYaml buildTool={buildTool} component={component} />
       <CreateYmlFile yamlFileName="bitbucket-pipelines.yml" yamlTemplate={yamlTemplate} />
-      {buildTool === BuildTools.CFamily && <CompilationInfo className="abs-width-800" />}
+      {buildTool === BuildTools.CFamily && <CompilationInfo />}
     </>
   );
 }
index f697f99b0007e4a1548e3515c6e24096847b5b3d..3d3c4ef3f3535e66d6e1cfe81110b108249c417d 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { BasicSeparator, Title, TutorialStep, TutorialStepList } from 'design-system';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import {
@@ -26,10 +27,8 @@ import {
 } from '../../../types/alm-settings';
 import { Component } from '../../../types/types';
 import { LoggedInUser } from '../../../types/users';
-import AllSetStep from '../components/AllSetStep';
-import FinishButton from '../components/FinishButton';
+import AllSet from '../components/AllSet';
 import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
-import Step from '../components/Step';
 import YamlFileStep from '../components/YamlFileStep';
 import { BuildTools, TutorialModes } from '../types';
 import AnalysisCommand from './AnalysisCommand';
@@ -62,37 +61,30 @@ export default function BitbucketPipelinesTutorial(props: BitbucketPipelinesTuto
     mainBranchName,
   } = props;
 
-  const [step, setStep] = React.useState<Steps>(Steps.REPOSITORY_VARIABLES);
+  const [done, setDone] = React.useState<boolean>(false);
   return (
     <>
-      <Step
-        finished={step > Steps.REPOSITORY_VARIABLES}
-        onOpen={() => setStep(Steps.REPOSITORY_VARIABLES)}
-        open={step === Steps.REPOSITORY_VARIABLES}
-        renderForm={() => (
+      <Title>{translate('onboarding.tutorial.with.bitbucket_ci.title')}</Title>
+
+      <TutorialStepList className="sw-mb-8">
+        <TutorialStep
+          title={translate('onboarding.tutorial.with.bitbucket_pipelines.variables.title')}
+        >
           <RepositoryVariables
             almBinding={almBinding}
             baseUrl={baseUrl}
             component={component}
             currentUser={currentUser}
-            onDone={() => setStep(Steps.YAML)}
             projectBinding={projectBinding}
           />
-        )}
-        stepNumber={Steps.REPOSITORY_VARIABLES}
-        stepTitle={translate('onboarding.tutorial.with.bitbucket_pipelines.variables.title')}
-      />
-      <Step
-        finished={step > Steps.YAML}
-        onOpen={() => setStep(Steps.YAML)}
-        open={step === Steps.YAML}
-        renderForm={() => (
-          <YamlFileStep>
+        </TutorialStep>
+        <TutorialStep title={translate('onboarding.tutorial.with.bitbucket_pipelines.yaml.title')}>
+          <YamlFileStep setDone={setDone}>
             {(buildTool) => (
               <>
                 {buildTool === BuildTools.CFamily && (
                   <GithubCFamilyExampleRepositories
-                    className="big-spacer-top"
+                    className="sw-my-4 sw-bg-inherit sw-w-abs-600"
                     ci={TutorialModes.BitbucketPipelines}
                   />
                 )}
@@ -101,20 +93,18 @@ export default function BitbucketPipelinesTutorial(props: BitbucketPipelinesTuto
                   component={component}
                   mainBranchName={mainBranchName}
                 />
-                <FinishButton onClick={() => setStep(Steps.ALL_SET)} />
               </>
             )}
           </YamlFileStep>
+        </TutorialStep>
+
+        {done && (
+          <>
+            <BasicSeparator className="sw-my-10" />
+            <AllSet alm={AlmKeys.GitLab} willRefreshAutomatically={willRefreshAutomatically} />
+          </>
         )}
-        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}
-        willRefreshAutomatically={willRefreshAutomatically}
-      />
+      </TutorialStepList>
     </>
   );
 }
index 74324efc8487a67e6637b03f3ce8c6afc711ce76..a84a805333535d0b83ceaf3daa1041e05a9fd0d9 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import {
+  BasicSeparator,
+  ClipboardIconButton,
+  NumberedList,
+  NumberedListItem,
+  StandoutLink,
+} from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
-import { Button } from '../../../components/controls/buttons';
-import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
 import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../../types/alm-settings';
 import { Component } from '../../../types/types';
 import { LoggedInUser } from '../../../types/users';
+import { InlineSnippet } from '../components/InlineSnippet';
 import SentenceWithHighlights from '../components/SentenceWithHighlights';
 import TokenStepGenerator from '../components/TokenStepGenerator';
 import { buildBitbucketCloudLink } from '../utils';
@@ -34,94 +40,95 @@ export interface RepositoryVariablesProps {
   baseUrl: string;
   component: Component;
   currentUser: LoggedInUser;
-  onDone: () => void;
   projectBinding?: ProjectAlmBindingResponse;
 }
 
 export default function RepositoryVariables(props: RepositoryVariablesProps) {
   const { almBinding, baseUrl, component, currentUser, projectBinding } = props;
   return (
-    <div className="boxed-group-inner">
-      <p className="big-spacer-bottom">
-        <FormattedMessage
-          defaultMessage={translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro')}
-          id="onboarding.tutorial.with.bitbucket_pipelines.variables.intro"
-          values={{
-            repository_variables:
-              almBinding?.url && projectBinding?.repository ? (
-                <a
-                  href={`${buildBitbucketCloudLink(
-                    almBinding,
-                    projectBinding
-                  )}/admin/addon/admin/pipelines/repository-variables`}
-                  target="_blank"
-                  rel="noopener noreferrer"
-                >
-                  {translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')}
-                </a>
-              ) : (
-                <strong>
-                  {translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')}
-                </strong>
-              ),
-          }}
-        />
-      </p>
-      <ol className="list-styled">
-        <li>
+    <>
+      <FormattedMessage
+        defaultMessage={translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro')}
+        id="onboarding.tutorial.with.bitbucket_pipelines.variables.intro"
+        values={{
+          repository_variables:
+            almBinding?.url && projectBinding?.repository ? (
+              <StandoutLink
+                to={`${buildBitbucketCloudLink(
+                  almBinding,
+                  projectBinding
+                )}/admin/addon/admin/pipelines/repository-variables`}
+                target="_blank"
+                rel="noopener noreferrer"
+              >
+                {translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')}
+              </StandoutLink>
+            ) : (
+              <span className="sw-body-sm-highlight">
+                {translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')}
+              </span>
+            ),
+        }}
+      />
+      <NumberedList>
+        <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.name"
             highlightKeys={['name']}
           />
-          <code className="rule little-spacer-left">SONAR_TOKEN</code>
-          <ClipboardIconButton copyValue="SONAR_TOKEN" />
-        </li>
-        <TokenStepGenerator component={component} currentUser={currentUser} />
-        <li>
+          <InlineSnippet snippet="SONAR_TOKEN" className="sw-ml-1" />
+          <ClipboardIconButton copyValue="SONAR_TOKEN" className="sw-ml-2" />
+        </NumberedListItem>
+        <NumberedListItem>
+          <TokenStepGenerator component={component} currentUser={currentUser} />
+        </NumberedListItem>
+        <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.secured"
             highlightKeys={['secured']}
           />
-        </li>
-        <li>
+        </NumberedListItem>
+        <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.add"
             highlightKeys={['add']}
           />
-        </li>
-      </ol>
+        </NumberedListItem>
+      </NumberedList>
 
-      <hr className="no-horizontal-margins" />
+      <BasicSeparator className="sw-my-6" />
 
-      <ol className="list-styled big-spacer-top big-spacer-bottom">
-        <li>
+      <NumberedList>
+        <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.name"
             highlightKeys={['name']}
           />
-
-          <code className="rule little-spacer-left">SONAR_HOST_URL</code>
-          <ClipboardIconButton copyValue="SONAR_HOST_URL" />
-        </li>
-        <li className="big-spacer-bottom">
+          <InlineSnippet snippet="SONAR_HOST_URL" className="sw-ml-1" />
+          <ClipboardIconButton copyValue="SONAR_HOST_URL" className="sw-ml-2" />
+        </NumberedListItem>
+        <NumberedListItem>
           <FormattedMessage
             defaultMessage={translate('onboarding.tutorial.env_variables')}
             id="onboarding.tutorial.env_variables"
             values={{
               extra: <ClipboardIconButton copyValue={baseUrl} />,
-              field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
-              value: <code className="rule">{baseUrl}</code>,
+              field: (
+                <span className="sw-body-sm-highlight">
+                  {translate('onboarding.tutorial.env_variables.field')}
+                </span>
+              ),
+              value: <InlineSnippet snippet={baseUrl} className="sw-ml-1" />,
             }}
           />
-        </li>
-        <li>
+        </NumberedListItem>
+        <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.add"
             highlightKeys={['add']}
           />
-        </li>
-      </ol>
-      <Button onClick={props.onDone}>{translate('continue')}</Button>
-    </div>
+        </NumberedListItem>
+      </NumberedList>
+    </>
   );
 }
index 07691d586b8821ca0e12f8508335a48eb56c3e8b..b35ef0639346c51dae8e29e89eecbe4e5cfc5be2 100644 (file)
@@ -67,10 +67,11 @@ it('should follow and complete all steps', async () => {
   expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
 
   // Env variables step
-  expect(getCopyToClipboardValue()).toMatchSnapshot('sonar token key');
-  expect(getCopyToClipboardValue(1)).toMatchSnapshot('sonarqube host url key');
-  expect(getCopyToClipboardValue(2)).toMatchSnapshot('sonarqube host url value');
-  await user.click(ui.continueButton.get());
+  expect(getCopyToClipboardValue(0, 'Copy to clipboard')).toMatchSnapshot('sonar token key');
+  expect(getCopyToClipboardValue(1, 'Copy to clipboard')).toMatchSnapshot('sonarqube host url key');
+  expect(getCopyToClipboardValue(2, 'Copy to clipboard')).toMatchSnapshot(
+    'sonarqube host url value'
+  );
 
   // Create/update configuration file step
   // Maven
@@ -98,7 +99,6 @@ it('should follow and complete all steps', async () => {
   expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Other: sonar-project.properties');
   expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('Other: .github/workflows/build.yml');
 
-  await user.click(ui.finishTutorialButton.get());
   expect(ui.allSetSentence.get()).toBeInTheDocument();
 });
 
@@ -111,7 +111,7 @@ it('should generate/delete a new token or use existing one', async () => {
   // Generate token
   await user.click(ui.genTokenDialogButton.get());
   await user.click(ui.generateTokenButton.get());
-  expect(getCopyToClipboardValue(3)).toEqual('generatedtoken2');
+  expect(getCopyToClipboardValue()).toEqual('generatedtoken2');
 
   // Revoke current token and create new one
   await user.click(ui.deleteTokenButton.get());
@@ -119,7 +119,7 @@ it('should generate/delete a new token or use existing one', async () => {
   await selectEvent.select(ui.expiresInSelect.get(), 'users.tokens.expiration.365');
   await user.click(ui.generateTokenButton.get());
   expect(ui.tokenValue.get()).toBeInTheDocument();
-  await user.click(ui.continueButton.getAll()[1]);
+  await user.click(ui.continueButton.getAll()[0]);
   expect(ui.tokenValue.query()).not.toBeInTheDocument();
 });
 
@@ -139,9 +139,7 @@ it('navigates between steps', async () => {
   // If project is bound, link to repo is visible
   expect(await ui.linkToRepo.find()).toBeInTheDocument();
 
-  await user.click(await ui.continueButton.find());
   await user.click(ui.mavenBuildButton.get());
-  await user.click(ui.finishTutorialButton.get());
   expect(ui.allSetSentence.get()).toBeInTheDocument();
 
   await user.click(ui.ymlFileStepTitle.get());
index cad8d25b570329083fd8a7a14e2520c46eb0aa09..756c28edb2926ce182ede883f0789e81e6250c01 100644 (file)
@@ -39,7 +39,7 @@ export default function CreateYmlFile(props: CreateYmlFileProps) {
           file: (
             <>
               <InlineSnippet snippet={yamlFileName} />
-              <ClipboardIconButton copyValue={yamlFileName} />
+              <ClipboardIconButton copyValue={yamlFileName} className="sw-ml-2" />
             </>
           ),
         }}
index 5833fdfd374cd00efcc1471bcaec097ef5eda02c..6303900989e8f4a441acaa7a04f44ba317959b9d 100644 (file)
@@ -38,7 +38,7 @@ export default function DefaultProjectKey(props: DefaultProjectKeyProps) {
       />
       <CodeSnippet
         snippet={sonarProjectSnippet(component.key)}
-        className="sw-p-8 sw-overflow-auto"
+        className="sw-p-9 sw-overflow-auto"
       />
     </NumberedListItem>
   );
index 8087bdb5b04c5afbcbdbce03870a80f28170deba..6e1edddb92b7a9aa99b8264e52d504e8c3265221 100644 (file)
@@ -41,13 +41,13 @@ export default function GradleBuild({ component }: Props) {
           groovy: (
             <>
               <InlineSnippet snippet={GradleBuildDSL.Groovy} />
-              <ClipboardIconButton copyValue={GradleBuildDSL.Groovy} />
+              <ClipboardIconButton copyValue={GradleBuildDSL.Groovy} className="sw-ml-2" />
             </>
           ),
           kotlin: (
             <>
               <InlineSnippet snippet={GradleBuildDSL.Kotlin} />
-              <ClipboardIconButton copyValue={GradleBuildDSL.Kotlin} />
+              <ClipboardIconButton copyValue={GradleBuildDSL.Kotlin} className="sw-ml-2" />
             </>
           ),
           sq: <InlineSnippet snippet="org.sonarqube" />,
index e43cb39b1c9c2b575f559279fba6f32aa69140e9..c8854e2ca025ea687f37eb9c8d17e37b95a863b8 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { ButtonSecondary, NumberedListItem } from 'design-system';
+import { ButtonSecondary } from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { translate } from '../../../helpers/l10n';
@@ -39,25 +39,23 @@ export default function TokenStepGenerator(props: TokenStepGeneratorProps) {
 
   return (
     <>
-      <NumberedListItem>
-        <FormattedMessage
-          defaultMessage={translate('onboarding.tutorial.env_variables')}
-          id="onboarding.tutorial.env_variables"
-          values={{
-            extra: (
-              <ButtonSecondary className="sw-ml-2" onClick={toggleTokenModal}>
-                {translate('onboarding.token.generate.long')}
-              </ButtonSecondary>
-            ),
-            field: (
-              <span className="sw-body-sm-highlight">
-                {translate('onboarding.tutorial.env_variables.field')}
-              </span>
-            ),
-            value: translate('onboarding.tutorial.env_variables.token_generator.value'),
-          }}
-        />
-      </NumberedListItem>
+      <FormattedMessage
+        defaultMessage={translate('onboarding.tutorial.env_variables')}
+        id="onboarding.tutorial.env_variables"
+        values={{
+          extra: (
+            <ButtonSecondary className="sw-ml-2" onClick={toggleTokenModal}>
+              {translate('onboarding.token.generate.long')}
+            </ButtonSecondary>
+          ),
+          field: (
+            <span className="sw-body-sm-highlight">
+              {translate('onboarding.tutorial.env_variables.field')}
+            </span>
+          ),
+          value: translate('onboarding.tutorial.env_variables.token_generator.value'),
+        }}
+      />
       {isModalVisible && (
         <EditTokenModal component={component} currentUser={currentUser} onClose={closeTokenModal} />
       )}
index 0f0b134674ec31347ac3ff19a20a2cf09b232e9c..e7f00e98a9d1196aeef0ae576f83fb3bcf052e76 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { BasicSeparator, TutorialStep, TutorialStepList } from 'design-system';
+import { BasicSeparator, Title, TutorialStep, TutorialStepList } from 'design-system';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import {
@@ -54,36 +54,42 @@ export default function GitHubActionTutorial(props: GitHubActionTutorialProps) {
     willRefreshAutomatically,
   } = props;
   return (
-    <TutorialStepList className="sw-mb-8">
-      <TutorialStep title={translate('onboarding.tutorial.with.github_action.create_secret.title')}>
-        <SecretStep
-          almBinding={almBinding}
-          baseUrl={baseUrl}
-          component={component}
-          currentUser={currentUser}
-          projectBinding={projectBinding}
-        />
-      </TutorialStep>
-      <TutorialStep title={translate('onboarding.tutorial.with.github_action.yaml.title')}>
-        <YamlFileStep setDone={setDone}>
-          {(buildTool) => (
-            <AnalysisCommand
-              buildTool={buildTool}
-              mainBranchName={mainBranchName}
-              component={component}
-            />
-          )}
-        </YamlFileStep>
-      </TutorialStep>
-      {done && (
-        <>
-          <BasicSeparator className="sw-my-10" />
-          <AllSet
-            alm={almBinding?.alm || AlmKeys.GitHub}
-            willRefreshAutomatically={willRefreshAutomatically}
+    <>
+      <Title>{translate('onboarding.tutorial.with.github_ci.title')}</Title>
+
+      <TutorialStepList className="sw-mb-8">
+        <TutorialStep
+          title={translate('onboarding.tutorial.with.github_action.create_secret.title')}
+        >
+          <SecretStep
+            almBinding={almBinding}
+            baseUrl={baseUrl}
+            component={component}
+            currentUser={currentUser}
+            projectBinding={projectBinding}
           />
-        </>
-      )}
-    </TutorialStepList>
+        </TutorialStep>
+        <TutorialStep title={translate('onboarding.tutorial.with.github_action.yaml.title')}>
+          <YamlFileStep setDone={setDone}>
+            {(buildTool) => (
+              <AnalysisCommand
+                buildTool={buildTool}
+                mainBranchName={mainBranchName}
+                component={component}
+              />
+            )}
+          </YamlFileStep>
+        </TutorialStep>
+        {done && (
+          <>
+            <BasicSeparator className="sw-my-10" />
+            <AllSet
+              alm={almBinding?.alm || AlmKeys.GitHub}
+              willRefreshAutomatically={willRefreshAutomatically}
+            />
+          </>
+        )}
+      </TutorialStepList>
+    </>
   );
 }
index a86d562f45ed7b50f893428ae3da146df4bad4f6..ef5ad4b7acd3de128b3ee2125fea648796632708 100644 (file)
@@ -81,9 +81,11 @@ export default function SecretStep(props: SecretStepProps) {
             highlightKeys={['name']}
           />
           <InlineSnippet snippet="SONAR_TOKEN" className="sw-ml-1" />
-          <ClipboardIconButton copyValue="SONAR_TOKEN" />
+          <ClipboardIconButton copyValue="SONAR_TOKEN" className="sw-ml-2" />
+        </NumberedListItem>
+        <NumberedListItem>
+          <TokenStepGenerator component={component} currentUser={currentUser} />
         </NumberedListItem>
-        <TokenStepGenerator component={component} currentUser={currentUser} />
         <NumberedListItem>
           <SentenceWithHighlights
             translationKey="onboarding.tutorial.with.github_action.secret.add"
@@ -105,7 +107,7 @@ export default function SecretStep(props: SecretStepProps) {
             highlightKeys={['name']}
           />
           <InlineSnippet snippet="SONAR_HOST_URL" className="sw-ml-1" />
-          <ClipboardIconButton copyValue="SONAR_HOST_URL" />
+          <ClipboardIconButton copyValue="SONAR_HOST_URL" className="sw-ml-2" />
         </NumberedListItem>
         <NumberedListItem>
           <FormattedMessage
index 7aeaf12410aa1e101ad9eb4272e11e394d7c56c2..450aad1d9a90d2704859b226f171ba58c25a6b83 100644 (file)
@@ -133,7 +133,7 @@ export default function CFamily(props: CFamilyProps) {
         />
         {os && (
           <GithubCFamilyExampleRepositories
-            className="sw-mt-4"
+            className="sw-mt-4 sw-bg-inherit sw-w-abs-600"
             os={os}
             ci={TutorialModes.GitHubActions}
           />
index 4c0f3fa42cb89ea82f15dd890d7ac69554713f49..f79655dc9f9801313f946153ba9a9f84187dded4 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import {
+  BasicSeparator,
+  ClipboardIconButton,
+  NumberedList,
+  NumberedListItem,
+  TutorialStep,
+  UnorderedList,
+  UnorderedListItem,
+} from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
-import { Button } from '../../../components/controls/buttons';
-import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { translate } from '../../../helpers/l10n';
 import { Component } from '../../../types/types';
 import { LoggedInUser } from '../../../types/users';
-import Step from '../components/Step';
+import { InlineSnippet } from '../components/InlineSnippet';
 import TokenStepGenerator from '../components/TokenStepGenerator';
 
 export interface EnvironmentVariablesStepProps {
   baseUrl: string;
   component: Component;
   currentUser: LoggedInUser;
-  finished: boolean;
-  onDone: () => void;
-  onOpen: () => void;
-  open: boolean;
 }
 
 const pipelineDescriptionLinkLabel = translate(
@@ -42,170 +45,157 @@ const pipelineDescriptionLinkLabel = translate(
 );
 
 export default function EnvironmentVariablesStep(props: EnvironmentVariablesStepProps) {
-  const { baseUrl, component, currentUser, finished, open } = props;
+  const { baseUrl, component, currentUser } = props;
 
   const fieldValueTranslation = translate('onboarding.tutorial.env_variables');
 
   const renderForm = () => (
-    <div className="boxed-group-inner">
-      <ol className="list-styled">
-        <li>
-          <p className="big-spacer-bottom">
-            {translate('onboarding.tutorial.with.gitlab_ci.variables.section.title')}
-          </p>
+    <NumberedList>
+      <NumberedListItem>
+        {translate('onboarding.tutorial.with.gitlab_ci.variables.section.title')}
 
-          <FormattedMessage
-            defaultMessage={translate(
-              'onboarding.tutorial.with.gitlab_ci.variables.section.description'
-            )}
-            id="onboarding.tutorial.with.gitlab_ci.variables.section.description"
-            values={{
-              /* This link will be added when the backend provides the project URL */
-              link: <strong>{pipelineDescriptionLinkLabel}</strong>,
-            }}
-          />
+        <FormattedMessage
+          defaultMessage={translate(
+            'onboarding.tutorial.with.gitlab_ci.variables.section.description'
+          )}
+          id="onboarding.tutorial.with.gitlab_ci.variables.section.description"
+          values={{
+            /* This link will be added when the backend provides the project URL */
+            link: <span className="sw-body-sm-highlight">{pipelineDescriptionLinkLabel}</span>,
+          }}
+        />
 
-          <ul className="list-styled list-alpha big-spacer-top">
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.variables.step1"
-                values={{
-                  extra: <ClipboardIconButton copyValue="SONAR_TOKEN" />,
-                  field: (
-                    <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
-                    </strong>
-                  ),
-                  value: <code className="rule">SONAR_TOKEN</code>,
-                }}
-              />
-            </li>
+        <UnorderedList ticks className="sw-ml-10">
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={fieldValueTranslation}
+              id="onboarding.tutorial.with.gitlab_ci.variables.step1"
+              values={{
+                extra: <ClipboardIconButton copyValue="SONAR_TOKEN" />,
+                field: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
+                  </span>
+                ),
+                value: <InlineSnippet snippet="SONAR_TOKEN" />,
+              }}
+            />
+          </UnorderedListItem>
+          <UnorderedListItem>
             <TokenStepGenerator component={component} currentUser={currentUser} />
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
-                id="onboarding.tutorial.with.gitlab_ci.variables.step3"
-                values={{
-                  value: (
-                    <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
-                    </strong>
-                  ),
-                }}
-              />
-            </li>
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={translate(
-                  'onboarding.tutorial.with.gitlab_ci.variables.section.step4'
-                )}
-                id="onboarding.tutorial.with.gitlab_ci.variables.section.step4"
-                values={{
-                  value: (
-                    <strong>
-                      {translate(
-                        'onboarding.tutorial.with.gitlab_ci.variables.section.step4.value'
-                      )}
-                    </strong>
-                  ),
-                }}
-              />
-            </li>
-          </ul>
-          <hr className="no-horizontal-margins" />
-        </li>
-        <li>
-          <p className="big-spacer-bottom big-spacer-top">
-            {translate('onboarding.tutorial.with.gitlab_ci.variables.section2.title')}
-          </p>
+          </UnorderedListItem>
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
+              id="onboarding.tutorial.with.gitlab_ci.variables.step3"
+              values={{
+                value: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
+                  </span>
+                ),
+              }}
+            />
+          </UnorderedListItem>
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={translate(
+                'onboarding.tutorial.with.gitlab_ci.variables.section.step4'
+              )}
+              id="onboarding.tutorial.with.gitlab_ci.variables.section.step4"
+              values={{
+                value: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.section.step4.value')}
+                  </span>
+                ),
+              }}
+            />
+          </UnorderedListItem>
+        </UnorderedList>
+        <BasicSeparator className="sw-my-6" />
+      </NumberedListItem>
+      <NumberedListItem>
+        {translate('onboarding.tutorial.with.gitlab_ci.variables.section2.title')}
 
-          <FormattedMessage
-            defaultMessage={translate(
-              'onboarding.tutorial.with.gitlab_ci.variables.section2.description'
-            )}
-            id="onboarding.tutorial.with.gitlab_ci.variables.section2.description"
-            values={{
-              /* This link will be added when the backend provides the project URL */
-              link: <strong>{pipelineDescriptionLinkLabel}</strong>,
-            }}
-          />
+        <FormattedMessage
+          defaultMessage={translate(
+            'onboarding.tutorial.with.gitlab_ci.variables.section2.description'
+          )}
+          id="onboarding.tutorial.with.gitlab_ci.variables.section2.description"
+          values={{
+            /* This link will be added when the backend provides the project URL */
+            link: <span className="sw-body-sm-highlight">{pipelineDescriptionLinkLabel}</span>,
+          }}
+        />
 
-          <ul className="list-styled list-alpha big-spacer-top big-spacer-bottom">
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.variables.step1"
-                values={{
-                  extra: <ClipboardIconButton copyValue="SONAR_HOST_URL" />,
-                  field: (
-                    <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
-                    </strong>
-                  ),
-                  value: <code className="rule">SONAR_HOST_URL</code>,
-                }}
-              />
-            </li>
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.variables.step2"
-                values={{
-                  extra: <ClipboardIconButton copyValue={baseUrl} />,
-                  field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
-                  value: <code className="rule">{baseUrl}</code>,
-                }}
-              />
-            </li>
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
-                id="onboarding.tutorial.with.gitlab_ci.variables.step3"
-                values={{
-                  value: (
-                    <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
-                    </strong>
-                  ),
-                }}
-              />
-            </li>
-            <li className="big-spacer-bottom">
-              <FormattedMessage
-                defaultMessage={translate(
-                  'onboarding.tutorial.with.gitlab_ci.variables.section2.step4'
-                )}
-                id="onboarding.tutorial.with.gitlab_ci.variables.section2.step4"
-                values={{
-                  value: (
-                    <strong>
-                      {translate(
-                        'onboarding.tutorial.with.gitlab_ci.variables.section.step4.value'
-                      )}
-                    </strong>
-                  ),
-                }}
-              />
-            </li>
-          </ul>
-
-          <Button className="big-spacer-bottom" onClick={props.onDone}>
-            {translate('continue')}
-          </Button>
-        </li>
-      </ol>
-    </div>
+        <UnorderedList ticks className="sw-ml-10">
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={fieldValueTranslation}
+              id="onboarding.tutorial.with.gitlab_ci.variables.step1"
+              values={{
+                extra: <ClipboardIconButton copyValue="SONAR_HOST_URL" />,
+                field: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
+                  </span>
+                ),
+                value: <InlineSnippet snippet="SONAR_HOST_URL" />,
+              }}
+            />
+          </UnorderedListItem>
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={fieldValueTranslation}
+              id="onboarding.tutorial.with.gitlab_ci.variables.step2"
+              values={{
+                extra: <ClipboardIconButton copyValue={baseUrl} />,
+                field: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.env_variables.field')}
+                  </span>
+                ),
+                value: <InlineSnippet snippet={baseUrl} />,
+              }}
+            />
+          </UnorderedListItem>
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
+              id="onboarding.tutorial.with.gitlab_ci.variables.step3"
+              values={{
+                value: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
+                  </span>
+                ),
+              }}
+            />
+          </UnorderedListItem>
+          <UnorderedListItem>
+            <FormattedMessage
+              defaultMessage={translate(
+                'onboarding.tutorial.with.gitlab_ci.variables.section2.step4'
+              )}
+              id="onboarding.tutorial.with.gitlab_ci.variables.section2.step4"
+              values={{
+                value: (
+                  <span className="sw-body-sm-highlight">
+                    {translate('onboarding.tutorial.with.gitlab_ci.variables.section.step4.value')}
+                  </span>
+                ),
+              }}
+            />
+          </UnorderedListItem>
+        </UnorderedList>
+      </NumberedListItem>
+    </NumberedList>
   );
 
   return (
-    <Step
-      finished={finished}
-      onOpen={props.onOpen}
-      open={open}
-      renderForm={renderForm}
-      stepNumber={1}
-      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.variables.title')}
-    />
+    <TutorialStep title={translate('onboarding.tutorial.with.gitlab_ci.variables.title')}>
+      {renderForm()}
+    </TutorialStep>
   );
 }
index 86a8b46dc38f518d9f8962684ac6f76462aa3bd6..7ebc36a475489f6a86df7b60477582b745db4b8e 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { BasicSeparator, Title, TutorialStepList } from 'design-system';
 import * as React from 'react';
 import { translate } from '../../../helpers/l10n';
 import { AlmKeys } from '../../../types/alm-settings';
 import { Component } from '../../../types/types';
 import { LoggedInUser } from '../../../types/users';
-import AllSetStep from '../components/AllSetStep';
+import AllSet from '../components/AllSet';
 import EnvironmentVariablesStep from './EnvironmentVariablesStep';
 import YmlFileStep from './YmlFileStep';
 
@@ -42,38 +43,27 @@ export interface GitLabCITutorialProps {
 export default function GitLabCITutorial(props: GitLabCITutorialProps) {
   const { baseUrl, component, currentUser, willRefreshAutomatically } = props;
 
-  const [step, setStep] = React.useState(Steps.ENV_VARIABLES);
-
+  const [done, setDone] = React.useState<boolean>(false);
   return (
     <>
-      <div className="page-header big-spacer-bottom">
-        <h2 className="page-title">{translate('onboarding.tutorial.with.gitlab_ci.title')}</h2>
-      </div>
+      <Title>{translate('onboarding.tutorial.with.gitlab_ci.title')}</Title>
 
-      <EnvironmentVariablesStep
-        baseUrl={baseUrl}
-        component={component}
-        currentUser={currentUser}
-        finished={step > Steps.ENV_VARIABLES}
-        onDone={() => setStep(Steps.YML)}
-        onOpen={() => setStep(Steps.ENV_VARIABLES)}
-        open={step === Steps.ENV_VARIABLES}
-      />
+      <TutorialStepList className="sw-mb-8">
+        <EnvironmentVariablesStep
+          baseUrl={baseUrl}
+          component={component}
+          currentUser={currentUser}
+        />
 
-      <YmlFileStep
-        finished={step > Steps.YML}
-        component={component}
-        onDone={() => setStep(Steps.ALL_SET)}
-        onOpen={() => setStep(Steps.YML)}
-        open={step === Steps.YML}
-      />
+        <YmlFileStep component={component} setDone={setDone} />
+      </TutorialStepList>
 
-      <AllSetStep
-        alm={AlmKeys.GitLab}
-        open={step === Steps.ALL_SET}
-        stepNumber={3}
-        willRefreshAutomatically={willRefreshAutomatically}
-      />
+      {done && (
+        <>
+          <BasicSeparator className="sw-my-10" />
+          <AllSet alm={AlmKeys.GitLab} willRefreshAutomatically={willRefreshAutomatically} />
+        </>
+      )}
     </>
   );
 }
index e5eb3526f37ce98dcb83c781d36f9e7332502732..664b4f2da6f79acae3cc00e55a82fc0d93b475e5 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-import { FlagMessage } from 'design-system';
+import {
+  ClipboardIconButton,
+  CodeSnippet,
+  FlagMessage,
+  NumberedList,
+  NumberedListItem,
+  TutorialStep,
+} from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import withAvailableFeatures, {
   WithAvailableFeaturesProps,
 } from '../../../app/components/available-features/withAvailableFeatures';
-import { ClipboardIconButton } from '../../../components/controls/clipboard';
 import { GRADLE_SCANNER_VERSION } from '../../../helpers/constants';
 import { translate } from '../../../helpers/l10n';
 import { Component } from '../../../types/types';
-import CodeSnippet from '../../common/CodeSnippet';
 import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
-import FinishButton from '../components/FinishButton';
 import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
 import GradleBuildSelection from '../components/GradleBuildSelection';
+import { InlineSnippet } from '../components/InlineSnippet';
 import RenderOptions from '../components/RenderOptions';
-import Step from '../components/Step';
 import { BuildTools, GradleBuildDSL, TutorialModes } from '../types';
 import PipeCommand from './commands/PipeCommand';
 
 export interface YmlFileStepProps extends WithAvailableFeaturesProps {
   component: Component;
-  finished: boolean;
   hasCLanguageFeature: boolean;
-  onDone: () => void;
-  onOpen: () => void;
-  open: boolean;
+  setDone: (doneStatus: boolean) => void;
 }
 
 const mavenSnippet = (key: string, name: string) => `<properties>
@@ -100,7 +101,7 @@ const filenameForBuildTool = {
 };
 
 export function YmlFileStep(props: YmlFileStepProps) {
-  const { component, hasCLanguageFeature, finished, open } = props;
+  const { component, hasCLanguageFeature } = props;
 
   const [buildTool, setBuildTool] = React.useState<BuildTools>();
 
@@ -113,142 +114,130 @@ export function YmlFileStep(props: YmlFileStepProps) {
   buildTools.push(BuildTools.Other);
 
   const renderForm = () => (
-    <div className="boxed-group-inner">
-      <ol className="list-styled">
-        <li>
-          {translate('onboarding.build')}
-
-          <RenderOptions
-            checked={buildTool}
-            label={translate('onboarding.build')}
-            onCheck={setBuildTool as (key: string) => void}
-            optionLabelKey="onboarding.build"
-            options={buildTools}
+    <NumberedList>
+      <NumberedListItem>
+        {translate('onboarding.build')}
+
+        <RenderOptions
+          checked={buildTool}
+          label={translate('onboarding.build')}
+          onCheck={setBuildTool as (key: string) => void}
+          optionLabelKey="onboarding.build"
+          options={buildTools}
+          setDone={props.setDone}
+        />
+
+        {buildTool === BuildTools.CFamily && (
+          <GithubCFamilyExampleRepositories
+            ci={TutorialModes.GitLabCI}
+            className="sw-my-4 sw-bg-inherit sw-w-abs-600"
           />
-
-          {buildTool === BuildTools.CFamily && (
-            <GithubCFamilyExampleRepositories
-              ci={TutorialModes.GitLabCI}
-              className="sw-mb-4 sw-mt-4 sw-w-[600px]"
-            />
-          )}
-        </li>
-
-        {buildTool !== undefined &&
-          buildTool !== BuildTools.CFamily &&
-          buildTool !== BuildTools.DotNet && (
-            <li className="sw-w-[600px]">
-              <FormattedMessage
-                defaultMessage={translate(
-                  `onboarding.tutorial.with.gitlab_ci.project_key.${buildTool}.step2`
-                )}
-                id={`onboarding.tutorial.with.gitlab_ci.project_key.${buildTool}.step2`}
-                values={Object.assign(
-                  {
-                    file: (
-                      <>
-                        <code className="rule">{filenameForBuildTool[buildTool]}</code>
-
-                        <ClipboardIconButton
-                          className="little-spacer-left"
-                          copyValue={filenameForBuildTool[buildTool]}
-                        />
-                      </>
-                    ),
-                  },
-                  buildTool === BuildTools.Gradle
-                    ? {
-                        file2: (
-                          <>
-                            <code className="rule">{GradleBuildDSL.Kotlin}</code>
-
-                            <ClipboardIconButton
-                              className="sw-ml-1"
-                              copyValue={GradleBuildDSL.Kotlin}
-                            />
-                          </>
-                        ),
-                      }
-                    : {}
-                )}
-              />
-
-              {buildTool === BuildTools.Gradle ? (
-                <GradleBuildSelection className="sw-mb-4 sw-mt-2">
-                  {(build) => (
-                    <CodeSnippet
-                      snippet={snippetForBuildTool[buildTool](component.key, component.name, build)}
-                    />
-                  )}
-                </GradleBuildSelection>
-              ) : (
-                <CodeSnippet
-                  snippet={snippetForBuildTool[buildTool](component.key, component.name)}
-                />
+        )}
+      </NumberedListItem>
+
+      {buildTool !== undefined &&
+        buildTool !== BuildTools.CFamily &&
+        buildTool !== BuildTools.DotNet && (
+          <NumberedListItem>
+            <FormattedMessage
+              defaultMessage={translate(
+                `onboarding.tutorial.with.gitlab_ci.project_key.${buildTool}.step2`
               )}
-            </li>
-          )}
-
-        {buildTool && (
-          <li className="sw-w-[600px]">
-            {buildTool !== BuildTools.CFamily && (
-              <>
-                <div className="sw-mb-4">
-                  <FormattedMessage
-                    defaultMessage={translate(
-                      'onboarding.tutorial.with.gitlab_ci.yaml.description'
-                    )}
-                    id="onboarding.tutorial.with.gitlab_ci.yaml.description"
-                    values={{
-                      filename: (
+              id={`onboarding.tutorial.with.gitlab_ci.project_key.${buildTool}.step2`}
+              values={Object.assign(
+                {
+                  file: (
+                    <>
+                      <InlineSnippet snippet={filenameForBuildTool[buildTool]} />
+
+                      <ClipboardIconButton
+                        className="sw-ml-2"
+                        copyValue={filenameForBuildTool[buildTool]}
+                      />
+                    </>
+                  ),
+                },
+                buildTool === BuildTools.Gradle
+                  ? {
+                      file2: (
                         <>
-                          <code className="rule">
-                            {translate('onboarding.tutorial.with.gitlab_ci.yaml.filename')}
-                          </code>
+                          <InlineSnippet snippet={GradleBuildDSL.Kotlin} />
 
                           <ClipboardIconButton
-                            className="sw-ml-1"
-                            copyValue={translate(
-                              'onboarding.tutorial.with.gitlab_ci.yaml.filename'
-                            )}
+                            className="sw-ml-2"
+                            copyValue={GradleBuildDSL.Kotlin}
                           />
                         </>
                       ),
-                    }}
+                    }
+                  : {}
+              )}
+            />
+            {buildTool === BuildTools.Gradle ? (
+              <GradleBuildSelection className="sw-mb-4 sw-mt-2">
+                {(build) => (
+                  <CodeSnippet
+                    className="sw-p-6 sw-overflow-auto"
+                    language="yml"
+                    snippet={snippetForBuildTool[buildTool](component.key, component.name, build)}
                   />
-                </div>
+                )}
+              </GradleBuildSelection>
+            ) : (
+              <CodeSnippet
+                className="sw-p-6 sw-overflow-auto"
+                language="yml"
+                snippet={snippetForBuildTool[buildTool](component.key, component.name)}
+              />
+            )}
+          </NumberedListItem>
+        )}
 
-                <div className="sw-mb-4 sw-w-[600px]">
-                  <PipeCommand buildTool={buildTool} projectKey={component.key} />
-                </div>
+      {buildTool && (
+        <>
+          {buildTool !== BuildTools.CFamily && (
+            <NumberedListItem>
+              <FormattedMessage
+                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.yaml.description')}
+                id="onboarding.tutorial.with.gitlab_ci.yaml.description"
+                values={{
+                  filename: (
+                    <>
+                      <InlineSnippet
+                        snippet={translate('onboarding.tutorial.with.gitlab_ci.yaml.filename')}
+                      />
+
+                      <ClipboardIconButton
+                        className="sw-ml-2"
+                        copyValue={translate('onboarding.tutorial.with.gitlab_ci.yaml.filename')}
+                      />
+                    </>
+                  ),
+                }}
+              />
 
-                <FlagMessage className="sw-mb-4" variant="warning">
-                  {translate('onboarding.tutorial.with.gitlab_ci.yaml.premium')}
-                </FlagMessage>
+              <PipeCommand buildTool={buildTool} projectKey={component.key} />
 
-                <p className="sw-mb-1">
-                  {translate('onboarding.tutorial.with.gitlab_ci.yaml.baseconfig')}
-                </p>
+              <FlagMessage className="sw-mb-4 sw-mt-2" variant="warning">
+                {translate('onboarding.tutorial.with.gitlab_ci.yaml.premium')}
+              </FlagMessage>
 
-                <p>{translate('onboarding.tutorial.with.gitlab_ci.yaml.existing')}</p>
-              </>
-            )}
-            <FinishButton onClick={props.onDone} />
-          </li>
-        )}
-      </ol>
-    </div>
+              <p className="sw-mb-1">
+                {translate('onboarding.tutorial.with.gitlab_ci.yaml.baseconfig')}
+              </p>
+
+              <p>{translate('onboarding.tutorial.with.gitlab_ci.yaml.existing')}</p>
+            </NumberedListItem>
+          )}
+        </>
+      )}
+    </NumberedList>
   );
 
   return (
-    <Step
-      finished={finished}
-      onOpen={props.onOpen}
-      open={open}
-      renderForm={renderForm}
-      stepNumber={2}
-      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.yaml.title')}
-    />
+    <TutorialStep title={translate('onboarding.tutorial.with.gitlab_ci.yaml.title')}>
+      {renderForm()}
+    </TutorialStep>
   );
 }
 
index 48caa3e9c5302cc8aba103445dc07cb8070cdd00..254cee6a35ef9c98b0c4bd5841eeddecfc59b645 100644 (file)
@@ -59,34 +59,34 @@ it('should follow and complete all steps', async () => {
   expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
 
   // Env variables step
-  expect(getCopyToClipboardValue()).toMatchSnapshot('sonar token key');
-  expect(getCopyToClipboardValue(1)).toMatchSnapshot('sonarqube host url key');
-  expect(getCopyToClipboardValue(2)).toMatchSnapshot('sonarqube host url value');
-  await user.click(ui.continueButton.get());
+  expect(getCopyToClipboardValue(0, 'Copy to clipboard')).toMatchSnapshot('sonar token key');
+  expect(getCopyToClipboardValue(1, 'Copy to clipboard')).toMatchSnapshot('sonarqube host url key');
+  expect(getCopyToClipboardValue(2, 'Copy to clipboard')).toMatchSnapshot(
+    'sonarqube host url value'
+  );
 
   // Create/update configuration file step
   // Maven
   await user.click(ui.mavenBuildButton.get());
-  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Maven: pom.xml');
-  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Maven: gitlab-ci.yml');
+  expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Maven: pom.xml');
+  expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('Maven: gitlab-ci.yml');
 
   // Gradle
   await user.click(ui.gradleBuildButton.get());
-  expect(getCopyToClipboardValue(2)).toMatchSnapshot('Groovy: build.gradle');
+  expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Groovy: build.gradle');
   await user.click(ui.gradleDSLButton(GradleBuildDSL.Kotlin).get());
-  expect(getCopyToClipboardValue(2)).toMatchSnapshot('Kotlin: build.gradle.kts');
-  expect(getCopyToClipboardValue(4)).toMatchSnapshot('Gradle: gitlab-ci.yml');
+  expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Kotlin: build.gradle.kts');
+  expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('Gradle: gitlab-ci.yml');
 
   // .NET
   await user.click(ui.dotnetBuildButton.get());
-  expect(getCopyToClipboardValue(1)).toMatchSnapshot('.NET: gitlab-ci.yml');
+  expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('.NET: gitlab-ci.yml');
 
   // Other
   await user.click(ui.otherBuildButton.get());
-  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Other: sonar-project.properties');
-  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Other: gitlab-ci.yml');
+  expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Other: sonar-project.properties');
+  expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('Other: gitlab-ci.yml');
 
-  await user.click(ui.finishTutorialButton.get());
   expect(ui.allSetSentence.get()).toBeInTheDocument();
 });
 
@@ -99,7 +99,7 @@ it('should generate/delete a new token or use existing one', async () => {
   // Generate token
   await user.click(ui.genTokenDialogButton.get());
   await user.click(ui.generateTokenButton.get());
-  expect(getCopyToClipboardValue(3)).toEqual('generatedtoken2');
+  expect(getCopyToClipboardValue()).toEqual('generatedtoken2');
 
   // Revoke current token and create new one
   await user.click(ui.deleteTokenButton.get());
@@ -107,25 +107,10 @@ it('should generate/delete a new token or use existing one', async () => {
   await selectEvent.select(ui.expiresInSelect.get(), 'users.tokens.expiration.365');
   await user.click(ui.generateTokenButton.get());
   expect(ui.tokenValue.get()).toBeInTheDocument();
-  await user.click(ui.continueButton.getAll()[1]);
+  await user.click(ui.continueButton.getAll()[0]);
   expect(ui.tokenValue.query()).not.toBeInTheDocument();
 });
 
-it('navigates between steps', async () => {
-  const user = userEvent.setup();
-  renderGitLabTutorial();
-
-  await user.click(await ui.continueButton.find());
-  await user.click(ui.mavenBuildButton.get());
-  await user.click(ui.finishTutorialButton.get());
-  expect(ui.allSetSentence.get()).toBeInTheDocument();
-
-  await user.click(ui.ymlFileStepTitle.get());
-  expect(ui.finishTutorialButton.get()).toBeInTheDocument();
-  await user.click(ui.secretsStepTitle.get());
-  expect(ui.continueButton.get()).toBeInTheDocument();
-});
-
 function renderGitLabTutorial(
   overrides: Partial<GitLabCITutorialProps> = {},
   { languages = { c: mockLanguage({ key: 'c' }) } }: RenderContext = {}
index 542818a2f354560d937bd72703d0d810c46807a8..bf6143cebc0773bb3942fb0316a7de236a6133c4 100644 (file)
@@ -18,8 +18,8 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+import { CodeSnippet } from 'design-system';
 import * as React from 'react';
-import CodeSnippet from '../../../common/CodeSnippet';
 import { BuildTools } from '../../types';
 
 export interface PipeCommandProps {
@@ -102,5 +102,5 @@ sonarqube-vulnerability-report:
     - sonarqube-check
 `;
 
-  return <CodeSnippet snippet={command} />;
+  return <CodeSnippet className="sw-p-6 sw-overflow-auto" snippet={command} language="yml" />;
 }
index ab12969f8633ee3f458a004ad8b0209c031ef3f2..4ca949a3f6524b15723cab006b3090240b7e1de0 100644 (file)
@@ -4104,7 +4104,7 @@ onboarding.mode.help.otherci=SonarQube integrates with your workflow no matter w
 onboarding.tutorial.with.yaml.gradle=Update your {groovy} or {kotlin} file with the {sq} plugin and its configuration:
 
 
-
+onboarding.tutorial.with.bitbucket_ci.title=Analyze your project with Bitbucket CI
 onboarding.tutorial.with.bitbucket_pipelines.variables.title=Create repository variables
 onboarding.tutorial.with.bitbucket_pipelines.yaml.title=Create your pipelines builds configuration
 onboarding.tutorial.with.bitbucket_pipelines.variables.intro=In your Bitbucket repository, go to {repository_variables} and create two new variables:
@@ -4116,6 +4116,7 @@ onboarding.tutorial.with.bitbucket_pipelines.variables.add.sentence.add=Add
 onboarding.tutorial.with.bitbucket_pipelines.variables.secured.sentence=Make sure {secured} is check.
 onboarding.tutorial.with.bitbucket_pipelines.variables.secured.sentence.secured=Secured
 
+onboarding.tutorial.with.github_ci.title=Analyze your project with GitHub CI
 onboarding.tutorial.with.github_action.create_secret.title=Create GitHub Secrets
 onboarding.tutorial.with.github_action.secret.intro=In your GitHub repository, go to {settings_secret} and create two new secrets:
 onboarding.tutorial.with.github_action.secret.intro.link=Settings > Secrets