Skip to content

Commit

Permalink
refactor: iPatente cta selector
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoMolinari95 committed Jan 15, 2025
1 parent 9d4dc6a commit faac2de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const itwDeferredIssuanceScreenContentSelector = createSelector(
/**
* Return the remote config about iPatente CTA inside the MDL credential details screen.
*/
export const itwIPatenteCtaSelector = createSelector(
export const itwIPatenteCtaConfigSelector = createSelector(
itwRemoteConfigSelector,
itwConfig =>
pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
trackItwCredentialDelete,
trackWalletCredentialSupport
} from "../../analytics";
import { itwIPatenteCtaSelector } from "../../common/store/selectors/remoteConfig";
import { itwIPatenteCtaConfigSelector } from "../../common/store/selectors/remoteConfig";
import { StoredCredential } from "../../common/utils/itwTypesUtils";
import { itwCredentialsRemove } from "../../credentials/store/actions";
import { trackAuthenticationStart } from "../../../fims/common/analytics";
Expand Down Expand Up @@ -133,9 +133,9 @@ const getCredentialActions = (credentialType: string): React.ReactNode =>
* Renders the IPatente service action item
*/
const IPatenteListItemAction = () => {
const iPatenteCtaSelector = useIOSelector(itwIPatenteCtaSelector);
const ctaConfig = useIOSelector(itwIPatenteCtaConfigSelector);

if (!iPatenteCtaSelector?.visibility) {
if (!ctaConfig?.visibility) {
return null;
}

Expand All @@ -145,10 +145,10 @@ const IPatenteListItemAction = () => {

const trackIPatenteAuthenticationStart = (label: string) =>
trackAuthenticationStart(
iPatenteCtaSelector.service_id as ServiceId,
iPatenteCtaSelector.service_name,
iPatenteCtaSelector.service_organization_name,
iPatenteCtaSelector.service_organization_fiscal_code,
ctaConfig.service_id as ServiceId,
ctaConfig.service_name,
ctaConfig.service_organization_name,
ctaConfig.service_organization_fiscal_code,
label,
//TODO Change with a new source
"message_detail"
Expand All @@ -166,7 +166,7 @@ const IPatenteListItemAction = () => {
screen: FIMS_ROUTES.CONSENTS,
params: {
ctaText: label,
ctaUrl: iPatenteCtaSelector.url
ctaUrl: ctaConfig.url
}
});
}}
Expand Down

0 comments on commit faac2de

Please sign in to comment.