-
-
Notifications
You must be signed in to change notification settings - Fork 72
Issue 314 - Hidden Columns #508
Changes from all commits
b011018
6bd3440
5fb388a
6c68d44
80c33a6
0948cca
1fb1e26
0e516dc
090ca2b
66f8d1d
5fec5f3
9f0dce9
f918216
952b2ab
7055d3c
4e70f92
239aad2
f37735f
c467fb5
1b7784a
342849f
1d02097
52568bc
5064da7
0b3a0c5
8b91da6
402b977
bc4b571
b01468d
5355559
6fbbe2f
1a5aba1
e5e7e7f
ac9b74e
c178da8
4fcd8e3
80e5137
d01777c
630345a
b9e235f
b3ff548
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,14 @@ import { | |
| PropsWithDefaults, | ||
| ChangeAction, | ||
| ChangeFailure, | ||
| IVisibleColumn, | ||
| ColumnType, | ||
| TableAction | ||
| } from 'dash-table/components/Table/props'; | ||
| import { TooltipSyntax } from 'dash-table/tooltips/props'; | ||
|
|
||
| export enum AppMode { | ||
| Clearable = 'clearable', | ||
| ClearableMerged = 'clearableMerged', | ||
| Actionable = 'actionable', | ||
| ActionableMerged = 'actionableMerged', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified |
||
| Date = 'date', | ||
| Default = 'default', | ||
| Filtering = 'filtering', | ||
|
|
@@ -178,7 +177,7 @@ function getTypedState() { | |
| const state = getDefaultState(); | ||
|
|
||
| R.forEach(column => { | ||
| (column as IVisibleColumn).on_change = { | ||
| column.on_change = { | ||
| action: ChangeAction.Coerce, | ||
| failure: ChangeFailure.Reject | ||
| }; | ||
|
|
@@ -187,19 +186,20 @@ function getTypedState() { | |
| return state; | ||
| } | ||
|
|
||
| function getClearableState() { | ||
| function getActionableState() { | ||
| const state = getDefaultState(); | ||
| state.tableProps.filter_action = TableAction.Native; | ||
|
|
||
| R.forEach(c => { | ||
| c.clearable = true; | ||
| c.hideable = [false, false, true]; | ||
| }, state.tableProps.columns || []); | ||
|
|
||
| return state; | ||
| } | ||
|
|
||
| function getClearableMergedState() { | ||
| const state = getClearableState(); | ||
| function getActionableMergedState() { | ||
| const state = getActionableState(); | ||
| state.tableProps.merge_duplicate_headers = true; | ||
|
|
||
| return state; | ||
|
|
@@ -345,10 +345,10 @@ function getState() { | |
| const mode = Environment.searchParams.get('mode'); | ||
|
|
||
| switch (mode) { | ||
| case AppMode.Clearable: | ||
| return getClearableState(); | ||
| case AppMode.ClearableMerged: | ||
| return getClearableMergedState(); | ||
| case AppMode.Actionable: | ||
| return getActionableState(); | ||
| case AppMode.ActionableMerged: | ||
| return getActionableMergedState(); | ||
| case AppMode.Date: | ||
| return getDateState(); | ||
| case AppMode.Filtering: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,10 @@ | |
| "@babel/preset-env": "^7.5.5", | ||
| "@babel/preset-react": "^7.0.0", | ||
| "@cypress/webpack-preprocessor": "^4.1.0", | ||
| "@fortawesome/fontawesome-svg-core": "^1.2.19", | ||
| "@fortawesome/free-regular-svg-icons": "^5.9.0", | ||
| "@fortawesome/free-solid-svg-icons": "^5.9.0", | ||
| "@fortawesome/react-fontawesome": "^0.1.4", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The core FA library for JS / tree-shaking, the free icons and the React wrapper. |
||
| "@percy-io/percy-storybook": "^2.1.0", | ||
| "@storybook/cli": "^5.1.9", | ||
| "@storybook/react": "^5.1.9", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ const __20years = 86400 * 1000 * 365 * 20; | |
|
|
||
| export default class CookieStorage { | ||
| public static delete(id: string, domain: string = '', path: string = '/') { | ||
| let expires = new Date((new Date().getTime() - __1day)).toUTCString(); | ||
| let expires = new Date(Date.now() - __1day).toUTCString(); | ||
|
|
||
| document.cookie = `${id}=;expires=${expires};domain=${domain};path=${path}`; | ||
| } | ||
|
|
@@ -28,7 +28,7 @@ export default class CookieStorage { | |
| } | ||
|
|
||
| public static set(id: string, value: string, domain: string = '', path: string = '/') { | ||
| let expires = new Date((new Date().getTime() + __20years)).toUTCString(); | ||
| let expires = new Date(Date.now() + __20years).toUTCString(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated cleanup that was done while the issue still included persistence. Keeping this small change around. |
||
|
|
||
| let entry = `${id}=${value};expires=${expires};domain=${domain};path=${path}`; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,6 @@ export default class CellFactory { | |
| public createCells(dataEdges: IEdgesMatrices | undefined, dataOpEdges: IEdgesMatrices | undefined) { | ||
| const { | ||
| active_cell, | ||
| columns, | ||
| dropdown_conditional, | ||
| dropdown, | ||
| data, | ||
|
|
@@ -51,7 +50,8 @@ export default class CellFactory { | |
| style_cell_conditional, | ||
| style_data, | ||
| style_data_conditional, | ||
| virtualized | ||
| virtualized, | ||
| visibleColumns | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. columns -> visibleColumns |
||
| } = this.props; | ||
|
|
||
| const relevantStyles = this.relevantStyles( | ||
|
|
@@ -62,7 +62,7 @@ export default class CellFactory { | |
| ); | ||
|
|
||
| const partialCellStyles = this.dataPartialStyles( | ||
| columns, | ||
| visibleColumns, | ||
| relevantStyles, | ||
| virtualized.data, | ||
| virtualized.offset | ||
|
|
@@ -82,7 +82,7 @@ export default class CellFactory { | |
| ); | ||
|
|
||
| const dropdowns = this.cellDropdowns( | ||
| columns, | ||
| visibleColumns, | ||
| virtualized.data, | ||
| virtualized.indices, | ||
| dropdown_conditional, | ||
|
|
@@ -101,7 +101,7 @@ export default class CellFactory { | |
| ); | ||
|
|
||
| const partialCellWrappers = this.cellWrappers.partialGet( | ||
| columns, | ||
| visibleColumns, | ||
| virtualized.data, | ||
| virtualized.offset | ||
| ); | ||
|
|
@@ -114,7 +114,7 @@ export default class CellFactory { | |
| ); | ||
|
|
||
| const partialCellContents = this.cellContents.partialGet( | ||
| columns, | ||
| visibleColumns, | ||
| virtualized.data, | ||
| virtualized.offset, | ||
| !!is_focused, | ||
|
|
@@ -124,7 +124,7 @@ export default class CellFactory { | |
| const cellContents = this.cellContents.get( | ||
| partialCellContents, | ||
| active_cell, | ||
| columns, | ||
| visibleColumns, | ||
| virtualized.data, | ||
| virtualized.offset, | ||
| !!is_focused, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.