Skip to content

Commit

Permalink
Issue 275 - Remove deprecated nested property 'displayed_pages' (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet committed Dec 10, 2018
1 parent 7dff4ee commit c6934a5
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 37 deletions.
4 changes: 4 additions & 0 deletions packages/dash-table/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.10] - 2018-12-10
### Removed
- Deprecated nested property 'displayed_pages' from 'pagination_settings' [#275](https://github.com/plotly/dash-table/issues/275)

## [3.1.9] - 2018-12-06
### Added
- Source map [#284](https://github.com/plotly/dash-table/issues/284)
Expand Down
4 changes: 1 addition & 3 deletions packages/dash-table/dash_table/DataTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,8 @@ class DataTable(Component):
displayed on a particular page.
- `current_page` represents which page the user is on.
Use this property to index through data in your callbacks with
backend paging.
- `displayed_pages` is DEPRECATED.. pagination_settings has the following type: dict containing keys 'displayed_pages', 'current_page', 'page_size'.
backend paging.. pagination_settings has the following type: dict containing keys 'current_page', 'page_size'.
Those keys have the following types:
- displayed_pages (number; required)
- current_page (number; required)
- page_size (number; required)
- navigation (string; optional): DEPRECATED
Expand Down
5 changes: 3 additions & 2 deletions packages/dash-table/dash_table/_imports_.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .DataTable import DataTable


__all__ = [
"DataTable"
]
"DataTable",
]
2 changes: 1 addition & 1 deletion packages/dash-table/dash_table/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/dash-table/dash_table/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/dash-table/dash_table/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/dash-table/dash_table/demo.js.map

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions packages/dash-table/dash_table/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@
"type": {
"name": "shape",
"value": {
"displayed_pages": {
"name": "number",
"required": true
},
"current_page": {
"name": "number",
"required": true
Expand All @@ -417,9 +413,9 @@
}
},
"required": false,
"description": "`pagination_settings` controls the pagination settings\n_and_ represents the current state of the pagination UI.\n- `page_size` represents the number of rows that will be\ndisplayed on a particular page.\n- `current_page` represents which page the user is on.\nUse this property to index through data in your callbacks with\nbackend paging.\n- `displayed_pages` is DEPRECATED.",
"description": "`pagination_settings` controls the pagination settings\n_and_ represents the current state of the pagination UI.\n- `page_size` represents the number of rows that will be\ndisplayed on a particular page.\n- `current_page` represents which page the user is on.\nUse this property to index through data in your callbacks with\nbackend paging.",
"defaultValue": {
"value": "{\n displayed_pages: 1,\n current_page: 0,\n page_size: 250\n}",
"value": "{\n current_page: 0,\n page_size: 250\n}",
"computed": false
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/dash-table/dash_table/package-info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.9",
"version": "3.1.10",
"description": "Dash table",
"main": "dash_table/bundle.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dash-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.1.9",
"version": "3.1.10",
"description": "Dash table",
"main": "dash_table/bundle.js",
"scripts": {
Expand Down
3 changes: 0 additions & 3 deletions packages/dash-table/src/dash-table/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default class DataTable extends Component {
export const defaultProps = {
pagination_mode: 'fe',
pagination_settings: {
displayed_pages: 1,
current_page: 0,
page_size: 250
},
Expand Down Expand Up @@ -431,10 +430,8 @@ export const propTypes = {
* - `current_page` represents which page the user is on.
* Use this property to index through data in your callbacks with
* backend paging.
* - `displayed_pages` is DEPRECATED.
*/
pagination_settings: PropTypes.shape({
displayed_pages: PropTypes.number.isRequired,
current_page: PropTypes.number.isRequired,
page_size: PropTypes.number.isRequired
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ interface IStylesheetRule {
}

export interface IPaginationSettings {
displayed_pages: number;
current_page: number;
page_size: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function getFrontEndPagination(settings: IPaginationSettings, data: Data, indice

const firstIndex = settings.page_size * currentPage;
const lastIndex = Math.min(
firstIndex + settings.displayed_pages * settings.page_size,
firstIndex + settings.page_size,
data.length
);

Expand Down
4 changes: 1 addition & 3 deletions packages/dash-table/tests/cypress/dash/v_be_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
data=[],
pagination_mode="be",
pagination_settings={
"displayed_pages": 1,
"current_page": 0,
"page_size": 250,
},
Expand Down Expand Up @@ -71,11 +70,10 @@ def updateData(pagination_settings, sorting_settings):
print(pagination_settings)

current_page = pagination_settings["current_page"]
displayed_pages = pagination_settings["displayed_pages"]
page_size = pagination_settings["page_size"]

start_index = current_page * page_size
end_index = start_index + displayed_pages * page_size
end_index = start_index + page_size
print(str(start_index) + "," + str(end_index))
print(sorting_settings)

Expand Down
1 change: 0 additions & 1 deletion packages/dash-table/tests/cypress/dash/v_fe_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
data=df,
pagination_mode="fe",
pagination_settings={
"displayed_pages": 1,
"current_page": 0,
"page_size": 250,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('derived viewport', () => {
it('returns entire data', () => {
const result = viewportData(
false,
{ displayed_pages: 1, current_page: 0, page_size: 250 },
{ current_page: 0, page_size: 250 },
R.map(() => { }, R.range(0, 5)),
R.range(0, 5)
);
Expand All @@ -24,7 +24,7 @@ describe('derived viewport', () => {
it('returns entire data', () => {
const result = viewportData(
'fe',
{ displayed_pages: 1, current_page: 0, page_size: 250 },
{ current_page: 0, page_size: 250 },
R.map(() => { }, R.range(0, 5)),
R.range(0, 5)
);
Expand All @@ -38,7 +38,7 @@ describe('derived viewport', () => {
it('returns entire data', () => {
const result = viewportData(
'be',
{ displayed_pages: 1, current_page: 0, page_size: 250 },
{ current_page: 0, page_size: 250 },
R.map(() => { }, R.range(0, 5)),
R.range(0, 5)
);
Expand All @@ -54,7 +54,7 @@ describe('derived viewport', () => {
it('returns slice of data', () => {
const result = viewportData(
'fe',
{ displayed_pages: 1, current_page: 0, page_size: 250 },
{ current_page: 0, page_size: 250 },
R.map(idx => ({ idx }), R.range(0, 500)),
R.range(0, 500)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': PAGE_SIZE
},
Expand Down Expand Up @@ -71,7 +70,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': PAGE_SIZE
},
Expand Down Expand Up @@ -99,7 +97,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': PAGE_SIZE
},
Expand Down Expand Up @@ -138,7 +135,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': PAGE_SIZE
},
Expand All @@ -156,7 +152,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': PAGE_SIZE
},
Expand Down Expand Up @@ -187,7 +182,6 @@ def layout():
{"name": i, "id": i, "deletable": True} for i in sorted(df.columns)
],
pagination_settings={
'displayed_pages': 1,
'current_page': 0,
'page_size': 20
},
Expand Down
7 changes: 6 additions & 1 deletion packages/dash-table/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
}
},
"exclude": [
"tests/*"
"dash_table/*",
"dist/*",
"node_modules/*",
"storybook-static/*",
"tests/*",
"vv/*"
]
}

0 comments on commit c6934a5

Please sign in to comment.