From 7dbf39baa25482ae99f2a7b50dbec6a5b02f68be Mon Sep 17 00:00:00 2001 From: Cristiano Tofani Date: Thu, 1 Feb 2024 17:07:25 +0100 Subject: [PATCH] chore: [IOPLT-326] Change reference on io-react-native-zendesk to load from zendesk (#5468) ## Short description This PR changes the installation reference of the io-react-native-zendesk library from github to npm release ## How to test Nothing should be changed, a part from the installation point of the library. Open a Zendesk help request to check anything's fine. --------- Co-authored-by: LazyAfternoons --- jest.config.js | 2 +- jest.config.no.timezone.js | 2 +- jestSetup.js | 2 ++ package.json | 2 +- ts/utils/supportAssistance.ts | 2 +- yarn.lock | 9 +++++---- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/jest.config.js b/jest.config.js index b1c2be49cb8..2b4929b5032 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,7 +4,7 @@ module.exports = { "^.+\\.js$": "/node_modules/react-native/jest/preprocessor.js" }, transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|native-base|native-base-shoutem-theme|@shoutem/animation|@shoutem/ui|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|@react-native-community/datetimepicker|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|io-react-native-zendesk|rn-qr-generator)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|native-base|native-base-shoutem-theme|@shoutem/animation|@shoutem/ui|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|@react-native-community/datetimepicker|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jest.config.no.timezone.js b/jest.config.no.timezone.js index c7d4185b54f..c9197d78ffd 100644 --- a/jest.config.no.timezone.js +++ b/jest.config.no.timezone.js @@ -4,7 +4,7 @@ module.exports = { "^.+\\.js$": "/node_modules/react-native/jest/preprocessor.js" }, transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|native-base|native-base-shoutem-theme|@shoutem/animation|@shoutem/ui|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|@react-native-community/datetimepicker|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|io-react-native-zendesk)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|native-base|native-base-shoutem-theme|@shoutem/animation|@shoutem/ui|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|@react-native-community/datetimepicker|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jestSetup.js b/jestSetup.js index 1f99c8a8aad..60213bda3a4 100644 --- a/jestSetup.js +++ b/jestSetup.js @@ -9,6 +9,7 @@ import nodeFetch from "node-fetch"; import { NativeModules } from "react-native"; import mockRNDeviceInfo from "react-native-device-info/jest/react-native-device-info-mock"; import mockRNCameraRoll from "@react-native-camera-roll/camera-roll/src/__mocks__/nativeInterface"; +import mockZendesk from "./ts/__mocks__/io-react-native-zendesk.ts"; // eslint-disable-next-line functional/immutable-data NativeModules.RNGestureHandlerModule = { @@ -21,6 +22,7 @@ NativeModules.RNGestureHandlerModule = { Directions: {} }; +jest.mock("@pagopa/io-react-native-zendesk", () => mockZendesk); jest.mock("@react-native-async-storage/async-storage", () => mockAsyncStorage); jest.mock("@react-native-community/push-notification-ios", jest.fn()); jest.mock("@react-native-cookies/cookies", jest.fn()); diff --git a/package.json b/package.json index b4746957867..a4855bdf366 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,7 @@ "@pagopa/io-pagopa-commons": "^3.1.0", "@pagopa/io-react-native-crypto": "^0.2.1", "@pagopa/io-react-native-login-utils": "^0.2.2", + "@pagopa/io-react-native-zendesk": "^0.3.28", "@pagopa/react-native-cie": "1.2.0", "@pagopa/ts-commons": "^10.15.0", "@react-native-async-storage/async-storage": "^1.17.10", @@ -126,7 +127,6 @@ "front-matter": "^4.0.2", "hastscript": "^7.0.2", "hoist-non-react-statics": "^3.0.1", - "io-react-native-zendesk": "https://github.com/pagopa/io-react-native-zendesk.git#0.3.25", "io-ts": "^2.2.16", "jail-monkey": "^2.3.2", "jwk-thumbprint": "^0.1.4", diff --git a/ts/utils/supportAssistance.ts b/ts/utils/supportAssistance.ts index b889880497e..ab446628975 100644 --- a/ts/utils/supportAssistance.ts +++ b/ts/utils/supportAssistance.ts @@ -1,4 +1,4 @@ -import ZendDesk from "io-react-native-zendesk"; +import ZendDesk from "@pagopa/io-react-native-zendesk"; import * as O from "fp-ts/lib/Option"; import { pipe } from "fp-ts/lib/function"; import { ToolEnum } from "../../definitions/content/AssistanceToolConfig"; diff --git a/yarn.lock b/yarn.lock index e7d8801e656..063bfb61df9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3089,6 +3089,11 @@ resolved "https://registry.yarnpkg.com/@pagopa/io-react-native-login-utils/-/io-react-native-login-utils-0.2.2.tgz#9b37787f98d94fac645e70bda926638b14e59d0d" integrity sha512-rOChvrMsJ5QvfLvcsttGP6M5LZkOWhOD2YVRL4+bMCVqNRMsSDmteBNoMWzWlRcXrKyd2ZORgDEa1zPmMRMhTw== +"@pagopa/io-react-native-zendesk@^0.3.28": + version "0.3.28" + resolved "https://registry.yarnpkg.com/@pagopa/io-react-native-zendesk/-/io-react-native-zendesk-0.3.28.tgz#eaef19df577bee000b615f6813d52546a1f2513f" + integrity sha512-U6avcojN+lbQgus1aYiggJ19wsqoHcVCm1EN4Dc7E+f32aCCfvsclFSisKd5FpubGsUdEd/x3De/+5At5c+K9w== + "@pagopa/openapi-codegen-ts@^12.2.1": version "12.2.1" resolved "https://registry.yarnpkg.com/@pagopa/openapi-codegen-ts/-/openapi-codegen-ts-12.2.1.tgz#e2cc9cedcbb23077b4f3f80e970ebd9c55e71afe" @@ -9624,10 +9629,6 @@ invariant@*, invariant@2.2.4, invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -"io-react-native-zendesk@https://github.com/pagopa/io-react-native-zendesk.git#0.3.25": - version "0.3.23" - resolved "https://github.com/pagopa/io-react-native-zendesk.git#66492028f52d3c64392ac4174d80d6fbf65d0e92" - io-ts@2.2.20: version "2.2.20" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.20.tgz#be42b75f6668a2c44f706f72ee6e4c906777c7f5"