From d0955f7efc28bdf5ba4fb62d3e0ba6f7333e7e45 Mon Sep 17 00:00:00 2001 From: Lucas Werey Date: Thu, 19 Sep 2024 11:24:50 +0200 Subject: [PATCH] :lipstick:(lld): skip drawer and update copy --- .changeset/neat-cameras-own.md | 5 ++ .../__tests__/manageYourBackup.test.tsx | 24 ++------- ...BackupStep.tsx => 01-DeleteBackupStep.tsx} | 17 +++--- .../ManageBackup/01-ManageBackupStep.tsx | 52 ------------------- .../{03-FinalStep.tsx => 02-FinalStep.tsx} | 0 .../WalletSync/screens/ManageBackup/index.tsx | 15 ++---- .../static/i18n/en/app.json | 22 +++----- .../tests/page/drawer/ledger.sync.drawer.ts | 8 --- 8 files changed, 29 insertions(+), 114 deletions(-) create mode 100644 .changeset/neat-cameras-own.md rename apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/{02-DeleteBackupStep.tsx => 01-DeleteBackupStep.tsx} (80%) delete mode 100644 apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-ManageBackupStep.tsx rename apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/{03-FinalStep.tsx => 02-FinalStep.tsx} (100%) diff --git a/.changeset/neat-cameras-own.md b/.changeset/neat-cameras-own.md new file mode 100644 index 000000000000..d037741e8b4a --- /dev/null +++ b/.changeset/neat-cameras-own.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Change delete sync flow on LS to skip a step and update copy diff --git a/apps/ledger-live-desktop/src/newArch/features/WalletSync/__tests__/manageYourBackup.test.tsx b/apps/ledger-live-desktop/src/newArch/features/WalletSync/__tests__/manageYourBackup.test.tsx index aaa2342cf87f..f42aa8b83893 100644 --- a/apps/ledger-live-desktop/src/newArch/features/WalletSync/__tests__/manageYourBackup.test.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/WalletSync/__tests__/manageYourBackup.test.tsx @@ -42,33 +42,17 @@ describe("ManageYourBackup", () => { await user.click(row); - await waitFor(() => - expect(screen.getByTestId("walletSync-manage-backup-delete")).toBeDefined(), - ); - const deleteCard = screen.getByTestId("walletSync-manage-backup-delete"); - await user.click(deleteCard); - - await waitFor(() => - expect(screen.getByText("Do you really want to delete your encryption key?")).toBeDefined(), - ); - // First we cancel the deletion - const cancelButton = screen.getByRole("button", { name: "Cancel" }); + const cancelButton = screen.getByRole("button", { name: "Keep sync" }); expect(cancelButton).toBeDefined(); await user.click(cancelButton); - await waitFor(() => expect(screen.getByText("Manage your key")).toBeDefined()); - expect(screen.getByTestId("walletSync-manage-backup-delete")).toBeDefined(); - - // go back to confirmation screen - await user.click(screen.getByTestId("walletSync-manage-backup-delete")); - await waitFor(() => - expect(screen.getByText("Do you really want to delete your encryption key?")).toBeDefined(), - ); + await waitFor(() => expect(row).toBeDefined()); + await user.click(screen.getByText(/Delete sync/i)); // Then we do the deletion - const deleteButton = screen.getByRole("button", { name: "Delete" }); + const deleteButton = screen.getByRole("button", { name: "Yes, delete" }); expect(deleteButton).toBeDefined(); await user.click(deleteButton); diff --git a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/02-DeleteBackupStep.tsx b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-DeleteBackupStep.tsx similarity index 80% rename from apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/02-DeleteBackupStep.tsx rename to apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-DeleteBackupStep.tsx index b4b6bc46a5f7..8f8182470797 100644 --- a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/02-DeleteBackupStep.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-DeleteBackupStep.tsx @@ -27,14 +27,15 @@ export default function DeleteBackupStep({ cancel }: DeleteBackupStepProps) { return ( - - {t("walletSync.manageBackup.deleteBackup.title")} - - - - {t("walletSync.manageBackup.deleteBackup.description")} - - + + + {t("walletSync.manageBackup.deleteBackup.title")} + + + + {t("walletSync.manageBackup.deleteBackup.description")} + + {t("walletSync.manageBackup.deleteBackup.cancel")} diff --git a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-ManageBackupStep.tsx b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-ManageBackupStep.tsx deleted file mode 100644 index 9cdfdf24e6dd..000000000000 --- a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/01-ManageBackupStep.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Flex, Icons, Text } from "@ledgerhq/react-ui"; -import React from "react"; -import { useTranslation } from "react-i18next"; -import { Card } from "../../components/Card"; -import styled, { useTheme } from "styled-components"; -import { rgba } from "~/renderer/styles/helpers"; -import { ManageBackupStepProps } from "./types"; -import { AnalyticsPage, useLedgerSyncAnalytics } from "../../hooks/useLedgerSyncAnalytics"; -import TrackPage from "~/renderer/analytics/TrackPage"; - -export default function ManageBackupStep({ goToDeleteBackup }: ManageBackupStepProps) { - const { t } = useTranslation(); - const { colors } = useTheme(); - - const { onClickTrack } = useLedgerSyncAnalytics(); - - const handleGoDeleteBackup = () => { - onClickTrack({ button: "Delete backup", page: AnalyticsPage.ManageBackup }); - goToDeleteBackup(); - }; - - return ( - - - - {t("walletSync.manageBackup.title")} - - - - - - } - /> - - ); -} - -const IconContainer = styled(Flex)` - border-radius: 8px; - height: 40px; - width: 40px; -`; diff --git a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/03-FinalStep.tsx b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/02-FinalStep.tsx similarity index 100% rename from apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/03-FinalStep.tsx rename to apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/02-FinalStep.tsx diff --git a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/index.tsx b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/index.tsx index b4625811ba65..6619eccb260e 100644 --- a/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/WalletSync/screens/ManageBackup/index.tsx @@ -2,19 +2,12 @@ import React, { forwardRef, useImperativeHandle } from "react"; import { Flex } from "@ledgerhq/react-ui"; import { Flow, Step } from "~/renderer/reducers/walletSync"; import { BackProps, BackRef } from "../router"; -import ManageBackupStep from "./01-ManageBackupStep"; -import DeleteBackupStep from "./02-DeleteBackupStep"; -import BackupDeleted from "./03-FinalStep"; +import DeleteBackupStep from "./01-DeleteBackupStep"; +import BackupDeleted from "./02-FinalStep"; import { useFlows } from "LLD/features/WalletSync/hooks/useFlows"; const WalletSyncManageBackup = forwardRef((_props, ref) => { - const { - currentStep, - goToNextScene, - goToPreviousScene, - FlowOptions, - goToWelcomeScreenWalletSync, - } = useFlows(); + const { currentStep, goToPreviousScene, FlowOptions, goToWelcomeScreenWalletSync } = useFlows(); useImperativeHandle(ref, () => ({ goBack, @@ -31,8 +24,6 @@ const WalletSyncManageBackup = forwardRef((_props, ref) => { const getStep = () => { switch (currentStep) { default: - case Step.ManageBackup: - return ; case Step.DeleteBackup: return ; case Step.BackupDeleted: diff --git a/apps/ledger-live-desktop/static/i18n/en/app.json b/apps/ledger-live-desktop/static/i18n/en/app.json index 9b5eb4026a52..f45d9524ef41 100644 --- a/apps/ledger-live-desktop/static/i18n/en/app.json +++ b/apps/ledger-live-desktop/static/i18n/en/app.json @@ -6461,12 +6461,12 @@ "description": "Synchronize your accounts with another Ledger Live app for a seamless experience." }, "backup": { - "label": "Manage Key", - "description": "Secure or delete your encryption key via another Ledger." + "label": "Delete sync", + "description": "Your synched crypto accounts across different Ledger Live apps will stop synching." }, "instance": { - "label": "1 Synchronized instance", - "label_other": "{{count}} Synchronized instances", + "label": "1 Ledger Live app synched", + "label_other": "{{count}} Ledger Live app synched", "cta": "Manage" } }, @@ -6520,17 +6520,11 @@ }, "manageBackup": { "title": "Manage your key", - "options": { - "deleteBackup": { - "title": "Delete your backup", - "description": "All synced accounts will be removed. This won’t affect your local accounts." - } - }, "deleteBackup": { - "title": "Do you really want to delete your encryption key?", - "description": "By clicking delete, your apps will be unsynchronized, and your backup will be deleted. Rest assured, this action does not affect your funds or your accounts in Ledger Live. You may resync your accounts at any time.", - "delete": "Delete", - "cancel": "Cancel" + "title": "Sure you want to delete sync?", + "description": "Your crypto accounts across Ledger Live apps on different phones and computers will stop being in sync. This does not impact your funds in any way. ", + "delete": "Yes, delete", + "cancel": "Keep sync" }, "deleteBackupSuccess": { "title": "Your devices have been unsynchronized and your key has been deleted" diff --git a/apps/ledger-live-desktop/tests/page/drawer/ledger.sync.drawer.ts b/apps/ledger-live-desktop/tests/page/drawer/ledger.sync.drawer.ts index 92349af2cc30..ad9480d98daa 100644 --- a/apps/ledger-live-desktop/tests/page/drawer/ledger.sync.drawer.ts +++ b/apps/ledger-live-desktop/tests/page/drawer/ledger.sync.drawer.ts @@ -7,7 +7,6 @@ export class LedgerSyncDrawer extends Drawer { private syncAccountsButton = this.page.getByRole("button", { name: "Sync your accounts" }); private closeLedgerSyncButton = this.page.getByRole("button", { name: "Close" }); private manageBackupButton = this.page.getByTestId("walletSync-manage-backup"); - private deleteBackupButton = this.page.getByTestId("walletSync-manage-backup-delete"); private confirmBackupDeletionButton = this.page.getByRole("button", { name: "Delete" }); private successTextElement = this.page.locator("span", { hasText: "Success" }).first(); private backupDeletionSuccessText = this.page.getByText( @@ -32,12 +31,6 @@ export class LedgerSyncDrawer extends Drawer { await this.manageBackupButton.click(); } - @step("Click on the 'Delete your data' button") - async deleteBackup() { - await expect(this.deleteBackupButton).toBeVisible(); - await this.deleteBackupButton.click(); - } - @step("Confirm the deletion of the data") async confirmBackupDeletion() { await expect(this.confirmBackupDeletionButton).toBeVisible(); @@ -47,7 +40,6 @@ export class LedgerSyncDrawer extends Drawer { @step("Destroy the trustchain - Delete the data") async destroyTrustchain() { await this.manageBackup(); - await this.deleteBackup(); await this.confirmBackupDeletion(); }