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

feat(Carta Giovani Nazionale): [#176456924,#176655324,#176655351,#176655437,#176655260,#176655162,#176456839] Adds UI on CGN activation workflow #2758

Merged
merged 135 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
1c8eb6a
[#176443044] Adds some skaffolding for CGN store, reducer and navigation
CrisTofani Jan 12, 2021
7141006
[#176443044] Minor fixes
CrisTofani Jan 12, 2021
dc9a92c
Update ts/features/bonus/cgn/screens/onboarding/CgnInformationScreen.tsx
CrisTofani Jan 12, 2021
4753823
Update ts/features/bonus/cgn/navigation/routes.ts
CrisTofani Jan 12, 2021
5b94b87
Update ts/features/bonus/cgn/navigation/actions.ts
CrisTofani Jan 13, 2021
a3b17b4
Update ts/features/bonus/cgn/navigation/actions.ts
CrisTofani Jan 14, 2021
13dbd74
Update ts/features/bonus/cgn/navigation/actions.ts
CrisTofani Jan 14, 2021
a7011c6
Update ts/features/bonus/cgn/navigation/actions.ts
CrisTofani Jan 14, 2021
f661e64
Merge branch 'master' into 176443044-store-directories-skeleton-cgn
CrisTofani Jan 14, 2021
e4cdac6
Merge branch 'master' into 176443044-store-directories-skeleton-cgn
fabriziofff Jan 14, 2021
492b356
Merge branch 'master' into 176443044-store-directories-skeleton-cgn
CrisTofani Jan 15, 2021
bc0e2f2
[#176443044] Adds a locale for activate CTA
CrisTofani Jan 15, 2021
d34f7be
[#176443163] New bonuses available visibility and start cgn flow logic
CrisTofani Jan 15, 2021
87cbffb
[#176443163] missing files
CrisTofani Jan 15, 2021
7170f23
[#176443163] Reverts package.json file
CrisTofani Jan 15, 2021
c3da6a8
Merge branch 'master' into 176443163-handle-cgn-bonus-information
CrisTofani Jan 15, 2021
4495850
[#176443163] Adds tests with mocked config file
CrisTofani Jan 18, 2021
6dbe941
Merge branch 'master' into 176443163-handle-cgn-bonus-information
CrisTofani Jan 19, 2021
92a3c0e
[#176443367] WIP on CGN Activation saga
CrisTofani Jan 18, 2021
9346ae9
[#176443367] removes unused action
CrisTofani Jan 18, 2021
b5e3371
[#176443367] fixes wrong renaming
CrisTofani Jan 19, 2021
2a4c768
[#176443367] WIP on base activation handler saga
CrisTofani Jan 20, 2021
5472593
[#176443367] fixes test execution
CrisTofani Jan 21, 2021
d00ed54
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Jan 21, 2021
590c5ec
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Jan 21, 2021
760af86
[#176443367] Activation saga structure
CrisTofani Jan 21, 2021
f696c42
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Jan 22, 2021
7116f2e
[#176443215] Request activation apis and completed saga
CrisTofani Jan 25, 2021
d3052b3
[#176443215] minor fixes
CrisTofani Jan 25, 2021
8b8ae17
[#176443367] Merge remote-tracking branch 'origin/master'
CrisTofani Jan 25, 2021
65cce81
[#176443367] fixes merge
CrisTofani Jan 25, 2021
26e22b5
[#176443367] Reverts bad refactoring of onboarding word
CrisTofani Jan 25, 2021
c84f774
[#176443367] Reverts bad refactoring of onboarding word
CrisTofani Jan 25, 2021
fe80d58
[#176443215] Merge branch '176443367-cgn-activation-saga-handler'
CrisTofani Jan 26, 2021
cf5b341
[#176443215] After merge fixes
CrisTofani Jan 26, 2021
6040d2b
[#176443215] Refactoring activation and orchestration saga
CrisTofani Jan 26, 2021
6e9eb2a
[#176456924] CgnLoadingActivation screen
CrisTofani Jan 26, 2021
dccf18c
[#176456924] loading Screen for CGN activation
CrisTofani Jan 26, 2021
43ac55a
[#176456924] Adds Ineligible Screen
CrisTofani Jan 27, 2021
4fe3416
[#176456924] Adds Timeout Screen
CrisTofani Jan 27, 2021
da387c5
Merge branch 'master' into 176443367-cgn-activation-saga-handler
debiff Jan 28, 2021
dcb6991
[#176456924] Adds CgnAlreadyActiveScreen
CrisTofani Jan 28, 2021
a9722c5
[#176456924] adds ActivationCompleted and ActivationPending screens
CrisTofani Jan 28, 2021
4e5340d
[#176456924] fixes on success screen
CrisTofani Jan 28, 2021
009ca3f
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Jan 28, 2021
177883b
[#176456924] Fixes error screen
CrisTofani Jan 28, 2021
dd4e38a
[#176456924] merges
CrisTofani Jan 28, 2021
a8aa378
[#176456924] Fixes navigation history issue
CrisTofani Jan 28, 2021
10c4e70
[#176443367] Removes unused saga file
CrisTofani Jan 29, 2021
051e34a
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Jan 29, 2021
17c5495
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Jan 29, 2021
6401bcc
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Jan 29, 2021
98e4a19
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Jan 29, 2021
fe212b6
[#176456924] merge from remote 176443215-request-cgn-activation
CrisTofani Jan 29, 2021
fdecc5e
[#176443215] adds some tests on handleActivationSaga
CrisTofani Jan 29, 2021
50a4cf4
[#176443215] fixes tests
CrisTofani Jan 29, 2021
aafb1c5
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Jan 29, 2021
d5f1172
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Jan 29, 2021
eb632cf
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 1, 2021
fcfbc45
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 1, 2021
078aed6
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Feb 1, 2021
ec9c392
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 2, 2021
f033af9
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Feb 2, 2021
fe0305e
[#176456924] Fixes component name
CrisTofani Feb 2, 2021
f1e047a
[#176456924] Fixes component comment
CrisTofani Feb 2, 2021
8014a88
[#176443367] Fixes reducer comments
CrisTofani Feb 2, 2021
4fd22ed
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 2, 2021
b76d24b
[#176715047] Implements CGN get information saga, action and reducer
CrisTofani Feb 2, 2021
c4e1322
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 3, 2021
b85a857
Merge branch 'master' into 176443367-cgn-activation-saga-handler
CrisTofani Feb 3, 2021
a7ca822
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 3, 2021
07cf235
Merge branch 'master' into 176443367-cgn-activation-saga-handler
debiff Feb 5, 2021
b507d38
[#176443367] Merge branch 'master' into 176443367-cgn-activation-saga…
debiff Feb 5, 2021
33fb493
[#176443215] Merge branch '176443367-cgn-activation-saga-handler' int…
debiff Feb 5, 2021
67ebeef
[#176456924] Merge from origin/176443215-request-cgn-activation
CrisTofani Feb 5, 2021
6ad399e
[#176456924] fixes tests
CrisTofani Feb 5, 2021
ac75d37
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 5, 2021
510cf45
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 5, 2021
bc1881b
[#176715047] Merge from origin/176443215-request-cgn-activation
CrisTofani Feb 5, 2021
0ab4df7
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 5, 2021
8046fe3
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 5, 2021
bc02912
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 5, 2021
a8a9e5d
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 8, 2021
282f0d7
[#176715047] Adds isCgnActive selector on Card Carousel
CrisTofani Feb 8, 2021
7c5edb6
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 8, 2021
d92c6f7
Merge branch 'master' into 176443215-request-cgn-activation
Undermaken Feb 8, 2021
407a33e
[#176443367] Merge branch 'master' of github.com:pagopa/io-app into 1…
Undermaken Feb 8, 2021
939b34f
[#176443215] Merge branch '176443367-cgn-activation-saga-handler' of …
Undermaken Feb 8, 2021
b7bfd00
Update package.json
CrisTofani Feb 8, 2021
1497741
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 8, 2021
6aca29b
Update ts/features/bonus/cgn/store/actions/activation.ts
CrisTofani Feb 8, 2021
ac8cb5a
Update ts/features/bonus/cgn/store/reducers/activation.ts
CrisTofani Feb 8, 2021
0b16a22
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 8, 2021
861e2a2
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 9, 2021
319641f
[#176443215] Adds comments on activations handlers
CrisTofani Feb 9, 2021
a98ce30
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 9, 2021
ffcb365
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 9, 2021
3d34b5a
[#176443215] Introduces the workunit for cgn activation flow
CrisTofani Feb 9, 2021
47e7f84
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 9, 2021
ee5aeba
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 9, 2021
f9f7043
Merge branch 'master' into 176443215-request-cgn-activation
CrisTofani Feb 9, 2021
b0d8450
[#176715047] fixes package.json
CrisTofani Feb 9, 2021
c5febd9
[#176443215] typo on api url
CrisTofani Feb 9, 2021
80dcf73
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 9, 2021
b20a89f
[#176443215] add getError to ensure the Error type
Undermaken Feb 9, 2021
c698518
[#176443215] Adds mixpanel track in case of error
CrisTofani Feb 9, 2021
a45d868
[#176443215] Merge from master
CrisTofani Feb 10, 2021
869805a
[#176715047] Merge from 176443215-request-cgn-activation
CrisTofani Feb 10, 2021
a2419cc
[#176456924] Merge from 176443215-request-cgn-activation
CrisTofani Feb 10, 2021
73264b5
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 11, 2021
c63b40a
[#176443215] Merge branch 'master' of github.com:pagopa/io-app into 1…
Undermaken Feb 11, 2021
0d06f61
[#176715047] Merge branch '176443215-request-cgn-activation' of githu…
Undermaken Feb 11, 2021
5c77855
[#176715047] Removes check on CGN detail type
CrisTofani Feb 11, 2021
55c4b8c
[#176715047] isCgnActive selector to return true if detail is some
CrisTofani Feb 11, 2021
b5948d0
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 11, 2021
344849a
[#176715047] Fixes bonus loading state
CrisTofani Feb 11, 2021
c209428
[#176715047] Adds NetworkError on cgn saga and action
CrisTofani Feb 11, 2021
402ec93
[#176715047] fixes
CrisTofani Feb 11, 2021
a9ed676
[#176715047] type fixing
CrisTofani Feb 11, 2021
4f50a28
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 12, 2021
d66688e
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 12, 2021
51c43f3
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 12, 2021
666c352
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 12, 2021
3bbf97b
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 15, 2021
60dc2fe
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 16, 2021
c1acd44
Merge branch 'master' into 176715047-request-cgn-status
CrisTofani Feb 16, 2021
8c9c0cf
[#176715047] Fixes CGN Specs fron backend
CrisTofani Feb 16, 2021
5e29333
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 16, 2021
c6636aa
[#176456924] Merge from 176715047-request-cgn-status
CrisTofani Feb 16, 2021
feac6c6
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 16, 2021
46d26ef
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 18, 2021
bad92a2
Merge branch 'master' into 176456924-activation-loading-screen
CrisTofani Feb 18, 2021
1b4e36b
Merge branch 'master' into 176456924-activation-loading-screen
fabriziofff Feb 23, 2021
4a99184
Merge branch 'master' into 176456924-activation-loading-screen
fabriziofff Feb 23, 2021
ff0cff3
[#176456924] Fixes the retry loading feature
CrisTofani Feb 24, 2021
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
23 changes: 23 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2158,8 +2158,31 @@ bonus:
closed: "Ranking for this period is closed."
lastUpdate: Updated at {{hour}} on {{date}}
cgn:
activation:
loading:
caption: "We're activating your Carta Giovani Nazionale"
subCaption: "Please wait."
error:
title: "The Carta Giovani Nazionale service is not available at the moment."
body: "We apologize for the issue.\nWe invite you to retry again later."
ineligible:
title: "We are sorry. You do not have the required characteristics to activate the Carta Giovani Nazionali."
body: "The Carta Giovani Nazionali is available only to Italian and European citizens residing in Italy, aged 18 to 35."
timeout:
title: "We're processing your request."
body: "We will send you an in-app message when your Carta Giovani will be activated."
alreadyActive:
title: "Your Carta Giovani Nazionale is already active!"
body: "You can find more details inside the Wallet section."
pending:
title: "Your Carta Giovani Nazionale's activation is in progress."
body: "You will receive a message when it has been activated."
success:
title: "Congratulation!"
body: "Your Carta Giovani Nazionale is active"
cta:
activeBonus: Activate your Carta Giovani
goToDetail: View your Carta Giovani
webView:
error:
missingParams: Not all information necessary to access this page are available
Expand Down
23 changes: 23 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2188,8 +2188,31 @@ bonus:
closed: "La classifica per questo periodo è chiusa."
lastUpdate: Aggiornato alle {{hour}} del {{date}}
cgn:
activation:
loading:
caption: "Stiamo attivando la tua Carta Giovani Nazionale"
subCaption: "Ti preghiamo di attendere."
error:
title: "Il servizio Carta Giovani Nazionale in questo momento non è disponibile."
body: "Ci scusiamo per il disagio.\nTi invitiamo a riprovare più tardi."
ineligible:
title: "Siamo spiacenti. Non hai le caratteristiche per attivare la Carta Giovani Nazionale."
body: "La Carta Giovani Nazionali è disponibile solo per i cittadini italiani ed europei residenti in Italia, dai 18 ai 35 anni di età."
timeout:
title: "Stiamo processando la tua richiesta."
body: "Ti invieremo un messaggio in app quando la tua Carta Giovani sarà attiva."
alreadyActive:
title: "La tua Carta Giovani Nazionale è già attiva!"
body: "Puoi visualizzarne i dettagli nella sezione Portafoglio."
pending:
title: "La tua Carta Giovani Nazionale è in fase di attivazione."
body: "Riceverai un messaggio quando sarà attivata."
success:
title: "Congratulazioni!"
body: "La tua Carta Giovani Nazionale è attiva"
cta:
activeBonus: Attiva la tua Carta Giovani
goToDetail: Visualizza la Carta Giovani
webView:
error:
missingParams: Non sono presenti le informazioni necessarie per accedere a questa pagina
Expand Down
2 changes: 0 additions & 2 deletions ts/components/screens/GenericErrorComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export default class GenericErrorComponent extends React.PureComponent<Props> {
? this.props.text
: I18n.t("wallet.errors.GENERIC_ERROR")}
</Text>
<View spacer={true} extralarge={true} />
<View spacer={true} extralarge={true} />

<Text alignCenter={true} accessible={subTextAccessible}>
{this.props.subText !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { bonusVacanzeStyle } from "../Styles";
export type LoadingErrorProps = WithTestID<{
isLoading: boolean;
loadingCaption: string;
loadingSubtitle?: string;
errorText?: string;
errorSubText?: string;
onRetry: () => void;
Expand All @@ -32,7 +33,7 @@ const renderError = (props: LoadingErrorProps) => (
/>
);

const renderLoading = (loadingCaption: string) => (
const renderLoading = (loadingCaption: string, loadingSubtitle?: string) => (
<View
accessible={true}
ref={loadingRef}
Expand All @@ -49,6 +50,7 @@ const renderLoading = (loadingCaption: string) => (
/>
}
title={loadingCaption}
body={loadingSubtitle}
/>
</View>
);
Expand All @@ -73,7 +75,7 @@ export const LoadingErrorComponent: React.FunctionComponent<LoadingErrorProps> =
return (
<SafeAreaView style={bonusVacanzeStyle.flex} testID={props.testID}>
{props.isLoading
? renderLoading(props.loadingCaption)
? renderLoading(props.loadingCaption, props.loadingSubtitle)
: renderError(props)}
</SafeAreaView>
);
Expand Down
5 changes: 5 additions & 0 deletions ts/features/bonus/cgn/navigation/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export const navigateToCgnActivationLoading = () =>
routeName: CGN_ROUTES.ACTIVATION.LOADING
});

export const navigateToCgnAlreadyActive = () =>
NavigationActions.navigate({
routeName: CGN_ROUTES.ACTIVATION.EXISTS
});

export const navigateToCgnActivationPending = () =>
NavigationActions.navigate({
routeName: CGN_ROUTES.ACTIVATION.PENDING
Expand Down
8 changes: 8 additions & 0 deletions ts/features/bonus/cgn/navigation/navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import CgnActivationPendingScreen from "../screens/activation/CgnActivationPendi
import CgnActivationTimeoutScreen from "../screens/activation/CgnActivationTimeoutScreen";
import CgnActivationCompletedScreen from "../screens/activation/CgnActivationCompletedScreen";
import CgnActivationIneligibleScreen from "../screens/activation/CgnActivationIneligibleScreen";
import CgnAlreadyActiveScreen from "../screens/activation/CgnAlreadyActiveScreen";
import CgnDetailScreen from "../screens/CgnDetailScreen";
import CGN_ROUTES from "./routes";

const CgnNavigator = createStackNavigator(
Expand All @@ -18,6 +20,9 @@ const CgnNavigator = createStackNavigator(
[CGN_ROUTES.ACTIVATION.PENDING]: {
screen: CgnActivationPendingScreen
},
[CGN_ROUTES.ACTIVATION.EXISTS]: {
screen: CgnAlreadyActiveScreen
},
[CGN_ROUTES.ACTIVATION.TIMEOUT]: {
screen: CgnActivationTimeoutScreen
},
Expand All @@ -26,6 +31,9 @@ const CgnNavigator = createStackNavigator(
},
[CGN_ROUTES.ACTIVATION.COMPLETED]: {
screen: CgnActivationCompletedScreen
},
[CGN_ROUTES.DETAILS]: {
screen: CgnDetailScreen
}
},
{
Expand Down
1 change: 1 addition & 0 deletions ts/features/bonus/cgn/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const CGN_ROUTES = {
LOAD_CHECK_ACTIVATION_STATUS: "CGN_LOAD_CHECK_ACTIVATION_STATUS",
INFORMATION_TOS: "CGN_INFORMATION_TOS",
LOADING: "CGN_ACTIVATION_LOADING",
EXISTS: "CGN_ACTIVATION_EXISTS",
TIMEOUT: "CGN_ACTIVATION_TIMEOUT",
INELIGIBLE: "CGN_ACTIVATION_INELIGIBLE",
PENDING: "CGN_ACTIVATION_PENDING",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
navigateToCgnActivationTimeout
} from "../../../../navigation/actions";
import { navigationHistoryPop } from "../../../../../../../store/actions/navigationHistory";
import {
cgnActivationComplete,
cgnActivationStatus
} from "../../../../store/actions/activation";
import { cgnActivationStatus } from "../../../../store/actions/activation";
import { CgnActivationProgressEnum } from "../../../../store/reducers/activation";
import CGN_ROUTES from "../../../../navigation/routes";

Expand Down Expand Up @@ -41,9 +38,7 @@ describe("cgnActivationWorker", () => {
.next()
.put(navigateToCgnActivationCompleted())
.next()
.put(navigationHistoryPop(1))
.next()
.take(cgnActivationComplete);
.put(navigationHistoryPop(1));
});

it("should activate user's CGN already on loading screen ", () => {
Expand All @@ -61,9 +56,7 @@ describe("cgnActivationWorker", () => {
.next()
.put(navigateToCgnActivationCompleted())
.next()
.put(navigationHistoryPop(1))
.next()
.take(cgnActivationComplete);
.put(navigationHistoryPop(1));
});

it("should navigate to TIMEOUT SCREEN on user's CGN activation", () => {
Expand All @@ -85,8 +78,6 @@ describe("cgnActivationWorker", () => {
.next()
.put(navigateToCgnActivationTimeout())
.next()
.put(navigationHistoryPop(1))
.next()
.take(cgnActivationComplete);
.put(navigationHistoryPop(1));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { fromNullable } from "fp-ts/lib/Option";
import { navigationHistoryPop } from "../../../../../../store/actions/navigationHistory";
import {
cgnActivationCancel,
cgnActivationComplete,
cgnActivationStatus
} from "../../../store/actions/activation";
import {
navigateToCgnActivationCompleted,
navigateToCgnActivationIneligible,
navigateToCgnActivationLoading,
navigateToCgnActivationPending,
navigateToCgnActivationTimeout
navigateToCgnActivationTimeout,
navigateToCgnAlreadyActive
} from "../../../navigation/actions";
import { CgnActivationProgressEnum } from "../../../store/reducers/activation";
import CGN_ROUTES from "../../../navigation/routes";
Expand All @@ -29,7 +29,7 @@ const mapEnumToNavigation = new Map<
[CgnActivationProgressEnum.PENDING, navigateToCgnActivationPending],
[CgnActivationProgressEnum.TIMEOUT, navigateToCgnActivationTimeout],
[CgnActivationProgressEnum.INELIGIBLE, navigateToCgnActivationIneligible],
[CgnActivationProgressEnum.EXISTS, navigateToCgnActivationCompleted]
[CgnActivationProgressEnum.EXISTS, navigateToCgnAlreadyActive]
]);

type CgnActivationType = ReturnType<typeof cgnActivationSaga>;
Expand Down Expand Up @@ -68,8 +68,6 @@ export function* cgnActivationWorker(cgnActivationSaga: CgnActivationType) {
yield put(nextNavigationStep());
yield put(navigationHistoryPop(1));
}

yield take(cgnActivationComplete);
}

/**
Expand Down
28 changes: 28 additions & 0 deletions ts/features/bonus/cgn/screens/CgnDetailScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from "react";
import { connect } from "react-redux";
import { View } from "native-base";
import { GlobalState } from "../../../../store/reducers/types";
import { Dispatch } from "../../../../store/actions/types";
import { H1 } from "../../../../components/core/typography/H1";
import BaseScreenComponent from "../../../../components/screens/BaseScreenComponent";

type Props = ReturnType<typeof mapStateToProps> &
ReturnType<typeof mapDispatchToProps>;

/**
* Screen to display all the information about the active CGN
*/
const CgnDetailScreen = (_: Props): React.ReactElement => (
// TODO PLACEHOLDER for CGN detail screen
<BaseScreenComponent>
<View>
<H1>{"CGN DETAIL"}</H1>
</View>
</BaseScreenComponent>
);

const mapStateToProps = (_: GlobalState) => ({});

const mapDispatchToProps = (_: Dispatch) => ({});

export default connect(mapStateToProps, mapDispatchToProps)(CgnDetailScreen);
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
import * as React from "react";
import { connect } from "react-redux";
import { View } from "native-base";
import { SafeAreaView } from "react-native";
import { GlobalState } from "../../../../../store/reducers/types";
import { Dispatch } from "../../../../../store/actions/types";
import { H1 } from "../../../../../components/core/typography/H1";
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent";
import { InfoScreenComponent } from "../../../../../components/infoScreen/InfoScreenComponent";
import { FooterStackButton } from "../../../bonusVacanze/components/buttons/FooterStackButtons";
import { confirmButtonProps } from "../../../bonusVacanze/components/buttons/ButtonConfigurations";
import { IOStyles } from "../../../../../components/core/variables/IOStyles";
import IconFont from "../../../../../components/ui/IconFont";
import { cgnActivationComplete } from "../../store/actions/activation";
import { navigateToCgnDetails } from "../../navigation/actions";
import I18n from "../../../../../i18n";
import { IOColors } from "../../../../../components/core/variables/IOColors";

type Props = ReturnType<typeof mapStateToProps> &
ReturnType<typeof mapDispatchToProps>;

/**
* Screen which is displayed when a user requested a CGN activation
* and it took too long to get an answer from the server
* (the user will be notified when the activation is completed by a message)
* and it has been correctly activated
*/
const CgnActivationCompletedScreen = (_: Props): React.ReactElement => (
// PLACEHOLDER for activation completed screen
<BaseScreenComponent>
<View>
<H1>{"Congrats, activation completed"}</H1>
</View>
</BaseScreenComponent>
const CgnActivationCompletedScreen = (props: Props): React.ReactElement => (
<SafeAreaView style={IOStyles.flex}>
<InfoScreenComponent
image={<IconFont name={"io-complete"} size={104} color={IOColors.aqua} />}
title={I18n.t("bonus.cgn.activation.success.title")}
body={I18n.t("bonus.cgn.activation.success.body")}
/>
<FooterStackButton
buttons={[
confirmButtonProps(props.onConfirm, I18n.t("bonus.cgn.cta.goToDetail"))
]}
/>
</SafeAreaView>
);

const mapStateToProps = (_: GlobalState) => ({});

const mapDispatchToProps = (_: Dispatch) => ({});
const mapDispatchToProps = (dispatch: Dispatch) => ({
onConfirm: () => {
dispatch(cgnActivationComplete());
dispatch(navigateToCgnDetails());
}
});

export default connect(
mapStateToProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import * as React from "react";
import { connect } from "react-redux";
import { View } from "native-base";
import { SafeAreaView } from "react-native";
import { GlobalState } from "../../../../../store/reducers/types";
import { Dispatch } from "../../../../../store/actions/types";
import { H1 } from "../../../../../components/core/typography/H1";
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent";
import { InfoScreenComponent } from "../../../../../components/infoScreen/InfoScreenComponent";
import { renderInfoRasterImage } from "../../../../../components/infoScreen/imageRendering";
import FooterWithButtons from "../../../../../components/ui/FooterWithButtons";
import { cancelButtonProps } from "../../../bonusVacanze/components/buttons/ButtonConfigurations";
import { IOStyles } from "../../../../../components/core/variables/IOStyles";
import { cgnActivationCancel } from "../../store/actions/activation";
import image from "../../../../../../img/servicesStatus/error-detail-icon.png";
import I18n from "../../../../../i18n";

type Props = ReturnType<typeof mapStateToProps> &
ReturnType<typeof mapDispatchToProps>;
Expand All @@ -13,18 +19,28 @@ type Props = ReturnType<typeof mapStateToProps> &
* Screen which is displayed when a user requested a CGN activation
* but is not eligible for its activation
*/
const CgnActivationIneligibleScreen = (_: Props): React.ReactElement => (
// PLACEHOLDER for request INELIGIBLE screen
<BaseScreenComponent>
<View>
<H1>{"You're not eligible to CGN activation"}</H1>
</View>
</BaseScreenComponent>
const CgnActivationIneligibleScreen = (props: Props): React.ReactElement => (
<SafeAreaView style={IOStyles.flex}>
<InfoScreenComponent
image={renderInfoRasterImage(image)}
title={I18n.t("bonus.cgn.activation.ineligible.title")}
body={I18n.t("bonus.cgn.activation.ineligible.body")}
/>
<FooterWithButtons
type="SingleButton"
leftButton={cancelButtonProps(
props.onCancel,
I18n.t("global.buttons.exit")
)}
/>
</SafeAreaView>
);

const mapStateToProps = (_: GlobalState) => ({});

const mapDispatchToProps = (_: Dispatch) => ({});
const mapDispatchToProps = (dispatch: Dispatch) => ({
onCancel: () => dispatch(cgnActivationCancel())
});

export default connect(
mapStateToProps,
Expand Down
Loading