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

feat(privacy): [IOPID-2609] Disable screenshots and recordings in PinCreation and CiePinScreen components #6628

Merged
merged 5 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
"@babel/plugin-transform-react-jsx": "^7.25.9",
"@gorhom/bottom-sheet": "^4.1.5",
"@pagopa/io-app-design-system": "4.3.0",
"@pagopa/io-app-design-system": "4.3.1",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-cieid": "^0.3.5",
"@pagopa/io-react-native-crypto": "^1.0.1",
Expand Down
2 changes: 2 additions & 0 deletions ts/components/screens/PinCreation/PinCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { setAccessibilityFocus } from "../../../utils/accessibility";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { ContextualHelpPropsMarkdown } from "../BaseScreenComponent";
import { PIN_LENGTH_SIX } from "../../../utils/constants";
import { usePreventScreenCapture } from "../../../utils/hooks/usePreventScreenCapture";
import usePinValidationBottomSheet from "./usePinValidationBottomSheet";
import { PinCaouselItemProps, PinCarouselItem } from "./PinCarouselItem";

Expand All @@ -56,6 +57,7 @@ type PinMode = "creation" | "confirmation";
* This component will allow the user to create a new pin or change the existing one.
*/
export const PinCreation = ({ isOnboarding = false }: Props) => {
usePreventScreenCapture();
const navigation = useIONavigation();
const [pin, setPin] = useState("");
const [pinConfirmation, setPinConfirmation] = useState("");
Expand Down
4 changes: 4 additions & 0 deletions ts/components/screens/__tests__/PinCreation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const DESC_NUMBER_SEQUENCE = Array.from({ length: PIN_LENGTH_SIX }, (_, i) =>
String(i + 1)
);

jest.mock("../../../utils/hooks/usePreventScreenCapture", () => ({
usePreventScreenCapture: jest.fn()
}));

const invalidPinCases = [
REPEATED_NUMBERS,
ASC_NUMBERS_SEQUENCE,
Expand Down
2 changes: 2 additions & 0 deletions ts/screens/authentication/cie/CiePinScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {
trackLoginCiePinInfo,
trackLoginCiePinScreen
} from "../analytics/cieAnalytics";
import { usePreventScreenCapture } from "../../../utils/hooks/usePreventScreenCapture";

const CIE_PIN_LENGTH = 8;

Expand All @@ -70,6 +71,7 @@ const getContextualHelp = (): ContextualHelpPropsMarkdown => ({
const onOpenForgotPinPage = () => openWebUrl(pinPukHelpUrl);

const CiePinScreen = () => {
usePreventScreenCapture();
shadowsheep1 marked this conversation as resolved.
Show resolved Hide resolved
useOnFirstRender(() => {
trackLoginCiePinScreen();
});
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3753,9 +3753,9 @@ __metadata:
languageName: node
linkType: hard

"@pagopa/io-app-design-system@npm:4.3.0":
version: 4.3.0
resolution: "@pagopa/io-app-design-system@npm:4.3.0"
"@pagopa/io-app-design-system@npm:4.3.1":
version: 4.3.1
resolution: "@pagopa/io-app-design-system@npm:4.3.1"
dependencies:
"@testing-library/jest-native": ^5.4.2
"@types/react-test-renderer": ^18.0.0
Expand All @@ -3779,7 +3779,7 @@ __metadata:
react-native-reanimated: "*"
react-native-safe-area-context: "*"
react-native-svg: "*"
checksum: f139ca05d783292fd4d1816698c56028d27ce58ece7d4acf1f5547757abb78d01019f6c4b29a697feb433e593771c9b4ee0cce8779c031bc84ef31d185572d09
checksum: 97c540c1e29cf3da90f5ea521a54dd1b46f418bc2cc6add748c48630f240a1df67e3825ca838b84de8c14416fdd7d5fd77fa414b68eddf6875ad2b0cd1a6f181
languageName: node
linkType: hard

Expand Down Expand Up @@ -13657,7 +13657,7 @@ __metadata:
"@babel/runtime": ^7.20.0
"@gorhom/bottom-sheet": ^4.1.5
"@jambit/eslint-plugin-typed-redux-saga": ^0.4.0
"@pagopa/io-app-design-system": 4.3.0
"@pagopa/io-app-design-system": 4.3.1
"@pagopa/io-pagopa-commons": ^3.1.0
"@pagopa/io-react-native-cieid": ^0.3.5
"@pagopa/io-react-native-crypto": ^1.0.1
Expand Down
Loading