Skip to content

Commit

Permalink
Merge pull request #3019 from dusk-network/feature-2991
Browse files Browse the repository at this point in the history
web-wallet: Change "Transaction Created" copy
  • Loading branch information
nortonandreev authored Nov 19, 2024
2 parents de8b157 + a3b3ef1 commit 6ddfea6
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 17 deletions.
2 changes: 2 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Suggested words in the Mnemonic (Authenticate) are accessible using Tab [#2879]
- Enhance Allocate flow on full amount allocation [#2938]
- Broken link in the stake warning [#2990]
- Change "Transaction created" copy [#2991]
- Fix Dashboard navigation menu padding [#3000]

## [0.7.0] - 2024-11-11
Expand Down Expand Up @@ -345,6 +346,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2932]: https://github.com/dusk-network/rusk/issues/2932
[#2938]: https://github.com/dusk-network/rusk/issues/2938
[#2990]: https://github.com/dusk-network/rusk/issues/2990
[#2991]: https://github.com/dusk-network/rusk/issues/2991
[#3000]: https://github.com/dusk-network/rusk/issues/3000
[#3006]: https://github.com/dusk-network/rusk/issues/3006

Expand Down
4 changes: 3 additions & 1 deletion web-wallet/src/lib/components/Allocate/Allocate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import { GasFee, GasSettings, OperationResult } from "$lib/components";
import { walletStore } from "$lib/stores";
import { Gas } from "$lib/vendor/w3sper.js/src/mod";
import { MESSAGES } from "$lib/constants";
import Banner from "../Banner/Banner.svelte";
/** @type {(amount: number) => string} */
Expand Down Expand Up @@ -329,9 +330,10 @@
errorMessage="Transaction failed"
operation={allocate()}
pendingMessage="Processing transaction"
successMessage="Transaction completed"
successMessage="Transaction created"
>
<svelte:fragment slot="success-content" let:result={hash}>
<p>{MESSAGES.TRANSACTION_CREATED}</p>
{#if hash}
<AnchorButton
href={`/explorer/transactions/transaction?id=${hash}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
>
<svelte:fragment slot="success-content" let:result>
<Icon path={mdiCheckDecagramOutline} size="large" />
<span>{successMessage}</span>
<b>{successMessage}</b>
<slot name="success-content" {result} />
<AppAnchorButton
href="/dashboard"
Expand Down
4 changes: 3 additions & 1 deletion web-wallet/src/lib/components/Send/Send.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
OperationResult,
ScanQR,
} from "$lib/components";
import { MESSAGES } from "$lib/constants";
/** @type {(to: string, amount: number, gasPrice: bigint, gasLimit: bigint) => Promise<string>} */
export let execute;
Expand Down Expand Up @@ -358,9 +359,10 @@
errorMessage="Transaction failed"
operation={execute(address, amount, gasPrice, gasLimit)}
pendingMessage="Processing transaction"
successMessage="Transaction completed"
successMessage="Transaction created"
>
<svelte:fragment slot="success-content" let:result={hash}>
<p>{MESSAGES.TRANSACTION_CREATED}</p>
{#if hash}
<AnchorButton
href={`/explorer/transactions/transaction?id=${hash}`}
Expand Down
5 changes: 3 additions & 2 deletions web-wallet/src/lib/components/Stake/Stake.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
mdiDatabaseOutline,
} from "@mdi/js";
import { DOCUMENTATION_LINKS } from "$lib/constants";
import { DOCUMENTATION_LINKS, MESSAGES } from "$lib/constants";
import { areValidGasSettings, deductLuxFeeFrom } from "$lib/contracts";
import { duskToLux, luxToDusk } from "$lib/dusk/currency";
import { logo } from "$lib/dusk/icons";
Expand Down Expand Up @@ -365,9 +365,10 @@
? execute(duskToLux(stakeAmount), gasPrice, gasLimit)
: execute(gasPrice, gasLimit)}
pendingMessage="Processing transaction"
successMessage="Transaction completed"
successMessage="Transaction created"
>
<svelte:fragment slot="success-content" let:result={hash}>
<p>{MESSAGES.TRANSACTION_CREATED}</p>
{#if hash}
<AnchorButton
href={`/explorer/transactions/transaction?id=${hash}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("OperationResult", () => {
it("should accept a custom message for the successful state", async () => {
const props = {
...baseProps,
successMessage: "Transaction completed",
successMessage: "Transaction created",
};

const { container } = render(OperationResult, { ...baseOptions, props });
Expand Down
4 changes: 2 additions & 2 deletions web-wallet/src/lib/components/__tests__/Send.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ describe("Send", () => {

const explorerLink = getByRole("link", { name: /explorer/i });

expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(explorerLink).toHaveAttribute("target", "_blank");
expect(explorerLink).toHaveAttribute("href", expectedExplorerLink);
});
Expand Down Expand Up @@ -336,7 +336,7 @@ describe("Send", () => {
baseProps.gasSettings.gasPrice,
baseProps.gasSettings.gasLimit
);
expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(() => getByRole("link", { name: /explorer/i })).toThrow();
});
});
Expand Down
8 changes: 4 additions & 4 deletions web-wallet/src/lib/components/__tests__/Stake.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ describe("Stake", () => {

const explorerLink = getByRole("link", { name: /explorer/i });

expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(explorerLink).toHaveAttribute("target", "_blank");
expect(explorerLink).toHaveAttribute("href", expectedExplorerLink);
});
Expand Down Expand Up @@ -294,7 +294,7 @@ describe("Stake", () => {
baseProps.gasSettings.gasPrice,
baseProps.gasSettings.gasLimit
);
expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(() => getByRole("link", { name: /explorer/i })).toThrow();
});
});
Expand Down Expand Up @@ -328,7 +328,7 @@ describe("Stake", () => {

const explorerLink = getByRole("link", { name: /explorer/i });

expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(explorerLink).toHaveAttribute("target", "_blank");
expect(explorerLink).toHaveAttribute("href", expectedExplorerLink);
});
Expand Down Expand Up @@ -380,7 +380,7 @@ describe("Stake", () => {

const explorerLink = getByRole("link", { name: /explorer/i });

expect(getByText("Transaction completed")).toBeInTheDocument();
expect(getByText("Transaction created")).toBeInTheDocument();
expect(explorerLink).toHaveAttribute("target", "_blank");
expect(explorerLink).toHaveAttribute("href", expectedExplorerLink);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ exports[`OperationResult > should accept a custom message for the successful sta
</svg>
<span>
Transaction completed
</span>
<b>
Transaction created
</b>
<a
Expand Down Expand Up @@ -230,9 +230,9 @@ exports[`OperationResult > should be able to render the \`OperationResult\` in a
</svg>
<span>
<b>
Operation completed
</span>
</b>
<a
Expand Down
1 change: 1 addition & 0 deletions web-wallet/src/lib/constants/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { DOCUMENTATION_LINKS } from "./documentationLinks";
export { MESSAGES } from "./messages";
3 changes: 3 additions & 0 deletions web-wallet/src/lib/constants/messages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const MESSAGES = {
TRANSACTION_CREATED: `Your transaction is now in the mempool and awaiting confirmation on the blockchain. The Web Wallet will update automatically once it’s added to the chain.`,
};

0 comments on commit 6ddfea6

Please sign in to comment.