Skip to content

Commit

Permalink
Merge branch 'master' into IOBP-616-durante-il-flusso-di-pagamento-ma…
Browse files Browse the repository at this point in the history
…ncano-alcuni-campi-nella-richiesta-calculate-fees
  • Loading branch information
hevelius authored Apr 12, 2024
2 parents 0bc7dfa + 6cc53f0 commit 9cc4c6e
Show file tree
Hide file tree
Showing 28 changed files with 497 additions and 184 deletions.
4 changes: 0 additions & 4 deletions locales/de/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,6 @@ authentication:
email:
cduScreens:
validateMail:
title: "Du hast deine E-Mail-Adresse nicht bestätigt"
subtitle: "Um die App weiter nutzen zu können, musst du deine E-Mail-Adresse bestätigen"
editButton: "E-Mail-Adresse ändern"
validateButton: "E-Mail-Adresse bestätigen"
header:
title: "IO konfigurieren"
help:
Expand Down
12 changes: 8 additions & 4 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ profile:
title: Warning
message: To add a new test card, you must enable the pagoPA test environment from the settings.
closeButton: Close
itWallet:
itWalletTest: IT Wallet
itWalletTestDescription: Enable the IT Wallet test environment
data:
title: Your data
subtitle: Here you will find your personal and contact data used by the IO app.
Expand Down Expand Up @@ -762,10 +765,10 @@ authentication:
email:
cduScreens:
validateMail:
title: Email address not validated
subtitle: To continue using the app, you must validate your email address
editButton: Edit email address
validateButton: Validate email address
title: Is this your email?
subtitle: To continue using the app, you must confirm that your email is
editButton: No, change email
validateButton: Yes, confirm
header:
title: Configure IO
help:
Expand Down Expand Up @@ -2939,6 +2942,7 @@ features:
close: Chiudi
cards:
categories:
all: All
bonus: Iniziative welfare
cgn: Carta Giovani Nazionale
itw: IT Wallet
Expand Down
12 changes: 8 additions & 4 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ profile:
title: Attenzione
message: Per aggiungere una nuova carta di test, devi abilitare l'ambiente pagoPA di test dalle impostazioni.
closeButton: Chiudi
itWallet:
itWalletTest: IT Wallet
itWalletTestDescription: Abilita ambiente di test per IT Wallet
data:
title: I tuoi dati
subtitle: Qui trovi i tuoi dati anagrafici e di contatto utilizzati da app IO
Expand Down Expand Up @@ -762,10 +765,10 @@ authentication:
email:
cduScreens:
validateMail:
title: Non hai confermato il tuo indirizzo email
subtitle: Per continuare a utilizzare l’app è necessario validare il tuo indirizzo email
editButton: Modifica email
validateButton: Conferma email
title: È questa la tua email?
subtitle: Per continuare a usare l’app, devi confermare che la tua email è
editButton: No, modifica
validateButton: Sì, conferma
header:
title: Configura IO
help:
Expand Down Expand Up @@ -2939,6 +2942,7 @@ features:
close: Chiudi
cards:
categories:
all: Tutti
bonus: Iniziative welfare
cgn: Carta Giovani Nazionale
itw: IT Wallet
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"dependencies": {
"@babel/plugin-transform-regenerator": "^7.18.6",
"@gorhom/bottom-sheet": "^4.1.5",
"@pagopa/io-app-design-system": "1.33.0",
"@pagopa/io-app-design-system": "1.34.0",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-crypto": "^0.3.0",
"@pagopa/io-react-native-http-client": "^0.1.3",
Expand Down
29 changes: 13 additions & 16 deletions scripts/check_urls/check_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,24 +223,21 @@ def send_slack_message(invalid_uris_list: List[IOUrl]):
urls_black_list = {
# 403 when this check runs (in the middle of the night)
"https://id.lepida.it/docs/manuale_utente.pdf",
# still not available
"https://io.italia.it/carta-giovani-nazionale/informativa-beneficiari",
# still not available
"https://io.italia.it/carta-giovani-nazionale/guida-beneficiari",
# the article is available but the response status code is 403
"https://help.mixpanel.com/hc/en-us/articles/115004494803-Disable-Geolocation-Collection",
"https://assets.cdn.io.italia.it",
"https://www.trusttechnologies.it/wp-content/uploads/SPIDPRIN.TT_.DPMU15000.03-Guida-Utente-al-servizio-TIM-ID.pdf",
"https://www.trusttechnologies.it/contatti/#form",
"https://support.namirial.com/it/faq/faq-tsp/faq-tsp-spid",
"https://paytipper.com/wp-content/uploads/2021/02/logo.png",
"https://fims-dev-app-provider.azurewebsites.net/",
# returns a 404 anytime the check runs but it actually works fine
"https://checkout.pagopa.it/dona",
# todo remove from blacklist when the url is available
"https://io.italia.it/app-content/tos_privacy_cartacultura.html/",
# todo remove from blacklist when the url is available
"https://cittadini.notifichedigitali.it"
# Mixpanel EU endpoint
"https://api-eu.mixpanel.com"
# Profile 412 status error types
# Already taken type
"https://ioapp.it/problems/email-already-taken"
# EIC UAT endpoint
"https://collaudo.idserver.servizicie.interno.gov.it/idp"
# localhost is not reachable
"https://localhost",
# local url used for E2E tests
"http://127.0.0.1:3000/api/v1/cgn/delete",
# not accessible outside of PagoPA
"https://docs.google.com/presentation/d/11rEttb7lJYlRqgFpl4QopyjFmjt2Q0K8uis6JhAQaCw/edit#slide=id.p"
}
locales = (abspath(join(dirname(__file__), "../..", "locales")), set())
ts_dir = (abspath(join(dirname(__file__), "../..", "ts")), files_black_list)
Expand Down
23 changes: 10 additions & 13 deletions scripts/ts/common/jiraTicket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,16 @@ export const getJiraIdFromPrTitle = (
* Try to retrieve Jira tickets from pr title
* and transforms them into {@link GenericTicket}
* @param title
* @returns a promise of {@link JiraTicketRetrievalResults} containing the jira tickets or an error. If no tickets are found, an empty array is returned
*/
export const getTicketsFromTitle = async (
export const getTicketsFromTitle = (
title: string
): Promise<JiraTicketRetrievalResults> => {
const maybeJiraId = await pipe(
getJiraIdFromPrTitle(title),
O.map(getJiraTickets),
O.toUndefined
): Promise<JiraTicketRetrievalResults> =>
pipe(
title,
getJiraIdFromPrTitle,
O.fold(
() => Promise.resolve([]),
jiraIds => getJiraTickets(jiraIds)
)
);

if (maybeJiraId) {
return maybeJiraId;
} else {
return [E.left(new Error("No Jira ticket found"))];
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Object {
"isDesignSystemEnabled": false,
"isFingerprintEnabled": undefined,
"isIdPayTestEnabled": false,
"isItWalletTestEnabled": false,
"isMixpanelEnabled": null,
"isNewWalletSectionEnabled": false,
"isPagoPATestEnabled": false,
Expand Down
8 changes: 8 additions & 0 deletions ts/boot/configureStoreAndPersistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,14 @@ const migrations: MigrationManifest = {
}
}
}
}),
// Version 27
// Adds it wallet section FF
"27": (state: PersistedState) =>
merge(state, {
persistedPreferences: {
isItWalletTestEnabled: false
}
})
};

Expand Down
4 changes: 2 additions & 2 deletions ts/features/newWallet/components/WalletCardBaseComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StyleSheet, View } from "react-native";

