-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: fix fiat values in testnet visibility #26273
Merged
OGPoyraz
merged 31 commits into
develop
from
24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled
Sep 16, 2024
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ad576c0
Fix fiat values in testnet visibility
OGPoyraz f75cce6
Fix lint
OGPoyraz 6bb9ace
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 3c74845
Fix suggestions
OGPoyraz 3042a8f
remove unnecessary useCurrencyRateCheck
OGPoyraz 76c1beb
Remove comment
OGPoyraz 4665294
Add localhost to testnets
OGPoyraz 775f822
revert
OGPoyraz 2ddf53b
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 81854ef
Fix e2e
OGPoyraz bc2cce1
Fix unit tests
OGPoyraz 7eb149b
Fix tests
OGPoyraz bf2e3d7
Update snapshot
OGPoyraz c4e530a
Fix e2e tests
OGPoyraz 114e26f
Remove localization e2e test
OGPoyraz e2713a5
Fix e2e tests
OGPoyraz 4b274ec
Remove delay
OGPoyraz 35543ad
Fix unit tests
OGPoyraz dde672c
Fix e2e tests
OGPoyraz 81dcfaf
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 5e49bc8
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
legobeat abab1f5
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 6aa5d5b
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz a22e2e0
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz e72d35e
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 0fbc9df
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 9c67f8c
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz 9e18129
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz bad0757
Fix e2e test
OGPoyraz 625217c
Fix mmi e2e test
OGPoyraz b3f44ac
Merge branch 'develop' into 24945-bug-fiat-values-continue-to-show-de…
OGPoyraz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import { | |
Text, | ||
} from '../../../../components/component-library'; | ||
import TransactionDetailItem from '../transaction-detail-item/transaction-detail-item.component'; | ||
import { getPreferences } from '../../../../selectors'; | ||
import { getPreferences, getShouldShowFiat } from '../../../../selectors'; | ||
import { useI18nContext } from '../../../../hooks/useI18nContext'; | ||
import LoadingHeartBeat from '../../../../components/ui/loading-heartbeat'; | ||
import UserPreferencedCurrencyDisplay from '../../../../components/app/user-preferenced-currency-display/user-preferenced-currency-display.component'; | ||
|
@@ -34,6 +34,7 @@ export default function FeeDetailsComponent({ | |
}) { | ||
const layer1GasFee = txData?.layer1GasFee ?? null; | ||
const [expandFeeDetails, setExpandFeeDetails] = useState(false); | ||
const shouldShowFiat = useSelector(getShouldShowFiat); | ||
|
||
const { useNativeCurrencyAsPrimaryCurrency } = useSelector(getPreferences); | ||
|
||
|
@@ -50,20 +51,22 @@ export default function FeeDetailsComponent({ | |
return ( | ||
<div className="confirm-page-container-content__total-value"> | ||
<LoadingHeartBeat estimateUsed={txData?.userFeeLevel} /> | ||
<UserPreferencedCurrencyDisplay | ||
type={SECONDARY} | ||
key="total-detail-text" | ||
value={value} | ||
suffixProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySmBold, | ||
}} | ||
textProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySmBold, | ||
}} | ||
hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} | ||
/> | ||
{shouldShowFiat && ( | ||
<UserPreferencedCurrencyDisplay | ||
type={SECONDARY} | ||
key="total-detail-text" | ||
value={value} | ||
suffixProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySmBold, | ||
}} | ||
textProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySmBold, | ||
}} | ||
hideLabel={Boolean(useNativeCurrencyAsPrimaryCurrency)} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}, | ||
|
@@ -75,20 +78,22 @@ export default function FeeDetailsComponent({ | |
return ( | ||
<Box className="confirm-page-container-content__total-value"> | ||
<LoadingHeartBeat estimateUsed={txData?.userFeeLevel} /> | ||
<UserPreferencedCurrencyDisplay | ||
type={PRIMARY} | ||
key="total-detail-value" | ||
value={value} | ||
suffixProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySm, | ||
}} | ||
textProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySm, | ||
}} | ||
hideLabel={!useNativeCurrencyAsPrimaryCurrency} | ||
/> | ||
{shouldShowFiat && ( | ||
<UserPreferencedCurrencyDisplay | ||
type={PRIMARY} | ||
key="total-detail-value" | ||
value={value} | ||
suffixProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySm, | ||
}} | ||
textProps={{ | ||
color: TextColor.textAlternative, | ||
variant: TextVariant.bodySm, | ||
}} | ||
hideLabel={!useNativeCurrencyAsPrimaryCurrency} | ||
/> | ||
)} | ||
</Box> | ||
); | ||
}, | ||
|
@@ -168,18 +173,15 @@ export default function FeeDetailsComponent({ | |
{t('layer1Fees')} | ||
</Text> | ||
} | ||
detailText={ | ||
useCurrencyRateCheck && renderTotalDetailText(layer1GasFee) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
detailText={shouldShowFiat && renderTotalDetailText(layer1GasFee)} | ||
detailTotal={renderTotalDetailValue(layer1GasFee)} | ||
/> | ||
)} | ||
{!hasLayer1GasFee && ( | ||
<TransactionDetailItem | ||
detailTitle={t('total')} | ||
detailText={ | ||
useCurrencyRateCheck && | ||
renderTotalDetailText(getTransactionFeeTotal) | ||
shouldShowFiat && renderTotalDetailText(getTransactionFeeTotal) | ||
} | ||
detailTotal={renderTotalDetailValue(getTransactionFeeTotal)} | ||
/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect,
0x539
(the network used for e2e tests) is not testnet and not in the testnet list (See here https://github.com/MetaMask/metamask-extension/blob/24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled/shared/constants/network.ts#L1033)0x539
is also not custom network (SeegetIsCustomNetwork
function here https://github.com/MetaMask/metamask-extension/blob/24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled/ui/selectors/selectors.js#L2372)Since this PR's aim is to correct previous
getShouldShowFiat
selector, this means that this e2e test must toggleuseCurrencyRateCheck
to make it work, and it's done viawithConversionRate Enabled/Disabled
fixture.