Skip to content

Commit

Permalink
ver. 0.2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
光弘 committed Aug 15, 2017
1 parent aca2026 commit 1d34bb5
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# history

## 0.2.16 / 2017-08-15
## 0.2.17 / 2017-08-15

* `CHANGED` instant validation fails to work due to fromRest logic.

Expand Down
10 changes: 5 additions & 5 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ <h1>
<span class='fraction'>270/287</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">74.77% </span>
<span class="strong">75.23% </span>
<span class="quiet">Branches</span>
<span class='fraction'>163/218</span>
<span class='fraction'>164/218</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.06% </span>
Expand Down Expand Up @@ -63,8 +63,8 @@ <h1>
<td data-value="94.08" class="pic high"><div class="chart"><div class="cover-fill" style="width: 94%;"></div><div class="cover-empty" style="width:6%;"></div></div></td>
<td data-value="94.08" class="pct high">94.08%</td>
<td data-value="287" class="abs high">270/287</td>
<td data-value="74.77" class="pct medium">74.77%</td>
<td data-value="218" class="abs medium">163/218</td>
<td data-value="75.23" class="pct medium">75.23%</td>
<td data-value="218" class="abs medium">164/218</td>
<td data-value="92.06" class="pct high">92.06%</td>
<td data-value="63" class="abs high">58/63</td>
<td data-value="97.8" class="pct high">97.8%</td>
Expand All @@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 19:47:04 GMT+0800 (CST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 20:07:26 GMT+0800 (CST)
</div>
</div>
<script src="prettify.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions coverage/lcov-report/src/FormField.jsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ <h1>
<span class='fraction'>202/211</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">80.12% </span>
<span class="strong">80.72% </span>
<span class="quiet">Branches</span>
<span class='fraction'>133/166</span>
<span class='fraction'>134/166</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">97.78% </span>
Expand Down Expand Up @@ -1187,7 +1187,7 @@ <h1>
FormField.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var me = this;
<span class="missing-if-branch" title="else path not taken" >E</span>if (!deepequal(nextProps.value, me.props.value)) {
me.handleDataChange(nextProps.value, true, true, true);
me.handleDataChange(nextProps.value, true, true);
}
};
&nbsp;
Expand Down Expand Up @@ -1235,7 +1235,7 @@ <h1>
me.setState({
value: value,
formatValue: me.formatValue(value),
error: fromReset &amp;&amp; fromPropsChange === undefined ? <span class="branch-0 cbranch-no" title="branch not covered" >false </span>: me.state.error,
error: fromReset &amp;&amp; fromPropsChange === undefined ? false : me.state.error,
/*
* why set state fromReset? some field like editor cannot be reset in the common way
* so set this state to tell the field that you need to reset by yourself.
Expand Down Expand Up @@ -1681,7 +1681,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 19:47:04 GMT+0800 (CST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 20:07:26 GMT+0800 (CST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/createFormField.jsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 19:47:04 GMT+0800 (CST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 20:07:26 GMT+0800 (CST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions coverage/lcov-report/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ <h1>
<span class='fraction'>270/287</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">74.77% </span>
<span class="strong">75.23% </span>
<span class="quiet">Branches</span>
<span class='fraction'>163/218</span>
<span class='fraction'>164/218</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.06% </span>
Expand Down Expand Up @@ -63,8 +63,8 @@ <h1>
<td data-value="95.73" class="pic high"><div class="chart"><div class="cover-fill" style="width: 95%;"></div><div class="cover-empty" style="width:5%;"></div></div></td>
<td data-value="95.73" class="pct high">95.73%</td>
<td data-value="211" class="abs high">202/211</td>
<td data-value="80.12" class="pct high">80.12%</td>
<td data-value="166" class="abs high">133/166</td>
<td data-value="80.72" class="pct high">80.72%</td>
<td data-value="166" class="abs high">134/166</td>
<td data-value="97.78" class="pct high">97.78%</td>
<td data-value="45" class="abs high">44/45</td>
<td data-value="98.33" class="pct high">98.33%</td>
Expand Down Expand Up @@ -103,7 +103,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 19:47:04 GMT+0800 (CST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 20:07:26 GMT+0800 (CST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 19:47:04 GMT+0800 (CST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 15 2017 20:07:26 GMT+0800 (CST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions coverage/lcov.info
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ BRDA:56,20,0,1
BRDA:56,20,1,0
BRDA:63,21,0,16
BRDA:63,21,1,4
BRDA:105,22,0,0
BRDA:105,22,1,7
BRDA:105,22,0,1
BRDA:105,22,1,6
BRDA:105,23,0,7
BRDA:105,23,1,1
BRDA:112,24,0,7
Expand Down Expand Up @@ -453,7 +453,7 @@ BRDA:477,78,1,12
BRDA:485,79,0,40
BRDA:485,79,1,0
BRF:166
BRH:133
BRH:134
end_of_record
TN:
SF:/Users/ens/pwd/uxcore/uxcore-form-field/src/createFormField.jsx
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxcore-form-field",
"version": "0.2.16",
"version": "0.2.17",
"description": "uxcore-form-field component for uxcore.",
"repository": "https://github.com/uxcore/uxcore-form-field.git",
"author": "eternalsky",
Expand Down
9 changes: 6 additions & 3 deletions src/FormField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ class FormField extends React.Component {

setValue(value, fromReset, fromPropsChange, next) {
const me = this;
me.setState({
const newState = {
value,
formatValue: me.formatValue(value),
error: (fromReset && fromPropsChange === undefined) ? false : me.state.error,
/*
* why set state fromReset? some field like editor cannot be reset in the common way
* so set this state to tell the field that you need to reset by yourself.
*/
fromReset: !!fromReset,
}, () => {
};
if (fromReset && fromPropsChange === undefined) {
newState.error = false;
}
me.setState(newState, () => {
if (next && typeof next === 'function') {
next();
}
Expand Down
10 changes: 8 additions & 2 deletions tests/FormField.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ describe('FormField', () => {

it('validate', (done) => {
const Demo = React.createClass({
getInitialState() {
return {};
},
render() {
return (
<Form>
<Form
jsxonChange={(values, name) => { this.setState({ test: values[name] }); }}
jsxvalues={{ test: this.state.test }}
>
<FormField
ref="formfield"
jsxname="test"
Expand Down Expand Up @@ -231,7 +237,7 @@ describe('FormField', () => {
}, 50);
});

it('validate should return true when no jsxrules', (done) => {
it('validation should return true when no jsxrules', (done) => {
const Demo = React.createClass({
render() {
return (
Expand Down

0 comments on commit 1d34bb5

Please sign in to comment.