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
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
19 changes: 7 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,19 @@ module.exports = {
"no-restricted-imports": [
"error",
{
"paths": [
paths: [
{
name: "i18n-js",
message: 'Importing I18n from "i18n-js" is not allowed. Import it from "ts/i18n.ts" instead.',
},
message:
'Importing I18n from "i18n-js" is not allowed. Import it from "ts/i18n.ts" instead.'
},
{
name: "@pagopa/ts-commons",
importNames: ["pot"],
message: 'Importing { pot } from "@pagopa/ts-commons" is not allowed. Use \'import * as pot from "@pagopa/ts-commons/lib/pot"\' instead.',
message:
'Importing { pot } from "@pagopa/ts-commons" is not allowed. Use \'import * as pot from "@pagopa/ts-commons/lib/pot"\' instead.'
}
],
patterns: [
{
group: ["**/config"],
importNames: ["privacyUrl"],
message: 'Importing "privacyUrl" from "config.ts" module is restricted. Please use "tosConfigSelector" to obtain it instead.'
}
]
]
}
]
},
Expand Down
1 change: 0 additions & 1 deletion locales/de/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down
1 change: 0 additions & 1 deletion locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down
1 change: 0 additions & 1 deletion locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down
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.54
# need to change after merge on io-services-metadata
IO_SERVICES_METADATA_VERSION=1.0.55

declare -a apis=(
# Backend APIs
Expand Down
23 changes: 0 additions & 23 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Up @@ -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));
Expand All @@ -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} />
Expand All @@ -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} />
Expand Down
11 changes: 8 additions & 3 deletions ts/features/itwallet/common/components/ItwIssuanceMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";

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

const releaserNameBottomSheet: ItwMetadataIssuanceListItemProps["bottomSheet"] =
useMemo(
Expand All @@ -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"] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { generateDynamicUrlSelector } 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 =>
generateDynamicUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);
const handleContinuePress = () => {
trackOpenItwTosAccepted();
machineRef.send({ type: "accept-ipzs-privacy" });
Expand Down Expand Up @@ -50,7 +54,7 @@ const ItwIpzsPrivacyScreen = () => {
</ContentWrapper>
<ItwPrivacyWebViewComponent
source={{
uri: itwIpzsPrivacyUrl
uri: privacyUrl
}}
onAcceptTos={handleContinuePress}
onLoadEnd={onLoadEnd}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ import {
} from "../../analytics";
import LoadingScreenContent from "../../../../components/screens/LoadingScreenContent";
import { usePreventScreenCapture } from "../../../../utils/hooks/usePreventScreenCapture";
import { itwIpzsPrivacyUrl } from "../../../../config";
import { ITW_ROUTES } from "../../navigation/routes";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";

const ItwIssuanceCredentialTrustIssuerScreen = () => {
const eidOption = useIOSelector(itwCredentialsEidSelector);
Expand Down Expand Up @@ -103,6 +104,9 @@ type ContentViewProps = {
*/
const ContentView = ({ credentialType, eid }: ContentViewProps) => {
const route = useRoute();
const privacyUrl = useIOSelector(state =>
generateDynamicUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);

useFocusEffect(
useCallback(() => {
Expand Down Expand Up @@ -210,7 +214,7 @@ const ContentView = ({ credentialType, eid }: ContentViewProps) => {
onLinkOpen={trackOpenItwTos}
>
{I18n.t("features.itWallet.issuance.credentialAuth.tos", {
privacyUrl: itwIpzsPrivacyUrl
privacyUrl
})}
</ItwMarkdown>
</ContentWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { DOCUMENTS_ON_IO_FAQ_12_URL_BODY } from "../../../../urls";

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

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

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