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

chore: [IOPID-2579] add management of remote portal urls #6594

Merged
merged 22 commits into from
Jan 16, 2025
Merged
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b67624a
edit io-web urls
Ladirico Jan 8, 2025
e9df741
add logic to manage the io.italia.it links
Ladirico Jan 9, 2025
1d6e394
edd explanation
Ladirico Jan 9, 2025
c30366d
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 9, 2025
01c184c
fix link on share data
Ladirico Jan 10, 2025
971f2c8
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 10, 2025
9b3c13a
delete nullish coalescing operator and fix mock
Ladirico Jan 10, 2025
7e00740
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 13, 2025
0f9e62a
delete references to ipatente_cta_visible added in order to carry out…
Ladirico Jan 13, 2025
360264c
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 13, 2025
b6df465
change name of selector that generate the URL dinamically and add log…
Ladirico Jan 13, 2025
5164701
delete config about privacyUrl
Ladirico Jan 14, 2025
f3e669d
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 14, 2025
1164aab
fix existent tests and add new tests on new selectors logic
Ladirico Jan 14, 2025
e6499b0
edit eslintrc file
Ladirico Jan 14, 2025
8acfe1e
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 14, 2025
c044e71
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 14, 2025
f795d58
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 15, 2025
dd9bd08
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 15, 2025
a51c3dd
incorrect merge deleted
Ladirico Jan 15, 2025
0ccfb97
add correct reference of metadata
Ladirico Jan 15, 2025
189d0b6
Merge branch 'master' into IOPID-2579-add-portal-links
Ladirico Jan 16, 2025
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
10 changes: 1 addition & 9 deletions .env.local
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ TOT_MESSAGE_FETCH_WORKERS=5
SHUFFLE_PINPAD_ON_PAYMENT=NO
# Repository of app content
CONTENT_REPO_URL='http://127.0.0.1:3000/static_contents'
# Privacy url to load in TOS Screen
PRIVACY_URL='https://io.italia.it/app-content/tos_privacy.html'
# Privacy url for Zendesk usage
ZENDESK_PRIVACY_URL='https://www.pagopa.it/it/privacy-policy-assistenza/'
# Mixpanel
@@ -60,10 +58,6 @@ IDPAY_ENABLED=YES
IDPAY_API_BASEURL='http://127.0.0.1:3000'
# IDPay test/env RESTful API
IDPAY_API_UAT_BASEURL='https://api-io.uat.cstar.pagopa.it'
# Unsupported device more information url
UNSUPPORTED_DEVICE_MORE_INFO_URL='https://io.italia.it/app-content/unsupported_device.html'
# Unsupported device learn more url
UNSUPPORTED_DEVICE_LEARN_MORE_URL='https://io.italia.it/faq/#n1_15'
# Cie/Spid more information url
CIE_SPID_INFORMATION_URL='https://identitadigitale.gov.it'
# Pin/Puk help url
@@ -95,6 +89,4 @@ ITW_ISSUANCE_REDIRECT_URI="https://wallet.io.pagopa.it/index.html"
# Bypass the check that enforces the identity of the issued eID is the same as the authenticated user
ITW_BYPASS_IDENTITY_MATCH=YES
# Use the test environment for the IDP hint for both CIE and SPID
ITW_IDP_HINT_TEST=YES
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
ITW_IDP_HINT_TEST=YES
10 changes: 1 addition & 9 deletions .env.production
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ TOT_MESSAGE_FETCH_WORKERS=5
SHUFFLE_PINPAD_ON_PAYMENT=NO
# Repository of app content
CONTENT_REPO_URL='https://assets.cdn.io.pagopa.it'
# Privacy url to load in TOS Screen
PRIVACY_URL='https://io.italia.it/app-content/tos_privacy.html'
# Privacy url for Zendesk usage
ZENDESK_PRIVACY_URL='https://www.pagopa.it/it/privacy-policy-assistenza/'
# Mixpanel
@@ -60,10 +58,6 @@ IDPAY_ENABLED=YES
IDPAY_API_BASEURL='https://api-io.cstar.pagopa.it'
# IDPay test/env RESTful API
IDPAY_API_UAT_BASEURL='https://api-io.uat.cstar.pagopa.it'
# Unsupported device more information url
UNSUPPORTED_DEVICE_MORE_INFO_URL='https://io.italia.it/app-content/unsupported_device.html'
# Unsupported device learn more url
UNSUPPORTED_DEVICE_LEARN_MORE_URL='https://io.italia.it/faq/#n1_15'
# Cie/Spid more information url
CIE_SPID_INFORMATION_URL='https://identitadigitale.gov.it'
# Pin/Puk help url
@@ -95,6 +89,4 @@ ITW_ISSUANCE_REDIRECT_URI="https://wallet.io.pagopa.it/index.html"
# Bypass the check that enforces the identity of the issued eID is the same as the authenticated user
ITW_BYPASS_IDENTITY_MATCH=NO
# Use the test environment for the IDP hint for both CIE and SPID
ITW_IDP_HINT_TEST=NO
# IPZS Privacy Policy URL
ITW_IPZS_PRIVACY_URL='https://io.italia.it/informativa-ipzs'
ITW_IDP_HINT_TEST=NO
1 change: 0 additions & 1 deletion locales/de/index.yml
Original file line number Diff line number Diff line change
@@ -110,7 +110,6 @@ global:
open:
label: "Kontextbezogene Hilfe"
hint: "Greif auf Informationen über den Inhalt des aktuellen Bildschirms zu"
ioWebSite: "https://io.italia.it"
symbols:
question: "?"
asterisk: "*"
1 change: 0 additions & 1 deletion locales/en/index.yml
Original file line number Diff line number Diff line change
@@ -119,7 +119,6 @@ global:
open:
label: Contextual Help
hint: Access information about the contents of the current screen
ioWebSite: https://io.italia.it
symbols:
question: "?"
asterisk: "*"
1 change: 0 additions & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
@@ -119,7 +119,6 @@ global:
open:
label: Aiuto contestuale
hint: Accedi alle informazioni sul contenuto della schermata corrente
ioWebSite: https://io.italia.it
symbols:
question: "?"
asterisk: "*"
3 changes: 2 additions & 1 deletion scripts/generate-api-models.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

