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

shinyvalidate improvements #199

Merged
merged 78 commits into from
Jan 3, 2023
Merged

shinyvalidate improvements #199

merged 78 commits into from
Jan 3, 2023

Conversation

chlebowa
Copy link
Contributor

@chlebowa chlebowa commented Nov 28, 2022

Closes this issue

Following the introduction of validate_inputs to teal by #199,
this PR:

  • changes all possible input validations from validate calls to shinyvalidate input validators
  • passes all validators to validate_input funcitons

@chlebowa chlebowa added the core label Nov 28, 2022
@chlebowa chlebowa requested a review from a team November 29, 2022 09:34
@gogonzo gogonzo self-assigned this Nov 29, 2022
R/tm_g_ae_oview.R Outdated Show resolved Hide resolved
@BLAZEWIM
Copy link
Contributor

Concerning gather_fails:

Like the idea and the example app. My comments / questions in the conversations.
It is only draft so I do not care about spelling or comments.
Are all those checkmate's needed? The number of developers that can make those mistakes is limited.

@chlebowa
Copy link
Contributor Author

All modules have been modified.

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

Concerning gather_fails:

Like the idea and the example app. My comments / questions in the conversations. It is only draft so I do not care about spelling or comments. Are all those checkmate's needed? The number of developers that can make those mistakes is limited.

I add checkmates by habit in case something is ever called programmatically.

R/gather_fails.R Outdated Show resolved Hide resolved
R/gather_fails.R Outdated Show resolved Hide resolved
R/gather_fails.R Outdated Show resolved Hide resolved
@donyunardi
Copy link
Contributor

donyunardi commented Nov 30, 2022

Sorry, maybe I shouldn't worry about the misspelling but I thought I just pointed out so we don't forget about it.

Overall, I think collating the validation messages is a great idea and will improve user's experience!

One scenario that I could recall recently is when a user got frustrated as he got into another issue after fixing one issue.
In this case, the data structure was not proper for the module (i.e. levels is expected on several columns) but I feel that expectation can be set should all validation warnings appear at once.

I think you pointed out that gather_fails should be in teal which I agree.

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.

👍

@chlebowa
Copy link
Contributor Author

I decided to add debouncing to all_q reactives in modules where the output takes long to update, which was most of them.

NEWS.md Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2022

badge

Code Coverage Summary

Filename                    Stmts    Miss  Cover    Missing
------------------------  -------  ------  -------  --------------
R/tm_g_ae_oview.R             247     247  0.00%    110-390
R/tm_g_ae_sub.R               316     316  0.00%    58-410
R/tm_g_butterfly.R            385     385  0.00%    124-549
R/tm_g_decorate.R              46      46  0.00%    18-98
R/tm_g_events_term_id.R       296     296  0.00%    63-397
R/tm_g_heat_bygrade.R         318     318  0.00%    164-517
R/tm_g_patient_profile.R      708     708  0.00%    205-978
R/tm_g_spiderplot.R           321     321  0.00%    83-449
R/tm_g_swimlane.R             375     375  0.00%    120-552
R/tm_g_waterfall.R            422     422  0.00%    113-586
R/utils.R                      37      32  13.51%   32-91, 124-131
R/zzz.R                         1       1  0.00%    2
TOTAL                        3472    3467  0.14%

Diff against main

Filename                    Stmts    Miss  Cover
------------------------  -------  ------  --------
R/tm_g_ae_oview.R              +5      +5  +100.00%
R/tm_g_ae_sub.R                -1      -1  +100.00%
R/tm_g_butterfly.R             +8      +8  +100.00%
R/tm_g_events_term_id.R        +2      +2  +100.00%
R/tm_g_heat_bygrade.R         +35     +35  +100.00%
R/tm_g_patient_profile.R      -78     -78  +100.00%
R/tm_g_spiderplot.R           +15     +15  +100.00%
R/tm_g_swimlane.R              +4      +4  +100.00%
R/tm_g_waterfall.R            +21     +21  +100.00%
TOTAL                         +11     +11  -0.00%

Results for commit: a47863c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@BLAZEWIM
Copy link
Contributor

BLAZEWIM commented Jan 3, 2023

One minor thing I noticed that is slightly (5%) annoying: uppercases and lowercases in labels. For example, in spiderplot, we have "Variable" used everywhere, while in patient profile it is "variable". It also goes for other packages. I noticed that developers usually just go with the convention used by labels when they create warning message, and it makes sense, but it could be managed on some lazy day.

@chlebowa
Copy link
Contributor Author

chlebowa commented Jan 3, 2023

One minor thing I noticed that is slightly (5%) annoying: uppercases and lowercases in labels. For example, in spiderplot, we have "Variable" used everywhere, while in patient profile it is "variable". It also goes for other packages. I noticed that developers usually just go with the convention used by labels when they create warning message, and it makes sense, but it could be managed on some lazy day.

I was equally annoyed by this but assumed it was due to independent design decisions by different module developers.

@BLAZEWIM
Copy link
Contributor

BLAZEWIM commented Jan 3, 2023

So the only problem is that the check() output is not full of no visible binding for global variable notes, we could use tidyselect:: all_of, but that will add a dependency...
if we are cool with ignoring notes, it is ok.

@chlebowa
Copy link
Contributor Author

chlebowa commented Jan 3, 2023

So the only problem is that the check() output is not full of no visible binding for global variable notes, we could use tidyselect:: all_of, but that will add a dependency... if we are cool with ignoring notes, it is ok.

We decided to ignore them.

Copy link
Contributor

@BLAZEWIM BLAZEWIM left a comment

Choose a reason for hiding this comment

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

ok

R/gather_fails.R Outdated Show resolved Hide resolved
R/gather_fails.R Outdated Show resolved Hide resolved
R/gather_fails.R Outdated Show resolved Hide resolved
R/gather_fails.R Outdated Show resolved Hide resolved
R/tm_g_ae_oview.R Outdated Show resolved Hide resolved
@chlebowa chlebowa merged commit 1ce7869 into main Jan 3, 2023
@chlebowa chlebowa deleted the 185_gather_fails@main branch January 3, 2023 13:50
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.

shiny validate improvements
6 participants