connectwidgets
connectwidgets copied to clipboard
`rsc_card` widget throws Error with no content; `rsc_table` and `rsc_grid` give a Warning.
Currently, if rsc_grid or rsc_table are called on a content list with no records, a warning is thrown, but the document will render. If rsc_card has no records, it throws an Error and the document or application will fail. The more forgiving Warning is preferred so as no to break deployments if dynamically generated content changes.
Example output showing the errors (sorry, not a reprex)
> project_r %>%
+ filter(str_detect(title, "API")) %>%
+ rsc_table()
Warning message:
In rsc_table(.) : rsc_table() was called with an empty data frame.
> project_r %>%
+ filter(str_detect(title, "API")) %>%
+ rsc_grid()
Warning message:
In rsc_grid(.) : rsc_grid() was called with an empty data frame.
> project_r %>%
+ filter(str_detect(title, "API")) %>%
+ rsc_card()
Error in rsc_card(.) :
rsc_card() expects a data frame with at least one record.