Skip to content

Commit

Permalink
Merge branch 'master' into SFEQS-2083-replace-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
hevelius authored Feb 23, 2024
2 parents d5b17b2 + 4e32f86 commit 2fc1faf
Show file tree
Hide file tree
Showing 125 changed files with 90 additions and 131 deletions.
2 changes: 0 additions & 2 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ profile:
title: Warning
message: To add a new test card, you must enable the pagoPA test environment from the settings.
closeButton: Close
walletPlayground:
titleSection: "New Wallet"
data:
title: Your data
subtitle: Here you will find your personal and contact data used by the IO app.
Expand Down
2 changes: 0 additions & 2 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ profile:
title: Attenzione
message: Per aggiungere una nuova carta di test, devi abilitare l'ambiente pagoPA di test dalle impostazioni.
closeButton: Chiudi
walletPlayground:
titleSection: "New Wallet"
data:
title: I tuoi dati
subtitle: Qui trovi i tuoi dati anagrafici e di contatto utilizzati da app IO
Expand Down
4 changes: 2 additions & 2 deletions ts/features/barcode/screens/BarcodeScanScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { emptyContextualHelp } from "../../../utils/emptyContextualHelp";
import { useIOBottomSheetAutoresizableModal } from "../../../utils/hooks/bottomSheet";
import { IDPayPaymentRoutes } from "../../idpay/payment/navigation/navigator";
import { WalletPaymentRoutes } from "../../walletV3/payment/navigation/routes";
import { WalletPaymentRoutes } from "../../payments/payment/navigation/routes";
import * as analytics from "../analytics";
import { BarcodeScanBaseScreenComponent } from "../components/BarcodeScanBaseScreenComponent";
import { useIOBarcodeFileReader } from "../hooks/useIOBarcodeFileReader";
Expand All @@ -38,7 +38,7 @@ import {
} from "../types/IOBarcode";
import { BarcodeFailure } from "../types/failure";
import { getIOBarcodesByType } from "../utils/getBarcodesByType";
import { WalletBarcodeRoutes } from "../../walletV3/barcode/navigation/routes";
import { WalletBarcodeRoutes } from "../../payments/barcode/navigation/routes";
import { useHardwareBackButton } from "../../../hooks/useHardwareBackButton";

const BarcodeScanScreen = () => {
Expand Down
10 changes: 5 additions & 5 deletions ts/features/common/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
CieLoginState
} from "../../../cieLogin/store/reducers";