// Wallet card base component props, which declares common props that wallet cards must have
export type WalletCardComponentBaseProps<P> = WithTestID<{
isStacked: boolean;
isStacked?: boolean;
cardProps: P;
}>;

Expand All @@ -15,7 +15,7 @@ export const withWalletCardBaseComponent =
>(
CardContent: React.ComponentType<CardProps>
) =>
({ cardProps, isStacked, testID }: ContentProps) =>
({ cardProps, isStacked = false, testID }: ContentProps) =>
(
<View
testID={testID}
Expand Down
24 changes: 6 additions & 18 deletions ts/features/newWallet/components/WalletCardsCategoryContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import {
WithTestID
} from "@pagopa/io-app-design-system";
import * as React from "react";
import { View } from "react-native";
import { WalletCard, walletCardComponentMapper } from "../types";
import Animated, { Layout } from "react-native-reanimated";
import { WalletCard } from "../types";
import { renderWalletCardFn } from "../utils";

export type WalletCategoryStackContainerProps = WithTestID<{
iconName: IOIcons;
Expand All @@ -31,30 +32,17 @@ const WalletCardsCategoryContainer = ({

const isStacked = cards.length > 1;

const renderCardFn = (card: WalletCard, stacked: boolean) => {
const Component = walletCardComponentMapper[card.type];
return (
Component && (
<Component
testID={`walletCardTestID_${card.key}`}
cardProps={card}
isStacked={stacked}
/>
)
);
};

return (
<View testID={testID}>
<Animated.View testID={testID} layout={Layout.duration(200)}>
<ListItemHeader iconName={iconName} label={label} />
{cards.map((card, index) => (
<React.Fragment key={`wallet_card_${card.key}`}>
{!isStacked && index !== 0 && <VSpacer size={16} />}
{renderCardFn(card, isStacked && index < cards.length - 1)}
{renderWalletCardFn(card, isStacked && index < cards.length - 1)}
</React.Fragment>
))}
<VSpacer size={16} />
</View>
</Animated.View>
);
};

Expand Down
16 changes: 14 additions & 2 deletions ts/features/newWallet/components/WalletCardsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ import * as React from "react";
import { View } from "react-native";
import I18n from "../../../i18n";
import { useIOSelector } from "../../../store/hooks";
import { getWalletCardsByCategorySelector } from "../store/selectors";
import {
getWalletCardsByCategoryWithFilterSelector,
selectWalletCards
} from "../store/selectors";
import { WalletCardCategory, walletCardCategoryIcons } from "../types";
import { renderWalletCardFn } from "../utils";
import { WalletCardsCategoryContainer } from "./WalletCardsCategoryContainer";

const WalletCardsContainer = () => {
const cardsByCategory = useIOSelector(getWalletCardsByCategorySelector);
const cards = useIOSelector(selectWalletCards);
const cardsByCategory = useIOSelector(
getWalletCardsByCategoryWithFilterSelector
);

if (cards.length === 1) {
// Single card does not need grouping
return renderWalletCardFn(cards[0]);
}

return (
<View testID="walletCardsContainerTestID">
Expand Down
81 changes: 81 additions & 0 deletions ts/features/newWallet/components/WalletCategoryFilterTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import {
IOVisualCostants,
TabItem,
TabNavigation,
VSpacer
} from "@pagopa/io-app-design-system";
import React from "react";
import { StyleSheet, View } from "react-native";
import I18n from "../../../i18n";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { walletSetCategoryFilter } from "../store/actions/preferences";
import {
getWalletCardsByCategorySelector,
selectWalletCategoryFilter
} from "../store/selectors";
import { WalletCardCategory, walletCardCategoryIcons } from "../types";

const WalletCategoryFilterTabs = () => {
const dispatch = useIODispatch();

const cardsByCategory = useIOSelector(getWalletCardsByCategorySelector);
const selectedCategory = useIOSelector(selectWalletCategoryFilter);

const categories = Object.keys(
cardsByCategory
) as ReadonlyArray<WalletCardCategory>;

const selectedIndex = selectedCategory
? categories.indexOf(selectedCategory) + 1
: 0;

const handleFilterSelected = (index: number) => {
dispatch(
walletSetCategoryFilter(index === 0 ? undefined : categories[index - 1])
);
};

if (categories.length < 2) {
// There is no need to show category filter if we have less than 2 categories
return <></>;
}

return (
<View style={styles.container} testID="CategoryTabsContainerTestID">
<TabNavigation
tabAlignment="start"
onItemPress={handleFilterSelected}
selectedIndex={selectedIndex}
>
{[
<TabItem
key={`category_tab_all`}
label={I18n.t(`features.wallet.cards.categories.all`)}
accessibilityLabel={I18n.t(`features.wallet.cards.categories.all`)}
/>,
...categories.map(category => (
<TabItem
testID={`CategoryTabTestID-${category}`}
key={`category_tab_${category}`}
label={I18n.t(`features.wallet.cards.categories.${category}`)}
accessibilityLabel={I18n.t(
`features.wallet.cards.categories.${category}`
)}
icon={walletCardCategoryIcons[category]}
/>
))
]}
</TabNavigation>
<VSpacer size={16} />
</View>
);
};

const styles = StyleSheet.create({
container: {
marginHorizontal: -IOVisualCostants.appMarginDefault * 2,
paddingHorizontal: IOVisualCostants.appMarginDefault
}
});

export { WalletCategoryFilterTabs };
Loading

0 comments on commit 9cc4c6e

Please sign in to comment.