-
Notifications
You must be signed in to change notification settings - Fork 178
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
refactor(app): create utils to format value for rtp #14720
Conversation
create formatRunTimeParameterValue to format rtp value and replacelocal function with that close AUTH-236
? `${defaultValue.toString()} ${suffix}` | ||
: defaultValue.toString() | ||
case 'boolean': | ||
return Boolean(defaultValue) ? 'On' : 'Off' |
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.
maybe the util should take in t
as a prop so On
and Off
can be a in i18n?
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.
updated the util function.
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.
thanks for creating this util! Left a suggestion about adding t
as a prop
* refactor(app): create utils to format value for rtp
Overview
create
formatRunTimeParameterValue
to format rtp value and replace a local function with that.I noticed a small bug I made. On the UI, the following code looks fine at first glance.
However, if the data doesn't have
suffix
, the return has an unnecessary space.ex
value: 6 without
suffix
->'6 '
(including unnecessary space) but for this case we should return'6'
close AUTH-236
Test Plan
Desktop app
ODD
Changelog
formatRunTimeParameterValue
+ its testReview requests
If there is a better place this util function, please let me know.
Risk assessment
low