This repository has been archived by the owner on Dec 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Frank Groeneveld
committed
Nov 11, 2016
1 parent
12a6cba
commit cd055f4
Showing
8 changed files
with
118 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require_tree ./components |
Empty file.
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,52 @@ | ||
class RuleFields extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { operation: 'assign_label' }; | ||
/* XXX Why can't we use ES6 fat-arrow for this? Gem too old? */ | ||
this.operationSelected = this.operationSelected.bind(this); | ||
} | ||
|
||
operationSelected(e) { | ||
this.setState({ | ||
operation: e.target.value | ||
}); | ||
} | ||
|
||
options(operation) { | ||
return this.props.options[operation].map(function(user) { | ||
return <option key={user.key} value={user.key}>{user.value}</option>; | ||
}); | ||
} | ||
|
||
render () { | ||
let action_value = <select name="rule[action_value]"> | ||
{this.options(this.state.operation)} | ||
</select>; | ||
|
||
return ( | ||
<div> | ||
<label htmlFor="rule[action_operation]"> | ||
{this.props.labels.action_operation} | ||
</label> | ||
<select onChange={this.operationSelected} name="rule[action_operation]"> | ||
<option value="assign_label"> | ||
{this.props.labels.assign_label} | ||
</option> | ||
<option value="change_status"> | ||
{this.props.labels.change_status} | ||
</option> | ||
<option value="change_priority"> | ||
{this.props.labels.change_priority} | ||
</option> | ||
<option value="assign_user"> | ||
{this.props.labels.assign_user} | ||
</option> | ||
</select> | ||
<label htmlFor="rule[action_value]"> | ||
{this.props.labels.action_value} | ||
</label> | ||
{action_value} | ||
</div> | ||
); | ||
} | ||
} |
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