]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19907 FIxes after validation and review
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Thu, 20 Jul 2023 08:17:56 +0000 (10:17 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 21 Jul 2023 20:03:16 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx
server/sonar-web/src/main/js/components/tutorials/components/GithubCFamilyExampleRepositories.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/YmlFileStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx
server/sonar-web/src/main/js/components/tutorials/other/DoneNextSteps.tsx

index 3d3c4ef3f3535e66d6e1cfe81110b108249c417d..31c33edbc1723dacba4369fec1ccee9bef14f70c 100644 (file)
@@ -84,7 +84,7 @@ export default function BitbucketPipelinesTutorial(props: BitbucketPipelinesTuto
               <>
                 {buildTool === BuildTools.CFamily && (
                   <GithubCFamilyExampleRepositories
-                    className="sw-my-4 sw-bg-inherit sw-w-abs-600"
+                    className="sw-my-4 sw-w-abs-600"
                     ci={TutorialModes.BitbucketPipelines}
                   />
                 )}
index b2b8bf75909c54f9789a1f287b54618af3176aa5..c53a717787b28933d47df9f028b6efb2a8e8f914 100644 (file)
@@ -36,11 +36,7 @@ export default function DefaultProjectKey(props: DefaultProjectKeyProps) {
         filename="sonar-project.properties"
         translationKey="onboarding.tutorial.other.project_key"
       />
-      <CodeSnippet
-        snippet={sonarProjectSnippet(component.key)}
-        isOneLine
-        className="sw-p-6 sw-overflow-auto"
-      />
+      <CodeSnippet snippet={sonarProjectSnippet(component.key)} isOneLine className="sw-p-6" />
     </NumberedListItem>
   );
 }
index 59c2ca6e6e975c3b9c2ecbc5a1de5b5fe13b40a9..b6fc67871abb549aab065ab800ffaa07208c2a09 100644 (file)
@@ -56,7 +56,7 @@ export default function GithubCFamilyExampleRepositories(
   const link = `https://github.com/orgs/sonarsource-cfamily-examples/repositories?q=${queryParams}`;
 
   return (
-    <Card className={classNames('sw-p-4', className)}>
+    <Card className={classNames('sw-p-4 sw-bg-inherit', className)}>
       <div>
         <img
           alt="" // Should be ignored by screen readers
index ef5ad4b7acd3de128b3ee2125fea648796632708..86b23d263ef5810130844dea449bf1552ff6f339 100644 (file)
@@ -114,7 +114,7 @@ export default function SecretStep(props: SecretStepProps) {
             defaultMessage={translate('onboarding.tutorial.env_variables')}
             id="onboarding.tutorial.env_variables"
             values={{
-              extra: <ClipboardIconButton copyValue={baseUrl} />,
+              extra: <ClipboardIconButton copyValue={baseUrl} className="sw-ml-1" />,
               field: (
                 <span className="sw-body-sm-highlight">
                   {translate('onboarding.tutorial.env_variables.field')}
index 450aad1d9a90d2704859b226f171ba58c25a6b83..b1a6589e7a02fa7835003f1803cff76c1e41e86a 100644 (file)
@@ -133,7 +133,7 @@ export default function CFamily(props: CFamilyProps) {
         />
         {os && (
           <GithubCFamilyExampleRepositories
-            className="sw-mt-4 sw-bg-inherit sw-w-abs-600"
+            className="sw-mt-4 sw-w-abs-600"
             os={os}
             ci={TutorialModes.GitHubActions}
           />
index 664b4f2da6f79acae3cc00e55a82fc0d93b475e5..b06d09d08e8b374772590a903bf95e286cc19037 100644 (file)
@@ -130,7 +130,7 @@ export function YmlFileStep(props: YmlFileStepProps) {
         {buildTool === BuildTools.CFamily && (
           <GithubCFamilyExampleRepositories
             ci={TutorialModes.GitLabCI}
-            className="sw-my-4 sw-bg-inherit sw-w-abs-600"
+            className="sw-my-4 sw-w-abs-600"
           />
         )}
       </NumberedListItem>
@@ -177,7 +177,7 @@ export function YmlFileStep(props: YmlFileStepProps) {
               <GradleBuildSelection className="sw-mb-4 sw-mt-2">
                 {(build) => (
                   <CodeSnippet
-                    className="sw-p-6 sw-overflow-auto"
+                    className="sw-p-6"
                     language="yml"
                     snippet={snippetForBuildTool[buildTool](component.key, component.name, build)}
                   />
@@ -185,7 +185,7 @@ export function YmlFileStep(props: YmlFileStepProps) {
               </GradleBuildSelection>
             ) : (
               <CodeSnippet
-                className="sw-p-6 sw-overflow-auto"
+                className="sw-p-6"
                 language="yml"
                 snippet={snippetForBuildTool[buildTool](component.key, component.name)}
               />
index bf6143cebc0773bb3942fb0316a7de236a6133c4..b5d13db1e0b3886e2730e63db938f6e16c585de1 100644 (file)
@@ -102,5 +102,5 @@ sonarqube-vulnerability-report:
     - sonarqube-check
 `;
 
-  return <CodeSnippet className="sw-p-6 sw-overflow-auto" snippet={command} language="yml" />;
+  return <CodeSnippet className="sw-p-6" snippet={command} language="yml" />;
 }
index ca17d2de1fd9a17f616ba9aa1e6d031bedeef998..a0e21e870132863755a724e7a596824948ffc179 100644 (file)
@@ -125,7 +125,7 @@ export default function CFamilly(props: LanguageProps) {
           />
           {os && (
             <GithubCFamilyExampleRepositories
-              className="sw-my-4 sw-bg-inherit"
+              className="sw-my-4"
               os={os}
               ci={TutorialModes.Jenkins}
             />
index 6f788da72e8c18fad38662007247345a3c9d99c2..4f9c5069055f69363a35168e47581686f4b5288d 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 styled from '@emotion/styled';
+import { animated, config, useSpring } from '@react-spring/web';
 import { BasicSeparator, FlagVisual, Link } from 'design-system';
 import * as React from 'react';
 import { useDocUrl } from '../../../helpers/docs';
 import { translate } from '../../../helpers/l10n';
+import useIntersectionObserver from '../../../hooks/useIntersectionObserver';
 import { Component } from '../../../types/types';
 
 export interface DoneNextStepsProps {
@@ -29,50 +32,71 @@ export interface DoneNextStepsProps {
 
 export default function DoneNextSteps({ component }: DoneNextStepsProps) {
   const isProjectAdmin = component.configuration?.showSettings;
+  const outroRef = React.useRef<HTMLDivElement>(null);
+
+  const intersectionEntry = useIntersectionObserver(outroRef, { freezeOnceVisible: true });
+
+  const outroAnimation = useSpring({
+    from: { top: '200px' },
+    to: intersectionEntry?.isIntersecting ? { top: '0px' } : { top: '200px' },
+    config: config.wobbly,
+  });
 
   const docUrl = useDocUrl();
 
   return (
-    <>
+    <animated.div
+      className="sw-flex sw-flex-col sw-items-center sw-relative"
+      ref={outroRef}
+      style={outroAnimation}
+    >
       <BasicSeparator className="sw-my-8" />
+      <StyledDiv>
+        <div className="sw-flex sw-justify-center sw-mb-12">
+          <FlagVisual />
+        </div>
 
-      <div className="sw-flex sw-justify-center sw-mb-12">
-        <FlagVisual />
-      </div>
+        <p>
+          <strong className="sw-font-semibold sw-mr-1">
+            {translate('onboarding.analysis.auto_refresh_after_analysis.done')}
+          </strong>
+          {translate('onboarding.analysis.auto_refresh_after_analysis.auto_refresh')}
+        </p>
+        <p className="sw-mt-4">
+          {isProjectAdmin
+            ? translate(
+                'onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci.admin'
+              )
+            : translate('onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci')}
+        </p>
+        <div className="sw-mt-4">
+          <span>
+            {translate('onboarding.analysis.auto_refresh_after_analysis.check_these_links')}
+          </span>
+          <ul className="sw-flex sw-flex-col sw-gap-2 sw-mt-2">
+            <li>
+              <Link to={docUrl('/analyzing-source-code/branches/branch-analysis/')}>
+                {translate(
+                  'onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches'
+                )}
+              </Link>
+            </li>
 
-      <p>
-        <strong className="sw-font-semibold sw-mr-1">
-          {translate('onboarding.analysis.auto_refresh_after_analysis.done')}
-        </strong>
-        {translate('onboarding.analysis.auto_refresh_after_analysis.auto_refresh')}
-      </p>
-      <p className="sw-mt-4">
-        {isProjectAdmin
-          ? translate('onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci.admin')
-          : translate('onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci')}
-      </p>
-      <div className="sw-mt-4">
-        <span>
-          {translate('onboarding.analysis.auto_refresh_after_analysis.check_these_links')}
-        </span>
-        <ul className="sw-flex sw-flex-col sw-gap-2 sw-mt-2">
-          <li>
-            <Link to={docUrl('/analyzing-source-code/branches/branch-analysis/')}>
-              {translate(
-                'onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches'
-              )}
-            </Link>
-          </li>
-
-          <li>
-            <Link to={docUrl('/analyzing-source-code/pull-request-analysis')}>
-              {translate(
-                'onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis'
-              )}
-            </Link>
-          </li>
-        </ul>
-      </div>
-    </>
+            <li>
+              <Link to={docUrl('/analyzing-source-code/pull-request-analysis')}>
+                {translate(
+                  'onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis'
+                )}
+              </Link>
+            </li>
+          </ul>
+        </div>
+      </StyledDiv>
+    </animated.div>
   );
 }
+
+const StyledDiv = styled.div`
+  width: 840px;
+  margin: auto;
+`;