This repository was archived by the owner on Aug 29, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Issue 765 - Sanitize Id #766
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ebaac2c
sanitize id + new css prop test
030fd0b
Merge branch 'dev' into 765-sanitize-id
Marc-Andre-Rivet 7e5ffca
changelog
7463d9b
Use CSS.escape polyfill + additional common cases tests
b398e14
Merge branch 'dev' into 765-sanitize-id
Marc-Andre-Rivet 524e5b3
invalidate cache
1519fe2
Merge branch '765-sanitize-id' of github.com:plotly/dash-table into 7…
f35a3b3
renderer needs `npm ci`
76916b9
npm ci
41981cb
Update Css.percy.tsx
Marc-Andre-Rivet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import 'css.escape'; // polyfill | ||
|
|
||
| import Environment from 'core/environment'; | ||
| import Logger from 'core/Logger'; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React from 'react'; | ||
| import { storiesOf } from '@storybook/react'; | ||
| import DataTable from 'dash-table/dash/DataTable'; | ||
|
|
||
| const props = { | ||
| setProps: () => { }, | ||
| data: [ | ||
| { a: 1, b: 2, c: 3 }, | ||
| { a: 2, b: 4, c: 6 }, | ||
| { a: 3, b: 6, c: 9 } | ||
| ], | ||
| columns: [ | ||
| { id: 'a', name: 'A' }, | ||
| { id: 'b', name: 'B' }, | ||
| { id: 'c', name: 'C' } | ||
| ], | ||
| css: [ | ||
| { selector: 'td', rule: 'background-color: red !important;' } | ||
| ] | ||
| }; | ||
|
|
||
| storiesOf('DashTable/CSS override', module) | ||
| .add('leading _ without letter', () => (<DataTable | ||
| {...props} | ||
| id={'_123'} | ||
| />)) | ||
| .add('leading number', () => (<DataTable | ||
| {...props} | ||
| id={'123'} | ||
| />)) | ||
| .add('escaped characters', () => (<DataTable | ||
| {...props} | ||
| id={'`~!@#$%^&*()=+ \\|/.,:;\'"`?[]<>{}'} | ||
| />)) | ||
| .add('stringified object as id', () => (<DataTable | ||
| {...props} | ||
| id={"{ id: 3, group: 'A' }"} | ||
| />)); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the fix, the table does not render and throws.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leading to the developer screaming "~!@#$%^&*()=+ \|/.,:;'"`?[]<>{}"