diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/shared')
14 files changed, 21 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/js/components/shared/FavoriteIssueFilter.js b/server/sonar-web/src/main/js/components/shared/FavoriteIssueFilter.js index fb7d817557c..e06c617f425 100644 --- a/server/sonar-web/src/main/js/components/shared/FavoriteIssueFilter.js +++ b/server/sonar-web/src/main/js/components/shared/FavoriteIssueFilter.js @@ -49,7 +49,7 @@ export default React.createClass({ }, renderSVG() { - /* eslint max-len: 0 */ + /* jscs:disable maximumLineLength */ return ( <svg width="16" height="16" style={{ fillRule: 'evenodd', clipRule: 'evenodd', strokeLinejoin: 'round', strokeMiterlimit: 1.41421 }}> <path d="M15.4275,5.77678C15.4275,5.90773 15.3501,6.05059 15.1953,6.20536L11.9542,9.36608L12.7221,13.8304C12.728,13.872 12.731,13.9316 12.731,14.0089C12.731,14.1339 12.6998,14.2396 12.6373,14.3259C12.5748,14.4122 12.484,14.4554 12.3649,14.4554C12.2518,14.4554 12.1328,14.4197 12.0078,14.3482L7.99888,12.2411L3.98995,14.3482C3.85901,14.4197 3.73996,14.4554 3.63281,14.4554C3.50781,14.4554 3.41406,14.4122 3.35156,14.3259C3.28906,14.2396 3.25781,14.1339 3.25781,14.0089C3.25781,13.9732 3.26377,13.9137 3.27567,13.8304L4.04353,9.36608L0.793531,6.20536C0.644719,6.04464 0.570313,5.90178 0.570313,5.77678C0.570313,5.55654 0.736979,5.41964 1.07031,5.36606L5.55245,4.71428L7.56138,0.651781C7.67447,0.407729 7.8203,0.285703 7.99888,0.285703C8.17745,0.285703 8.32328,0.407729 8.43638,0.651781L10.4453,4.71428L14.9274,5.36606C15.2608,5.41964 15.4274,5.55654 15.4274,5.77678L15.4275,5.77678Z" diff --git a/server/sonar-web/src/main/js/components/shared/FavoriteMeasureFilter.js b/server/sonar-web/src/main/js/components/shared/FavoriteMeasureFilter.js index 620583e57ae..c4bc895e610 100644 --- a/server/sonar-web/src/main/js/components/shared/FavoriteMeasureFilter.js +++ b/server/sonar-web/src/main/js/components/shared/FavoriteMeasureFilter.js @@ -49,7 +49,7 @@ export default React.createClass({ }, renderSVG() { - /* eslint max-len: 0 */ + /* jscs:disable maximumLineLength */ return ( <svg width="16" height="16" style={{ fillRule: 'evenodd', clipRule: 'evenodd', strokeLinejoin: 'round', strokeMiterlimit: 1.41421 }}> <path d="M15.4275,5.77678C15.4275,5.90773 15.3501,6.05059 15.1953,6.20536L11.9542,9.36608L12.7221,13.8304C12.728,13.872 12.731,13.9316 12.731,14.0089C12.731,14.1339 12.6998,14.2396 12.6373,14.3259C12.5748,14.4122 12.484,14.4554 12.3649,14.4554C12.2518,14.4554 12.1328,14.4197 12.0078,14.3482L7.99888,12.2411L3.98995,14.3482C3.85901,14.4197 3.73996,14.4554 3.63281,14.4554C3.50781,14.4554 3.41406,14.4122 3.35156,14.3259C3.28906,14.2396 3.25781,14.1339 3.25781,14.0089C3.25781,13.9732 3.26377,13.9137 3.27567,13.8304L4.04353,9.36608L0.793531,6.20536C0.644719,6.04464 0.570313,5.90178 0.570313,5.77678C0.570313,5.55654 0.736979,5.41964 1.07031,5.36606L5.55245,4.71428L7.56138,0.651781C7.67447,0.407729 7.8203,0.285703 7.99888,0.285703C8.17745,0.285703 8.32328,0.407729 8.43638,0.651781L10.4453,4.71428L14.9274,5.36606C15.2608,5.41964 15.4274,5.55654 15.4274,5.77678L15.4275,5.77678Z" diff --git a/server/sonar-web/src/main/js/components/shared/assignee-helper.js b/server/sonar-web/src/main/js/components/shared/assignee-helper.js index 590a7e019f8..76bcbf30f3f 100644 --- a/server/sonar-web/src/main/js/components/shared/assignee-helper.js +++ b/server/sonar-web/src/main/js/components/shared/assignee-helper.js @@ -23,9 +23,9 @@ import { translate } from '../../helpers/l10n'; export default class Assignee extends React.Component { render () { - let avatar = this.props.user ? + const avatar = this.props.user ? <span className="spacer-right"><Avatar email={this.props.user.email} size={16}/></span> : null; - let name = this.props.user ? this.props.user.name : translate('unassigned'); + const name = this.props.user ? this.props.user.name : translate('unassigned'); return <span>{avatar}{name}</span>; } } diff --git a/server/sonar-web/src/main/js/components/shared/checkbox.js b/server/sonar-web/src/main/js/components/shared/checkbox.js index 05ad7cd93dd..978e146e6cd 100644 --- a/server/sonar-web/src/main/js/components/shared/checkbox.js +++ b/server/sonar-web/src/main/js/components/shared/checkbox.js @@ -43,14 +43,14 @@ export default React.createClass({ }, render() { - let classNames = ['icon-checkbox']; + const classNames = ['icon-checkbox']; if (this.state.checked) { classNames.push('icon-checkbox-checked'); } if (this.props.thirdState) { classNames.push('icon-checkbox-single'); } - let className = classNames.join(' '); + const className = classNames.join(' '); return <a onClick={this.toggle} className={className} href="#"/>; } }); diff --git a/server/sonar-web/src/main/js/components/shared/drilldown-link.js b/server/sonar-web/src/main/js/components/shared/drilldown-link.js index 633797d5451..c3ee5902ac7 100644 --- a/server/sonar-web/src/main/js/components/shared/drilldown-link.js +++ b/server/sonar-web/src/main/js/components/shared/drilldown-link.js @@ -24,7 +24,6 @@ import React from 'react'; import { IssuesLink } from './issues-link'; import { getComponentDrilldownUrl } from '../../helpers/urls'; - const ISSUE_MEASURES = [ 'violations', 'new_violations', @@ -50,7 +49,6 @@ const ISSUE_MEASURES = [ 'new_vulnerabilities' ]; - export const DrilldownLink = React.createClass({ isIssueMeasure() { return ISSUE_MEASURES.indexOf(this.props.metric) !== -1; diff --git a/server/sonar-web/src/main/js/components/shared/favorite.js b/server/sonar-web/src/main/js/components/shared/favorite.js index 00dd7d8359f..20726776f26 100644 --- a/server/sonar-web/src/main/js/components/shared/favorite.js +++ b/server/sonar-web/src/main/js/components/shared/favorite.js @@ -51,7 +51,7 @@ export default React.createClass({ }, renderSVG() { - /* eslint max-len: 0 */ + /* jscs:disable maximumLineLength */ return ( <svg width="16" height="16" style={{ fillRule: 'evenodd', clipRule: 'evenodd', strokeLinejoin: 'round', strokeMiterlimit: 1.41421 }}> <path d="M15.4275,5.77678C15.4275,5.90773 15.3501,6.05059 15.1953,6.20536L11.9542,9.36608L12.7221,13.8304C12.728,13.872 12.731,13.9316 12.731,14.0089C12.731,14.1339 12.6998,14.2396 12.6373,14.3259C12.5748,14.4122 12.484,14.4554 12.3649,14.4554C12.2518,14.4554 12.1328,14.4197 12.0078,14.3482L7.99888,12.2411L3.98995,14.3482C3.85901,14.4197 3.73996,14.4554 3.63281,14.4554C3.50781,14.4554 3.41406,14.4122 3.35156,14.3259C3.28906,14.2396 3.25781,14.1339 3.25781,14.0089C3.25781,13.9732 3.26377,13.9137 3.27567,13.8304L4.04353,9.36608L0.793531,6.20536C0.644719,6.04464 0.570313,5.90178 0.570313,5.77678C0.570313,5.55654 0.736979,5.41964 1.07031,5.36606L5.55245,4.71428L7.56138,0.651781C7.67447,0.407729 7.8203,0.285703 7.99888,0.285703C8.17745,0.285703 8.32328,0.407729 8.43638,0.651781L10.4453,4.71428L14.9274,5.36606C15.2608,5.41964 15.4274,5.55654 15.4274,5.77678L15.4275,5.77678Z" diff --git a/server/sonar-web/src/main/js/components/shared/issues-link.js b/server/sonar-web/src/main/js/components/shared/issues-link.js index 290ec84874c..e550faa81d4 100644 --- a/server/sonar-web/src/main/js/components/shared/issues-link.js +++ b/server/sonar-web/src/main/js/components/shared/issues-link.js @@ -21,10 +21,9 @@ import React from 'react'; import { getComponentIssuesUrl } from '../../helpers/urls'; - export const IssuesLink = React.createClass({ render() { - let url = getComponentIssuesUrl(this.props.component, this.props.params); + const url = getComponentIssuesUrl(this.props.component, this.props.params); return <a className={this.props.className} href={url}>{this.props.children}</a>; } }); diff --git a/server/sonar-web/src/main/js/components/shared/list-footer.js b/server/sonar-web/src/main/js/components/shared/list-footer.js index fd9392b05ab..f21757c4a3a 100644 --- a/server/sonar-web/src/main/js/components/shared/list-footer.js +++ b/server/sonar-web/src/main/js/components/shared/list-footer.js @@ -22,7 +22,6 @@ import React from 'react'; import { translate } from '../../helpers/l10n'; import { formatMeasure } from '../../helpers/measures'; - export default React.createClass({ propTypes: { count: React.PropTypes.number.isRequired, @@ -54,9 +53,9 @@ export default React.createClass({ }, render() { - let hasMore = this.props.total > this.props.count; - let loadMoreLink = <a onClick={this.handleLoadMore} className="spacer-left" href="#">show more</a>; - let className = classNames('spacer-top note text-center', { 'new-loading': !this.props.ready }); + const hasMore = this.props.total > this.props.count; + const loadMoreLink = <a onClick={this.handleLoadMore} className="spacer-left" href="#">show more</a>; + const className = classNames('spacer-top note text-center', { 'new-loading': !this.props.ready }); return ( <footer className={className}> {formatMeasure(this.props.count, 'INT')} of {formatMeasure(this.props.total, 'INT')} shown diff --git a/server/sonar-web/src/main/js/components/shared/pending-icon.js b/server/sonar-web/src/main/js/components/shared/pending-icon.js index 8a9488ff0e5..51dbfa48dcb 100644 --- a/server/sonar-web/src/main/js/components/shared/pending-icon.js +++ b/server/sonar-web/src/main/js/components/shared/pending-icon.js @@ -21,7 +21,7 @@ import React from 'react'; export default React.createClass({ render() { - /* eslint max-len: 0 */ + /* jscs:disable maximumLineLength */ return ( <svg width="16" height="16" className="icon-pending"> <g transform="matrix(0.0364583,0,0,0.0364583,1,-0.166667)"> diff --git a/server/sonar-web/src/main/js/components/shared/pin-icon.js b/server/sonar-web/src/main/js/components/shared/pin-icon.js index 49c57355992..5a6c1870697 100644 --- a/server/sonar-web/src/main/js/components/shared/pin-icon.js +++ b/server/sonar-web/src/main/js/components/shared/pin-icon.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* eslint max-len: 0 */ +/* jscs:disable maximumLineLength */ import React from 'react'; const PinIcon = () => ( @@ -29,4 +29,3 @@ const PinIcon = () => ( ); export default PinIcon; - diff --git a/server/sonar-web/src/main/js/components/shared/quality-gate-link.js b/server/sonar-web/src/main/js/components/shared/quality-gate-link.js index c0f506ce69a..069fb395dab 100644 --- a/server/sonar-web/src/main/js/components/shared/quality-gate-link.js +++ b/server/sonar-web/src/main/js/components/shared/quality-gate-link.js @@ -19,10 +19,9 @@ */ import React from 'react'; - export const QualityGateLink = React.createClass({ render() { - let url = `${window.baseUrl}/quality_gates/show/${this.props.gate}`; + const url = `${window.baseUrl}/quality_gates/show/${this.props.gate}`; return <a href={url}>{this.props.children}</a>; } }); diff --git a/server/sonar-web/src/main/js/components/shared/quality-profile-link.js b/server/sonar-web/src/main/js/components/shared/quality-profile-link.js index 681c1494258..a4deb7700c7 100644 --- a/server/sonar-web/src/main/js/components/shared/quality-profile-link.js +++ b/server/sonar-web/src/main/js/components/shared/quality-profile-link.js @@ -19,10 +19,9 @@ */ import React from 'react'; - export const QualityProfileLink = React.createClass({ render() { - let url = `${window.baseUrl}/profiles/show?key=${encodeURIComponent(this.props.profile)}`; + const url = `${window.baseUrl}/profiles/show?key=${encodeURIComponent(this.props.profile)}`; return <a href={url}>{this.props.children}</a>; } }); diff --git a/server/sonar-web/src/main/js/components/shared/radio-toggle.js b/server/sonar-web/src/main/js/components/shared/radio-toggle.js index 7866cf71753..aff2443f12a 100644 --- a/server/sonar-web/src/main/js/components/shared/radio-toggle.js +++ b/server/sonar-web/src/main/js/components/shared/radio-toggle.js @@ -32,13 +32,13 @@ export default React.createClass({ }, onChange(e) { - let newValue = e.currentTarget.value; + const newValue = e.currentTarget.value; this.props.onCheck(newValue); }, renderOption(option) { - let checked = option.value === this.props.value; - let htmlId = this.props.name + '__' + option.value; + const checked = option.value === this.props.value; + const htmlId = this.props.name + '__' + option.value; return ( <li key={option.value}> <input onChange={this.onChange} @@ -54,7 +54,7 @@ export default React.createClass({ }, render() { - let options = this.props.options.map(this.renderOption); + const options = this.props.options.map(this.renderOption); return ( <ul className="radio-toggle">{options}</ul> ); diff --git a/server/sonar-web/src/main/js/components/shared/rating.js b/server/sonar-web/src/main/js/components/shared/rating.js index 2c1a3679742..51022ee6ede 100644 --- a/server/sonar-web/src/main/js/components/shared/rating.js +++ b/server/sonar-web/src/main/js/components/shared/rating.js @@ -21,14 +21,13 @@ import React from 'react'; import { formatMeasure } from '../../helpers/measures'; - export const Rating = React.createClass({ render() { if (this.props.value == null || isNaN(this.props.value)) { return null; } - let formatted = formatMeasure(this.props.value, 'RATING'); - let className = 'rating rating-' + formatted; + const formatted = formatMeasure(this.props.value, 'RATING'); + const className = 'rating rating-' + formatted; return <span className={className}>{formatted}</span>; } }); |