Skip to content
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

1110 when no filters provided, report card should notify about it #1111

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

m7pr
Copy link
Contributor

@m7pr m7pr commented Feb 22, 2024

Close #1110

Tested on teal.modules.general::tm_a_pca()

tm_a_pca code
library(teal.widgets)

data <- teal_data()
data <- within(data, {
  library(nestcolor)
  USArrests <- USArrests
})
datanames(data) <- "USArrests"

app <- init(
  data = data,
  modules = modules(
    tm_a_pca(
      "PCA",
      dat = data_extract_spec(
        dataname = "USArrests",
        select = select_spec(
          choices = variable_choices(
            data = data[["USArrests"]], c("Murder", "Assault", "UrbanPop", "Rape")
          ),
          selected = c("Murder", "Assault"),
          multiple = TRUE
        ),
        filter = NULL
      ),
      ggplot2_args = ggplot2_args(
        labs = list(subtitle = "Plot generated by PCA Module")
      )
    )
  )
)

if (interactive()) {
  shinyApp(app$ui, app$server)
}

Now, when a report card is created, but no filters were specified, we will have an extra text on a report card:

image

A potential change to this solution is to hide the Filter State header (and it's empty content) at all.

@m7pr m7pr added the core label Feb 22, 2024
R/teal_reporter.R Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Feb 22, 2024

badge

Code Coverage Summary

Filename                          Stmts    Miss  Cover    Missing
------------------------------  -------  ------  -------  -------------------------------------------------------------------------------------------------------------------------------
R/dummy_functions.R                  30      21  30.00%   21-33, 36-43
R/get_rcode_utils.R                  32       1  96.88%   51
R/include_css_js.R                   22       0  100.00%
R/init.R                             86      31  63.95%   107-114, 160-161, 163, 175-196, 226-227, 229
R/landing_popup_module.R             25      25  0.00%    61-87
R/module_filter_manager.R           107      36  66.36%   37-43, 50-58, 67-72, 195, 200-213
R/module_nested_tabs.R              154      58  62.34%   39-112, 128, 180, 202, 228
R/module_snapshot_manager.R         209     157  24.88%   87-99, 127-136, 140-152, 154-161, 168-182, 186-188, 190-195, 198-208, 211-227, 236-251, 265-288, 291-302, 305-311, 325, 343-366
R/module_tabs_with_filters.R         76      33  56.58%   33-68, 100, 116
R/module_teal_with_splash.R         114       4  96.49%   110, 131, 197-198
R/module_teal.R                     139      32  76.98%   57, 68, 77, 150-151, 157, 188, 196-197, 219-250
R/modules.R                         153      27  82.35%   127-130, 147-151, 206-210, 292-293, 345, 357-365, 419-422
R/reporter_previewer_module.R        18       2  88.89%   30, 34
R/show_rcode_modal.R                 19      19  0.00%    17-36
R/tdata.R                            53       1  98.11%   154
R/teal_data_module-eval_code.R       27       0  100.00%
R/teal_data_module-within.R           7       0  100.00%
R/teal_data_module.R                  6       0  100.00%
R/teal_reporter.R                    62       5  91.94%   69, 118-119, 122, 139
R/teal_slices-store.R                29       0  100.00%
R/teal_slices.R                      59      12  79.66%   137-150
R/utils.R                           147      27  81.63%   117-144
R/validate_inputs.R                  32       0  100.00%
R/validations.R                      58      37  36.21%   110-377
R/zzz.R                              11       7  36.36%   3-14
TOTAL                              1675     535  68.06%

Diff against main

Filename             Stmts    Miss  Cover
-----------------  -------  ------  -------
R/teal_reporter.R       +2       0  +0.27%
TOTAL                   +2       0  +0.04%

Results for commit: 1a2d7a1

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@gogonzo gogonzo self-requested a review February 23, 2024 11:31
Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@m7pr m7pr enabled auto-merge (squash) February 26, 2024 09:02
Copy link
Contributor

Unit Tests Summary

  1 files   19 suites   10s ⏱️
207 tests 207 ✅ 0 💤 0 ❌
418 runs  418 ✅ 0 💤 0 ❌

Results for commit 1a2d7a1.

@m7pr m7pr merged commit d0f5583 into main Feb 26, 2024
22 checks passed
@m7pr m7pr deleted the 1110_info_for_empty_filters@main branch February 26, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a message informing about no active filters or don't return anything from the format_data_extract
3 participants