From 6f98d1d569c6dc5604b821c2f0d912547a51c9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Rivet?= Date: Tue, 18 Jun 2019 18:48:54 -0400 Subject: [PATCH] remove column.hidden (but keep capabilities) (#473) --- packages/dash-table/CHANGELOG.md | 4 +- .../src/dash-table/dash/DataTable.js | 8 -- .../visual/percy-storybook/Header.percy.tsx | 2 +- .../tests/visual/percy-storybook/fixtures.ts | 85 ------------------- 4 files changed, 4 insertions(+), 95 deletions(-) diff --git a/packages/dash-table/CHANGELOG.md b/packages/dash-table/CHANGELOG.md index 3af9a979df..77d68b0dfc 100644 --- a/packages/dash-table/CHANGELOG.md +++ b/packages/dash-table/CHANGELOG.md @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). #### REMOVED - `column.clearable`: Allows clearing the value of a dropdown cell. Removed in favor of `dropdown_**` `clearable` nested property. + - `column.hidden`: Allows hiding column + Removed. Stay tuned by following https://github.com/plotly/dash-table/issues/314. - `column.options` Removed. Redundant with `dropdown`. - `pagination_settings` @@ -43,7 +45,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - `n_fixed_columns`: Will fix columns to the left. Renamed to `fixed_columns` Now accepts an object { headers: boolean, data: number } instead of a number. - { headers: true } determines the number of columns to fix automatically. For example, if the rows are selectable or deletable, { headers: true } would fix those columns automatically. If { headers: true, data: 2 }, it would fix the first two data columns in addition to the selectable and deletable if visible. + { headers: true } determines the number of columns to fix automatically. For example, if the rows are selectable or deletable, { headers: true } would fix those columns automatically. If { headers: true, data: 2 }, it would fix the first two data columns in addition to the selectable and deletable if visible. - `n_fixed_rows`: Will fix rows to the top. Renamed to `fixed_rows` Now accepts an object { headers: boolean, data: number } instead of a number. diff --git a/packages/dash-table/src/dash-table/dash/DataTable.js b/packages/dash-table/src/dash-table/dash/DataTable.js index 8f986558bd..3f67fa9df0 100644 --- a/packages/dash-table/src/dash-table/dash/DataTable.js +++ b/packages/dash-table/src/dash-table/dash/DataTable.js @@ -195,14 +195,6 @@ export const propTypes = { specifier: PropTypes.string }), - /** - * If True, then the column and its data is hidden. - * This can be useful if you want to transport extra - * meta data (like a data index) to and from callbacks - * but you don't necessarily want to display that data. - */ - hidden: PropTypes.bool, - /** * The `id` of the column. * The column `id` is used to match cells in data diff --git a/packages/dash-table/tests/visual/percy-storybook/Header.percy.tsx b/packages/dash-table/tests/visual/percy-storybook/Header.percy.tsx index e74780e431..1335e0481e 100644 --- a/packages/dash-table/tests/visual/percy-storybook/Header.percy.tsx +++ b/packages/dash-table/tests/visual/percy-storybook/Header.percy.tsx @@ -22,7 +22,7 @@ storiesOf('DashTable/Headers', module) { name: ['Year', ''], id: 'year' }, { name: ['City', 'Montreal'], id: 'montreal' }, { name: ['City', 'Toronto'], id: 'toronto' }, - { name: ['City', 'Ottawa'], id: 'ottawa', hidden: true }, + { name: ['City', 'Ottawa'], id: 'ottawa' }, { name: ['City', 'Vancouver'], id: 'vancouver' }, { name: ['Climate', 'Temperature'], id: 'temp' }, { name: ['Climate', 'Humidity'], id: 'humidity' } diff --git a/packages/dash-table/tests/visual/percy-storybook/fixtures.ts b/packages/dash-table/tests/visual/percy-storybook/fixtures.ts index 18b80be776..150db82180 100644 --- a/packages/dash-table/tests/visual/percy-storybook/fixtures.ts +++ b/packages/dash-table/tests/visual/percy-storybook/fixtures.ts @@ -386,91 +386,6 @@ export default [ } }, - { - name: 'hidden-columns', - props: { - id: 'table', - editable: true, - selected_cells: [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]], - active_cell: [1, 1], - columns: [ - { - name: 'Column 1', - id: 'column-1' - }, - { - name: 'Column 2', - id: 'column-2', - hidden: true - }, - { - name: 'Column 3', - id: 'column-3' - }, - { - name: 'Column 4', - id: 'column-4' - } - ], - data: [ - {'column-1': 1, 'column-2': 'alpha', 'column-3': 2, 'column-4': 1}, - {'column-1': 2, 'column-2': {data: 'whatever im hidden who cares'}, 'column-3': 2, 'column-4': 1}, - {'column-1': 3, 'column-2': true, 'column-3': 2, 'column-4': 1}, - {'column-1': 4, 'column-2': 'delta', 'column-3': 2, 'column-4': 1} - ] - } - }, - - { - name: 'hidden-columns-with-merged-headers', - props: { - id: 'table', - editable: true, - selected_cells: [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]], - active_cell: [1, 1], - merge_duplicate_headers: true, - columns: [ - { - name: ['Columns', 'Column 1'], - id: 'column-1' - }, - { - name: ['Columns', 'Column 2'], - id: 'column-2', - hidden: true - }, - { - name: ['Columns', 'Column 3'], - id: 'column-3' - }, - { - name: ['Columns', 'Column 4'], - id: 'column-4' - }, - { - name: ['Colors', 'Blue'], - id: 'column-5' - }, - { - name: ['Colors', 'Red'], - id: 'column-6', - hidden: true - - }, - { - name: ['Colors', 'Orange'], - id: 'column-7' - } - ], - data: [ - {'column-1': 1, 'column-2': 'alpha', 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1}, - {'column-1': 2, 'column-2': {data: 'whatever im hidden who cares'}, 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1}, - {'column-1': 3, 'column-2': true, 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1}, - {'column-1': 4, 'column-2': 'delta', 'column-3': 2, 'column-4': 1, 'column-5': 1, 'column-6': 2, 'column-7': 1} - ] - } - }, - { name: 'per-cell dropdowns', props: {