Repository: couchdb-fauxton Updated Branches: refs/heads/master b48b232bf -> d25f32404
Small fixes This fixes replication edit to show all the correct info. Also fixes the styling for the styled select in the edit view and clone view Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/d25f3240 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/d25f3240 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/d25f3240 Branch: refs/heads/master Commit: d25f324047264797b6cde7c4257c0ceef819aa91 Parents: b48b232 Author: Garren Smith <[email protected]> Authored: Tue Jan 17 15:25:14 2017 +0200 Committer: Garren Smith <[email protected]> Committed: Tue Jan 17 16:43:54 2017 +0200 ---------------------------------------------------------------------- .../documents/index-editor/components.react.jsx | 23 ++++++++++---------- .../tests/viewIndex.componentsSpec.react.jsx | 2 +- .../documents/tests/nightwatch/viewEdit.js | 4 ++-- app/addons/replication/controller.js | 18 ++++++++++----- .../tests/nightwatch/replicationactivity.js | 2 ++ 5 files changed, 30 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d25f3240/app/addons/documents/index-editor/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/documents/index-editor/components.react.jsx b/app/addons/documents/index-editor/components.react.jsx index dc3f22c..883dc71 100644 --- a/app/addons/documents/index-editor/components.react.jsx +++ b/app/addons/documents/index-editor/components.react.jsx @@ -96,23 +96,24 @@ var DesignDocSelector = React.createClass({ }, render: function () { + const selectContent = + <optgroup label="Select a document"> + <option value="new-doc">New document</option> + {this.getDocList()} + </optgroup>; + return ( <div className="design-doc-group control-group"> <div className="span3"> <label htmlFor="ddoc">{this.props.designDocLabel} {this.getDocLink()} </label> - <div className="styled-select"> - <label htmlFor="js-backup-list-select"> - <i className="fonticon-down-dir" /> - <select id="ddoc" onChange={this.selectDesignDoc} value={this.props.selectedDesignDocName}> - <optgroup label="Select a document"> - <option value="new-doc">New document</option> - {this.getDocList()} - </optgroup> - </select> - </label> - </div> + <StyledSelect + selectChange={this.selectDesignDoc} + selectValue={this.props.selectedDesignDocName} + selectId={"faux__edit-view__design-doc"} + selectContent={selectContent} + /> </div> {this.getNewDDocField()} </div> http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d25f3240/app/addons/documents/index-editor/tests/viewIndex.componentsSpec.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/documents/index-editor/tests/viewIndex.componentsSpec.react.jsx b/app/addons/documents/index-editor/tests/viewIndex.componentsSpec.react.jsx index b4ab031..16be89b 100644 --- a/app/addons/documents/index-editor/tests/viewIndex.componentsSpec.react.jsx +++ b/app/addons/documents/index-editor/tests/viewIndex.componentsSpec.react.jsx @@ -150,7 +150,7 @@ describe('DesignDocSelector component', function () { onSelectDesignDoc={spy} />, container); - TestUtils.Simulate.change($(ReactDOM.findDOMNode(selectorEl)).find('#ddoc')[0], { + TestUtils.Simulate.change($(ReactDOM.findDOMNode(selectorEl)).find('.styled-select select')[0], { target: { value: '_design/test-doc' } http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d25f3240/app/addons/documents/tests/nightwatch/viewEdit.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/viewEdit.js b/app/addons/documents/tests/nightwatch/viewEdit.js index ffcc42e..7deab4c 100644 --- a/app/addons/documents/tests/nightwatch/viewEdit.js +++ b/app/addons/documents/tests/nightwatch/viewEdit.js @@ -216,10 +216,10 @@ module.exports = { }) .waitForElementPresent('.index-cancel-link', waitTime, true) - .waitForElementVisible('select#ddoc', waitTime, true) + .waitForElementVisible('.styled-select select', waitTime, true) .waitForElementNotPresent('.loading-lines', waitTime, true) - .setValue('select#ddoc', 'new-doc') + .setValue('.styled-select select', 'new-doc') // needed to get React to update + show the new design doc field .click('body') http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d25f3240/app/addons/replication/controller.js ---------------------------------------------------------------------- diff --git a/app/addons/replication/controller.js b/app/addons/replication/controller.js index 30b248d..1ac4fb2 100644 --- a/app/addons/replication/controller.js +++ b/app/addons/replication/controller.js @@ -65,14 +65,22 @@ export default class ReplicationController extends React.Component { }; } + loadReplicationInfo (props, oldProps) { + Actions.initReplicator(props.localSource); + Actions.getReplicationActivity(); + if (props.replicationId && props.replicationId !== oldProps.replicationId) { + Actions.clearReplicationForm(); + Actions.getReplicationStateFrom(props.replicationId); + } + } + componentDidMount () { store.on('change', this.onChange, this); - Actions.initReplicator(this.props.localSource); - Actions.getReplicationActivity(); + this.loadReplicationInfo(this.props, {}); + } - if (this.props.replicationId) { - Actions.getReplicationStateFrom(this.props.replicationId); - } + componentWillReceiveProps (nextProps) { + this.loadReplicationInfo(nextProps, this.props); } componentWillUnmount () { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d25f3240/app/addons/replication/tests/nightwatch/replicationactivity.js ---------------------------------------------------------------------- diff --git a/app/addons/replication/tests/nightwatch/replicationactivity.js b/app/addons/replication/tests/nightwatch/replicationactivity.js index 1c85479..c3f2e07 100644 --- a/app/addons/replication/tests/nightwatch/replicationactivity.js +++ b/app/addons/replication/tests/nightwatch/replicationactivity.js @@ -58,6 +58,8 @@ module.exports = { .clickWhenVisible('a[title="Edit replication"]') .waitForElementNotPresent('.load-lines', waitTime, true) .waitForElementPresent('.replication__section', waitTime, true) + .pause(10000) + .assert.valueContains(".replication__doc-name-input", replicatorDoc._id) .end(); },
