-
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
[#173510346] Fixes test 2e2 #1959
Merged
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4f4f2ac
[#173510346] fix
Undermaken 60d00de
[#173510346] fix
Undermaken bfc3f45
Merge branch 'master' into 173510346-fixes
Undermaken a3785ac
[#173510346] fix cta language picking
Undermaken 0443729
[#173510346] fix
Undermaken 6e0e1ea
Merge branch 'master' into 173510346-fixes
Undermaken 78a42b7
[#173510346] fix tests
Undermaken 16c0509
Merge branch 'master' into 173510346-fixes
Undermaken 714fca8
[#173510346] fix
Undermaken e0b6ff2
[#173510346] fix
Undermaken 0bf3382
[#173510346] sensible error now are cleaned from sensible data
Undermaken ba95ec1
[#173510346] refactoring
Undermaken 9c29402
[#173510346] refactoring
Undermaken bff8853
[#173510346] update tests
Undermaken bd8a090
[#173510346] update comment
Undermaken 228529b
Merge branch 'master' into 173510346-fixes
Undermaken 3b44550
[#173510346] update activation integration test with new remote response
fabriziofff ebfbb98
Merge remote-tracking branch 'origin/173510346-fixes' into 173510346-…
fabriziofff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,46 @@ | ||
import { View } from "native-base"; | ||
import React from "react"; | ||
import React, { ReactElement } from "react"; | ||
import { Dispatch } from "redux"; | ||
import { CreatedMessageWithContent } from "../../../definitions/backend/CreatedMessageWithContent"; | ||
import { CTA } from "../../types/MessageCTA"; | ||
import { | ||
getCTA, | ||
handleCtaAction, | ||
hasCTAValidActions, | ||
isCtaActionValid | ||
} from "../../utils/messages"; | ||
import { CTA, CTAS } from "../../types/MessageCTA"; | ||
import { handleCtaAction, isCtaActionValid } from "../../utils/messages"; | ||
import { MessageNestedCtaButton } from "./MessageNestedCtaButton"; | ||
|
||
type Props = { | ||
message: CreatedMessageWithContent; | ||
ctas: CTAS; | ||
xsmall: boolean; | ||
dispatch: Dispatch; | ||
}; | ||
|
||
// render cta1 and cta2 if they are defined in the message content as nested front-matter | ||
export const MessageNestedCTABar: React.FunctionComponent<Props> = ( | ||
props: Props | ||
) => { | ||
): ReactElement => { | ||
const handleCTAPress = (cta: CTA) => { | ||
handleCtaAction(cta, props.dispatch); | ||
}; | ||
|
||
const maybeNestedCTA = getCTA(props.message); | ||
if (maybeNestedCTA.isSome()) { | ||
const ctas = maybeNestedCTA.value; | ||
if (hasCTAValidActions(ctas)) { | ||
const cta2 = ctas.cta_2 && | ||
isCtaActionValid(ctas.cta_2) && ( | ||
<MessageNestedCtaButton | ||
cta={ctas.cta_2} | ||
xsmall={props.xsmall} | ||
primary={false} | ||
onCTAPress={handleCTAPress} | ||
/> | ||
); | ||
const cta1 = isCtaActionValid(ctas.cta_1) && ( | ||
<MessageNestedCtaButton | ||
cta={ctas.cta_1} | ||
primary={true} | ||
xsmall={props.xsmall} | ||
onCTAPress={handleCTAPress} | ||
/> | ||
); | ||
return ( | ||
<> | ||
{cta2} | ||
{cta2 && <View hspacer={true} small={true} />} | ||
{cta1} | ||
</> | ||
); | ||
} | ||
} | ||
return null; | ||
const { ctas } = props; | ||
const cta2 = ctas.cta_2 && | ||
isCtaActionValid(ctas.cta_2) && ( | ||
<MessageNestedCtaButton | ||
cta={ctas.cta_2} | ||
xsmall={props.xsmall} | ||
primary={false} | ||
onCTAPress={handleCTAPress} | ||
/> | ||
); | ||
const cta1 = isCtaActionValid(ctas.cta_1) && ( | ||
<MessageNestedCtaButton | ||
cta={ctas.cta_1} | ||
primary={true} | ||
xsmall={props.xsmall} | ||
onCTAPress={handleCTAPress} | ||
/> | ||
); | ||
return ( | ||
<> | ||
{cta2} | ||
{cta2 && <View hspacer={true} small={true} />} | ||
{cta1} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 case the user will see the generic error page (cancel / retry). Is it right when in processing?
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.
@fabriziofff
The comment is misleading. In that case we should continue to polling.
Do you confirm?
update within bd8a090
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.
If I understand right whengetBonusActivation
return anyleft
value, the polling is stopped and aactivateBonusVacanze.failure(e)
is dispatched. So all the switch cases will stop the polling. It is right?EDIT: nvm, left(none) will continue the polling, I understand now!