Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-605] Rename remaning screens with new schema (#…
Browse files Browse the repository at this point in the history
…5277)

## Short description
This PR is a follow up to #5245 and renames the renaming screens, along
with some fixes for some screens which don't follow the same scheme.
The naming scheme convention follows the structure of the routes defined
in `ItwRoutes.tsx`. While adhering to this convention, some screens
underwent slight shortening for practicality.

The `cie` folder of the PID issuing doesn't follow this schema because
the screens would have a very long name and also because it's a very
specific block of screen.

## How to test
Static checks should be enough.

---------

Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
  • Loading branch information
LazyAfternoons and hevelius authored Dec 1, 2023
1 parent f4fe5cb commit 9ea1542
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 72 deletions.
8 changes: 4 additions & 4 deletions ts/features/it-wallet/navigation/ItwParamsList.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ItwPrCredentialDetailsScreenNavigationParams } from "../screens/presentation/ItwPrCredentialDetails";
import { ItwPidRequestScreenNavigationParams } from "../screens/issuing/pid/ItwPidRequestScreen";
import { ItwIssuingPidRequestScreenNavigationParams } from "../screens/issuing/pid/ItwIssuingPidRequestScreen";
import { ItwCieCardReaderScreenNavigationParams } from "../screens/issuing/pid/cie/ItwCieCardReaderScreen";
import { ItwCieConsentDataUsageScreenNavigationParams } from "../screens/issuing/pid/cie/ItwCieConsentDataUsageScreen";
import { ItwCieWrongPinScreenNavigationParams } from "../screens/issuing/pid/cie/ItwCieWrongPinScreen";
import { ItwPrPidChecksScreenNavigationParams } from "../screens/presentation/remote/pid/ItwPrPidChecksScreen";
import { ItwPrRemotePidChecksScreenNavigationParams } from "../screens/presentation/remote/pid/ItwPrRemotePidChecksScreen";
import { ITW_ROUTES } from "./ItwRoutes";

