-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Filter fix #119
Filter fix #119
Conversation
Code Coverage Summary
Diff against main
Results for commit: c761af6 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
@@ -60,4 +60,4 @@ Encoding: UTF-8 | |||
Language: en-US | |||
LazyData: true | |||
Roxygen: list(markdown = TRUE) | |||
RoxygenNote: 7.2.1 | |||
RoxygenNote: 7.2.3 |
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.
Intended?
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.
yes.
R/data_extract_filter_module.R
Outdated
selected <- if (!is.null(filter$selected)) { | ||
filter$selected | ||
} else { | ||
selected <- choices[1] | ||
if (filter$multiple) { | ||
choices | ||
} else { | ||
choices[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.
God, the ifs xd
R/data_extract_filter_module.R
Outdated
if (filter$multiple) { | ||
choices | ||
} else { | ||
choices[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.
What's the type of choices
in here? Is it possible to abuse this R
thing:
val = 2
print(val[1])
# prints 2
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.
Weirdly enough, I have a vague recollection of asking myself this question in these parts of the code in the past xd
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.
I tested choices
with AGE
and SEX
which returned the types integer
and character
respectively.
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.
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.
👍
closes #117
The two
updateOptionalSelectInput
could not be removed because of their need when the selection is not assigned by default, checktm_g_distribution
example app from tmg for clarification.We now account for when something is pre-selected in
data_extract_filter_srv
and assign the selected value to it.Test with app below and try to remove the
selected
value also:Also test with modules from tmg and tmc.