Skip to content
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

[#173077316] Timeout eligibility screen #1864

Merged
merged 63 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
29b267c
Added IseeNotAvailableScreen
fabriziofff May 26, 2020
bfe27b7
Merge remote-tracking branch 'origin/master' into 172989356-isee-not-…
fabriziofff May 26, 2020
956ecb2
fix merge conflict
fabriziofff May 26, 2020
1dcf302
Merge remote-tracking branch 'origin/master' into 172989356-isee-not-…
fabriziofff May 26, 2020
33ced3b
reset loading when change markdown
fabriziofff May 26, 2020
82199a8
rename FooterTwoButtons
fabriziofff May 26, 2020
7d867c2
[#172989379] add screen for IseeNotEligible
fabriziofff May 26, 2020
a2ff0c9
skeleton for activate bonus screen
fabriziofff May 27, 2020
a0811d8
Merge branch '172989379-isee-not-eligible' into 172992652-activate-bo…
fabriziofff May 27, 2020
fda4425
add locales & ActivateBonusScreen refinements
fabriziofff May 27, 2020
bd96820
Merge remote-tracking branch 'origin/master' into 172992652-activate-…
fabriziofff May 27, 2020
60e1132
link with the new FamilyMember
fabriziofff May 27, 2020
69a0a2d
request pin to confirm identity when the user choose to activate bonus
fabriziofff May 28, 2020
8dc4938
Merge remote-tracking branch 'origin/master' into 172992652-activate-…
fabriziofff May 28, 2020
22d8626
add new field fiscal_code to FamilyMember mock
fabriziofff May 28, 2020
a5a55c3
Merge branch '172992652-activate-bonus-screen' into 173054348-verify-…
fabriziofff May 28, 2020
ef9adad
Merge branch 'master' into 172992652-activate-bonus-screen
fabriziofff May 28, 2020
b0faa6b
Merge branch '172992652-activate-bonus-screen' into 173054348-verify-…
fabriziofff May 28, 2020
96f7368
change checkbonuseligibilityscreen and add navigation header
fabriziofff May 28, 2020
032f758
skeleton for navigation
fabriziofff May 28, 2020
edb99b6
Merge branch 'master' into 173054348-verify-bonus-eligibility-workflow
fabriziofff May 28, 2020
26a6756
group event of "eligibility" sub-phase
fabriziofff May 28, 2020
4ffe52a
add featureflag in wallet navigator
fabriziofff May 28, 2020
047106e
first link with the business logic
fabriziofff May 28, 2020
cce33a5
Merge branch 'master' into 172992652-activate-bonus-screen
fabriziofff May 28, 2020
02cf004
fix formatting for amount and change to single mock datasource
fabriziofff May 28, 2020
0b97349
addt axBenefit placeholder
fabriziofff May 28, 2020
867f25b
add taxBenefit placeholder
fabriziofff May 28, 2020
cce395c
Merge remote-tracking branch 'origin/172992652-activate-bonus-screen'…
fabriziofff May 28, 2020
c8533a2
Merge branch '172992652-activate-bonus-screen' into 173054348-verify-…
fabriziofff May 28, 2020
3261337
[#172992652] replace hardcoded value with mocked data
Undermaken May 28, 2020
4b54c53
draft navigation between eligibility states
fabriziofff May 28, 2020
9446c24
change activatebonuscomponent to handle tax benefit
fabriziofff May 28, 2020
460447b
revert to single values for bonusamount and taxbenefit
fabriziofff May 29, 2020
eb67fac
remove unused import
fabriziofff May 29, 2020
c7db21e
Merge remote-tracking branch 'origin/master' into 172992652-activate-…
fabriziofff May 29, 2020
c060292
Merge remote-tracking branch 'origin/master' into 173054348-verify-bo…
fabriziofff May 29, 2020
36bdd5c
refactoring of EligibilityCheckStatusEnum
fabriziofff May 29, 2020
da54744
Merge remote-tracking branch 'origin/master' into 173054348-verify-bo…
fabriziofff May 29, 2020
74696ff
Merge branch '172992652-activate-bonus-screen' into 173054348-verify-…
fabriziofff May 29, 2020
10b455a
dispatch events together
fabriziofff May 29, 2020
49c7325
link activatebonusscreen with the business logic
fabriziofff May 29, 2020
367689c
Merge remote-tracking branch 'origin/master' into 173054348-verify-bo…
fabriziofff May 29, 2020
eccd335
fix lint
fabriziofff May 29, 2020
c4f2788
Merge remote-tracking branch 'origin/master' into 173054348-verify-bo…
fabriziofff May 29, 2020
5931cce
[#173054348] remove RTron logs
Undermaken May 29, 2020
2504c33
Merge branch 'master' into 173054348-verify-bonus-eligibility-workflow
Undermaken May 29, 2020
5ca90e4
[#173054348] minor change on locales
Undermaken May 29, 2020
626c331
Merge branch '173054348-verify-bonus-eligibility-workflow' of github.…
Undermaken May 29, 2020
d26100f
Merge branch 'master' into 173077316-async-eligibility-screen
fabriziofff May 29, 2020
13a15b4
draft asynceligibilitycheckinfo
fabriziofff May 29, 2020
89a4b63
group languages under section eligibility
fabriziofff Jun 1, 2020
bcf8d56
link with languages text
fabriziofff Jun 1, 2020
8412052
Merge remote-tracking branch 'origin/master' into 173077316-async-eli…
fabriziofff Jun 1, 2020
b2fd413
name refactoring
fabriziofff Jun 1, 2020
2110757
renaming screens
fabriziofff Jun 1, 2020
2fc174f
fix loadingerrorcomponent layout
fabriziofff Jun 1, 2020
51de760
add navigation when timeout
fabriziofff Jun 1, 2020
7e94f12
remove rtron log
fabriziofff Jun 1, 2020
08b6628
fix lint
fabriziofff Jun 1, 2020
cce2d21
Merge branch 'master' into 173077316-async-eligibility-screen
Undermaken Jun 1, 2020
654a99d
[#173077316] minor changes
Undermaken Jun 1, 2020
8e115c7
[#173077316] restore image as const outside component
Undermaken Jun 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1247,18 +1247,23 @@ bonus:
loading: Checking bonus eligibility
cta:
requestBonus: Request
iseeNotAvailable:
title: ISEE not available
subtitle: ISEE not found for the user
text: !include bonus/bonusVacanze/iseeNotAvailable.md
goToINPSWebsite: Go to INPS Website
iseeNotEligible:
title: ISEE not eligible
subtitle: The ISEE submitted does not meet the requirements
text: !include bonus/bonusVacanze/iseeNotEligible.md
activateBonus:
title: Activate
description: You can activate a {{amount}} bonus. Your tax discount is equal to {{taxBenefit}}
eligibility:
loading: Checking bonus eligibility
iseeNotAvailable:
title: ISEE not available
subtitle: ISEE not found for the user
text: !include bonus/bonusVacanze/iseeNotAvailable.md
goToINPSWebsite: Go to INPS Website
iseeNotEligible:
title: ISEE not eligible
subtitle: The ISEE submitted does not meet the requirements
text: !include bonus/bonusVacanze/iseeNotEligible.md
activateBonus:
title: Activate
description: You can activate a {{amount}} bonus. Your tax discount is equal to {{taxBenefit}}
timeout:
title: Eligibility request received
description: Verification of eligibility for bonus access has been recorded. You will receive a message when the outcome of your request will be available.
bonusList:
title: Available bonuses
contentTitle: Select one of the available bonus
Expand Down
29 changes: 17 additions & 12 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1280,18 +1280,23 @@ bonus:
loading: Verifico l'idoneità per l'accesso al bonus
cta:
requestBonus: Richiedi
iseeNotAvailable:
title: ISEE not trovato
subtitle: Non è disponibile nessun ISEE per l'utente
text: !include bonus/bonusVacanze/iseeNotAvailable.md
goToINPSWebsite: Vai al sito INPS
iseeNotEligible:
title: ISEE not idoneo
subtitle: L'ISEE presentato non soddisfa i requisiti per il bonus vacanze
text: !include bonus/bonusVacanze/iseeNotEligible.md
activateBonus:
title: Attiva
description: Puoi attivare un bonus di {{amount}}. Il tuo sconto sulle tasse è pari a {{taxBenefit}}
eligibility:
loading: Verifico l'idoneità per l'accesso al bonus
iseeNotAvailable:
title: ISEE non trovato
subtitle: Non è disponibile nessun ISEE per l'utente
text: !include bonus/bonusVacanze/iseeNotAvailable.md
goToINPSWebsite: Vai al sito INPS
iseeNotEligible:
title: ISEE non idoneo
subtitle: L'ISEE presentato non soddisfa i requisiti per il bonus vacanze
text: !include bonus/bonusVacanze/iseeNotEligible.md
activateBonus:
title: Attiva
description: Puoi attivare un bonus di {{amount}}. Il tuo sconto sulle tasse è pari a {{taxBenefit}}
timeout:
title: Verifica richiesta
description: La verifica dell'idoneità per l'accesso al bonus è stata registrata. Riceverai un messaggio quando l'esito della tua richiesta sarà disponibile.
bonusList:
title: Bonus disponibili
contentTitle: Seleziona uno dei bonus disponibili
Expand Down
49 changes: 49 additions & 0 deletions ts/features/bonusVacanze/components/InfoScreenComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Text, View } from "native-base";
import * as React from "react";
import { Image, ImageSourcePropType, StyleSheet } from "react-native";
import BaseScreenComponent from "../../../components/screens/BaseScreenComponent";
import FooterWithButtons from "../../../components/ui/FooterWithButtons";
import themeVariables from "../../../theme/variables";
import { confirmButtonProps } from "./markdown/ButtonConfigurations";

/**
* TODO Rename the title prop in the BaseScreenComponent to navigationTitle
* https://www.pivotaltracker.com/story/show/173056117
*/
type Props = {
navigationTitle: string;
image?: ImageSourcePropType;
body: string;
confirmText?: string;
onConfirm: () => void;
};

const styles = StyleSheet.create({
body: {
padding: themeVariables.contentPadding,
flex: 1,
alignItems: "center"
}
});

/**
* A base screen that displays one image, text, and one bottom button
* @param props
* @constructor
*/
export const InfoScreenComponent: React.FunctionComponent<Props> = props => {
return (
<BaseScreenComponent goBack={true} headerTitle={props.navigationTitle}>
<View style={styles.body}>
<View spacer={true} extralarge={true} />
{props.image && <Image source={props.image} resizeMode="contain" />}
<View spacer={true} extralarge={true} />
<Text>{props.body}</Text>
</View>
<FooterWithButtons
type={"SingleButton"}
leftButton={confirmButtonProps(props.onConfirm, props.confirmText)}
/>
</BaseScreenComponent>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from "react";
import BaseScreenComponent from "../../../../components/screens/BaseScreenComponent";
import ScreenContent from "../../../../components/screens/ScreenContent";
import {
LoadingErrorComponent,
LoadingErrorProps
Expand All @@ -19,9 +18,7 @@ type Props = OwnProps & LoadingErrorProps;
export const BaseLoadingErrorScreen: React.FunctionComponent<Props> = props => {
return (
<BaseScreenComponent goBack={true} headerTitle={props.navigationTitle}>
<ScreenContent bounces={false}>
<LoadingErrorComponent {...props} />
</ScreenContent>
<LoadingErrorComponent {...props} />
</BaseScreenComponent>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { View } from "native-base";
import * as React from "react";
import { StyleSheet } from "react-native";
import { withLoadingSpinner } from "../../../../components/helpers/withLoadingSpinner";
import GenericErrorComponent from "../../../../components/screens/GenericErrorComponent";

Expand All @@ -12,6 +13,12 @@ export type LoadingErrorProps = {
onCancel?: () => void;
};

const styles = StyleSheet.create({
body: {
flex: 1
}
});

/**
* This component is a generic error component composed with a loading.
* In this way it is testable regardless of how it will be connected to the application flow.
Expand All @@ -26,7 +33,7 @@ const InnerLoadingErrorComponent: React.FunctionComponent<
LoadingErrorProps
> = props => {
return (
<View>
<View style={styles.body}>
<GenericErrorComponent
onRetry={props.onRetry}
onCancel={props.onCancel}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { BlockButtonProps } from "../../../../components/ui/BlockButtons";
import I18n from "../../../../i18n";

export const cancelButtonProps = (
onPress: () => void,
title?: string
): BlockButtonProps => {
return {
bordered: true,
title: title ? title : I18n.t("global.buttons.cancel"),
onPress
};
};

export const confirmButtonProps = (
onPress: () => void,
title?: string
): BlockButtonProps => {
return {
primary: true,
title: title ? title : I18n.t("global.buttons.confirm"),
onPress
};
};
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import * as React from "react";
import { BlockButtonProps } from "../../../../components/ui/BlockButtons";
import FooterWithButtons from "../../../../components/ui/FooterWithButtons";
import I18n from "../../../../i18n";
import { cancelButtonProps } from "./ButtonConfigurations";

export type OnCancelProps = {
onCancel: () => void;
};

export const cancelButtonProps = (props: OnCancelProps): BlockButtonProps => {
return {
bordered: true,
title: I18n.t("global.buttons.cancel"),
onPress: props.onCancel
};
};

/**
* A preset for {@link MarkdownBaseView}
* A preset for {@link MarkdownBaseView} with a single cancel button
* @param props
*/
export const FooterSingleButton: React.FunctionComponent<
Expand All @@ -25,7 +16,7 @@ export const FooterSingleButton: React.FunctionComponent<
return (
<FooterWithButtons
type={"SingleButton"}
leftButton={cancelButtonProps(props)}
leftButton={cancelButtonProps(props.onCancel)}
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import * as React from "react";
import { BlockButtonProps } from "../../../../components/ui/BlockButtons";
import FooterWithButtons from "../../../../components/ui/FooterWithButtons";
import { cancelButtonProps, OnCancelProps } from "./FooterSingleButton";
import { cancelButtonProps, confirmButtonProps } from "./ButtonConfigurations";
import { OnCancelProps } from "./FooterSingleButton";

type OnRightProps = {
onRight: () => void;
title: string;
};

export const rightButtonProps = (props: OnRightProps): BlockButtonProps => {
return {
primary: true,
title: props.title,
onPress: props.onRight
};
};

type MyProps = OnCancelProps & OnRightProps;

/**
Expand All @@ -26,8 +18,8 @@ export const FooterTwoButtons: React.FunctionComponent<MyProps> = props => {
return (
<FooterWithButtons
type={"TwoButtonsInlineHalf"}
leftButton={cancelButtonProps(props)}
rightButton={rightButtonProps(props)}
leftButton={cancelButtonProps(props.onCancel)}
rightButton={confirmButtonProps(props.onRight, props.title)}
/>
);
};
7 changes: 6 additions & 1 deletion ts/features/bonusVacanze/navigation/action.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NavigationActions } from "react-navigation";
import BONUSVACANZE_ROUTES from "./routes";

export const navigateToBonusEligibilityCheck = () =>
export const navigateToBonusEligibilityLoading = () =>
NavigationActions.navigate({
routeName: BONUSVACANZE_ROUTES.ELIGIBILITY.CHECK
});
Expand All @@ -20,3 +20,8 @@ export const navigateToActivateBonus = () =>
NavigationActions.navigate({
routeName: BONUSVACANZE_ROUTES.ELIGIBILITY.ACTIVATE_BONUS
});

export const navigateToTimeoutEligibilityCheck = () =>
NavigationActions.navigate({
routeName: BONUSVACANZE_ROUTES.ELIGIBILITY.TIMEOUT
});
14 changes: 9 additions & 5 deletions ts/features/bonusVacanze/navigation/navigator.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { createStackNavigator } from "react-navigation";
import ActivateBonusScreen from "../screens/ActivateBonus/ActivateBonusScreen";
import CheckBonusEligibilityScreen from "../screens/CheckBonusEligibilityScreen";
import IseeNotAvailableScreen from "../screens/IseeNotAvailableScreen";
import IseeNotEligibleScreen from "../screens/IseeNotEligibleScreen";
import ActivateBonusScreen from "../screens/eligibility/ActivateBonus/ActivateBonusScreen";
import IseeNotAvailableScreen from "../screens/eligibility/IseeNotAvailableScreen";
import IseeNotEligibleScreen from "../screens/eligibility/IseeNotEligibleScreen";
import LoadBonusEligibilityScreen from "../screens/eligibility/LoadBonusEligibilityScreen";
import TimeoutEligibilityCheckInfoScreen from "../screens/eligibility/TimeoutEligibilityCheckInfoScreen";
import BONUSVACANZE_ROUTES from "./routes";

const BonusVacanzeNavigator = createStackNavigator(
{
[BONUSVACANZE_ROUTES.ELIGIBILITY.CHECK]: {
screen: CheckBonusEligibilityScreen
screen: LoadBonusEligibilityScreen
},
[BONUSVACANZE_ROUTES.ELIGIBILITY.ISEE_NOT_AVAILABLE]: {
screen: IseeNotAvailableScreen
Expand All @@ -18,6 +19,9 @@ const BonusVacanzeNavigator = createStackNavigator(
},
[BONUSVACANZE_ROUTES.ELIGIBILITY.ACTIVATE_BONUS]: {
screen: ActivateBonusScreen
},
[BONUSVACANZE_ROUTES.ELIGIBILITY.TIMEOUT]: {
screen: TimeoutEligibilityCheckInfoScreen
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { List, View } from "native-base";
import * as React from "react";
import { StyleSheet, Text } from "react-native";
import BaseScreenComponent from "../../../../components/screens/BaseScreenComponent";
import ListItemComponent from "../../../../components/screens/ListItemComponent";
import ScreenContent from "../../../../components/screens/ScreenContent";
import I18n from "../../../../i18n";
import themeVariables from "../../../../theme/variables";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { FooterTwoButtons } from "../../components/markdown/FooterTwoButtons";
import { FamilyMember } from "../../types/eligibility";
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent";
import ListItemComponent from "../../../../../components/screens/ListItemComponent";
import ScreenContent from "../../../../../components/screens/ScreenContent";
import I18n from "../../../../../i18n";
import themeVariables from "../../../../../theme/variables";
import { formatNumberCentsToAmount } from "../../../../../utils/stringBuilder";
import { FooterTwoButtons } from "../../../components/markdown/FooterTwoButtons";
import { FamilyMember } from "../../../types/eligibility";

type Props = {
familyMembers: ReadonlyArray<FamilyMember>;
Expand All @@ -28,9 +28,6 @@ const styles = StyleSheet.create({
}
});

const title = I18n.t("bonus.bonusVacanza.activateBonus.title");
const activateBonusText = title;

/**
* Transform an object of type {@link FamilyMember} to a string representation
* @param familyMember
Expand Down Expand Up @@ -68,10 +65,16 @@ const renderFamilyMembersList = (
* @constructor
*/
export const ActivateBonusComponent: React.FunctionComponent<Props> = props => {
const description = I18n.t("bonus.bonusVacanza.activateBonus.description", {
amount: formatNumberCentsToAmount(props.bonusAmount, true),
taxBenefit: formatNumberCentsToAmount(props.taxBenefit, true)
});
const title = I18n.t("bonus.bonusVacanza.eligibility.activateBonus.title");
const activateBonusText = title;

const description = I18n.t(
"bonus.bonusVacanza.eligibility.activateBonus.description",
{
amount: formatNumberCentsToAmount(props.bonusAmount, true),
taxBenefit: formatNumberCentsToAmount(props.taxBenefit, true)
}
);

return (
<BaseScreenComponent goBack={true} headerTitle={title}>
Expand Down
Loading