This repository was archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Re-render on changes to undefined props #785
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
52b5a36
use dash state-machine branch
1defea2
noise
36885d7
3.7.6
bf0d25c
remove cache
dc01001
re-render on previously missing props
7b46e05
make sure the graphs are visible before taking snapshot
70a038d
noise
617e1d8
Merge branch 'dev' into state-machine
Marc-Andre-Rivet 74d51ee
noise
9069a19
Update config.yml
Marc-Andre-Rivet 0488ad2
Merge branch 'dev' into state-machine
Marc-Andre-Rivet a30121e
Merge branch 'state-machine' of github.com:plotly/dash-table into sta…
8849e85
unit test table shouldComponentUpdate condition
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
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,14 @@ | ||
import * as R from 'ramda'; | ||
import { isEqual } from 'core/comparer'; | ||
|
||
const DERIVED_REGEX = /^derived_/; | ||
|
||
export default ( | ||
props: any, | ||
nextProps: any, | ||
state: any, | ||
nextState: any | ||
) => R.any( | ||
key => !DERIVED_REGEX.test(key) && props[key] !== nextProps[key], | ||
R.keysIn({ ...props, ...nextProps }) | ||
) || !isEqual(state, nextState); |
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,27 @@ | ||
import shouldComponentUpdate from 'dash-table/components/Table/shouldComponentUpdate'; | ||
|
||
describe('shouldComponentUpdate', () => { | ||
it('should update on undefined -> defined props', () => { | ||
assert(shouldComponentUpdate({}, { a: 0 }, {}, {})); | ||
}); | ||
|
||
it('should update on undefined -> defined state', () => { | ||
assert(shouldComponentUpdate({}, {}, {}, { a: 0 })); | ||
}); | ||
|
||
it('should update on defined -> undefined props', () => { | ||
assert(shouldComponentUpdate({ a: 0 }, {}, {}, {})); | ||
}); | ||
|
||
it('should update on defined -> undefined state', () => { | ||
assert(shouldComponentUpdate({}, {}, { a: 0 }, {})); | ||
}); | ||
|
||
it('should not update on derived props', () => { | ||
assert(!shouldComponentUpdate({ derived_test: 0 }, { derived_test: 1 }, {}, {})); | ||
}); | ||
|
||
it('should update on derived state', () => { | ||
assert(shouldComponentUpdate({}, {}, { derived_test: 0 }, { derived_test: 1 })); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -152,5 +152,8 @@ def update_graph(rows, selected_rows): | |
dash_duo.wait_for_element("#waitfor") | ||
|
||
dash_duo.wait_for_element("#{}".format(IDS["table"])) | ||
dash_duo.wait_for_element("#pop svg") | ||
dash_duo.wait_for_element("#lifeExp svg") | ||
dash_duo.wait_for_element("#gdpPercap svg") | ||
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. Slight changes in timing / rendering require the test to be more specific and wait for the graph to be ready |
||
|
||
dash_duo.percy_snapshot("rapp002 - loaded") |
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.
This test fails without the added
...nextProps
8849e85#diff-aa707fa377faf64638e062a12fb52d85R13