]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9842 align project, portfolio and application home pages
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 19 Sep 2017 15:28:23 +0000 (17:28 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 25 Sep 2017 08:17:18 +0000 (10:17 +0200)
server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js
server/sonar-web/src/main/js/apps/portfolio/components/Activity.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Report.tsx
server/sonar-web/src/main/js/apps/portfolio/components/Summary.tsx
server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Activity-test.tsx.snap
server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Report-test.tsx.snap
server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Summary-test.tsx.snap
server/sonar-web/src/main/js/apps/portfolio/styles.css
server/sonar-web/src/main/less/init/misc.less

index 7cd41c45753f0ca39504ae1c44efd89eb1e081ed..3b7561ca16a7b63a5472fc0e12535e203b672b10 100644 (file)
@@ -46,7 +46,7 @@ export default class MetaSize extends React.PureComponent {
       <DrilldownLink branch={this.props.branch} component={this.props.component.key} metric="ncloc">
         {formatMeasure(ncloc.value, 'SHORT_INT')}
       </DrilldownLink>
-      <div className="overview-domain-measure-label text-muted">{getMetricName('ncloc')}</div>
+      <div className="spacer-top text-muted">{getMetricName('ncloc')}</div>
     </div>
   );
 
@@ -55,8 +55,11 @@ export default class MetaSize extends React.PureComponent {
       measure => measure.metric.key === 'ncloc_language_distribution'
     );
 
+    const className =
+      this.props.component.qualifier === 'TRK' ? 'overview-meta-size-lang-dist' : 'big-spacer-top';
+
     return languageDistribution ? (
-      <div id="overview-language-distribution" className="overview-meta-size-lang-dist">
+      <div id="overview-language-distribution" className={className}>
         <LanguageDistributionContainer distribution={languageDistribution.value} width={160} />
       </div>
     ) : null;
@@ -66,16 +69,14 @@ export default class MetaSize extends React.PureComponent {
     const projects = this.props.measures.find(measure => measure.metric.key === 'projects');
 
     return projects ? (
-      <div id="overview-projects" className="overview-meta-size-ncloc is-half-width bordered-left">
+      <div id="overview-projects" className="overview-meta-size-ncloc is-half-width">
         <DrilldownLink
           branch={this.props.branch}
           component={this.props.component.key}
           metric="projects">
           {formatMeasure(projects.value, 'SHORT_INT')}
         </DrilldownLink>
-        <div className="overview-domain-measure-label text-muted">
-          {translate('metric.projects.name')}
-        </div>
+        <div className="spacer-top text-muted">{translate('metric.projects.name')}</div>
       </div>
     ) : null;
   };
@@ -89,12 +90,9 @@ export default class MetaSize extends React.PureComponent {
 
     return (
       <div id="overview-size" className="overview-meta-card">
+        {this.props.component.qualifier === 'APP' && this.renderProjects()}
         {this.renderLoC(ncloc)}
-        {this.props.component.qualifier === 'APP' ? (
-          this.renderProjects()
-        ) : (
-          this.renderLoCDistribution()
-        )}
+        {this.renderLoCDistribution()}
       </div>
     );
   }
index 63ccdd7217cb80838f087b42bdb98d2b9c9c625a..66cef7e572d22970c8b937363998d434f885952a 100644 (file)
@@ -97,10 +97,8 @@ export default class Activity extends React.PureComponent<Props> {
 
   render() {
     return (
-      <div className="huge-spacer-bottom">
-        <header className="page-header">
-          <h3 className="page-title">{translate('project_activity.page')}</h3>
-        </header>
+      <div className="big-spacer-bottom">
+        <h4>{translate('project_activity.page')}</h4>
 
         {this.state.loading ? (
           <i className="spinner" />
index 86bf16d5050d21bfb67ca3cc15921445218711f2..e552313cc403d3230c0cbcb2eac1b9bfaa705aad 100644 (file)
@@ -59,11 +59,7 @@ export default class Report extends React.PureComponent<Props, State> {
     );
   }
 
-  renderHeader = () => (
-    <header className="page-header">
-      <h3 className="page-title">{translate('report.page')}</h3>
-    </header>
-  );
+  renderHeader = () => <h4>{translate('report.page')}</h4>;
 
   render() {
     const { component } = this.props;
index 5aecf73d70ff29f5f03a85fb39091ebcfb34f70a..018940b3aa032aa98ce9837b0679bd6b37e66ac4 100644 (file)
@@ -35,7 +35,7 @@ export default function Summary({ component, measures }: Props) {
   const nclocDistribution = measures['ncloc_language_distribution'];
 
   return (
-    <section id="portfolio-summary" className="huge-spacer-bottom">
+    <section id="portfolio-summary" className="big-spacer-bottom">
       {component.description && <div className="big-spacer-bottom">{component.description}</div>}
 
       <ul className="portfolio-grid">
@@ -47,7 +47,7 @@ export default function Summary({ component, measures }: Props) {
               />
             </Link>
           </div>
-          {translate('projects')}
+          <div className="spacer-top text-muted">{translate('projects')}</div>
         </li>
         <li>
           <div className="portfolio-measure-secondary-value">
@@ -55,12 +55,12 @@ export default function Summary({ component, measures }: Props) {
               <Measure measure={{ metric: { key: 'ncloc', type: 'SHORT_INT' }, value: ncloc }} />
             </Link>
           </div>
-          {translate('metric.ncloc.name')}
+          <div className="spacer-top text-muted">{translate('metric.ncloc.name')}</div>
         </li>
       </ul>
 
       {nclocDistribution && (
-        <div className="huge-spacer-top">
+        <div className="big-spacer-top">
           <LanguageDistributionContainer distribution={nclocDistribution} width={260} />
         </div>
       )}
index fa3361a98b5995caffa9b98e8a923a76308e06d4..2a0038daecbf4e8207ea09a09fb383b37049720a 100644 (file)
@@ -2,17 +2,11 @@
 
 exports[`renders 1`] = `
 <div
-  className="huge-spacer-bottom"
+  className="big-spacer-bottom"
 >
-  <header
-    className="page-header"
-  >
-    <h3
-      className="page-title"
-    >
-      project_activity.page
-    </h3>
-  </header>
+  <h4>
+    project_activity.page
+  </h4>
   <PreviewGraph
     history={
       Object {
index 50b579f8303ecb46be6599b79f422cedfb1f6eb1..d955ec60f55ea4e1a9f74d7cfc9f9b0be8d4344a 100644 (file)
@@ -2,15 +2,9 @@
 
 exports[`renders 1`] = `
 <div>
-  <header
-    className="page-header"
-  >
-    <h3
-      className="page-title"
-    >
-      report.page
-    </h3>
-  </header>
+  <h4>
+    report.page
+  </h4>
   <i
     className="spinner"
   />
@@ -19,15 +13,9 @@ exports[`renders 1`] = `
 
 exports[`renders 2`] = `
 <div>
-  <header
-    className="page-header"
-  >
-    <h3
-      className="page-title"
-    >
-      report.page
-    </h3>
-  </header>
+  <h4>
+    report.page
+  </h4>
   <div
     className="js-report-can-download"
   >
index db159a6947aeeb7695a3704df9919b884752d6b7..f8f2706777dd8f3c63d9a259de92a7032290a1ba 100644 (file)
@@ -2,7 +2,7 @@
 
 exports[`renders 1`] = `
 <section
-  className="huge-spacer-bottom"
+  className="big-spacer-bottom"
   id="portfolio-summary"
 >
   <div
@@ -44,7 +44,11 @@ exports[`renders 1`] = `
           />
         </Link>
       </div>
-      projects
+      <div
+        className="spacer-top text-muted"
+      >
+        projects
+      </div>
     </li>
     <li>
       <div
@@ -77,11 +81,15 @@ exports[`renders 1`] = `
           />
         </Link>
       </div>
-      metric.ncloc.name
+      <div
+        className="spacer-top text-muted"
+      >
+        metric.ncloc.name
+      </div>
     </li>
   </ul>
   <div
-    className="huge-spacer-top"
+    className="big-spacer-top"
   >
     <Connect(LanguageDistribution)
       distribution="java=13;js=17"
index 6214d02e657594b2ad402bea3bd73db3d6efed68..06bd6423d05bb1ded42c6b2cee1a6d41808f2a77 100644 (file)
@@ -1,7 +1,6 @@
 .portfolio-measure-secondary-value {
-  line-height: 1.4;
-  margin-bottom: 4px;
-  font-size: 24px;
+  line-height: 24px;
+  font-size: 18px;
   font-weight: 300;
 }
 
@@ -9,7 +8,6 @@
   position: relative;
   z-index: 10;
   display: flex;
-  height: 80px;
   justify-content: space-around;
   align-items: center;
 }
index d83fb0b515342c03fc5578d798e4509caea264f6..ddca44d3771d36b2fb62cde6dadad6edc62b5d36 100644 (file)
@@ -83,9 +83,6 @@ th.nowrap {
 .huge-spacer-top {
   margin-top: 40px;
 }
-.huge-spacer-bottom {
-  margin-bottom: 40px;
-}
 .huge-spacer-left {
   margin-left: 40px;
 }