-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(graphs): compare multiple reports graph
- Loading branch information
Showing
27 changed files
with
1,190 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ module.exports.validateBenchmarkWeights = (req, res, next) => { | |
} | ||
} | ||
return next(); | ||
}; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types' | ||
import style from './Checkbox.scss' | ||
import FontAwesome from '../FontAwesome/FontAwesome.export' | ||
import classnames from 'classnames' | ||
|
||
class Checkbox extends Component { | ||
render () { | ||
const { disabled, checked, indeterminate } = this.props | ||
const icon = this.getIcon() | ||
return ( | ||
<div | ||
data-checked={checked} | ||
className={classnames(icon ? style['checkbox--checked'] : style['checkbox--unchecked'], style.checkbox, { [style.disabled]: disabled })} | ||
> | ||
{icon && <FontAwesome className={style.icon} icon={icon} />} | ||
<input disabled={disabled} checked={checked || indeterminate} type='checkbox' onChange={this.handleOnChange} /> | ||
</div> | ||
) | ||
} | ||
|
||
handleOnChange = (e) => { | ||
e.stopPropagation() | ||
const { onChange, disabled, checked } = this.props | ||
if (onChange && !disabled) { | ||
onChange(!checked) | ||
} | ||
} | ||
|
||
getIcon = () => { | ||
const { indeterminate, checked } = this.props | ||
if (indeterminate) { | ||
return 'minus' | ||
} | ||
return checked && 'check' | ||
} | ||
} | ||
|
||
Checkbox.propTypes = { | ||
indeterminate: PropTypes.bool, | ||
checked: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
onChange: PropTypes.func | ||
} | ||
Checkbox.defaultProps = { | ||
indeterminate: false, | ||
checked: false, | ||
disabled: false | ||
} | ||
|
||
export default Checkbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@import 'style/colors'; | ||
@import "../styles/inputs"; | ||
|
||
$size: 14px; | ||
$default-border: solid 1px $active-border-color; | ||
|
||
@mixin box() { | ||
width: $size; | ||
height: $size; | ||
border-radius: 2px; | ||
flex-shrink: 0; | ||
flex-grow: 0; | ||
} | ||
|
||
.checkbox { | ||
@include box(); | ||
position: relative; | ||
cursor: pointer; | ||
font-size: 12px; | ||
|
||
input[type='checkbox'] { | ||
cursor: inherit; | ||
opacity: 0; | ||
width: $size; | ||
height: $size; | ||
margin: 0; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
} | ||
|
||
&.disabled { | ||
cursor: default; | ||
background-color: $default-border-color; | ||
} | ||
} | ||
|
||
.checkbox--checked { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: $active-border-color; | ||
color: $white; | ||
&.disabled { | ||
color: $checkbox-disabled-color; | ||
} | ||
} | ||
|
||
.checkbox--unchecked { | ||
border: $default-border; | ||
background-color: $white; | ||
|
||
&.disabled { | ||
border: solid 1px $checkbox-disabled-border; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@import "../../styles/colors"; | ||
|
||
$checkbox-disabled-color: #c2c2c2; | ||
$checkbox-disabled-border: #dbdbdb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.