IO_BACKEND_VERSION=v16.4.0-RELEASE
IO_SERVICES_METADATA_VERSION=1.0.51
# need to change after merge on io-services-metadata
IO_SERVICES_METADATA_VERSION=IOPID-2581-add-portal-links

declare -a apis=(
# Backend APIs
23 changes: 0 additions & 23 deletions ts/config.ts
Original file line number Diff line number Diff line change
@@ -150,30 +150,12 @@ export const totMessageFetchWorkers = pipe(
export const shufflePinPadOnPayment =
Config.SHUFFLE_PINPAD_ON_PAYMENT === "YES";

export const privacyUrl: string = pipe(
Config.PRIVACY_URL,
t.string.decode,
E.getOrElse(() => "https://io.italia.it/app-content/tos_privacy.html")
);

Ladirico marked this conversation as resolved.
Show resolved Hide resolved
export const zendeskPrivacyUrl: string = pipe(
Config.ZENDESK_PRIVACY_URL,
t.string.decode,
E.getOrElse(() => "https://www.pagopa.it/it/privacy-policy-assistenza/")
);

export const unsupportedDeviceMoreInfoUrl: string = pipe(
Config.UNSUPPORTED_DEVICE_MORE_INFO_URL,
NonEmptyString.decode,
E.getOrElse(() => "https://io.italia.it/app-content/unsupported_device.html")
);

export const unsupportedDeviceLearnMoreUrl: string = pipe(
Config.UNSUPPORTED_DEVICE_LEARN_MORE_URL,
NonEmptyString.decode,
E.getOrElse(() => "https://io.italia.it/faq/#n1_15")
);

export const cieSpidMoreInfoUrl: string = pipe(
Config.CIE_SPID_INFORMATION_URL,
NonEmptyString.decode,
@@ -247,8 +229,3 @@ export const itwEaaVerifierBaseUrl = Config.ITW_EAA_VERIFIER_BASE_URL;
export const itwBypassIdentityMatch =
Config.ITW_BYPASS_IDENTITY_MATCH === "YES";
export const itwIdpHintTest = Config.ITW_IDP_HINT_TEST === "YES";
export const itwIpzsPrivacyUrl: string = pipe(
Config.ITW_IPZS_PRIVACY_URL,
t.string.decode,
E.getOrElse(() => "https://io.italia.it/informativa-ipzs")
);
56 changes: 0 additions & 56 deletions ts/features/bonus/cgn/__mock__/availableMerchantDetail.ts

This file was deleted.

8 changes: 5 additions & 3 deletions ts/features/fastLogin/components/SecuritySuggestions.tsx
Original file line number Diff line number Diff line change
@@ -4,12 +4,14 @@ import { View } from "react-native";
import I18n from "../../../i18n";
import { openWebUrl } from "../../../utils/url";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { useIODispatch } from "../../../store/hooks";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { setSecurityAdviceAcknowledged } from "../store/actions/securityAdviceActions";
import { trackWhatsNewScreen } from "../../whatsnew/analytics";
import { absolutePortalLinksSelector } from "../../../store/reducers/backendStatus/remoteConfig";

const SecuritySuggestions = () => {
const dispatch = useIODispatch();
const absolutePortalLinks = useIOSelector(absolutePortalLinksSelector);

useOnFirstRender(() => {
dispatch(setSecurityAdviceAcknowledged(true));
@@ -30,7 +32,7 @@ const SecuritySuggestions = () => {
label: I18n.t(
"authentication.security_suggestions.navigate_to_the_site"
),
onPress: () => openWebUrl("https://ioapp.it/")
onPress: () => openWebUrl(absolutePortalLinks.io_web)
}}
/>
<VSpacer size={24} />
@@ -41,7 +43,7 @@ const SecuritySuggestions = () => {
label: I18n.t(
"authentication.security_suggestions.navigate_to_the_site"
),
onPress: () => openWebUrl("https://ioapp.it/")
onPress: () => openWebUrl(absolutePortalLinks.io_web)
}}
/>
<VSpacer size={24} />
11 changes: 8 additions & 3 deletions ts/features/itwallet/common/components/ItwIssuanceMetadata.tsx
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@ import {
trackWalletCredentialShowAuthSource,
trackWalletCredentialShowIssuer
} from "../../analytics";
import { itwIpzsPrivacyUrl } from "../../../../config";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import { useIOSelector } from "../../../../store/hooks";
import { replaceBaseUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";

type ItwIssuanceMetadataProps = {
credential: StoredCredential;
@@ -98,6 +100,9 @@ export const ItwIssuanceMetadata = ({
const releaserName =
credential.issuerConf.federation_entity.organization_name;
const authSource = getAuthSource(credential);
const privacyUrl = useIOSelector(state =>
replaceBaseUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);

const releaserNameBottomSheet: ItwMetadataIssuanceListItemProps["bottomSheet"] =
useMemo(
@@ -108,15 +113,15 @@ export const ItwIssuanceMetadata = ({
contentBody: I18n.t(
"features.itWallet.issuance.credentialPreview.bottomSheet.about.subtitle",
{
privacyUrl: itwIpzsPrivacyUrl
privacyUrl
}
),
onPress: () =>
trackWalletCredentialShowIssuer(
CREDENTIALS_MAP[credential.credentialType]
)
}),
[credential.credentialType]
[credential.credentialType, privacyUrl]
);

const authSourceBottomSheet: ItwMetadataIssuanceListItemProps["bottomSheet"] =
Original file line number Diff line number Diff line change
@@ -6,13 +6,17 @@ import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay"
import ItwPrivacyWebViewComponent from "../components/ItwPrivacyWebViewComponent";
import { ItwEidIssuanceMachineContext } from "../../machine/provider";
import { trackOpenItwTosAccepted } from "../../analytics";
import { itwIpzsPrivacyUrl } from "../../../../config";
import ItwMarkdown from "../../common/components/ItwMarkdown";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import { replaceBaseUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useIOSelector } from "../../../../store/hooks";

const ItwIpzsPrivacyScreen = () => {
const [isLoading, setIsLoading] = useState(true);
const machineRef = ItwEidIssuanceMachineContext.useActorRef();

const privacyUrl = useIOSelector(state =>
replaceBaseUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);
const handleContinuePress = () => {
trackOpenItwTosAccepted();
machineRef.send({ type: "accept-ipzs-privacy" });
@@ -50,7 +54,7 @@ const ItwIpzsPrivacyScreen = () => {
</ContentWrapper>
<ItwPrivacyWebViewComponent
source={{
uri: itwIpzsPrivacyUrl
uri: privacyUrl
}}
onAcceptTos={handleContinuePress}
onLoadEnd={onLoadEnd}
Original file line number Diff line number Diff line change
@@ -53,8 +53,9 @@ import {
trackWalletDataShareAccepted
} from "../../analytics";
import LoadingScreenContent from "../../../../components/screens/LoadingScreenContent";
import { itwIpzsPrivacyUrl } from "../../../../config";
import { ITW_ROUTES } from "../../navigation/routes";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import { replaceBaseUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";

const ItwIssuanceCredentialTrustIssuerScreen = () => {
const eidOption = useIOSelector(itwCredentialsEidSelector);
@@ -101,6 +102,9 @@ type ContentViewProps = {
*/
const ContentView = ({ credentialType, eid }: ContentViewProps) => {
const route = useRoute();
const privacyUrl = useIOSelector(state =>
replaceBaseUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);

useFocusEffect(
useCallback(() => {
@@ -208,7 +212,7 @@ const ContentView = ({ credentialType, eid }: ContentViewProps) => {
onLinkOpen={trackOpenItwTos}
>
{I18n.t("features.itWallet.issuance.credentialAuth.tos", {
privacyUrl: itwIpzsPrivacyUrl
privacyUrl
})}
</ItwMarkdown>
</ContentWrapper>
Original file line number Diff line number Diff line change
@@ -23,8 +23,9 @@ import { KoState, trackWalletCreationFailed } from "../../analytics";
import { openWebUrl } from "../../../../utils/url";
import { useEidEventsTracking } from "../hooks/useEidEventsTracking";
import { serializeFailureReason } from "../../common/utils/itwStoreUtils";

const FAQ_URL = "https://io.italia.it/documenti-su-io/faq/#n1_12";
import { useIOSelector } from "../../../../store/hooks";
import { replaceBaseUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { DOCUMENTS_ON_IO_FAQ_12_URL_BODY } from "../../../../urls";

export const ItwIssuanceEidFailureScreen = () => {
const failureOption =
@@ -47,6 +48,14 @@ const ContentView = ({ failure }: ContentViewProps) => {
ItwEidIssuanceMachineContext.useSelector(selectIdentification);
const toast = useIOToast();

const FAQ_URL = useIOSelector(state =>
replaceBaseUrlSelector(
state,
"io_showcase",
DOCUMENTS_ON_IO_FAQ_12_URL_BODY
)
);

useDebugInfo({
failure: serializeFailureReason(failure)
});
Loading

Unchanged files with check annotations Beta

case CredentialIssuanceFailureType.ASYNC_ISSUANCE:
return {
title:
deferredIssuanceScreenContent?.title?.[locale] ??

Check failure on line 121 in ts/features/itwallet/issuance/screens/ItwIssuanceCredentialFailureScreen.tsx

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "it-IT": string; "en-EN": string; } & {}'.
I18n.t("features.itWallet.issuance.asyncCredentialError.title"),
subtitle:
deferredIssuanceScreenContent?.description?.[locale] ??

Check failure on line 124 in ts/features/itwallet/issuance/screens/ItwIssuanceCredentialFailureScreen.tsx

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "it-IT": string; "en-EN": string; } & {}'.
I18n.t("features.itWallet.issuance.asyncCredentialError.body"),
pictogram: "pending",
action: {
pictogramName="feedback"
size="big"
viewRef={bannerViewRef}
title={feedbackBannerConfig.title?.[locale]}

Check failure on line 45 in ts/features/payments/checkout/components/WalletPaymentFeedbackBanner.tsx

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "it-IT": string; "en-EN": string; } & {}'.
content={feedbackBannerConfig.description[locale]}

Check failure on line 46 in ts/features/payments/checkout/components/WalletPaymentFeedbackBanner.tsx

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "it-IT": string; "en-EN": string; } & {}'.
action={feedbackBannerConfig.action?.label[locale]}

Check failure on line 47 in ts/features/payments/checkout/components/WalletPaymentFeedbackBanner.tsx

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "it-IT": string; "en-EN": string; } & {}'.
onPress={handleBannerPress}
/>
</>
const handleOnPressAlertStatusInfo = (_: GestureResponderEvent) => {
if (alertInfo && alertInfo.web_url && alertInfo.web_url[getFullLocale()]) {
openWebUrl(alertInfo.web_url[getFullLocale()]);

Check failure on line 25 in ts/features/payments/home/components/PaymentsAlertStatus.tsx

GitHub Actions / static-checks

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
}
};
layout={Layout.duration(200)}
>
<Alert
content={alertInfo.message[getFullLocale()]}

Check failure on line 36 in ts/features/payments/home/components/PaymentsAlertStatus.tsx

GitHub Actions / static-checks

Type 'string | undefined' is not assignable to type 'string'.
variant={getAlertVariant(alertInfo.level)}
action={actionLabel}
onPress={
);
const locale = getFullLocale();
return useMemo(() => {

Check failure on line 37 in ts/hooks/useStatusAlertProps.ts

GitHub Actions / static-checks

Type '{ action?: undefined; onPress?: undefined; content: string | undefined; variant: "warning" | "error" | "info"; } | undefined' is not assignable to type 'AlertEdgeToEdgeProps | undefined'.
if (!currentStatusMessage || currentStatusMessage.length === 0) {
return undefined;
}
() => ({}),
url => ({
action: I18n.t("global.sectionStatus.moreInfo"),
onPress: () => openWebUrl(url[locale])

Check failure on line 51 in ts/hooks/useStatusAlertProps.ts

GitHub Actions / static-checks

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
})
)
);
outcomeCodes[maybeOutcomeCodeKey.right] as OutcomeCode,
O.fromNullable,
O.chainNullableK(oc => oc.description),
O.map(description => description[getFullLocale()])

Check failure on line 424 in ts/utils/payment.ts

GitHub Actions / static-checks

Element implicitly has an 'any' type because expression of type '"it-IT" | "en-EN" | "de-DE"' can't be used to index type '{ "en-EN": string; "it-IT": string; }'.
);
}
return O.none;