mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
removed portfolio link from wallet view (#19716)
* removed portfolio link from wallet view * removed unused code * updated test * updated spec file * updated test
This commit is contained in:
parent
0f330e21e5
commit
5512e2921f
@ -26,7 +26,7 @@ describe('Portfolio site', function () {
|
|||||||
await driver.press('#password', driver.Key.ENTER);
|
await driver.press('#password', driver.Key.ENTER);
|
||||||
|
|
||||||
// Click Portfolio site
|
// Click Portfolio site
|
||||||
await driver.clickElement('[data-testid="home__portfolio-site"]');
|
await driver.clickElement('[data-testid="eth-overview-portfolio"]');
|
||||||
await driver.waitUntilXWindowHandles(2);
|
await driver.waitUntilXWindowHandles(2);
|
||||||
const windowHandles = await driver.getAllWindowHandles();
|
const windowHandles = await driver.getAllWindowHandles();
|
||||||
await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles);
|
await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles);
|
||||||
@ -34,7 +34,7 @@ describe('Portfolio site', function () {
|
|||||||
// Verify site
|
// Verify site
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await driver.getCurrentUrl(),
|
await driver.getCurrentUrl(),
|
||||||
'http://127.0.0.1:8080/?metamaskEntry=ext&metametricsId=null',
|
'http://127.0.0.1:8080/?metamaskEntry=ext_portfolio_button&metametricsId=null',
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -36,7 +36,6 @@ import IconButton from '../../ui/icon-button';
|
|||||||
import { isHardwareKeyring } from '../../../helpers/utils/hardware';
|
import { isHardwareKeyring } from '../../../helpers/utils/hardware';
|
||||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||||
import {
|
import {
|
||||||
MetaMetricsContextProp,
|
|
||||||
MetaMetricsEventCategory,
|
MetaMetricsEventCategory,
|
||||||
MetaMetricsEventName,
|
MetaMetricsEventName,
|
||||||
MetaMetricsSwapsEventSource,
|
MetaMetricsSwapsEventSource,
|
||||||
@ -44,12 +43,7 @@ import {
|
|||||||
import Spinner from '../../ui/spinner';
|
import Spinner from '../../ui/spinner';
|
||||||
import { startNewDraftTransaction } from '../../../ducks/send';
|
import { startNewDraftTransaction } from '../../../ducks/send';
|
||||||
import { AssetType } from '../../../../shared/constants/transaction';
|
import { AssetType } from '../../../../shared/constants/transaction';
|
||||||
import {
|
import { Icon, IconName } from '../../component-library';
|
||||||
ButtonIcon,
|
|
||||||
ButtonIconSize,
|
|
||||||
Icon,
|
|
||||||
IconName,
|
|
||||||
} from '../../component-library';
|
|
||||||
import { IconColor } from '../../../helpers/constants/design-system';
|
import { IconColor } from '../../../helpers/constants/design-system';
|
||||||
import useRamps from '../../../hooks/experiences/useRamps';
|
import useRamps from '../../../hooks/experiences/useRamps';
|
||||||
import { getPortfolioUrl } from '../../../helpers/utils/portfolio';
|
import { getPortfolioUrl } from '../../../helpers/utils/portfolio';
|
||||||
@ -156,42 +150,6 @@ const EthOverview = ({ className }) => {
|
|||||||
{balanceIsCached ? (
|
{balanceIsCached ? (
|
||||||
<span className="eth-overview__cached-star">*</span>
|
<span className="eth-overview__cached-star">*</span>
|
||||||
) : null}
|
) : null}
|
||||||
{
|
|
||||||
///: BEGIN:ONLY_INCLUDE_IN(build-main,build-beta,build-flask)
|
|
||||||
<ButtonIcon
|
|
||||||
className="eth-overview__portfolio-button"
|
|
||||||
data-testid="home__portfolio-site"
|
|
||||||
color={IconColor.primaryDefault}
|
|
||||||
iconName={IconName.Diagram}
|
|
||||||
ariaLabel={t('portfolio')}
|
|
||||||
size={ButtonIconSize.Lg}
|
|
||||||
onClick={() => {
|
|
||||||
const portfolioUrl = getPortfolioUrl(
|
|
||||||
'',
|
|
||||||
'ext',
|
|
||||||
metaMetricsId,
|
|
||||||
);
|
|
||||||
global.platform.openTab({
|
|
||||||
url: portfolioUrl,
|
|
||||||
});
|
|
||||||
trackEvent(
|
|
||||||
{
|
|
||||||
category: MetaMetricsEventCategory.Home,
|
|
||||||
event: MetaMetricsEventName.PortfolioLinkClicked,
|
|
||||||
properties: {
|
|
||||||
url: portfolioUrl,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
contextPropsIntoEventProperties: [
|
|
||||||
MetaMetricsContextProp.PageTitle,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
///: END:ONLY_INCLUDE_IN
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
{showFiat && balance && (
|
{showFiat && balance && (
|
||||||
<UserPreferencedCurrencyDisplay
|
<UserPreferencedCurrencyDisplay
|
||||||
|
@ -71,7 +71,7 @@ describe('EthOverview', () => {
|
|||||||
const store = configureMockStore([thunk])(mockStore);
|
const store = configureMockStore([thunk])(mockStore);
|
||||||
const ETH_OVERVIEW_BUY = 'eth-overview-buy';
|
const ETH_OVERVIEW_BUY = 'eth-overview-buy';
|
||||||
const ETH_OVERVIEW_BRIDGE = 'eth-overview-bridge';
|
const ETH_OVERVIEW_BRIDGE = 'eth-overview-bridge';
|
||||||
const ETH_OVERVIEW_PORTFOLIO = 'home__portfolio-site';
|
const ETH_OVERVIEW_PORTFOLIO = 'eth-overview-portfolio';
|
||||||
const ETH_OVERVIEW_PRIMARY_CURRENCY = 'eth-overview__primary-currency';
|
const ETH_OVERVIEW_PRIMARY_CURRENCY = 'eth-overview__primary-currency';
|
||||||
const ETH_OVERVIEW_SECONDARY_CURRENCY = 'eth-overview__secondary-currency';
|
const ETH_OVERVIEW_SECONDARY_CURRENCY = 'eth-overview__secondary-currency';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user