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

refactor(react-grid): rename the *hiddenColumns getters and props #651

Merged

Conversation

SergeyAlexeev
Copy link
Contributor

@SergeyAlexeev SergeyAlexeev commented Jan 10, 2018

BREAKING CHANGES:

We renamed the following TableColumnVisibility plugin's properties to improve the API consistency:

  • hiddenColumns -> hiddenColumnNames
  • defaultHiddenColumns -> defaultHiddenColumnNames
  • onHiddenColumnsChange -> onHiddenColumnNamesChange

The hiddenColumns getter has been renamed to hiddenColumnNames.

@@ -1,2 +1,2 @@
export const columnChooserItems = (columns, hiddenColumns) =>
columns.map(column => ({ column, hidden: hiddenColumns.indexOf(column.name) !== -1 }));
export const columnChooserItems = (columns, hiddenColumnNames) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is not in the plugins directory?

@@ -68,7 +68,7 @@ export default class Demo extends React.PureComponent {
</Toolbar>
<ColumnChooser
columns={columns}
hiddenColumns={hiddenColumns}
hiddenColumnNames={hiddenColumnNames}
onHiddenColumnsChange={this.hiddenColumnsChange}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we also rename onHiddenColumnsChange to onHiddenColumnNamesChange?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems too long

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's leave it as is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we introduce this complexity in naming guidelines? There is a simple rule. The onXXXChange spelling for an event and defaultXXX for a starting value.


.embedded-demo(column-chooser/uncontrolled)

### Controlled Mode

In [controlled mode](controlled-and-uncontrolled-modes.md#controlled-mode), pass the hidden columns to the `TableColumnVisibility` plugin's `hiddenColumns` property and handle the `onHiddenColumnsChange` event to control column visibility externally.
In [controlled mode](controlled-and-uncontrolled-modes.md#controlled-mode), pass the hidden columns to the `TableColumnVisibility` plugin's `hiddenColumnNames` property and handle the `onHiddenColumnsChange` event to control column visibility externally.
Copy link
Contributor

Choose a reason for hiding this comment

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

... pass the hidden column names to the ... hiddenColumnNames property ?

@SergeyAlexeev SergeyAlexeev merged commit 068604d into DevExpress:master Jan 11, 2018
@SergeyAlexeev SergeyAlexeev deleted the hiddenColumns-hiddenColumnNames branch January 11, 2018 12:06
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.

4 participants