-
-
Notifications
You must be signed in to change notification settings - Fork 73
Issue 765 - Sanitize Id #766
Changes from 9 commits
ebaac2c
030fd0b
7e5ffca
7463d9b
b398e14
524e5b3
1519fe2
f35a3b3
76916b9
41981cb
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
pip install -r dev-requirements.txt --quiet | ||
git clone --depth 1 [email protected]:plotly/dash.git dash-main | ||
pip install -e ./dash-main[dev,testing] --quiet | ||
cd dash-main/dash-renderer && npm run build && pip install -e . && cd ./../.. | ||
cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../.. | ||
|
||
- run: | ||
name: Build | ||
|
@@ -215,7 +215,7 @@ jobs: | |
. venv/bin/activate | ||
git clone --depth 1 [email protected]:plotly/dash.git dash-main | ||
pip install -e ./dash-main[dev,testing] --quiet | ||
cd dash-main/dash-renderer && npm run build && pip install -e . && cd ../.. | ||
cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ../.. | ||
|
||
- run: | ||
name: Install test requirements | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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'; | ||
|
||
|
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' }} | ||
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. FWIW you're never going to actually get an object sent to the component by the renderer as an Does 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.
Oups. |
||
/>)); |
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 "~!@#$%^&*()=+ \|/.,:;'"`?[]<>{}"