]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8300 adjust layout
authorStas Vilchik <vilchiks@gmail.com>
Tue, 1 Nov 2016 16:42:17 +0000 (17:42 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 2 Nov 2016 08:03:26 +0000 (09:03 +0100)
21 files changed:
server/sonar-web/src/main/js/apps/projects/components/App.js
server/sonar-web/src/main/js/apps/projects/components/FavoriteProjects.js
server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js
server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js
server/sonar-web/src/main/js/apps/projects/components/ProjectCardMeasures.js
server/sonar-web/src/main/js/apps/projects/components/ProjectCardQualityGate.js
server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js
server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js
server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js
server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js
server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js
server/sonar-web/src/main/js/apps/projects/styles.css
server/sonar-web/src/main/js/components/ui/CoverageRating.js
server/sonar-web/src/main/js/components/ui/DuplicationsRating.css
server/sonar-web/src/main/js/components/ui/DuplicationsRating.js
server/sonar-web/src/main/js/components/ui/Level.js
server/sonar-web/src/main/js/components/ui/Rating.css
server/sonar-web/src/main/js/components/ui/Rating.js
server/sonar-web/src/main/js/components/ui/SizeRating.css
server/sonar-web/src/main/js/components/ui/SizeRating.js
server/sonar-web/src/main/less/components/search-navigator.less

index 34d280a228e366718eb7fc6cfaa43e338f01372c..f58788129d8b870cc55a18ca4c0b222d4cbede3e 100644 (file)
@@ -78,7 +78,7 @@ export default class App extends React.Component {
               <ProjectsListContainer/>
               <ProjectsListFooterContainer query={this.state.query}/>
             </div>
-            <aside className="page-sidebar-fixed">
+            <aside className="page-sidebar-fixed projects-sidebar">
               <FavoriteFilterContainer/>
               <PageSidebarContainer query={this.state.query}/>
             </aside>
index 6503b1e083f101f156e14940410b58fc663359c6..a6a04e47390ede6b794394e51fe3a095bd9dfc22 100644 (file)
@@ -58,7 +58,7 @@ export default class FavoriteProjects extends React.Component {
             <div className="page-main">
               <ProjectsListContainer/>
             </div>
-            <aside className="page-sidebar-fixed">
+            <aside className="page-sidebar-fixed projects-sidebar">
               <FavoriteFilterContainer/>
 
               <p className="note text-center">Filters are not available.</p>
index 705ade84aea5532e3390d78bc04a3f72dc650c27..a5cd4c4b31fbb28a3de3575164b2b58b8792fa6a 100644 (file)
@@ -39,13 +39,13 @@ export default class PageSidebar extends React.Component {
 
     return (
         <div className="search-navigator-facets-list">
+          <QualityGateFilter query={this.props.query}/>
           <ReliabilityFilter query={this.props.query}/>
           <SecurityFilter query={this.props.query}/>
           <MaintainabilityFilter query={this.props.query}/>
           <CoverageFilter query={this.props.query}/>
           <DuplicationsFilter query={this.props.query}/>
           <SizeFilter query={this.props.query}/>
-          <QualityGateFilter query={this.props.query}/>
 
           {isFiltered && (
               <div className="projects-facets-reset">
index 8ed3558a129216e82def3cd3a0a47b64e07bcecb..04dbdb15fc379d266f7d95d3b67f43635c392bd9 100644 (file)
@@ -19,6 +19,7 @@
  */
 import React from 'react';
 import classNames from 'classnames';
+import ProjectCardQualityGate from './ProjectCardQualityGate';
 import ProjectCardMeasures from './ProjectCardMeasures';
 import { getComponentUrl } from '../../../helpers/urls';
 
@@ -38,6 +39,11 @@ export default class ProjectCard extends React.Component {
 
     return (
         <div className={className}>
+          {this.props.measures != null && (
+              <div className="boxed-group-actions">
+                <ProjectCardQualityGate status={this.props.measures['alert_status']}/>
+              </div>
+          )}
           <h2 className="project-card-name">
             <a className="link-base-color" href={getComponentUrl(project.key)}>{project.name}</a>
           </h2>
index 9c7cc99abfd38227671d3368885efd0ba7e9d1c7..d8004d2de665bd4c1c33b3d23f5c24f133cb99e3 100644 (file)
@@ -19,7 +19,6 @@
  */
 import React from 'react';
 import ProjectCardLanguages from './ProjectCardLanguages';
-import ProjectCardQualityGate from './ProjectCardQualityGate';
 import Measure from '../../component-measures/components/Measure';
 import Rating from '../../../components/ui/Rating';
 import CoverageRating from '../../../components/ui/CoverageRating';
@@ -121,8 +120,6 @@ export default class ProjectCardMeasures extends React.Component {
               </div>
             </div>
           </div>
-
-          <ProjectCardQualityGate status={measures['alert_status']}/>
         </div>
     );
   }
index cc542cabefae4d5fae9d0b7e174018a73e3db2ff..1f60437b534fc62564a00c2e6216913bde738a36 100644 (file)
@@ -34,14 +34,13 @@ export default class ProjectCardQualityGate extends React.Component {
     }
 
     return (
-        <div className="project-card-measure pull-right">
+        <div className="project-card-measure">
           <div className="project-card-measure-inner">
-            <div>
-              <Level level={status}/>
-            </div>
-            <div className="project-card-measure-label">
+            <span className="small spacer-right">
               {translate('overview.quality_gate')}
-            </div>
+              {':'}
+            </span>
+            <Level level={status} small={true}/>
           </div>
         </div>
     );
index 4ff3f821130d8d049381d746bc0e6c6c13ce0c29..5ac1adec4c397931e0aef9265c15f45528ba4601 100644 (file)
@@ -26,7 +26,7 @@ export default class CoverageFilter extends React.Component {
   renderOption = option => {
     return (
         <span>
-          <CoverageRating value={getCoverageRatingAverageValue(option)}/>
+          <CoverageRating value={getCoverageRatingAverageValue(option)} small={true}/>
           <span className="spacer-left">
             {getCoverageRatingLabel(option)}
           </span>
@@ -43,7 +43,7 @@ export default class CoverageFilter extends React.Component {
     return (
         <FilterContainer
             property="coverage"
-            options={[1, 2, 3, 4, 5]}
+            options={[5, 4, 3, 2, 1]}
             renderName={() => 'Coverage'}
             renderOption={this.renderOption}
             getFacetValueForOption={this.getFacetValueForOption}
index c74cd36483875f1e02060022827b9894a6fe96f6..153be2be7dcf80e7db7ebea7e4fb7abff308cf0c 100644 (file)
@@ -26,7 +26,7 @@ export default class DuplicationsFilter extends React.Component {
   renderOption = option => {
     return (
         <span>
-          <DuplicationsRating value={getDuplicationsRatingAverageValue(option)}/>
+          <DuplicationsRating value={getDuplicationsRatingAverageValue(option)} small={true}/>
           <span className="spacer-left">
             {getDuplicationsRatingLabel(option)}
           </span>
index 42199463b179bf801530380e91960af17e611242..0c282f587590eb44991c5ba88986b29965bd3f5c 100644 (file)
@@ -24,7 +24,9 @@ import Rating from '../../../components/ui/Rating';
 export default class IssuesFilter extends React.Component {
   renderOption = option => {
     return (
-        <Rating value={option}/>
+        <span>
+          <Rating value={option} small={true}/>
+        </span>
     );
   };
 
index e236a62e22e13f5a8048dd83075d4cd4cbdd10ff..a4838824870f92626debff88dce62d1634259a3c 100644 (file)
@@ -24,7 +24,7 @@ import Level from '../../../components/ui/Level';
 export default class QualityGateFilter extends React.Component {
   renderOption = option => {
     return (
-        <Level level={option}/>
+        <Level level={option} small={true}/>
     );
   };
 
index ed331913ac8ceb41f0b35a20e2f3f529fa0b3c0e..7b947b002d2d64f4699f0920e4a4940d5caaa69e 100644 (file)
@@ -26,7 +26,7 @@ export default class SizeFilter extends React.Component {
   renderOption = option => {
     return (
         <span>
-          <SizeRating value={getSizeRatingAverageValue(option)}/>
+          <SizeRating value={getSizeRatingAverageValue(option)} small={true}/>
           <span className="spacer-left">
             {getSizeRatingLabel(option)}
           </span>
index cc1105ba0aa4f2c395ef23fb61d1a4f247c83e39..ac52d3a74d11ef4902d88d90761dc0b556871637 100644 (file)
@@ -1,3 +1,7 @@
+.projects-sidebar {
+  width: 260px;
+}
+
 .projects-list {
   outline: none;
 }
 }
 
 .project-card-measures {
-  margin: 0 -20px;
+  margin: 0 -15px;
+}
+
+.project-card-measures .project-card-measure {
+  width: 120px;
+  box-sizing: border-box;
+  padding: 0 15px;
+}
+
+.project-card-measures .project-card-measure:nth-child(-n+2) {
+  width: 90px;
 }
 
 .project-card-measure {
   position: relative;
   display: inline-block;
   vertical-align: top;
-  padding: 0 15px;
   text-align: center;
 }
 
   transition: none;
 }
 
-.projects-facet .facet-name,
-.projects-facet .facet-stat {
-  line-height: 24px !important;
-}
-
 .projects-facets-reset {
   margin-top: 20px;
   padding: 10px;
index d6d6d54d85bec692fa0849316c80416fef4b164f..1546962ff141385d76e5678d2842a66606e0c324 100644 (file)
@@ -22,7 +22,12 @@ import { DonutChart } from '../charts/donut-chart';
 
 export default class CoverageRating extends React.Component {
   static propTypes = {
-    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string])
+    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]),
+    small: React.PropTypes.bool
+  };
+
+  static defaultProps = {
+    small: false
   };
 
   render () {
@@ -36,12 +41,15 @@ export default class CoverageRating extends React.Component {
       ];
     }
 
+    const size = this.props.small ? 16 : 24;
+    const thickness = this.props.small ? 2 : 3;
+
     return (
         <DonutChart
             data={data}
-            width={24}
-            height={24}
-            thickness={3}/>
+            width={size}
+            height={size}
+            thickness={thickness}/>
     );
   }
 }
index 73c12db92df797b663d0d571b5cde96c74048724..25ca62145e9ab9b93d180e69649ed432ff0cd397 100644 (file)
   box-sizing: border-box;
 }
 
+.duplications-rating-small {
+  width: 16px;
+  height: 16px;
+  border-width: 2px;
+}
+
 .duplications-rating:after {
   border-radius: 24px;
   background-color: #f3ca8e;
   height: 6px;
 }
 
+.duplications-rating-small.duplications-rating-B:after {
+  width: 2px;
+  height: 2px;
+}
+
 .duplications-rating-C:after {
   width: 8px;
   height: 8px;
 }
 
+.duplications-rating-small.duplications-rating-C:after {
+  width: 6px;
+  height: 6px;
+}
+
 .duplications-rating-D {
   border-color: #d4333f;
 }
   background-color: #d4333f;
 }
 
+.duplications-rating-small.duplications-rating-D:after {
+  width: 8px;
+  height: 8px;
+  background-color: #d4333f;
+}
+
 .duplications-rating-E {
   border-color: #d4333f;
 }
 
+.duplications-rating-small.duplications-rating-E:after {
+  width: 10px;
+  height: 10px;
+  background-color: #d4333f;
+}
+
 .duplications-rating-E:after {
   width: 14px;
   height: 14px;
index 35765a68a37a522922e1e7a7d70413d757be2e97..4d0e4f5c9bf64eb20495e96f12f07c6500f28857 100644 (file)
@@ -24,12 +24,18 @@ import './DuplicationsRating.css';
 
 export default class DuplicationsRating extends React.Component {
   static propTypes = {
-    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]).isRequired
+    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]).isRequired,
+    small: React.PropTypes.bool
+  };
+
+  static defaultProps = {
+    small: false
   };
 
   render () {
     const { value } = this.props;
     const className = classNames('duplications-rating', {
+      'duplications-rating-small': this.props.small,
       'duplications-rating-A': inRange(value, 3),
       'duplications-rating-B': inRange(value, 3, 5),
       'duplications-rating-C': inRange(value, 5, 10),
index 69f1c51282235a5e34043e8564123bd03e152f3a..3b05b9cfe1666e7fee4315eba804aafd2cc813ba 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import React from 'react';
+import classNames from 'classnames';
 import { formatMeasure } from '../../helpers/measures';
 import './Level.css';
 
 export default class Level extends React.Component {
   static propTypes = {
-    level: React.PropTypes.oneOf(['ERROR', 'WARN', 'OK']).isRequired
+    level: React.PropTypes.oneOf(['ERROR', 'WARN', 'OK']).isRequired,
+    small: React.PropTypes.bool
+  };
+
+  static defaultProps = {
+    small: false
   };
 
   render () {
     const formatted = formatMeasure(this.props.level, 'LEVEL');
-    const className = 'level level-' + this.props.level;
+    const className = classNames('level', 'level-' + this.props.level, { 'level-small': this.props.small });
     return <span className={className}>{formatted}</span>;
   }
 }
index 31d8bb6f4d3ebedbd2db125f5f139407750e93bb..7b63ce958799ed6b81cfe1dbed344c898b131275 100644 (file)
   text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
 }
 
+.rating-small {
+  width: 18px;
+  height: 18px;
+  line-height: 18px;
+  margin-top: -1px;
+  margin-bottom: -1px;
+  font-size: 12px;
+}
+
 a > .rating {
   margin-bottom: -1px;
   border-bottom: 1px solid;
index 74e61d2b6249978ac5c13c5184d44e2947c55a85..7fe7d07da424fc853b173ee6eb11b9adfbc51434 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import React from 'react';
+import classNames from 'classnames';
 import { formatMeasure } from '../../helpers/measures';
 import './Rating.css';
 
@@ -30,12 +31,17 @@ export default class Rating extends React.Component {
         throw new Error(
             `Invalid prop "${propName}" passed to "${componentName}".`);
       }
-    }
+    },
+    small: React.PropTypes.bool
+  };
+
+  static defaultProps = {
+    small: false
   };
 
   render () {
     const formatted = formatMeasure(this.props.value, 'RATING');
-    const className = 'rating rating-' + formatted;
+    const className = classNames('rating', 'rating-' + formatted, { 'rating-small': this.props.small });
     return <span className={className}>{formatted}</span>;
   }
 }
index 7aeb21a922ae1a88e9392f6b048dc373ffe31038..7d6d7e171d35716e60a412ec152a08292822e675 100644 (file)
   text-align: center;
 }
 
+.size-rating-small {
+  width: 18px;
+  height: 18px;
+  line-height: 18px;
+  margin-top: -1px;
+  margin-bottom: -1px;
+  font-size: 10px;
+}
+
 .size-rating-muted {
   background-color: #ccc;
 }
index 40ed0ebd8c547acbf10be45c5fa55b1dafdc3549..f62fd4766b27f4ece28bd2af4af80b9aa385affb 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import React from 'react';
+import classNames from 'classnames';
 import inRange from 'lodash/inRange';
 import './SizeRating.css';
 
 export default class SizeRating extends React.Component {
   static propTypes = {
-    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string])
+    value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]),
+    small: React.PropTypes.bool
+  };
+
+  static defaultProps = {
+    small: false
   };
 
   render () {
@@ -48,8 +54,10 @@ export default class SizeRating extends React.Component {
       letter = 'XL';
     }
 
+    const className = classNames('size-rating', { 'size-rating-small': this.props.small });
+
     return (
-        <div className="size-rating">{letter}</div>
+        <div className={className}>{letter}</div>
     );
   }
 }
index 34485d9f112780cdea3cafa8896252fde456c1a3..56698560fb17333ecfac95fa79fd758aa51e73e3 100644 (file)
     top: 0;
     right: 0;
     margin-left: 5px;
-    padding: 3px 5px;
+    padding: 4px 5px;
     background-color: @barBackgroundColor;
     color: @secondFontColor;
     font-size: @smallFontSize;