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

204 Add "rendering in progress" info #253

Merged
merged 12 commits into from
Feb 28, 2024
Merged

Conversation

chlebowa
Copy link
Contributor

@chlebowa chlebowa commented Feb 21, 2024

Closes #204.

Added blocking of download buttons with shinybusy::block.

TESTING APP

devtools::load_all()
library(teal.modules.general)

data <- teal_data()
data <- within(data, {
  library(nestcolor)
  ADSL <- teal.modules.general::rADSL
})
datanames <- c("ADSL")
datanames(data) <- datanames
join_keys(data) <- default_cdisc_join_keys[datanames]

app <- teal::init(
  data = data,
  modules = teal::modules(
    teal.modules.general::tm_a_regression(
      label = "Regression",
      response = teal.transform::data_extract_spec(
        dataname = "ADSL",
        select = teal.transform::select_spec(
          label = "Select variable:",
          choices = "BMRKR1",
          selected = "BMRKR1",
          multiple = FALSE,
          fixed = TRUE
        )
      ),
      regressor = teal.transform::data_extract_spec(
        dataname = "ADSL",
        select = teal.transform::select_spec(
          label = "Select variables:",
          choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")),
          selected = "AGE",
          multiple = TRUE,
          fixed = FALSE
        )
      ),
      ggplot2_args = teal.widgets::ggplot2_args(
        labs = list(subtitle = "Plot generated by Regression Module")
      )
    )
  )
)
runApp(app, launch.browser = TRUE)

@chlebowa chlebowa added the core label Feb 21, 2024
@Polkas
Copy link
Contributor

Polkas commented Feb 21, 2024

Nice solution; an advantage is that the solution does not add other dependencies than shinybusy to the package.

> tools::package_dependencies("shinybusy")
$shinybusy
[1] "htmltools"   "shiny"       "jsonlite"    "htmlwidgets"

@chlebowa
Copy link
Contributor Author

chlebowa commented Feb 22, 2024

Thanks @Polkas.
It is rather light. 3/4 of its dependencies are already used in teal.reporter and htmlwidgets brings no new ones. 🙂

@pawelru
Copy link
Contributor

pawelru commented Feb 22, 2024

Thanks. I like this. Details to be sorted out but functional wise I feel this is exactly what we need.

@chlebowa
Copy link
Contributor Author

This is what it looks like now:
image

Note that the Cancel button merely closes the modal and does not in fact cancel the rendering. If that can be done, it would be a separate issue.

@chlebowa chlebowa marked this pull request as ready for review February 23, 2024 11:19
@pawelru
Copy link
Contributor

pawelru commented Feb 23, 2024

Pls add news entry

Copy link
Contributor

github-actions bot commented Feb 23, 2024

badge

Code Coverage Summary

Filename              Stmts    Miss  Cover    Missing
------------------  -------  ------  -------  -----------------------------------------------------------------------------------
R/AddCardModule.R       144       2  98.61%   165, 202
R/Archiver.R             25       0  100.00%
R/ContentBlock.R         18       2  88.89%   57-63
R/DownloadModule.R      209      49  76.56%   98-104, 147, 179-184, 193-197, 200-204, 212-216, 219-223, 230-234, 237-241, 280-284
R/FileBlock.R            13       0  100.00%
R/NewpageBlock.R          2       0  100.00%
R/PictureBlock.R         30       2  93.33%   20, 118
R/Previewer.R           297      56  81.14%   199, 215, 217-220, 223, 226-234, 348-392
R/RcodeBlock.R           15       0  100.00%
R/Renderer.R            113      37  67.26%   97-112, 216, 224, 233, 235-256
R/ReportCard.R           77       4  94.81%   192, 233, 238, 259
R/Reporter.R             94       1  98.94%   270
R/ResetModule.R          55       0  100.00%
R/SimpleReporter.R       30       0  100.00%
R/TableBlock.R            9       0  100.00%
R/TextBlock.R            13       0  100.00%
R/utils.R               171      80  53.22%   7, 38-97, 99, 102-109, 167, 179-181, 285-294
R/yaml_utils.R           81       2  97.53%   79, 290
R/zzz.R                  14      10  28.57%   2-13, 19
TOTAL                  1410     245  82.62%

Diff against main

Filename              Stmts    Miss  Cover
------------------  -------  ------  -------
R/DownloadModule.R       +2       0  +0.23%
R/Previewer.R            +2       0  +0.13%
TOTAL                    +4       0  +0.05%

Results for commit: 09f7d65

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Unit Tests Summary

  1 files   18 suites   10s ⏱️
204 tests 204 ✅ 0 💤 0 ❌
346 runs  346 ✅ 0 💤 0 ❌

Results for commit 09f7d65.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
DownloadReportModule 💔 $1.23$ $+3.02$ $0$ $0$ $0$ $0$
PreviewerReportModule 💔 $1.01$ $+3.00$ $0$ $0$ $0$ $0$
SimpleReporter 💔 $0.55$ $+3.01$ $0$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
DownloadReportModule 💔 $0.57$ $+3.00$ download_report_button_srv_render_and_downlaod_a_document
PreviewerReportModule 💔 $0.36$ $+3.00$ reporter_previewer_srv_render_and_downlaod_a_document
SimpleReporter 💔 $0.31$ $+3.01$ simple_reporter_srv_render_and_downlaod_a_document

Results for commit eb2adbd

♻️ This comment has been updated with latest results.

R/DownloadModule.R Outdated Show resolved Hide resolved
@chlebowa
Copy link
Contributor Author

@pawelru Anything else needed here?

@pawelru
Copy link
Contributor

pawelru commented Feb 28, 2024

Thanks. It's good now. Please remove sys wait and I will be happy to approve.

Copy link
Contributor

@pawelru pawelru left a comment

Choose a reason for hiding this comment

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

👍 thanks!

@chlebowa chlebowa enabled auto-merge (squash) February 28, 2024 08:25
@chlebowa chlebowa merged commit 203baa7 into main Feb 28, 2024
25 checks passed
@chlebowa chlebowa deleted the 204_add_rendering_in_progress@main branch February 28, 2024 08:27
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.

[Feature Request]: Add "rendering in progress" info
3 participants