export type ItwParamsList = {
// ISSUING PID
[ITW_ROUTES.ISSUING.PID.INFO]: undefined;
[ITW_ROUTES.ISSUING.PID.AUTH]: undefined;
[ITW_ROUTES.ISSUING.PID.AUTH_INFO]: undefined;
[ITW_ROUTES.ISSUING.PID.REQUEST]: ItwPidRequestScreenNavigationParams;
[ITW_ROUTES.ISSUING.PID.REQUEST]: ItwIssuingPidRequestScreenNavigationParams;
[ITW_ROUTES.ISSUING.PID.PREVIEW]: undefined;
[ITW_ROUTES.ISSUING.PID.ADDING]: undefined;

Expand All @@ -35,7 +35,7 @@ export type ItwParamsList = {
// PRESENTATION REMOTE PID
[ITW_ROUTES.PRESENTATION.PID.DETAILS]: undefined;
[ITW_ROUTES.PRESENTATION.PID.REMOTE
.CHECKS]: ItwPrPidChecksScreenNavigationParams;
.CHECKS]: ItwPrRemotePidChecksScreenNavigationParams;
[ITW_ROUTES.PRESENTATION.PID.REMOTE.DATA]: undefined;
[ITW_ROUTES.PRESENTATION.PID.REMOTE.RESULT]: undefined;

Expand Down
60 changes: 30 additions & 30 deletions ts/features/it-wallet/navigation/ItwStackNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import ItwCieCardReaderScreen from "../screens/issuing/pid/cie/ItwCieCardReaderS
import ItwCieConsentDataUsageScreen from "../screens/issuing/pid/cie/ItwCieConsentDataUsageScreen";
import ItwCieExpiredOrInvalidScreen from "../screens/issuing/pid/cie/ItwCieExpiredOrInvalidScreen";
import ItwCieWrongPinScreen from "../screens/issuing/pid/cie/ItwCieWrongPinScreen";
import ItwPidInfoScreen from "../screens/issuing/pid/ItwPidInfoScreen";
import ItwPidAuthInfoScreen from "../screens/issuing/pid/ItwPidAuthInfoScreen";
import ItwIssuingPidInfoScreen from "../screens/issuing/pid/ItwIssuingPidInfoScreen";
import ItwIssuingPidAuthInfoScreen from "../screens/issuing/pid/ItwIssuingPidAuthInfoScreen";
import ItwPidPreviewScreen from "../screens/issuing/pid/cie/ItwPidPreviewScreen";
import ItwPidAddingScreen from "../screens/issuing/pid/ItwPidAddingScreen";
import ItwIssuingPidAddingScreen from "../screens/issuing/pid/ItwIssuingPidAddingScreen";
import ItwPrPidDetails from "../screens/presentation/ItwPrPidDetails";
import ItwPidRequestScreen from "../screens/issuing/pid/ItwPidRequestScreen";
import ItwPrPidChecksScreen from "../screens/presentation/remote/pid/ItwPrPidChecksScreen";
import ItwPrPidResultScreen from "../screens/presentation/remote/pid/ItwPrPidResultScreen";
import ItwPidAuthScreen from "../screens/issuing/pid/ItwPidAuthScreen";
import ItwIssuingPidRequestScreen from "../screens/issuing/pid/ItwIssuingPidRequestScreen";
import ItwPrRemotePidChecksScreen from "../screens/presentation/remote/pid/ItwPrRemotePidChecksScreen";
import ItwPrRemotePidResultScreen from "../screens/presentation/remote/pid/ItwPrRemotePidResultScreen";
import ItwIssuingPidAuthScreen from "../screens/issuing/pid/ItwIssuingPidAuthScreen";
import ItwGenericNotAvailableScreen from "../screens/generic/ItwGenericNotAvailableScreen";
import ItwCredentialPreviewScreen from "../screens/issuing/credential/ItwCredentialPreviewScreen";
import ItwCredentialAuthScreen from "../screens/issuing/credential/ItwCredentialAuthScreen";
import ItwPrCredentialChecksScreen from "../screens/presentation/remote/credential/ItwPrCredentialChecksScreen";
import ItwPrCredentialDataScreen from "../screens/presentation/remote/credential/ItwPrCredentialDataScreen";
import ItwPrCredentialResultScreen from "../screens/presentation/remote/credential/ItwPrCredentialResultScreen";
import ItwCredentialsChecksScreen from "../screens/issuing/credential/ItwCredentialChecksScreen";
import ItwCredentialCatalogScreen from "../screens/issuing/credential/ItwCredentialCatalogScreen";
import ItwIssuingCredentialPreviewScreen from "../screens/issuing/credential/ItwIssuingCredentialPreviewScreen";
import ItwIssuingCredentialAuthScreen from "../screens/issuing/credential/ItwIssuingCredentialAuthScreen";
import ItwPrRemoteCredentialChecksScreen from "../screens/presentation/remote/credential/ItwPrRemoteCredentialChecksScreen";
import ItwPrRemoteCredentialDataScreen from "../screens/presentation/remote/credential/ItwPrRemoteCredentialDataScreen";
import ItwPrRemoteCredentialResultScreen from "../screens/presentation/remote/credential/ItwPrRemoteCredentialResultScreen";
import ItwIssuingCredentialsChecksScreen from "../screens/issuing/credential/ItwIssuingCredentialChecksScreen";
import ItwIssuingCredentialCatalogScreen from "../screens/issuing/credential/ItwIssuingCredentialCatalogScreen";
import ItwPrCredentialDetailsScreen from "../screens/presentation/ItwPrCredentialDetails";
import ItwPrPidDataScreen from "../screens/presentation/remote/pid/ItwPrPidDataScreen";
import ItwPrRemotePidDataScreen from "../screens/presentation/remote/pid/ItwPrRemotePidDataScreen";
import ItwPrProximityQrCodeScreen from "../screens/presentation/ItwPrProximityQrCodeScreen";
import { ItwParamsList } from "./ItwParamsList";
import { ITW_ROUTES } from "./ItwRoutes";
Expand Down Expand Up @@ -61,45 +61,45 @@ export const ItwStackNavigator = () => (
{/* ISSUING PID */}
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.INFO}
component={ItwPidInfoScreen}
component={ItwIssuingPidInfoScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.AUTH}
component={ItwPidAuthScreen}
component={ItwIssuingPidAuthScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.AUTH_INFO}
component={ItwPidAuthInfoScreen}
component={ItwIssuingPidAuthInfoScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.REQUEST}
component={ItwPidRequestScreen}
component={ItwIssuingPidRequestScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.PREVIEW}
component={ItwPidPreviewScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.PID.ADDING}
component={ItwPidAddingScreen}
component={ItwIssuingPidAddingScreen}
/>

{/* ISSUING CREDENTIAL */}
<Stack.Screen
name={ITW_ROUTES.ISSUING.CREDENTIAL.CATALOG}
component={ItwCredentialCatalogScreen}
component={ItwIssuingCredentialCatalogScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.CREDENTIAL.CHECKS}
component={ItwCredentialsChecksScreen}
component={ItwIssuingCredentialsChecksScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.CREDENTIAL.AUTH}
component={ItwCredentialAuthScreen}
component={ItwIssuingCredentialAuthScreen}
/>
<Stack.Screen
name={ITW_ROUTES.ISSUING.CREDENTIAL.PREVIEW}
component={ItwCredentialPreviewScreen}
component={ItwIssuingCredentialPreviewScreen}
/>

{/* PRESENTATION PID */}
Expand All @@ -109,15 +109,15 @@ export const ItwStackNavigator = () => (
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.PID.REMOTE.CHECKS}
component={ItwPrPidChecksScreen}
component={ItwPrRemotePidChecksScreen}
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.PID.REMOTE.DATA}
component={ItwPrPidDataScreen}
component={ItwPrRemotePidDataScreen}
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.PID.REMOTE.RESULT}
component={ItwPrPidResultScreen}
component={ItwPrRemotePidResultScreen}
/>

