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

chore(Cross): [IOAPPX-445] Replace legacy FooterWithButtons with a mix of FooterActions and FooterActionsInline #6477

Merged
merged 21 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
559a8c5
Replace first instances of `FooterWithButtons`
dmnplb Dec 2, 2024
8e101f8
Replace legacy instances of `FooterWithButtons`
dmnplb Dec 2, 2024
47ba751
Replace legacy instances of `FooterWithButtons`
dmnplb Dec 3, 2024
73765ff
Update `jest` snapshots
dmnplb Dec 3, 2024
fe9f328
Remove `FooterTopShadow` and `FooterStackButtons`
dmnplb Dec 3, 2024
64aec62
Fix `tsc` error
dmnplb Dec 3, 2024
756de29
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 3, 2024
1c449c1
Remove three button combo from `DocumentViewer`
dmnplb Dec 3, 2024
af1d0f8
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 3, 2024
410b65e
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 4, 2024
3de411a
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 5, 2024
a231809
Remove comment from `DocumentViewer`
dmnplb Dec 5, 2024
435f6e6
Rename variable name in the FCI flow
dmnplb Dec 5, 2024
a085f06
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 5, 2024
e293e2e
Update `jest` snapshots
dmnplb Dec 5, 2024
6458b0b
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
LeleDallas Dec 6, 2024
d53bd1c
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
LeleDallas Dec 6, 2024
ea77a7d
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
LeleDallas Dec 9, 2024
7b3c2cd
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
LeleDallas Dec 9, 2024
cbe5fb4
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 10, 2024
7655ab7
Merge branch 'master' into IOAPPX-445-replace-legacy-footer-with-buttons
dmnplb Dec 10, 2024
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
24 changes: 0 additions & 24 deletions ts/components/FooterTopShadow.tsx

This file was deleted.

13 changes: 6 additions & 7 deletions ts/components/TosWebviewErrorComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from "react";
import {
FooterWithButtons,
FooterActions,
H3,
IOStyles,
Pictogram,
VSpacer
} from "@pagopa/io-app-design-system";
import React from "react";
import { View } from "react-native";
import I18n from "../i18n";

