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

feat: Nonce is always editable in advanced details view #29627

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,17 @@ exports[`<ApproveInfo /> renders component for approve request 1`] = `
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ exports[`<AdvancedDetails /> renders component when the prop override is passed
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down Expand Up @@ -164,6 +175,17 @@ exports[`<AdvancedDetails /> renders component when the state property is true 1
class="mm-box mm-box--display-flex mm-box--gap-2 mm-box--flex-wrap-wrap mm-box--align-items-center mm-box--min-width-0"
data-testid="advanced-details-displayed-nonce"
>
<button
aria-label="Edit"
class="mm-box mm-button-icon mm-button-icon--size-sm edit-nonce-btn mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-lg"
data-testid="edit-nonce-icon"
style="margin-right: -4px;"
>
<span
class="mm-box mm-icon mm-icon--size-sm mm-box--display-inline-block mm-box--color-inherit"
style="mask-image: url('./images/icons/edit.svg');"
/>
</button>
<p
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
style="white-space: pre-wrap;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useI18nContext } from '../../../../../../../hooks/useI18nContext';
import {
getCustomNonceValue,
getNextSuggestedNonce,
getUseNonceField,
} from '../../../../../../../selectors';
import {
getNextNonce,
Expand All @@ -37,7 +36,6 @@ const NonceDetails = () => {
}
}, [currentConfirmation, dispatch]);

const enableCustomNonce = useSelector(getUseNonceField);
const nextNonce = useSelector(getNextSuggestedNonce);
const customNonceValue = useSelector(getCustomNonceValue);

Expand Down Expand Up @@ -65,9 +63,7 @@ const NonceDetails = () => {
<ConfirmInfoRowText
data-testid="advanced-details-displayed-nonce"
text={`${displayedNonce}`}
onEditClick={
enableCustomNonce ? () => openEditNonceModal() : undefined
}
onEditClick={() => openEditNonceModal()}
editIconClassName="edit-nonce-btn"
editIconDataTestId="edit-nonce-icon"
/>
Expand Down
Loading