-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat: Add logs to feature config changes [WPB-1933] #15639
Conversation
atomrc
commented
Aug 22, 2023
•
edited by github-actions
bot
Loading
edited by github-actions
bot
|
Codecov Report
@@ Coverage Diff @@
## dev #15639 +/- ##
==========================================
+ Coverage 43.63% 43.78% +0.14%
==========================================
Files 668 669 +1
Lines 22627 22633 +6
Branches 5147 5145 -2
==========================================
+ Hits 9873 9909 +36
+ Misses 11502 11483 -19
+ Partials 1252 1241 -11 |
ab26550
to
ad0c6a4
Compare
htmlMessage: isFeatureEnabled | ||
? isEnforced | ||
? t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnforced', { | ||
timeout: formatDuration(newTimeout).text, | ||
}) | ||
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnabled') | ||
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemDisabled'), |
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'll move this to variable to avoid complex ternary operators.
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 think it's pretty readable like this (and backed up by tests now)
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'll go this way:
htmlMessage: isFeatureEnabled | |
? isEnforced | |
? t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnforced', { | |
timeout: formatDuration(newTimeout).text, | |
}) | |
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnabled') | |
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemDisabled'), | |
const enforcedMessage = isEnforced | |
? t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnforced', { | |
timeout: formatDuration(newTimeout).text, | |
}) | |
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemEnabled'); | |
htmlMessage: isFeatureEnabled | |
? enforcedMessage | |
: t('featureConfigChangeModalSelfDeletingMessagesDescriptionItemDisabled'), |
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.
LGTM!