]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20086 After validation changes to correct warning message and spacing
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Mon, 14 Aug 2023 10:29:09 +0000 (12:29 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 14 Aug 2023 20:02:58 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/create/project/Azure/AzureProjectAccordion.tsx
server/sonar-web/src/main/js/apps/create/project/Azure/AzureProjectCreateRenderer.tsx
server/sonar-web/src/main/js/apps/create/project/Azure/AzureProjectsList.tsx
server/sonar-web/src/main/js/apps/create/project/BitbucketCloud/BitbucketCloudSearchForm.tsx
server/sonar-web/src/main/js/apps/create/project/BitbucketServer/BitbucketImportRepositoryForm.tsx
server/sonar-web/src/main/js/apps/create/project/BitbucketServer/BitbucketProjectAccordion.tsx
server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx
server/sonar-web/src/main/js/apps/create/project/manual/ManualProjectCreate.tsx

index 1cb9fb701d4f4a0f6248146b669b81ef3519c831..9bc4aaa19c86ad5a71dad4155258167829f7717b 100644 (file)
@@ -70,25 +70,27 @@ export default function AzureProjectAccordion(props: AzureProjectAccordionProps)
           {/* The extra loading guard is to prevent the flash of the Alert */}
           {!loading && repositories.length === 0 ? (
             <FlagMessage variant="warning">
-              <FormattedMessage
-                defaultMessage={translate('onboarding.create_project.azure.no_repositories')}
-                id="onboarding.create_project.azure.no_repositories"
-                values={{
-                  link: (
-                    <Link
-                      to={{
-                        pathname: '/projects/create',
-                        search: queryToSearch({
-                          mode: CreateProjectModes.AzureDevOps,
-                          resetPat: 1,
-                        }),
-                      }}
-                    >
-                      {translate('onboarding.create_project.update_your_token')}
-                    </Link>
-                  ),
-                }}
-              />
+              <span>
+                <FormattedMessage
+                  defaultMessage={translate('onboarding.create_project.azure.no_repositories')}
+                  id="onboarding.create_project.azure.no_repositories"
+                  values={{
+                    link: (
+                      <Link
+                        to={{
+                          pathname: '/projects/create',
+                          search: queryToSearch({
+                            mode: CreateProjectModes.AzureDevOps,
+                            resetPat: 1,
+                          }),
+                        }}
+                      >
+                        {translate('onboarding.create_project.update_your_token')}
+                      </Link>
+                    ),
+                  }}
+                />
+              </span>
             </FlagMessage>
           ) : (
             <>
index 94c4ec746cd9fcaa22c229cf9956a6cb62a500fa..c775999c4d6d2de58ed96b0381315365e2a6f43a 100644 (file)
@@ -97,23 +97,25 @@ export default function AzureProjectCreateRenderer(props: AzureProjectCreateRend
       <DeferredSpinner loading={loading} />
 
       {showUrlError && (
-        <FlagMessage variant="error">
-          {canAdmin ? (
-            <FormattedMessage
-              defaultMessage={translate('onboarding.create_project.azure.no_url.admin')}
-              id="onboarding.create_project.azure.no_url.admin"
-              values={{
-                alm: translate('onboarding.alm', AlmKeys.Azure),
-                url: (
-                  <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY)}>
-                    {translate('settings.page')}
-                  </Link>
-                ),
-              }}
-            />
-          ) : (
-            translate('onboarding.create_project.azure.no_url')
-          )}
+        <FlagMessage variant="error" className="sw-mb-2">
+          <span>
+            {canAdmin ? (
+              <FormattedMessage
+                defaultMessage={translate('onboarding.create_project.azure.no_url.admin')}
+                id="onboarding.create_project.azure.no_url.admin"
+                values={{
+                  alm: translate('onboarding.alm', AlmKeys.Azure),
+                  url: (
+                    <Link to={getGlobalSettingsUrl(ALM_INTEGRATION_CATEGORY)}>
+                      {translate('settings.page')}
+                    </Link>
+                  ),
+                }}
+              />
+            ) : (
+              translate('onboarding.create_project.azure.no_url')
+            )}
+          </span>
         </FlagMessage>
       )}
 
index e4caacd0a6c32db6fea925f2a50d784677c74573..8ea226667a8a7743a53390efbd92ecf3bdd9cf4b 100644 (file)
@@ -57,22 +57,24 @@ export default function AzureProjectsList(props: AzureProjectsListProps) {
   if (projects.length === 0) {
     return (
       <FlagMessage className="sw-mt-2" variant="warning">
-        <FormattedMessage
-          defaultMessage={translate('onboarding.create_project.azure.no_projects')}
-          id="onboarding.create_project.azure.no_projects"
-          values={{
-            link: (
-              <Link
-                to={{
-                  pathname: '/projects/create',
-                  search: queryToSearch({ mode: CreateProjectModes.AzureDevOps, resetPat: 1 }),
-                }}
-              >
-                {translate('onboarding.create_project.update_your_token')}
-              </Link>
-            ),
-          }}
-        />
+        <span>
+          <FormattedMessage
+            defaultMessage={translate('onboarding.create_project.azure.no_projects')}
+            id="onboarding.create_project.azure.no_projects"
+            values={{
+              link: (
+                <Link
+                  to={{
+                    pathname: '/projects/create',
+                    search: queryToSearch({ mode: CreateProjectModes.AzureDevOps, resetPat: 1 }),
+                  }}
+                >
+                  {translate('onboarding.create_project.update_your_token')}
+                </Link>
+              ),
+            }}
+          />
+        </span>
       </FlagMessage>
     );
   }
index 206a2bcb082c8eb8c204662e0fdbf6f8ce622783..9f9994d82a093fce6650b334412b821479b2bf03 100644 (file)
@@ -50,22 +50,24 @@ export default function BitbucketCloudSearchForm(props: BitbucketCloudSearchForm
   if (repositories.length === 0 && searchQuery.length === 0 && !searching) {
     return (
       <FlagMessage className="sw-mt-2" variant="warning">
-        <FormattedMessage
-          defaultMessage={translate('onboarding.create_project.bitbucketcloud.no_projects')}
-          id="onboarding.create_project.bitbucketcloud.no_projects"
-          values={{
-            link: (
-              <Link
-                to={{
-                  pathname: '/projects/create',
-                  search: queryToSearch({ mode: CreateProjectModes.BitbucketCloud, resetPat: 1 }),
-                }}
-              >
-                {translate('onboarding.create_project.update_your_token')}
-              </Link>
-            ),
-          }}
-        />
+        <span>
+          <FormattedMessage
+            defaultMessage={translate('onboarding.create_project.bitbucketcloud.no_projects')}
+            id="onboarding.create_project.bitbucketcloud.no_projects"
+            values={{
+              link: (
+                <Link
+                  to={{
+                    pathname: '/projects/create',
+                    search: queryToSearch({ mode: CreateProjectModes.BitbucketCloud, resetPat: 1 }),
+                  }}
+                >
+                  {translate('onboarding.create_project.update_your_token')}
+                </Link>
+              ),
+            }}
+          />
+        </span>
       </FlagMessage>
     );
   }
index 8ea8ca5afda269275ea0764457c714ce8de9ef21..e7a05eb1c15dec28f773751e0f2e2b5796333273 100644 (file)
@@ -46,22 +46,27 @@ export default function BitbucketImportRepositoryForm(props: BitbucketImportRepo
   if (projects.length === 0) {
     return (
       <FlagMessage variant="warning">
-        <FormattedMessage
-          defaultMessage={translate('onboarding.create_project.no_bbs_projects')}
-          id="onboarding.create_project.no_bbs_projects"
-          values={{
-            link: (
-              <Link
-                to={{
-                  pathname: '/projects/create',
-                  search: queryToSearch({ mode: CreateProjectModes.BitbucketServer, resetPat: 1 }),
-                }}
-              >
-                {translate('onboarding.create_project.update_your_token')}
-              </Link>
-            ),
-          }}
-        />
+        <span>
+          <FormattedMessage
+            defaultMessage={translate('onboarding.create_project.no_bbs_projects')}
+            id="onboarding.create_project.no_bbs_projects"
+            values={{
+              link: (
+                <Link
+                  to={{
+                    pathname: '/projects/create',
+                    search: queryToSearch({
+                      mode: CreateProjectModes.BitbucketServer,
+                      resetPat: 1,
+                    }),
+                  }}
+                >
+                  {translate('onboarding.create_project.update_your_token')}
+                </Link>
+              ),
+            }}
+          />
+        </span>
       </FlagMessage>
     );
   }
index 99c3291f515236104cb0fc986977593bd2671640..a2d11496fcccadb06adfc043b56fdb91c9b5eaa6 100644 (file)
@@ -61,25 +61,27 @@ export default function BitbucketProjectAccordion(props: BitbucketProjectAccordi
           <div className="sw-mb-4">
             {repositoryCount === 0 && (
               <FlagMessage variant="warning">
-                <FormattedMessage
-                  defaultMessage={translate('onboarding.create_project.no_bbs_repos')}
-                  id="onboarding.create_project.no_bbs_repos"
-                  values={{
-                    link: (
-                      <Link
-                        to={{
-                          pathname: '/projects/create',
-                          search: queryToSearch({
-                            mode: CreateProjectModes.BitbucketServer,
-                            resetPat: 1,
-                          }),
-                        }}
-                      >
-                        {translate('onboarding.create_project.update_your_token')}
-                      </Link>
-                    ),
-                  }}
-                />
+                <span>
+                  <FormattedMessage
+                    defaultMessage={translate('onboarding.create_project.no_bbs_repos')}
+                    id="onboarding.create_project.no_bbs_repos"
+                    values={{
+                      link: (
+                        <Link
+                          to={{
+                            pathname: '/projects/create',
+                            search: queryToSearch({
+                              mode: CreateProjectModes.BitbucketServer,
+                              resetPat: 1,
+                            }),
+                          }}
+                        >
+                          {translate('onboarding.create_project.update_your_token')}
+                        </Link>
+                      ),
+                    }}
+                  />
+                </span>
               </FlagMessage>
             )}
 
index f0678eb6757d2b31d29f515051304c81b199ebe7..f331941bdc52b36feef5501f710c133e0165d6f8 100644 (file)
@@ -59,9 +59,7 @@ export default function NewCodeDefinitionSelection(props: Props) {
 
   return (
     <div id="project-ncd-selection" className="sw-body-sm">
-      <Title className="sw-mt-8">
-        {translate('onboarding.create_project.new_code_definition.title')}
-      </Title>
+      <Title>{translate('onboarding.create_project.new_code_definition.title')}</Title>
 
       <p className="sw-mb-2">
         <FormattedMessage
index 2d3b7373f4e588d0b79a8fcdc3b8de9bf37715dd..cd52345b59a71cdf8a6d944f3f018a7ba32bad06 100644 (file)
@@ -227,7 +227,7 @@ export default class ManualProjectCreate extends React.PureComponent<Props, Stat
 
     return (
       <div className="sw-max-w-[50%]">
-        <Title className="sw-mt-8">{translate('onboarding.create_project.setup_manually')}</Title>
+        <Title>{translate('onboarding.create_project.setup_manually')}</Title>
         {branchesEnabled && (
           <FlagMessage className="sw-my-4" variant="info">
             {translate('onboarding.create_project.pr_decoration.information')}
@@ -324,7 +324,11 @@ export default class ManualProjectCreate extends React.PureComponent<Props, Stat
             </Note>
           </FormField>
 
-          <ButtonPrimary type="submit" className="sw-mt-4" disabled={!this.canSubmit(this.state)}>
+          <ButtonPrimary
+            type="submit"
+            className="sw-mt-4 sw-mb-4"
+            disabled={!this.canSubmit(this.state)}
+          >
             {translate('next')}
           </ButtonPrimary>
         </form>