Expand All @@ -32,11 +32,10 @@ const TosWebviewErrorComponent = ({
{I18n.t("onboarding.tos.error")}
</H3>
</View>
<FooterWithButtons
type="SingleButton"
primary={{
type: "Solid",
buttonProps: {
<FooterActions
actions={{
type: "SingleButton",
primary: {
label: I18n.t("global.buttons.retry"),
onPress: handleRetry,
testID: "RetryButtonTest"
Expand Down
5 changes: 2 additions & 3 deletions ts/components/__tests__/TosWebviewComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe("TosWebviewComponent", () => {
it("The footer should not render", () => {
const renderAPI = commonSetup({ shouldRenderFooter: false });
// The footer should be rendered
const footerWithButtonsViewRTI =
renderAPI.queryByTestId("FooterWithButtons");
const footerWithButtonsViewRTI = renderAPI.queryByTestId("FooterActions");
expect(footerWithButtonsViewRTI).toBeFalsy();
});
});
Expand All @@ -74,7 +73,7 @@ describe("TosWebviewComponent", () => {
onRightButton: rightButtonHandlerMock
});
// Find the right button and press it
const footerDefined = renderAPI.queryByTestId("FooterWithButtons");
const footerDefined = renderAPI.queryByTestId("FooterActions");
expect(footerDefined).toBeDefined();
const footerWithButtonsViewRTI =
renderAPI.queryByTestId("AcceptToSButton");
Expand Down
37 changes: 0 additions & 37 deletions ts/components/buttons/FooterStackButtons.tsx

This file was deleted.

12 changes: 5 additions & 7 deletions ts/components/error/WorkunitGenericFailure.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FooterWithButtons } from "@pagopa/io-app-design-system";
import { FooterActions } from "@pagopa/io-app-design-system";
import * as React from "react";
import { SafeAreaView } from "react-native";
import { connect } from "react-redux";
Expand Down Expand Up @@ -35,13 +35,11 @@ const WorkunitGenericFailure = (props: Props): React.ReactElement => {
title={title}
/>
</SafeAreaView>
<FooterWithButtons
type="SingleButton"
primary={{
type: "Outline",
buttonProps: {
<FooterActions
actions={{
type: "SingleButton",
primary: {
label: close,
accessibilityLabel: close,
onPress: props.cancel
}
}}
Expand Down
41 changes: 15 additions & 26 deletions ts/components/screens/GenericErrorComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Body,
FooterWithButtons,
FooterActions,
FooterActionsInline,
H4,
Pictogram,
VSpacer
Expand Down Expand Up @@ -48,36 +49,24 @@ const GenericErrorComponent = (props: Props) => {

const renderFooterButtons = () =>
props.onCancel ? (
<FooterWithButtons
type="TwoButtonsInlineHalf"
primary={{
type: "Outline",
buttonProps: {
label: props.cancelButtonTitle ?? I18n.t("global.buttons.cancel"),
accessibilityLabel:
props.cancelButtonTitle ?? I18n.t("global.buttons.cancel"),
onPress: props.onCancel
}
<FooterActionsInline
startAction={{
color: "primary",
label: props.cancelButtonTitle ?? I18n.t("global.buttons.cancel"),
onPress: props.onCancel
}}
secondary={{
type: "Solid",
buttonProps: {
label: props.retryButtonTitle ?? I18n.t("global.buttons.retry"),
accessibilityLabel:
props.retryButtonTitle ?? I18n.t("global.buttons.retry"),
onPress: props.onRetry
}
endAction={{
color: "primary",
label: props.retryButtonTitle ?? I18n.t("global.buttons.retry"),
onPress: props.onRetry
}}
/>
) : (
<FooterWithButtons
type="SingleButton"
primary={{
type: "Solid",
buttonProps: {
<FooterActions
actions={{
type: "SingleButton",
primary: {
label: props.retryButtonTitle ?? I18n.t("global.buttons.retry"),
accessibilityLabel:
props.retryButtonTitle ?? I18n.t("global.buttons.retry"),
onPress: props.onRetry
}
}}
Expand Down
12 changes: 5 additions & 7 deletions ts/features/bonus/cdc/components/CdcRequirementsError.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FooterWithButtons } from "@pagopa/io-app-design-system";
import { FooterActions } from "@pagopa/io-app-design-system";
import { useNavigation } from "@react-navigation/native";
import * as React from "react";
import { SafeAreaView } from "react-native";
Expand Down Expand Up @@ -31,13 +31,11 @@ const CdcRequirementsError = () => {
)}
/>
</SafeAreaView>
<FooterWithButtons
type="SingleButton"
primary={{
type: "Outline",
buttonProps: {
<FooterActions
actions={{
type: "SingleButton",
primary: {
label: I18n.t("global.buttons.close"),
accessibilityLabel: I18n.t("global.buttons.close"),
onPress: onExitPress,
testID: "closeButton"
}
Expand Down
31 changes: 12 additions & 19 deletions ts/features/bonus/cdc/screens/CdcBonusRequestInformationTos.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
FooterWithButtons,
FooterActionsInline,
H4,
H6,
VSpacer
Expand Down Expand Up @@ -101,26 +101,19 @@ const CdcBonusRequestInformationTos = () => {
<VSpacer size={16} />
</ScrollView>
</SafeAreaView>
<FooterWithButtons
type={"TwoButtonsInlineThird"}
primary={{
type: "Outline",
buttonProps: {
label: I18n.t("global.buttons.cancel"),
accessibilityLabel: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
<FooterActionsInline
startAction={{
color: "primary",
label: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
}}
secondary={{
type: "Solid",
buttonProps: {
label: I18n.t("global.buttons.continue"),
accessibilityLabel: I18n.t("global.buttons.continue"),
onPress: () => {
navigation.navigate(CDC_ROUTES.SELECT_BONUS_YEAR);
}
endAction={{
color: "primary",
label: I18n.t("global.buttons.continue"),
onPress: () => {
navigation.navigate(CDC_ROUTES.SELECT_BONUS_YEAR);
}
}}
/>
Expand Down
51 changes: 22 additions & 29 deletions ts/features/bonus/cdc/screens/CdcBonusRequestSelectResidence.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
FooterWithButtons,
FooterActionsInline,
H2,
H6,
HSpacer,
Expand Down Expand Up @@ -93,36 +93,29 @@ const CdcBonusRequestSelectResidence = () => {
))}
</ScrollView>
</SafeAreaView>
<FooterWithButtons
type="TwoButtonsInlineHalf"
primary={{
type: "Outline",
buttonProps: {
label: I18n.t("global.buttons.cancel"),
accessibilityLabel: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
<FooterActionsInline
startAction={{
color: "primary",
label: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
}}
secondary={{
type: "Solid",
buttonProps: {
label: I18n.t("global.buttons.continue"),
accessibilityLabel: I18n.t("global.buttons.continue"),
onPress: () => {
dispatch(
cdcSelectedBonusAction(
cdcSelectedBonus?.map(b => ({
year: b.year,
residence: isResidentInItaly[b.year]
}))
)
);
navigation.navigate(CDC_ROUTES.BONUS_REQUESTED);
},
disabled: cdcSelectedBonus.some(b => !isResidentInItaly[b.year])
}
endAction={{
color: "primary",
label: I18n.t("global.buttons.continue"),
onPress: () => {
dispatch(
cdcSelectedBonusAction(
cdcSelectedBonus?.map(b => ({
year: b.year,
residence: isResidentInItaly[b.year]
}))
)
);
navigation.navigate(CDC_ROUTES.BONUS_REQUESTED);
},
disabled: cdcSelectedBonus.some(b => !isResidentInItaly[b.year])
}}
/>
</BaseScreenComponent>
Expand Down
39 changes: 16 additions & 23 deletions ts/features/bonus/cdc/screens/CdcBonusRequestSelectYear.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
CheckboxLabel,
FooterWithButtons,
FooterActionsInline,
H2,
H6,
VSpacer
Expand Down Expand Up @@ -89,30 +89,23 @@ const CdcBonusRequestSelectYear = () => {
))}
</ScrollView>
</SafeAreaView>
<FooterWithButtons
type="TwoButtonsInlineHalf"
primary={{
type: "Outline",
buttonProps: {
label: I18n.t("global.buttons.cancel"),
accessibilityLabel: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
<FooterActionsInline
startAction={{
color: "primary",
label: I18n.t("global.buttons.cancel"),
onPress: () => {
navigation.getParent()?.goBack();
}
}}
secondary={{
type: "Solid",
buttonProps: {
label: I18n.t("global.buttons.continue"),
accessibilityLabel: I18n.t("global.buttons.continue"),
onPress: () => {
dispatch(cdcSelectedBonus(years.map(y => ({ year: y }))));
navigation.navigate(CDC_ROUTES.SELECT_RESIDENCE);
},
disabled: years.length === 0,
testID: "continueButton"
}
endAction={{
color: "primary",
label: I18n.t("global.buttons.continue"),
onPress: () => {
dispatch(cdcSelectedBonus(years.map(y => ({ year: y }))));
navigation.navigate(CDC_ROUTES.SELECT_RESIDENCE);
},
disabled: years.length === 0,
testID: "continueButton"
}}
/>
</BaseScreenComponent>
Expand Down
Loading
Loading