]> source.dussan.org Git - sonarqube.git/blob
ba4930155f9902fb974ca8b70c7c1664962cac53
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2023 SonarSource SA
4  * mailto:info AT sonarsource DOT com
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 3 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  */
20 import { CodeSnippet, FlagMessage, HelperHintIcon, NumberedListItem } from 'design-system';
21 import * as React from 'react';
22 import HelpTooltip from '../../../../components/controls/HelpTooltip';
23 import SentenceWithFilename from '../../components/SentenceWithFilename';
24 import SentenceWithHighlights from '../../components/SentenceWithHighlights';
25
26 export interface CreateJenkinsfileBulletPointProps {
27   alertTranslationKeyPart?: string;
28   children?: React.ReactNode;
29   snippet: string;
30 }
31
32 export default function CreateJenkinsfileBulletPoint(props: CreateJenkinsfileBulletPointProps) {
33   const { children, snippet, alertTranslationKeyPart } = props;
34
35   return (
36     <NumberedListItem className="sw-max-w-2/3">
37       <SentenceWithFilename
38         filename="Jenkinsfile"
39         translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
40       />
41       <div className="sw-ml-8">
42         {alertTranslationKeyPart && (
43           <FlagMessage className="sw-mt-2" variant="info">
44             <div>
45               <SentenceWithHighlights
46                 highlightKeys={['default', 'in_jenkins']}
47                 translationKey={`${alertTranslationKeyPart}.replace`}
48               />
49               <HelpTooltip
50                 className="sw-ml-1"
51                 overlay={
52                   <>
53                     <p className="sw-mb-2">
54                       <SentenceWithHighlights
55                         highlightKeys={['path']}
56                         translationKey={`${alertTranslationKeyPart}.help1`}
57                       />
58                     </p>
59                     <p>
60                       <SentenceWithHighlights
61                         highlightKeys={['path', 'name']}
62                         translationKey={`${alertTranslationKeyPart}.help2`}
63                       />
64                     </p>
65                   </>
66                 }
67               >
68                 <HelperHintIcon />
69               </HelpTooltip>
70             </div>
71           </FlagMessage>
72         )}
73         <CodeSnippet className="sw-p-6" language="groovy" snippet={snippet} />
74         {children}
75       </div>
76     </NumberedListItem>
77   );
78 }