import { getCoverageRatingLabel, getCoverageRatingAverageValue } from '../../../helpers/ratings';
export default class CoverageFilter extends React.Component {
- renderOption = option => {
+ renderOption = (option, selected) => {
return (
<span>
- <CoverageRating value={getCoverageRatingAverageValue(option)} small={true}/>
+ <CoverageRating value={getCoverageRatingAverageValue(option)} small={true} muted={!selected}/>
<span className="spacer-left">
{getCoverageRatingLabel(option)}
</span>
import { getDuplicationsRatingLabel, getDuplicationsRatingAverageValue } from '../../../helpers/ratings';
export default class DuplicationsFilter extends React.Component {
- renderOption = option => {
+ renderOption = (option, selected) => {
return (
<span>
- <DuplicationsRating value={getDuplicationsRatingAverageValue(option)} small={true}/>
+ <DuplicationsRating value={getDuplicationsRatingAverageValue(option)} small={true} muted={!selected}/>
<span className="spacer-left">
{getDuplicationsRatingLabel(option)}
</span>
return (
<Link key={option} className={className} to={path}>
<span className="facet-name">
- {this.props.renderOption(option, facetValue)}
+ {this.props.renderOption(option, option === value)}
</span>
{facetValue != null && (
<span className="facet-stat">
import Rating from '../../../components/ui/Rating';
export default class IssuesFilter extends React.Component {
- renderOption = option => {
+ renderOption = (option, selected) => {
return (
<span>
- <Rating value={option} small={true}/>
+ <Rating value={option} small={true} muted={!selected}/>
{option > 1 && option < 5 && (
<span className="note spacer-left">and worse</span>
)}
import Level from '../../../components/ui/Level';
export default class QualityGateFilter extends React.Component {
- renderOption = option => {
+ renderOption = (option, selected) => {
return (
- <Level level={option} small={true}/>
+ <Level level={option} small={true} muted={!selected}/>
);
};
import { getSizeRatingLabel, getSizeRatingAverageValue } from '../../../helpers/ratings';
export default class SizeFilter extends React.Component {
- renderOption = option => {
+ renderOption = (option, selected) => {
return (
<span>
- <SizeRating value={getSizeRatingAverageValue(option)} small={true}/>
+ <SizeRating value={getSizeRatingAverageValue(option)} small={true} muted={!selected}/>
<span className="spacer-left">
{getSizeRatingLabel(option)}
</span>
background-color: #b4b4b4;
transition: width 0.3s ease;
}
+
+.search-navigator-facet.active .projects-facet-bar-inner {
+ background-color: #4b9fd5;
+}
export default class CoverageRating extends React.Component {
static propTypes = {
value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]),
- small: React.PropTypes.bool
+ small: React.PropTypes.bool,
+ muted: React.PropTypes.bool
};
static defaultProps = {
- small: false
+ small: false,
+ muted: false
};
render () {
if (this.props.value != null) {
const value = Number(this.props.value);
data = [
- { value, fill: '#85bb43' },
- { value: 100 - value, fill: '#d4333f' }
+ { value, fill: this.props.muted ? '#bdbdbd' : '#85bb43' },
+ { value: 100 - value, fill: this.props.muted ? '#f3f3f3' : '#d4333f' }
];
}
border-width: 2px;
}
+.duplications-rating-muted {
+ border-color: #bdbdbd !important;
+}
+
+.duplications-rating-muted:after {
+ background-color: #bdbdbd !important;
+}
+
.duplications-rating:after {
border-radius: 24px;
background-color: #f3ca8e;
export default class DuplicationsRating extends React.Component {
static propTypes = {
value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]).isRequired,
- small: React.PropTypes.bool
+ small: React.PropTypes.bool,
+ muted: React.PropTypes.bool
};
static defaultProps = {
- small: false
+ small: false,
+ muted: false
};
render () {
const { value } = this.props;
const className = classNames('duplications-rating', {
'duplications-rating-small': this.props.small,
+ 'duplications-rating-muted': this.props.muted,
'duplications-rating-A': inRange(value, 3),
'duplications-rating-B': inRange(value, 3, 5),
'duplications-rating-C': inRange(value, 5, 10),
font-size: 12px;
}
+.level-muted {
+ background-color: #bdbdbd !important;
+}
+
a > .level {
margin-bottom: -1px;
border-bottom: 1px solid;
export default class Level extends React.Component {
static propTypes = {
level: React.PropTypes.oneOf(['ERROR', 'WARN', 'OK']).isRequired,
- small: React.PropTypes.bool
+ small: React.PropTypes.bool,
+ muted: React.PropTypes.bool
};
static defaultProps = {
- small: false
+ small: false,
+ muted: false
};
render () {
const formatted = formatMeasure(this.props.level, 'LEVEL');
- const className = classNames('level', 'level-' + this.props.level, { 'level-small': this.props.small });
+ const className = classNames('level', 'level-' + this.props.level, {
+ 'level-small': this.props.small,
+ 'level-muted': this.props.muted
+ });
return <span className={className}>{formatted}</span>;
}
}
font-size: 12px;
}
+.rating-muted {
+ background-color: #bdbdbd !important;
+ color: #fff !important;
+ text-shadow: 0 0 1px rgba(0, 0, 0, 0.35) !important;
+}
+
a > .rating {
margin-bottom: -1px;
border-bottom: 1px solid;
`Invalid prop "${propName}" passed to "${componentName}".`);
}
},
- small: React.PropTypes.bool
+ small: React.PropTypes.bool,
+ muted: React.PropTypes.bool
};
static defaultProps = {
- small: false
+ small: false,
+ muted: false
};
render () {
const formatted = formatMeasure(this.props.value, 'RATING');
- const className = classNames('rating', 'rating-' + formatted, { 'rating-small': this.props.small });
+ const className = classNames('rating', 'rating-' + formatted, {
+ 'rating-small': this.props.small,
+ 'rating-muted': this.props.muted
+ });
return <span className={className}>{formatted}</span>;
}
}
color: #fff;
font-size: 12px;
text-align: center;
+ text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
}
.size-rating-small {
}
.size-rating-muted {
- background-color: #ccc;
+ background-color: #bdbdbd;
}
export default class SizeRating extends React.Component {
static propTypes = {
value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]),
- small: React.PropTypes.bool
+ small: React.PropTypes.bool,
+ muted: React.PropTypes.bool
};
static defaultProps = {
- small: false
+ small: false,
+ muted: false
};
render () {
letter = 'XL';
}
- const className = classNames('size-rating', { 'size-rating-small': this.props.small });
+ const className = classNames('size-rating', {
+ 'size-rating-small': this.props.small,
+ 'size-rating-muted': this.props.muted
+ });
return (
<div className={className}>{letter}</div>