Skip to content

Commit

Permalink
feat(IT Wallet): [SIW-1744] Add ITW feedback banner (#6378)
Browse files Browse the repository at this point in the history
## Short description
This PR the IT Wallet feedback request banner, displayed after a
successful credential issuance.
This PR also introduces minor adjustments and refactoring to the
`WalletCardContainer`.

## List of changes proposed in this pull request
- Added ItwFeedbackBanner component
- Added `itWallet/preferences` reducer to store the feedback visibility
preferences
- Added `itwCloseFeedbackBanner` action
- Added `itwShouldRenderFeedbackBannerSelector` selector
- Added `itwIsFeedbackBannerHiddenSelector` selector
- Added migration to the root persistor to accomodate the new persisted
reducer
- Added `bottomElement` prop to `WalletCardsCategoryContainer`, which
allows to render an element below the main component
- Adjusted margins for `ItwEidLifecycleAlert`,
`ItwUpcomingWalletBanner`, `ItwDiscoveryBannerStandalone`,
`WalletCardsCategoryRetryErrorBanner` components
- Adjusted margins for wallet card container (slightly less that the
rest of the elements on the screen, according to the Figma)

## How to test
Check that all the banners are correctly displayed:
- **Wallet not yet activated, subscribed to the trial**: you should see
the "upcoming IT Wallet" banner
- **Wallet not yet activated, trial active**: you should see the
discovery banner on top of the wallet cards
- **Wallet active, but with invalid status**: you should be able to see
the lifecycle alert status
- **Wallet active, at least one credential obtained**: you should be
able to see the feedback request banner below your credentials. Click on
the **x** in the banner, check that the banner is correctly hidden and
the preference is persisted across app launches

## Preview

<img
src="https://github.com/user-attachments/assets/426afe52-548f-4c29-aa89-3c618b0e3f9a"
width="200" />
  • Loading branch information
mastro993 authored Nov 14, 2024
1 parent 62db5f6 commit 07ba58d
Show file tree
Hide file tree
Showing 27 changed files with 2,053 additions and 476 deletions.
11 changes: 8 additions & 3 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3238,12 +3238,12 @@ features:
error: Unable to retrieve the receipt.
download: Get receipt
hideFromList: Hide from list
delete:
delete:
successful: The receipt has been hidden
failed: An error occurred, please try again
hideBanner:
hideBanner:
title: "Do you want to hide this receipt from your list?"
content: "This action is irreversible. The receipt will no longer be shown in your list of receipts."
content: "This action is irreversible. The receipt will no longer be shown in your list of receipts."
accept: "Yes, hide"
details:
totalFeeUnknown: "Il totale non include i costi di commissione: puoi trovarli nel documento che hai ricevuto da {{pspName}}"
Expand Down Expand Up @@ -3556,6 +3556,11 @@ features:
failureScreen:
title: Si è verificato un errore imprevisto
subtitle: Non è stato possibile disattivare il servizio. Riprova.
feedback:
banner:
title: Dicci cosa ne pensi
content: Raccontaci la tua esperienza con la funzionalità Documenti su IO.
action: Inizia
support:
ticketList:
noTicket:
Expand Down
9 changes: 7 additions & 2 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3239,10 +3239,10 @@ features:
error: Non è stato possibile recuperare la ricevuta.
download: Ottieni ricevuta
hideFromList: Nascondi dalla lista
delete:
delete:
successful: La ricevuta è stata nascosta
failed: C’è stato un errore, riprova
hideBanner:
hideBanner:
title: "Vuoi nascondere questa ricevuta dalla tua lista?"
content: "L’operazione è irreversibile. La ricevuta non verrà più mostrata nell’elenco delle tue ricevute."
accept: "Sì, nascondi"
Expand Down Expand Up @@ -3557,6 +3557,11 @@ features:
failureScreen:
title: Si è verificato un errore imprevisto
subtitle: Non è stato possibile disattivare il servizio. Riprova.
feedback:
banner:
title: Dicci cosa ne pensi
content: Raccontaci la tua esperienza con la funzionalità Documenti su IO.
action: Inizia
support:
ticketList:
noTicket:
Expand Down
1 change: 0 additions & 1 deletion ts/boot/__tests__/persistedStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe("Check the addition for new fields to the persisted store. If one of th
it("Freeze 'wallet.wallets.walletById' state", () => {
expect(globalState.wallet.wallets.walletById).toMatchSnapshot();
});

it("Freeze 'installation.appVersionHistory' state", () => {
expect(globalState.installation.appVersionHistory).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,329 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`featuresPersistor should match snapshot 1`] = `"{"euCovidCert":{"byAuthCode":{}},"pn":{"activation":{"kind":"PotNone"}},"fci":{"signatureRequest":{"kind":"PotNone"},"qtspClauses":{"kind":"PotNone"},"qstpFilledDocument":{"kind":"PotNone"},"signature":{"kind":"PotNone"},"documentSignatures":{"documents":[]},"signatureFieldDrawing":{"kind":"PotNone"},"documentPreview":{"kind":"PotNone"},"pollFilledDocument":{"kind":"PotSome","value":{"isReady":false}},"metadata":{"kind":"PotNone"},"signaturesList":{"kind":"PotNone"},"environment":{"_tag":"None"}},"idPay":{"wallet":{"initiatives":{"kind":"PotNone"},"initiativesWithInstrument":{"kind":"PotNone"},"initiativesAwaitingStatusUpdate":{}},"initiative":{"details":{"kind":"PotNone"},"beneficiaryDetails":{"kind":"PotNone"},"onboardingStatus":{"kind":"PotNone"},"timeline":{"kind":"PotNone"}},"timeline":{"details":{"kind":"PotNone"}},"code":{"isOnboarded":{"kind":"PotNone"},"code":{"kind":"PotNone"},"enrollmentRequest":{"kind":"PotNone"},"isIdPayInitiativeBannerClosed":{}},"configuration":{"instruments":{"kind":"PotNone"},"instrumentStatus":{}},"barcode":{},"unsubscription":{"kind":"PotNone"}},"payments":{"onboarding":{"result":{"kind":"PotNone"},"paymentMethods":{"kind":"PotNoneLoading"}},"details":{"walletDetails":{"kind":"PotNoneLoading"},"isWalletPayPalBannerClosed":false},"checkout":{"currentStep":0,"paymentDetails":{"kind":"PotNone"},"userWallets":{"kind":"PotNone"},"recentUsedPaymentMethod":{"kind":"PotNone"},"allPaymentMethods":{"kind":"PotNone"},"pspList":{"kind":"PotNone"},"selectedWallet":{"_tag":"None"},"selectedPaymentMethod":{"_tag":"None"},"selectedPsp":{"_tag":"None"},"transaction":{"kind":"PotNone"},"authorizationUrl":{"kind":"PotNone"}},"transaction":{"details":{"kind":"PotNoneLoading"}},"history":{"archive":[],"receiptsOpened":{}},"home":{"shouldShowAddMethodsBanner":true},"wallet":{"userMethods":{"kind":"PotNone"}},"bizEventsTransaction":{"transactions":{"kind":"PotNoneLoading"},"latestTransactions":{"kind":"PotNone"},"details":{"kind":"PotNoneLoading"},"receiptDocument":{"kind":"PotNone"},"cancelTransactionRecord":{"kind":"PotNone"}},"pagoPaPlatform":{"sessionToken":{"kind":"PotNone"},"pendingActions":[]},"paymentsBackoffRetry":{}},"services":{"details":{"byId":{},"servicePreference":{"kind":"PotNone"}},"home":{"featuredInstitutions":{"kind":"PotNone"},"featuredServices":{"kind":"PotNone"},"paginatedInstitutions":{"kind":"PotNone"}},"institution":{"paginatedServices":{"kind":"PotNone"}},"search":{"paginatedInstitutions":{"kind":"PotNone"}}},"whatsNew":{},"loginFeatures":{"testLogin":{"kind":"idle"},"nativeLogin":{"enabled":true},"fastLogin":{"optIn":{},"automaticSessionRefresh":{"areAlreadyTwoMinAfterLastActivity":false},"tokenRefreshHandler":{"userInteractionForSessionExpiredNeeded":false,"tokenRefresh":{"kind":"idle"},"pendingActions":[]},"securityAdviceAcknowledged":{"acknowledged":false,"readyToShow":false}},"cieLogin":{"useUat":false,"isCieIDFeatureEnabled":false},"loginInfo":{"userFromSuccessLogin":false}},"wallet":{"cards":{},"preferences":{},"placeholders":{"items":{},"isLoading":false}},"fims":{"sso":{"ssoData":{"kind":"PotNone"},"currentFlowState":"idle"},"history":{"historyExportState":{"kind":"undefined"},"consentsList":{"kind":"PotNone"}}},"itWallet":{"identification":{"isNfcEnabled":{"kind":"PotNone"},"isCieSupported":{"kind":"PotNone"}},"issuance":{"integrityKeyTag":{"_tag":"None"}},"lifecycle":0,"credentials":{"eid":{"_tag":"None"},"credentials":[]},"walletInstance":{}},"profileSettings":{"showProfileBanner":true,"hasUserAcknowledgedSettingsBanner":false},"mixpanel":{"isMixpanelInitialized":false},"ingress":{"isBlockingScreen":false},"landingBanners":{"ITW_DISCOVERY":true,"SETTINGS_DISCOVERY":true}}"`;
exports[`featuresPersistor should match snapshot 1`] = `
{
"euCovidCert": {
"byAuthCode": {},
},
"fci": {
"documentPreview": {
"kind": "PotNone",
},
"documentSignatures": {
"documents": [],
},
"environment": {
"_tag": "None",
},
"metadata": {
"kind": "PotNone",
},
"pollFilledDocument": {
"kind": "PotSome",
"value": {
"isReady": false,
},
},
"qstpFilledDocument": {
"kind": "PotNone",
},
"qtspClauses": {
"kind": "PotNone",
},
"signature": {
"kind": "PotNone",
},
"signatureFieldDrawing": {
"kind": "PotNone",
},
"signatureRequest": {
"kind": "PotNone",
},
"signaturesList": {
"kind": "PotNone",
},
},
"fims": {
"history": {
"consentsList": {
"kind": "PotNone",
},
"historyExportState": {
"kind": "undefined",
},
},
"sso": {
"ctaText": undefined,
"currentFlowState": "idle",
"relyingPartyServiceId": undefined,
"relyingPartyUrl": undefined,
"ssoData": {
"kind": "PotNone",
},
},
},
"idPay": {
"barcode": {},
"code": {
"code": {
"kind": "PotNone",
},
"enrollmentRequest": {
"kind": "PotNone",
},
"isIdPayInitiativeBannerClosed": {},
"isOnboarded": {
"kind": "PotNone",
},
},
"configuration": {
"instrumentStatus": {},
"instruments": {
"kind": "PotNone",
},
},
"initiative": {
"beneficiaryDetails": {
"kind": "PotNone",
},
"details": {
"kind": "PotNone",
},
"onboardingStatus": {
"kind": "PotNone",
},
"timeline": {
"kind": "PotNone",
},
},
"timeline": {
"details": {
"kind": "PotNone",
},
},
"unsubscription": {
"kind": "PotNone",
},
"wallet": {
"initiatives": {
"kind": "PotNone",
},
"initiativesAwaitingStatusUpdate": {},
"initiativesWithInstrument": {
"kind": "PotNone",
},
},
},
"ingress": {
"isBlockingScreen": false,
},
"itWallet": {
"credentials": {
"credentials": [],
"eid": {
"_tag": "None",
},
},
"identification": {
"isCieSupported": {
"kind": "PotNone",
},
"isNfcEnabled": {
"kind": "PotNone",
},
},
"issuance": {
"integrityKeyTag": {
"_tag": "None",
},
},
"lifecycle": 0,
"preferences": {},
"walletInstance": {
"attestation": undefined,
},
},
"landingBanners": {
"ITW_DISCOVERY": true,
"SETTINGS_DISCOVERY": true,
},
"loginFeatures": {
"cieLogin": {
"isCieIDFeatureEnabled": false,
"useUat": false,
},
"fastLogin": {
"automaticSessionRefresh": {
"areAlreadyTwoMinAfterLastActivity": false,
},
"optIn": {
"enabled": undefined,
},
"securityAdviceAcknowledged": {
"acknowledged": false,
"readyToShow": false,
},
"tokenRefreshHandler": {
"pendingActions": [],
"tokenRefresh": {
"kind": "idle",
},
"userInteractionForSessionExpiredNeeded": false,
},
},
"loginInfo": {
"userFromSuccessLogin": false,
},
"nativeLogin": {
"enabled": true,
},
"testLogin": {
"kind": "idle",
},
},
"mixpanel": {
"isMixpanelInitialized": false,
},
"payments": {
"bizEventsTransaction": {
"cancelTransactionRecord": {
"kind": "PotNone",
},
"details": {
"kind": "PotNoneLoading",
},
"latestTransactions": {
"kind": "PotNone",
},
"receiptDocument": {
"kind": "PotNone",
},
"transactions": {
"kind": "PotNoneLoading",
},
},
"checkout": {
"allPaymentMethods": {
"kind": "PotNone",
},
"authorizationUrl": {
"kind": "PotNone",
},
"currentStep": 0,
"paymentDetails": {
"kind": "PotNone",
},
"pspList": {
"kind": "PotNone",
},
"recentUsedPaymentMethod": {
"kind": "PotNone",
},
"selectedPaymentMethod": {
"_tag": "None",
},
"selectedPsp": {
"_tag": "None",
},
"selectedWallet": {
"_tag": "None",
},
"transaction": {
"kind": "PotNone",
},
"userWallets": {
"kind": "PotNone",
},
},
"details": {
"isWalletPayPalBannerClosed": false,
"walletDetails": {
"kind": "PotNoneLoading",
},
},
"history": {
"archive": [],
"receiptsOpened": Set {},
},
"home": {
"shouldShowAddMethodsBanner": true,
},
"onboarding": {
"paymentMethods": {
"kind": "PotNoneLoading",
},
"result": {
"kind": "PotNone",
},
"rptIdToResume": undefined,
"selectedPaymentMethodId": undefined,
},
"pagoPaPlatform": {
"pendingActions": [],
"sessionToken": {
"kind": "PotNone",
},
},
"paymentsBackoffRetry": {},
"transaction": {
"details": {
"kind": "PotNoneLoading",
},
},
"wallet": {
"userMethods": {
"kind": "PotNone",
},
},
},
"pn": {
"activation": {
"kind": "PotNone",
},
},
"profileSettings": {
"hasUserAcknowledgedSettingsBanner": false,
"showProfileBanner": true,
},
"services": {
"details": {
"byId": {},
"servicePreference": {
"kind": "PotNone",
},
},
"home": {
"featuredInstitutions": {
"kind": "PotNone",
},
"featuredServices": {
"kind": "PotNone",
},
"paginatedInstitutions": {
"kind": "PotNone",
},
},
"institution": {
"paginatedServices": {
"kind": "PotNone",
},
},
"search": {
"paginatedInstitutions": {
"kind": "PotNone",
},
},
},
"wallet": {
"cards": {},
"placeholders": {
"isLoading": false,
"items": {},
},
"preferences": {},
},
"whatsNew": {
"lastVisualizedVersion": undefined,
},
}
`;
Loading

0 comments on commit 07ba58d

Please sign in to comment.