-
Notifications
You must be signed in to change notification settings - Fork 106
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: [#176825286,#176323469] Features Carousel: Items are now shown depending on local and remote feature flag. BPD item is shown only when user is not enrolled to the program, hidden if loading or the information is not available #2793
feat: [#176825286,#176323469] Features Carousel: Items are now shown depending on local and remote feature flag. BPD item is shown only when user is not enrolled to the program, hidden if loading or the information is not available #2793
Conversation
Affected stories
|
Codecov Report
@@ Coverage Diff @@
## master #2793 +/- ##
==========================================
+ Coverage 54.83% 54.85% +0.01%
==========================================
Files 813 813
Lines 22547 22547
Branches 4233 4233
==========================================
+ Hits 12364 12368 +4
+ Misses 10122 10118 -4
Partials 61 61
Continue to review full report at Codecov.
|
(abs: AvailableBonusTypesState) => pot.isLoading(abs) | ||
); | ||
|
||
export const isAvailableBonusNoneErrorSelector = createSelector( |
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.
In this selector you could use composition
export const isAvailableBonusNoneErrorSelector = createSelector(
[availableBonusTypesSelector, isAvailableBonusErrorSelector],
(abs: AvailableBonusTypesState, hasError: boolean) =>
hasError && pot.isNone(abs)
);
PS you could also leave a little comment for each selector?
const anyBonusNotActive = | ||
(!pot.getOrElse(props.bpdActiveBonus, false) && bpdEnabled) || | ||
(!props.cgnActiveBonus && cgnEnabled); | ||
const hasBpdActive: boolean | undefined = pot.getOrElse( |
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.
this expression never returns undefined
. It returns always a boolean
we should implement this logic
if we have a value (pot some) we can say has bpd or not (true / false, depending of the pot value). Otherwise we can't say nothing (undefined)
const hasBpdActive: boolean | undefined = pot.getOrElse( | |
const hasBpdActive: boolean | undefined = | |
props.bpdActiveBonus.kind === "PotSome" | |
? props.bpdActiveBonus.value | |
: undefined; |
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.
You're absolutely right I thought to commit the previously suggested code:
const hasBpdActive: boolean | undefined =
pot.isSome(props.bpdActiveBonus)
? props.bpdActiveBonus.value
: undefined;
I'm fixing it asap!
@CrisTofani since now we are using PR title as changelog detail what do you think to change PR from
to
|
@Undermaken maybe
what do you think? |
@Undermaken a fix from previous proposal:
what do you think? |
Short description
This PR converts the usage of the
availableBonusTypesSelector
with the newvisibleAvailableBonusSelector
which handles the visibility of bonus items