import walletV3Reducer, {
WalletState as WalletV3State
} from "../../../walletV3/common/store/reducers";
import paymentsReducer, {
PaymentsState
} from "../../../payments/common/store/reducers";
import {
fastLoginReducer,
FastLoginState
Expand All @@ -50,7 +50,7 @@ export type FeaturesState = {
idPay: IDPayState;
whatsNew: WhatsNewState & PersistPartial;
loginFeatures: LoginFeaturesState;
wallet: WalletV3State;
payments: PaymentsState;
};

export type PersistedFeaturesState = FeaturesState & PersistPartial;
Expand All @@ -60,7 +60,7 @@ const rootReducer = combineReducers<FeaturesState, Action>({
pn: pnReducer,
fci: fciReducer,
idPay: idPayReducer,
wallet: walletV3Reducer,
payments: paymentsReducer,
whatsNew: whatsNewPersistor,
loginFeatures: combineReducers<LoginFeaturesState, Action>({
testLogin: testLoginReducer,
Expand Down
2 changes: 1 addition & 1 deletion ts/features/design-system/core/DSListItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ProductCategoryEnum } from "../../../../definitions/cgn/merchants/Produ
import DetailedlistItemComponent from "../../../components/DetailedlistItemComponent";
import CgnMerchantListItem from "../../bonus/cgn/components/merchants/CgnMerchantListItem";
import OrderOption from "../../bonus/cgn/components/merchants/search/OrderOption";
import { getBadgeTextByTransactionStatus } from "../../walletV3/common/utils";
import { getBadgeTextByTransactionStatus } from "../../payments/common/utils";
import ZendeskItemPermissionComponent from "../../zendesk/components/ZendeskItemPermissionComponent";
import { DesignSystemScreen } from "../components/DesignSystemScreen";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
import I18n from "../../../../i18n";
import { hoursAndMinutesToAccessibilityReadableFormat } from "../../../../utils/accessibility";
import { localeDateFormat } from "../../../../utils/locale";
import { getBadgeTextByTransactionStatus } from "../../../walletV3/common/utils";
import { getBadgeTextByTransactionStatus } from "../../../payments/common/utils";
import { formatAbsNumberAmountOrDefault } from "../../common/utils/strings";

export type TimelineOperationListItemProps = WithTestID<
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { walletApiBaseUrl, walletApiUatBaseUrl } from "../../../../config";
import { watchWalletDetailsSaga } from "../../details/saga";
import { watchWalletTransactionSaga } from "../../transaction/saga";

export function* watchWalletSaga(walletToken: string): SagaIterator {
export function* watchPaymentsSaga(walletToken: string): SagaIterator {
const isPagoPATestEnabled = yield* select(isPagoPATestEnabledSelector);

const walletBaseUrl = isPagoPATestEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { WalletOnboardingActions } from "../../../onboarding/store/actions";
import { WalletPaymentActions } from "../../../payment/store/actions";
import { WalletTransactionActions } from "../../../transaction/store/actions";

export type WalletActions =
export type PaymentsActions =
| WalletOnboardingActions
| WalletDetailsActions
| WalletPaymentActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ import walletTransactionReducer, {
WalletTransactionState
} from "../../../transaction/store";

export type WalletState = {
export type PaymentsState = {
onboarding: WalletOnboardingState;
details: WalletDetailsState;
payment: WalletPaymentState;
transaction: WalletTransactionState;
history: WalletPaymentHistoryState & PersistPartial;
};

const walletReducer = combineReducers({
const paymentsReducer = combineReducers({
onboarding: walletOnboardingReducer,
details: walletDetailsReducer,
payment: walletPaymentReducer,
transaction: walletTransactionReducer,
history: walletPaymentHistoryReducer
});

export default walletReducer;
export default paymentsReducer;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as _ from "lodash";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
import { Action } from "../../../../store/actions/types";
import { NetworkError } from "../../../../utils/errors";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";

import { ServiceNameEnum } from "../../../../../definitions/pagopa/walletv3/ServiceName";
import { WalletInfo } from "../../../../../definitions/pagopa/walletv3/WalletInfo";
import { ServiceStatusEnum } from "../../../../../definitions/pagopa/walletv3/ServiceStatus";
import { WalletInfo } from "../../../../../definitions/pagopa/walletv3/WalletInfo";
import {
walletDetailsGetInstrument,
walletDetailsPagoPaCapabilityToggle
Expand Down Expand Up @@ -78,26 +76,18 @@ const walletDetailsReducer = (
};

const walletDetailsSelector = (state: GlobalState) =>
state.features.wallet.details;
state.features.payments.details;

export const walletDetailsInstrumentPotSelector = createSelector(
walletDetailsSelector,
details => details.walletDetails
);
export const walletDetailsInstrumentPotSelector = (state: GlobalState) =>
walletDetailsSelector(state).walletDetails;

export const walletDetailsInstrumentSelector = createSelector(
walletDetailsInstrumentPotSelector,
details => pot.toUndefined(details)
);
export const walletDetailsInstrumentSelector = (state: GlobalState) =>
pot.toUndefined(walletDetailsSelector(state).walletDetails);

export const isLoadingWalletInstrumentSelector = createSelector(
walletDetailsInstrumentPotSelector,
walletInstrument => pot.isLoading(walletInstrument)
);
export const isLoadingWalletInstrumentSelector = (state: GlobalState) =>
pot.isLoading(walletDetailsSelector(state).walletDetails);

export const isErrorWalletInstrumentSelector = createSelector(
walletDetailsInstrumentPotSelector,
walletInstrument => pot.isError(walletInstrument)
);
export const isErrorWalletInstrumentSelector = (state: GlobalState) =>
pot.isError(walletDetailsSelector(state).walletDetails);

export default walletDetailsReducer;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("Test Wallet payment history reducers and selectors", () => {

it("should have INITIAL_STATE before any dispatched action", () => {
const globalState = appReducer(undefined, applicationChangeState("active"));
expect(globalState.features.wallet.history).toStrictEqual({
expect(globalState.features.payments.history).toStrictEqual({
archive: []
});
expect(selectWalletPaymentHistoryArchive(globalState)).toStrictEqual([]);
Expand All @@ -43,12 +43,14 @@ describe("Test Wallet payment history reducers and selectors", () => {
);

expect(
store.getState().features.wallet.history.ongoingPayment
store.getState().features.payments.history.ongoingPayment
).toStrictEqual({
startOrigin: T_START_ORIGIN,
lookupId: MOCKED_LOOKUP_ID,
startedAt: MOCKED_DATE
});
expect(store.getState().features.wallet.history.archive).toStrictEqual([]);
expect(store.getState().features.payments.history.archive).toStrictEqual(
[]
);
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GlobalState } from "../../../../../store/reducers/types";

export const selectWalletPaymentHistoryArchive = (state: GlobalState) =>
state.features.wallet.history.archive;
state.features.payments.history.archive;

export const selectWalletOngoingPaymentHistory = (state: GlobalState) =>
state.features.wallet.history.ongoingPayment;
state.features.payments.history.ongoingPayment;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as _ from "lodash";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
import { PaymentMethodsResponse } from "../../../../../definitions/pagopa/walletv3/PaymentMethodsResponse";
import { WalletCreateResponse } from "../../../../../definitions/pagopa/walletv3/WalletCreateResponse";
import { Action } from "../../../../store/actions/types";
import { NetworkError } from "../../../../utils/errors";
import { GlobalState } from "../../../../store/reducers/types";
import { WalletCreateResponse } from "../../../../../definitions/pagopa/walletv3/WalletCreateResponse";
import { PaymentMethodsResponse } from "../../../../../definitions/pagopa/walletv3/PaymentMethodsResponse";
import { NetworkError } from "../../../../utils/errors";

import { walletGetPaymentMethods, walletStartOnboarding } from "./actions";

Expand Down Expand Up @@ -72,21 +70,15 @@ const walletOnboardingReducer = (
};

const walletOnboardingSelector = (state: GlobalState) =>
state.features.wallet.onboarding;
state.features.payments.onboarding;

export const walletOnboardingStartupSelector = createSelector(
walletOnboardingSelector,
onboarding => onboarding.result
);
export const walletOnboardingStartupSelector = (state: GlobalState) =>
walletOnboardingSelector(state).result;

export const walletOnboardingPaymentMethodsSelector = createSelector(
walletOnboardingSelector,
onboarding => onboarding.paymentMethods
);
export const walletOnboardingPaymentMethodsSelector = (state: GlobalState) =>
walletOnboardingSelector(state).paymentMethods;

export const isLoadingPaymentMethodsSelector = createSelector(
walletOnboardingPaymentMethodsSelector,
paymentMethods => pot.isLoading(paymentMethods)
);
export const isLoadingPaymentMethodsSelector = (state: GlobalState) =>
pot.isLoading(walletOnboardingSelector(state).paymentMethods);

export default walletOnboardingReducer;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ const INITIAL_STATE: WalletPaymentState = {
describe("Test Wallet reducer", () => {
it("should have initial state at startup", () => {
const globalState = appReducer(undefined, applicationChangeState("active"));
expect(globalState.features.wallet.payment).toStrictEqual(INITIAL_STATE);
expect(globalState.features.payments.payment).toStrictEqual(INITIAL_STATE);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ import { createSelector } from "reselect";
import { GlobalState } from "../../../../../store/reducers/types";

const selectWalletPayment = (state: GlobalState) =>
state.features.wallet.payment;
state.features.payments.payment;

export const selectWalletPaymentSessionTokenPot = (state: GlobalState) =>
selectWalletPayment(state).sessionToken;

export const selectWalletPaymentSessionToken = (state: GlobalState) =>
pot.toUndefined(selectWalletPaymentSessionTokenPot(state));

export const walletPaymentRptIdSelector = createSelector(
selectWalletPayment,
state => state.rptId
);
export const walletPaymentRptIdSelector = (state: GlobalState) =>
selectWalletPayment(state).rptId;

export const walletPaymentDetailsSelector = createSelector(
selectWalletPayment,
state => state.paymentDetails
);
export const walletPaymentDetailsSelector = (state: GlobalState) =>
selectWalletPayment(state).paymentDetails;

export const walletPaymentAmountSelector = createSelector(
walletPaymentDetailsSelector,
Expand Down Expand Up @@ -58,32 +54,20 @@ export const walletPaymentSavedMethodByIdSelector = createSelector(
)
);

export const walletPaymentPickedPaymentMethodSelector = createSelector(
selectWalletPayment,
state => state.chosenPaymentMethod
);
export const walletPaymentPickedPaymentMethodSelector = (state: GlobalState) =>
selectWalletPayment(state).chosenPaymentMethod;

export const walletPaymentPspListSelector = createSelector(
selectWalletPayment,
state => state.pspList
);
export const walletPaymentPspListSelector = (state: GlobalState) =>
selectWalletPayment(state).pspList;

export const walletPaymentPickedPspSelector = createSelector(
selectWalletPayment,
state => state.chosenPsp
);
export const walletPaymentPickedPspSelector = (state: GlobalState) =>
selectWalletPayment(state).chosenPsp;

export const walletPaymentTransactionSelector = createSelector(
selectWalletPayment,
state => state.transaction
);
export const walletPaymentTransactionSelector = (state: GlobalState) =>
selectWalletPayment(state).transaction;

export const walletPaymentAuthorizationUrlSelector = createSelector(
selectWalletPayment,
state => state.authorizationUrl
);
export const walletPaymentAuthorizationUrlSelector = (state: GlobalState) =>
selectWalletPayment(state).authorizationUrl;

export const walletPaymentStartRouteSelector = createSelector(
selectWalletPayment,
state => state.startRoute
);
export const walletPaymentStartRouteSelector = (state: GlobalState) =>
selectWalletPayment(state).startRoute;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as pot from "@pagopa/ts-commons/lib/pot";
import * as _ from "lodash";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
import { Action } from "../../../../store/actions/types";
import { NetworkError } from "../../../../utils/errors";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";

import { Transaction } from "../../../../types/pagopa";
import { walletTransactionDetailsGet } from "./actions";
Expand Down Expand Up @@ -48,11 +46,9 @@ const walletTransactionReducer = (
};

const walletTransactionSelector = (state: GlobalState) =>
state.features.wallet.transaction;
state.features.payments.transaction;

export const walletTransactionDetailsPotSelector = createSelector(
walletTransactionSelector,
transaction => transaction.details
);
export const walletTransactionDetailsPotSelector = (state: GlobalState) =>
walletTransactionSelector(state).details;

export default walletTransactionReducer;
14 changes: 7 additions & 7 deletions ts/navigation/AuthenticatedStackNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ import {
import UnsupportedDeviceScreen from "../features/lollipop/screens/UnsupportedDeviceScreen";
import UADONATION_ROUTES from "../features/uaDonations/navigation/routes";
import { UAWebViewScreen } from "../features/uaDonations/screens/UAWebViewScreen";
import { WalletBarcodeNavigator } from "../features/walletV3/barcode/navigation/navigator";
import { WalletBarcodeRoutes } from "../features/walletV3/barcode/navigation/routes";
import { WalletBarcodeNavigator } from "../features/payments/barcode/navigation/navigator";
import { WalletBarcodeRoutes } from "../features/payments/barcode/navigation/routes";
import {
WalletDetailsNavigator,
WalletDetailsRoutes
} from "../features/walletV3/details/navigation/navigator";
} from "../features/payments/details/navigation/navigator";
import {
WalletOnboardingNavigator,
WalletOnboardingRoutes
} from "../features/walletV3/onboarding/navigation/navigator";
import { WalletPaymentNavigator } from "../features/walletV3/payment/navigation/navigator";
import { WalletPaymentRoutes } from "../features/walletV3/payment/navigation/routes";
} from "../features/payments/onboarding/navigation/navigator";
import { WalletPaymentNavigator } from "../features/payments/payment/navigation/navigator";
import { WalletPaymentRoutes } from "../features/payments/payment/navigation/routes";
import {
WalletTransactionNavigator,
WalletTransactionRoutes
} from "../features/walletV3/transaction/navigation/navigator";
} from "../features/payments/transaction/navigation/navigator";
import { ZendeskStackNavigator } from "../features/zendesk/navigation/navigator";
import ZENDESK_ROUTES from "../features/zendesk/navigation/routes";
import { GalleryPermissionInstructionsScreen } from "../screens/misc/GalleryPermissionInstructionsScreen";
Expand Down
Loading

0 comments on commit 2fc1faf

Please sign in to comment.