{/* CREDENTIAL PRESENTATION */}
Expand All @@ -127,15 +127,15 @@ export const ItwStackNavigator = () => (
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.CREDENTIAL.REMOTE.CHECKS}
component={ItwPrCredentialChecksScreen}
component={ItwPrRemoteCredentialChecksScreen}
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.CREDENTIAL.REMOTE.DATA}
component={ItwPrCredentialDataScreen}
component={ItwPrRemoteCredentialDataScreen}
/>
<Stack.Screen
name={ITW_ROUTES.PRESENTATION.CREDENTIAL.REMOTE.RESULT}
component={ItwPrCredentialResultScreen}
component={ItwPrRemoteCredentialResultScreen}
/>

{/* PRESENTATION PROXIMITY */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { itwIssuanceChecksDataSelector } from "../../../store/reducers/new/itwIs
* This screen displays the information about the credential that is going to be shared
* with the issuer.
*/
const ItwCredentialAuthScreen = () => {
const ItwIssuingCredentialAuthScreen = () => {
const decodedPid = useIOSelector(itwDecodedPidValueSelector);
const checks = useIOSelector(itwIssuanceChecksDataSelector);
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
Expand Down Expand Up @@ -211,4 +211,4 @@ const ItwCredentialAuthScreen = () => {
</>
);
};
export default ItwCredentialAuthScreen;
export default ItwIssuingCredentialAuthScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const NONE_LOADING = -1;
/**
* Renders a preview screen which displays a visual representation and the claims contained in the PID.
*/
const ItwCredentialCatalogScreen = () => {
const ItwIssuingCredentialCatalogScreen = () => {
const dispatch = useIODispatch();
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const preliminaryChecks = useIOSelector(itwIssuanceChecksSelector);
Expand Down Expand Up @@ -146,4 +146,4 @@ const ItwCredentialCatalogScreen = () => {
);
};

export default ItwCredentialCatalogScreen;
export default ItwIssuingCredentialCatalogScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import ROUTES from "../../../../../navigation/routes";
* Screen that displays the result of the credential issuance checks
* by folding the preliminaryChecks pot.
*/
const ItwCredentialsChecksScreen = () => {
const ItwIssuingCredentialsChecksScreen = () => {
const toast = useIOToast();
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const preliminaryChecks = useIOSelector(itwIssuanceChecksSelector);
Expand Down Expand Up @@ -147,4 +147,4 @@ const ItwCredentialsChecksScreen = () => {
return <RenderMask />;
};

export default ItwCredentialsChecksScreen;
export default ItwIssuingCredentialsChecksScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { ITW_ROUTES } from "../../../navigation/ItwRoutes";
/**
* Renders a preview screen which displays a visual representation and the claims contained in the credential.
*/
const ItwCredentialPreviewScreen = () => {
const ItwIssuingCredentialPreviewScreen = () => {
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const issuanceResult = useIOSelector(itwIssuanceResultSelector);
const bannerViewRef = React.createRef<View>();
Expand Down Expand Up @@ -195,4 +195,4 @@ const ItwCredentialPreviewScreen = () => {
return <RenderMask />;
};

export default ItwCredentialPreviewScreen;
export default ItwIssuingCredentialPreviewScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ItwKoView from "../../../components/ItwKoView";
/**
* Renders an activation screen which displays a loading screen while the PID is being added and a success screen when the PID is added.
*/
const ItwPidAddingScreen = () => {
const ItwIssuingPidAddingScreen = () => {
const dispatch = useIODispatch();
const pid = useIOSelector(itwPidValueSelector);
const navigation = useNavigation();
Expand Down Expand Up @@ -93,4 +93,4 @@ const ItwPidAddingScreen = () => {
return <RenderMask />;
};

export default ItwPidAddingScreen;
export default ItwIssuingPidAddingScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
/**
* Renders the screen which displays the information about the authentication process to obtain a Wallet Instance.
*/
const ItwPidAuthInfoScreen = () => {
const ItwIssuingPidAuthInfoScreen = () => {
const navigation = useNavigation();
const dispatch = useIODispatch();
const wia = useIOSelector(itwWiaStateSelector);
Expand Down Expand Up @@ -131,4 +131,4 @@ const ItwPidAuthInfoScreen = () => {
return <RenderMask />;
};

export default ItwPidAuthInfoScreen;
export default ItwIssuingPidAuthInfoScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { useItwInfoBottomSheet } from "../../../hooks/useItwInfoBottomSheet";
* Renders the screen which display a list of features (or trusty providers)
* to activate the wallet.
*/
const ItwPidAuthScreen = () => {
const ItwIssuingPidAuthScreen = () => {
const navigation = useNavigation();

const { present, bottomSheet } = useItwInfoBottomSheet({
Expand Down Expand Up @@ -204,4 +204,4 @@ const ItwPidAuthScreen = () => {
);
};

export default ItwPidAuthScreen;
export default ItwIssuingPidAuthScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import itwCardImage from "../../../assets/img/issuing/itw_card.png";
import { isAndroid } from "../../../../../utils/platform";
import ItwFooterVerticalButtons from "../../../components/ItwFooterVerticalButtons";

const ItwPidInfoScreen = () => {
const ItwIssuingPidInfoScreen = () => {
const dispatch = useIODispatch();
const navigation = useNavigation();

Expand Down Expand Up @@ -98,4 +98,4 @@ const ItwPidInfoScreen = () => {
);
};

export default ItwPidInfoScreen;
export default ItwIssuingPidInfoScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,23 @@ import {
} from "../../../utils/itwErrorsUtils";

/**
* ItwPidRequestScreen's navigation params.
* ItwIssuingPidRequestScreen's navigation params.
* The pidData consists of the data needed to request a PID.
*/
export type ItwPidRequestScreenNavigationParams = {
export type ItwIssuingPidRequestScreenNavigationParams = {
pidData: PidData;
};

/**
* Renders a preview screen which requests a PID.
*/
const ItwPidRequestScreen = () => {
const ItwIssuingPidRequestScreen = () => {
const route =
useRoute<
Route<"ITW_ACTIVATION_PID_REQUEST", ItwPidRequestScreenNavigationParams>
Route<
"ITW_ACTIVATION_PID_REQUEST",
ItwIssuingPidRequestScreenNavigationParams
>
>();
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const dispatch = useIODispatch();
Expand Down Expand Up @@ -110,4 +113,4 @@ const ItwPidRequestScreen = () => {
);
};

export default ItwPidRequestScreen;
export default ItwIssuingPidRequestScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { getItwGenericMappedError } from "../../../../utils/itwErrorsUtils";
* It shows an error screen if the checks fail.
* The view is rendered based on the state of the checks pot.
*/
const ItwPrCredentialChecksScreen = () => {
const ItwPrRemoteCredentialChecksScreen = () => {
const dispatch = useIODispatch();
const checksPot = useIOSelector(itwPresentationChecksSelector);
const navigation =
Expand Down Expand Up @@ -87,4 +87,4 @@ const ItwPrCredentialChecksScreen = () => {
return <RenderMask />;
};

export default ItwPrCredentialChecksScreen;
export default ItwPrRemoteCredentialChecksScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ContentViewParams = {
* This screen displays the information about the credential that is going to be shared
* with the issuer.
*/
const ItwPrCredentialDataScreen = () => {
const ItwPrRemoteCredentialDataScreen = () => {
const decodedPid = useIOSelector(itwDecodedPidValueSelector);
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const rpMock = getRpMock();
Expand Down Expand Up @@ -246,4 +246,4 @@ const styles = StyleSheet.create({
}
});

export default ItwPrCredentialDataScreen;
export default ItwPrRemoteCredentialDataScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { getItwGenericMappedError } from "../../../../utils/itwErrorsUtils";
* It shows an error screen if the checks fail.
* The view is rendered based on the state of the checks pot.
*/
const ItwPrCredentialResultScreen = () => {
const ItwPrRemoteCredentialResultScreen = () => {
const dispatch = useIODispatch();
const resultPot = useIOSelector(itwPresentationResultSelector);
const navigation =
Expand Down Expand Up @@ -95,4 +95,4 @@ const ItwPrCredentialResultScreen = () => {
return <RenderMask />;
};

export default ItwPrCredentialResultScreen;
export default ItwPrRemoteCredentialResultScreen;
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ import { IOStackNavigationProp } from "../../../../../../navigation/params/AppPa
import ItwContinueView from "../../../../components/ItwContinueView";

/**
* ItwPrPidChecksScreenNavigationParams's navigation params.
* ItwPrRemotePidChecksScreenNavigationParams's navigation params.
* The authReqUrl is the url to use to start the RP flow.
*/
export type ItwPrPidChecksScreenNavigationParams = RpData;
export type ItwPrRemotePidChecksScreenNavigationParams = RpData;

/**
* Type of the route props for the ItwPidRequestScreen.
* Type of the route props for the ItwIssuingPidRequestScreen.
*/
type ItwPrPidChecksScreenRouteProps = RouteProp<
type ItwPrRemotePidChecksScreenRouteProps = RouteProp<
ItwParamsList,
"ITW_PRESENTATION_PID_REMOTE_CHECKS"
>;

const ItwPrPidChecksScreen = () => {
const route = useRoute<ItwPrPidChecksScreenRouteProps>();
const ItwPrRemotePidChecksScreen = () => {
const route = useRoute<ItwPrRemotePidChecksScreenRouteProps>();
const dispatch = useIODispatch();
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const initStatus = useIOSelector(itwRpInitializationSelector);
Expand Down Expand Up @@ -105,4 +105,4 @@ const ItwPrPidChecksScreen = () => {
return <RenderMask />;
};

export default ItwPrPidChecksScreen;
export default ItwPrRemotePidChecksScreen;
Loading

0 comments on commit 9ea1542

Please sign in to comment.