Skip to content

Commit e7f7591

Browse files
Allow adding extra content to the databases list footer (#1473)
1 parent 007a555 commit e7f7591

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

app/addons/databases/__tests__/components.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ describe('DatabasePagination', () => {
118118
expect(controller.find('.all-db-footer__total-db-count').text()).toBe('30');
119119
});
120120

121+
it('renders custom content when supplied', () => {
122+
const withCustomFooter = (
123+
<Views.DatabasePagination linkPath="_custom_path">
124+
<span className="custom">custom content</span>
125+
</Views.DatabasePagination>
126+
);
127+
const el = mount(withCustomFooter);
128+
expect(el.find('span.custom').exists()).toBe(true);
129+
});
130+
121131
});
122132

123133
describe('DatabaseTable', () => {

app/addons/databases/components.js

+4
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ class DatabasePagination extends React.Component {
531531
const { limit, page, totalAmountOfDatabases } = this.state;
532532
const start = 1 + (page - 1) * limit;
533533
const end = Math.min(totalAmountOfDatabases, page * limit);
534+
const { children } = this.props;
534535

535536
return (
536537
<footer className="all-db-footer pagination-footer">
@@ -548,6 +549,9 @@ class DatabasePagination extends React.Component {
548549
&nbsp;of&nbsp;<span className="all-db-footer__total-db-count">{totalAmountOfDatabases}</span>
549550
&nbsp;databases.
550551
</div>
552+
<div className="custom-db-footer-item">
553+
{children}
554+
</div>
551555
</footer>
552556
);
553557
}

assets/scss/_pagination.scss

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ footer.pagination-footer {
4444
margin: 15px 20px 17px 20px;
4545
}
4646

47+
.custom-db-footer-item {
48+
float: right;
49+
}
50+
4751
.documents-pagination {
4852
float: right;
4953
}

0 commit comments

Comments
 (0)