-
-
Notifications
You must be signed in to change notification settings - Fork 144
Conversation
9228382
to
5b80c6f
Compare
@@ -99,7 +99,7 @@ ConfirmDialog.propTypes = { | |||
/** | |||
* Set to true to send the ConfirmDialog. | |||
*/ | |||
displayed: PropTypes.bool, | |||
displayed: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.bool]), |
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.
Necessary because of this test, since it will set displayed=None
. Or, should we change that test and keep this as only PropTypes.bool
@@ -173,36 +173,36 @@ DatePickerRange.propTypes = { | |||
* Accepts datetime.datetime objects or strings | |||
* in the format 'YYYY-MM-DD' | |||
*/ | |||
start_date: PropTypes.string, | |||
start_date: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), |
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.
Technically a Python datetime
object is stored, which is automatically serialized to a string; however, validation occurs before serialization, so we need this so the validation schema
is automatically generated to accept datetime
objects.
@@ -8,7 +8,7 @@ const filterEventData = (gd, eventData, event) => { | |||
if (contains(event, ['click', 'hover', 'selected'])) { | |||
const points = []; | |||
|
|||
if (isNil(eventData)) { | |||
if (isNil(eventData) || isNil(eventData.points)) { |
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.
Was throwing front-end error is eventData.points
was undefined.
src/components/Graph.react.js
Outdated
@@ -74,7 +74,10 @@ export default class PlotlyGraph extends Component { | |||
const {id, figure, animate, animation_options, config} = props; | |||
const gd = document.getElementById(id); | |||
|
|||
if (animate && this._hasPlotted && figure.data.length === gd.data.length) { | |||
if (animate && this._hasPlotted && | |||
!isNil(figure) && !isNil(gd) && |
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.
Was throwing front-end errors.
src/components/Location.react.js
Outdated
pathname: PropTypes.string, | ||
pathname: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.oneOf([null]) |
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.
Added because of this test, which results in an initial callback setting pathname=None
. We can change the test instead.
@@ -52,8 +52,8 @@ Slider.propTypes = { | |||
* the value should be an object which | |||
* contains style and label properties. | |||
*/ | |||
marks: PropTypes.shape({ | |||
number: PropTypes.oneOfType([ | |||
marks: PropTypes.objectOf( |
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.
This just had the wrong schema initially.
src/components/Tabs.react.js
Outdated
@@ -214,7 +214,7 @@ export default class Tabs extends Component { | |||
selectedTab = this.props.children.filter(child => { | |||
return child.props.children.props.value === this.state.selected; | |||
}); | |||
if ('props' in selectedTab[0]) { | |||
if (selectedTab[0] && 'props' in selectedTab[0]) { |
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.
Was throwing front-end exceptions.
src/components/Tabs.react.js
Outdated
@@ -359,7 +359,7 @@ Tabs.propTypes = { | |||
/** | |||
* Array that holds Tab components | |||
*/ | |||
children: PropTypes.node, | |||
children: PropTypes.node.isRequired, |
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.
Front-end exceptions when this is None
.
@rmarren1 What's the status of this PR? Is this blocked or moot? If blocked, what can we do to help unblock it. Just doing sanity checks on PRs that have been outstanding for a while. Thanks! |
@Marc-Andre-Rivet This is dependent on plotly/dash#452 which is still awaiting approval. I'll update the top level to explain that! (It was linked to old version of the PR). |
Close this PR as we shifted the validation in dash-renderer #100 |
This PR is dependent on the validation PR plotly/dash#452, and consists of the Dash Core Components generated with schemas, some tests, and some modifications to DCC prop-types to make validation work.