Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set number of databases per page to display #1168

Merged

Conversation

Antonio-Maranhao
Copy link
Contributor

Overview

Allows the user to set the number of databases per page.

Testing recommendations

  • Go to all dbs
  • Create about 6 dbs
  • At the bottom, set 'Databases per page' to 5
  • Validate only 5 dbs are listed in each page
  • Click on a database, then click the "<" link besides the db name at the top left
  • Validate it still shows 5 dbs per page

GitHub issue number

#1167

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
  • Update rebar.config.script with the correct tag once a new Fauxton release is made

@popojargo
Copy link
Member

@Antonio-Maranhao Maybe we should store this UI configuration to a cookie/localStorage? People might find it frustrating to change the setting each time they open up Fauxton.

Copy link
Member

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

Great work. Some small changes. Once they done +1

@@ -37,7 +37,9 @@ function deleteDatabase (dbId) {
});

Copy link
Member

Choose a reason for hiding this comment

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

While you here, could you change the ajax to fetch.

@@ -64,7 +65,7 @@ export class DeleteDatabaseModal extends React.Component {
onDeleteClick = (e) => {
e.preventDefault();

Actions.deleteDatabase(this.getDatabaseName());
Actions.deleteDatabase(this.getDatabaseName(), this.props.onSuccess);
Copy link
Member

Choose a reason for hiding this comment

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

I'm kind of torn between rather just returning a promise from the Actions.deleteDatabase and then calling this.props.onSuccess. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used a callback because that fits better when it's converted to use Redux.

});
},

setLimit: function (limit) {
Copy link
Member

Choose a reason for hiding this comment

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

tedious but could you remove the function and make it fat arrows.

@@ -55,6 +77,18 @@ class DatabasesController extends React.Component {
this.setState(this.getStoreState());
};

reloadAfterDatabaseDeleted() {
let page = this.state.page;
if (page > 1 && this.state.dbList.length === 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Nicely done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants