]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13838 Clean up GitLab onboarding project list
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 9 Feb 2021 11:00:27 +0000 (12:00 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 11 Feb 2021 20:07:07 +0000 (20:07 +0000)
server/sonar-web/src/main/js/apps/create/project/GitlabProjectSelectionForm.tsx
server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/GitlabProjectSelectionForm-test.tsx.snap

index 57fc84e72671fe6cfd27245de1ede61a09246639..d87c95f825c4d72b985a3af2df8a2e0d32025f1c 100644 (file)
@@ -101,7 +101,17 @@ export default function GitlabProjectSelectionForm(props: GitlabProjectSelection
                 <td>
                   <Tooltip overlay={project.slug}>
                     <strong className="project-name display-inline-block text-ellipsis">
-                      {project.name}
+                      {project.sqProjectKey ? (
+                        <Link to={getProjectUrl(project.sqProjectKey)}>
+                          <QualifierIcon
+                            className="spacer-right"
+                            qualifier={ComponentQualifier.Project}
+                          />
+                          {project.sqProjectName}
+                        </Link>
+                      ) : (
+                        project.name
+                      )}
                     </strong>
                   </Tooltip>
                   <br />
@@ -122,27 +132,14 @@ export default function GitlabProjectSelectionForm(props: GitlabProjectSelection
                   </a>
                 </td>
                 {project.sqProjectKey ? (
-                  <>
-                    <td>
-                      <span className="display-flex-center display-flex-justify-end already-set-up">
-                        <CheckIcon className="little-spacer-right" size={12} />
-                        {translate('onboarding.create_project.repository_imported')}:
-                      </span>
-                    </td>
-                    <td>
-                      <div className="sq-project-link text-ellipsis">
-                        <Link to={getProjectUrl(project.sqProjectKey)}>
-                          <QualifierIcon
-                            className="spacer-right"
-                            qualifier={ComponentQualifier.Project}
-                          />
-                          {project.sqProjectName}
-                        </Link>
-                      </div>
-                    </td>
-                  </>
+                  <td>
+                    <span className="display-flex-center display-flex-justify-end already-set-up">
+                      <CheckIcon className="little-spacer-right" size={12} />
+                      {translate('onboarding.create_project.repository_imported')}
+                    </span>
+                  </td>
                 ) : (
-                  <td colSpan={2} className="text-right">
+                  <td className="text-right">
                     <Button
                       disabled={!!importingGitlabProjectId}
                       onClick={() => props.onImport(project.id)}>
index 7c2d25d78cec134d45018eb07c26a9af0d4b0a60..b416707e214a31067606c9c9da551566d31477e1 100644 (file)
@@ -55,7 +55,6 @@ exports[`should render correctly: importing 1`] = `
         </td>
         <td
           className="text-right"
-          colSpan={2}
         >
           <Button
             disabled={true}
@@ -75,7 +74,25 @@ exports[`should render correctly: importing 1`] = `
             <strong
               className="project-name display-inline-block text-ellipsis"
             >
-              Awesome Project !
+              <Link
+                onlyActiveOnIndex={false}
+                style={Object {}}
+                to={
+                  Object {
+                    "pathname": "/dashboard",
+                    "query": Object {
+                      "branch": undefined,
+                      "id": "already-imported",
+                    },
+                  }
+                }
+              >
+                <QualifierIcon
+                  className="spacer-right"
+                  qualifier="TRK"
+                />
+                Already Imported
+              </Link>
             </strong>
           </Tooltip>
           <br />
@@ -111,34 +128,8 @@ exports[`should render correctly: importing 1`] = `
               size={12}
             />
             onboarding.create_project.repository_imported
-            :
           </span>
         </td>
-        <td>
-          <div
-            className="sq-project-link text-ellipsis"
-          >
-            <Link
-              onlyActiveOnIndex={false}
-              style={Object {}}
-              to={
-                Object {
-                  "pathname": "/dashboard",
-                  "query": Object {
-                    "branch": undefined,
-                    "id": "already-imported",
-                  },
-                }
-              }
-            >
-              <QualifierIcon
-                className="spacer-right"
-                qualifier="TRK"
-              />
-              Already Imported
-            </Link>
-          </div>
-        </td>
       </tr>
     </tbody>
   </table>
@@ -263,7 +254,6 @@ exports[`should render correctly: projects 1`] = `
         </td>
         <td
           className="text-right"
-          colSpan={2}
         >
           <Button
             disabled={false}
@@ -283,7 +273,25 @@ exports[`should render correctly: projects 1`] = `
             <strong
               className="project-name display-inline-block text-ellipsis"
             >
-              Awesome Project !
+              <Link
+                onlyActiveOnIndex={false}
+                style={Object {}}
+                to={
+                  Object {
+                    "pathname": "/dashboard",
+                    "query": Object {
+                      "branch": undefined,
+                      "id": "already-imported",
+                    },
+                  }
+                }
+              >
+                <QualifierIcon
+                  className="spacer-right"
+                  qualifier="TRK"
+                />
+                Already Imported
+              </Link>
             </strong>
           </Tooltip>
           <br />
@@ -319,34 +327,8 @@ exports[`should render correctly: projects 1`] = `
               size={12}
             />
             onboarding.create_project.repository_imported
-            :
           </span>
         </td>
-        <td>
-          <div
-            className="sq-project-link text-ellipsis"
-          >
-            <Link
-              onlyActiveOnIndex={false}
-              style={Object {}}
-              to={
-                Object {
-                  "pathname": "/dashboard",
-                  "query": Object {
-                    "branch": undefined,
-                    "id": "already-imported",
-                  },
-                }
-              }
-            >
-              <QualifierIcon
-                className="spacer-right"
-                qualifier="TRK"
-              />
-              Already Imported
-            </Link>
-          </div>
-        </td>
       </tr>
     </tbody>
   </table>