1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Fixed jsxhint errors

This commit is contained in:
ivaosthu 2015-03-23 18:47:23 +01:00 committed by Ivar Conradi Østhus
parent 3c57c50912
commit 5e226f07c4
5 changed files with 49 additions and 26 deletions

View File

@ -3,8 +3,6 @@ var FeatureForm = require('./FeatureForm');
var LogEntryList = require('../log/LogEntryList');
var eventStore = require('../../stores/EventStore');
var Feature = React.createClass({
getInitialState: function() {
return {
@ -34,7 +32,7 @@ var Feature = React.createClass({
},
archiveFeature: function() {
if (confirm("Are you sure you want to delete " + this.props.feature.name + "?")) {
if (window.confirm("Are you sure you want to delete " + this.props.feature.name + "?")) {
this.props.onArchive(this.props.feature);
}
},
@ -60,7 +58,8 @@ var Feature = React.createClass({
<tbody className="feature">
<tr className={this.state.editMode ? "edit bg-lilac-xlt" : ""}>
<td width="20">
<span className={this.props.feature.enabled ? "toggle-active" : "toggle-inactive"} title="Status">
<span className=
{this.props.feature.enabled ? "toggle-active" : "toggle-inactive"} title="Status">
</span>
</td>
<td>
@ -77,17 +76,25 @@ var Feature = React.createClass({
<td width="150">
<div className="line">
<div className="unit size1of3">
<button title='Archive' onClick={this.archiveFeature} title="Remove">
<button
title='Archive'
onClick={this.archiveFeature}>
<span className="icon-kryss1" />
</button>
</div>
<div className="unit size1of3">
<button className={this.state.editMode ? "primary" : ""} title='Edit' onClick={this.toggleEditMode}>
<button
className={this.state.editMode ? "primary" : ""}
title='Edit'
onClick={this.toggleEditMode}>
<span className="icon-redigere" />
</button>
</div>
<div className="unit size1of3">
<button className={this.state.showHistory ? "primary" : ""} title='History' onClick={this.toggleHistory}>
<button
className={this.state.showHistory ? "primary" : ""}
title='History'
onClick={this.toggleHistory}>
<span className="icon-visning_liste" />
</button>
</div>

View File

@ -90,7 +90,10 @@ var FeatureForm = React.createClass({
<div className="formelement">
<label htmlFor={idPrefix + "-strategy"}>Strategy</label>
<div className="input select">
<select id={idPrefix + "-strategy"} ref="strategy" value={this.state.currentStrategy} onChange={this.onStrategyChange}>
<select id={idPrefix + "-strategy"}
ref="strategy"
value={this.state.currentStrategy}
onChange={this.onStrategyChange}>
{this.renderStrategyOptions()}
</select>
</div>
@ -100,8 +103,13 @@ var FeatureForm = React.createClass({
<div className="input">
<ul className="inputs-list">
<li>
<input id={idPrefix + "-active"} ref="enabled" type="checkbox" defaultChecked={feature.enabled} />
<label htmlFor={idPrefix + "-active"}>Active</label>
<input id={idPrefix + "-active"}
ref="enabled"
type="checkbox"
defaultChecked={feature.enabled} />
<label htmlFor={idPrefix + "-active"}>
Active
</label>
</li>
</ul>
</div>
@ -138,7 +146,7 @@ var FeatureForm = React.createClass({
name={param.name}
label={param.name}
ref={param.name}
value={param.value} />
value={param.value} />;
});
},

View File

@ -6,14 +6,14 @@ var DIFF_PREFIXES = {
E: ' ',
D: '-',
N: '+'
}
};
var SPADEN_CLASS = {
A: 'blue', // array edited
E: 'blue', // edited
D: 'negative', // deleted
N: 'positive', // added
}
};
var LogEntry = React.createClass({
propTypes: {
@ -47,13 +47,15 @@ var LogEntry = React.createClass({
var prettyPrinted = JSON.stringify(localEventData, null, 2);
return (<code className='JSON smalltext man'>{prettyPrinted}</code>)
return (<code className='JSON smalltext man'>{prettyPrinted}</code>);
},
renderEventDiff: function() {
if (!this.props.showFullEvents && this.props.event.diffs) {
var changes = this.props.event.diffs.map(this.buildDiff);
return (<code className='smalltext man'>{changes.length === 0 ? '(no changes)' : changes}</code>)
return (
<code className='smalltext man'>{changes.length === 0 ? '(no changes)' : changes}</code>
);
} else {
return this.renderFullEventData();
}
@ -71,15 +73,15 @@ var LogEntry = React.createClass({
</div>
);
} else {
var spadenClass = SPADEN_CLASS[diff.kind]
var spadenClass = SPADEN_CLASS[diff.kind];
var prefix = DIFF_PREFIXES[diff.kind];
change = (<div className={spadenClass}>{prefix} {key}: {JSON.stringify(diff.rhs)}</div>)
change = (<div className={spadenClass}>{prefix} {key}: {JSON.stringify(diff.rhs)}</div>);
}
return (<div key={idx}>{change}</div>)
return (<div key={idx}>{change}</div>);
}
});
module.exports = LogEntry;
module.exports = LogEntry;

View File

@ -7,7 +7,8 @@ var Strategy = React.createClass({
onRemove: function(event) {
event.preventDefault();
if (confirm("Are you sure you want to delete strategy '"+this.props.strategy.name+"'?")) {
if (window.confirm("Are you sure you want to delete strategy '"+
this.props.strategy.name+"'?")) {
this.props.onRemove(this.props.strategy);
}
},
@ -17,7 +18,9 @@ var Strategy = React.createClass({
<div className="line mal">
<div className="unit">
<strong>{this.props.strategy.name} </strong>
<a href="" title="Delete strategy" onClick={this.onRemove}>(remove)</a><br />
<a href=""
title="Delete strategy"
onClick={this.onRemove}>(remove)</a><br />
<em>{this.props.strategy.description}</em><br />
</div>
</div>
@ -25,4 +28,4 @@ var Strategy = React.createClass({
}
});
module.exports = Strategy;
module.exports = Strategy;

View File

@ -50,7 +50,6 @@ var StrategyForm = React.createClass({
onRemoveParam: function(event) {
event.preventDefault();
var id = this.state.parameters.length + 1;
var params = this.state.parameters.slice(0, -1);
this.setState({parameters: params});
@ -118,7 +117,7 @@ var StrategyForm = React.createClass({
</div>
</div>
</div>
)
);
});
},
@ -131,11 +130,15 @@ var StrategyForm = React.createClass({
if(this.state.parameters.length > 0) {
return (
<div className="formelement mtn">
<a href="#add" className="negative" onClick={this.onRemoveParam}>- Remove parameter</a>
<a href="#add"
className="negative"
onClick={this.onRemoveParam}>
- Remove parameter
</a>
</div>
);
}
}
});
module.exports = StrategyForm;
module.exports = StrategyForm;