Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33
Add show_undo_redo parameter to Dash for R#194
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| def click_undo(self): | ||
| undo_selector = "._dash-undo-redo span:first-child div:last-child" | ||
| undo = self.wait_for_element_by_css_selector(undo_selector) | ||
| self.wait_for_text_to_equal(undo_selector, "undo") | ||
| undo.click() | ||
| def click_redo(self): | ||
| redo_selector = "._dash-undo-redo span:last-child div:last-child" | ||
| self.wait_for_text_to_equal(redo_selector, "redo") | ||
| redo = self.wait_for_element_by_css_selector(redo_selector) | ||
| redo.click() | ||
| app = ''' | ||
| library(dash) | ||
| library(dashHtmlComponents) | ||
| library(dashCoreComponents) | ||
| app <- Dash$new(show_undo_redo=TRUE) | ||
| app$layout(htmlDiv(list(dccInput(id="a"), htmlDiv(id="b")))) | ||
| app$callback( | ||
| output("b", "children"), | ||
| list(input("a", "value")), | ||
| function(a) { | ||
| return(a) | ||
| } | ||
| ) | ||
| app$run_server() | ||
| ''' | ||
| def test_rstr001r_undo_redo(dashr): | ||
| dashr.start_server(app) | ||
| dashr.wait_for_element_by_css_selector( | ||
| "#a" | ||
| ) | ||
| input1 = dashr.find_element("#a") | ||
| input1.send_keys("xyz") | ||
| dashr.wait_for_text_to_equal( | ||
| "#b", "xyz", timeout=1 | ||
| ) | ||
| click_undo(dashr) | ||
| dashr.wait_for_text_to_equal( | ||
| "#b", "xy", timeout=1 | ||
| ) | ||
| click_undo(dashr) | ||
| dashr.wait_for_text_to_equal( | ||
| "#b", "x", timeout=1 | ||
| ) | ||
| click_redo(dashr) | ||
| dashr.wait_for_text_to_equal( | ||
| "#b", "xy", timeout=1 | ||
| ) | ||
| dashr.percy_snapshot(name="undo-redo") | ||
| click_undo(dashr) | ||
| click_undo(dashr) | ||
| dashr.wait_for_text_to_equal( | ||
| "#b", "", timeout=1 | ||
| ) |
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.
Ah ok - you're calling
to_JSON(self$config)for the_dash-configsection of the index, so putting this intoself$configis enough to get it included in the index. That probably means there's too much stuff being shoved in there. Doesn't have to be addressed now, feel free to make a new issue for it, but on the Py side we explicitly set what makes its way to the front end here