Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sudo: required
language: node_js
node_js:
- 6.3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ class CreateCollectionDialog extends React.Component {

/**
* Initiate the attempt to create a collection.
* @param {Object} evt - The event object
*/
onCreateCollectionButtonClicked() {
onCreateCollectionButtonClicked(evt) {
evt.preventDefault();
evt.stopPropagation();

this.setState({ inProgress: true, error: false, errorMessage: '' });
Actions.createCollection(
this.state.databaseName,
Expand Down Expand Up @@ -163,7 +167,9 @@ class CreateCollectionDialog extends React.Component {
</Modal.Header>

<Modal.Body>
<form name="create-collection-dialog-form">
<form name="create-collection-dialog-form"
onSubmit={this.onCreateCollectionButtonClicked.bind(this)}
>
<CreateCollectionInput
name="Collection Name"
value={this.state.collectionName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,17 @@ class DropCollectionDialog extends React.Component {

/**
* Initiate the attempt to drop a database.
* @param {Object} evt - The event object
*/
onDropCollectionButtonClicked() {
onDropCollectionButtonClicked(evt) {
evt.preventDefault();
evt.stopPropagation();

// prevent drop of collection if names don't match
if (this.state.confirmName !== this.state.name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we not confirm the typed name is identical before? What was the behaviour for 1.5.1?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pressing enter would've caused a refresh in 1.5.1, after adding an onSubmit method it would drop the collection without checking if it matches.

return;
}

this.setState({ inProgress: true, error: false, errorMessage: '' });
Actions.dropCollection(this.state.databaseName, this.state.name);
}
Expand Down Expand Up @@ -111,7 +120,9 @@ class DropCollectionDialog extends React.Component {
to drop
</p>
</div>
<form>
<form
onSubmit={this.onDropCollectionButtonClicked.bind(this)}
>
<div className="form-group">
<input
type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ class CreateDatabaseDialog extends React.Component {

/**
* Initiate the attempt to create a database.
* @param {Object} evt - The event object
*/
onCreateDatabaseButtonClicked() {
onCreateDatabaseButtonClicked(evt) {
evt.preventDefault();
evt.stopPropagation();
this.setState({ inProgress: true, error: false, errorMessage: '' });
Actions.createDatabase(
this.state.databaseName,
Expand Down Expand Up @@ -186,7 +189,10 @@ class CreateDatabaseDialog extends React.Component {
</Modal.Header>

<Modal.Body>
<form name="create-collection-dialog-form">
<form
name="create-collection-dialog-form"
onSubmit={this.onCreateDatabaseButtonClicked.bind(this)}
>
<this.CreateCollectionInput
name="Database Name"
value={this.state.databaseName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ class DropDatabaseDialog extends React.Component {

/**
* Initiate the attempt to drop a database.
* @param {Object} evt - The event object
*/
onDropDatabaseButtonClicked() {
onDropDatabaseButtonClicked(evt) {
evt.preventDefault();
evt.stopPropagation();

// prevent drop database if names don't match
if (this.state.confirmName !== this.state.name) {
return;
}
this.setState({ inProgress: true, error: false, errorMessage: '' });
Actions.dropDatabase(this.state.name);
}
Expand Down Expand Up @@ -104,7 +112,9 @@ class DropDatabaseDialog extends React.Component {
to drop
</p>
</div>
<form>
<form
onSubmit={this.onDropDatabaseButtonClicked.bind(this)}
>
<div className="form-group">
<input
type="text"
Expand Down