1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

UX: Multichain: Restore Flask support link and text (#19198)

* UX: Multichain: Restore Flask support link and text

* Update test
This commit is contained in:
David Walsh 2023-06-06 11:02:00 -05:00 committed by GitHub
parent 51f6a29461
commit 7d7d09e469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -22,6 +22,9 @@ import { Menu, MenuItem } from '../../ui/menu';
import { getEnvironmentType } from '../../../../app/scripts/lib/util'; import { getEnvironmentType } from '../../../../app/scripts/lib/util';
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app'; import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils'; import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common';
///: END:ONLY_INCLUDE_IN
import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsContext } from '../../../contexts/metametrics';
import { import {
@ -59,6 +62,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
const unreadNotificationsCount = useSelector(getUnreadNotificationsCount); const unreadNotificationsCount = useSelector(getUnreadNotificationsCount);
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
let supportText = t('support');
let supportLink = SUPPORT_LINK;
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
supportText = t('needHelpSubmitTicket');
supportLink = SUPPORT_REQUEST_LINK;
///: END:ONLY_INCLUDE_IN
return ( return (
<Menu anchorElement={anchorElement} onHide={closeMenu}> <Menu anchorElement={anchorElement} onHide={closeMenu}>
<MenuItem <MenuItem
@ -165,13 +175,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
<MenuItem <MenuItem
iconName={IconName.MessageQuestion} iconName={IconName.MessageQuestion}
onClick={() => { onClick={() => {
global.platform.openTab({ url: SUPPORT_LINK }); global.platform.openTab({ url: supportLink });
trackEvent( trackEvent(
{ {
category: MetaMetricsEventCategory.Home, category: MetaMetricsEventCategory.Home,
event: MetaMetricsEventName.SupportLinkClicked, event: MetaMetricsEventName.SupportLinkClicked,
properties: { properties: {
url: SUPPORT_LINK, url: supportLink,
location: 'Global Menu', location: 'Global Menu',
}, },
}, },
@ -185,7 +195,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
}} }}
data-testid="global-menu-support" data-testid="global-menu-support"
> >
{t('support')} {supportText}
</MenuItem> </MenuItem>
<MenuItem <MenuItem
iconName={IconName.Setting} iconName={IconName.Setting}

View File

@ -2,7 +2,6 @@ import React from 'react';
import { renderWithProvider, fireEvent, waitFor } from '../../../../test/jest'; import { renderWithProvider, fireEvent, waitFor } from '../../../../test/jest';
import configureStore from '../../../store/store'; import configureStore from '../../../store/store';
import mockState from '../../../../test/data/mock-state.json'; import mockState from '../../../../test/data/mock-state.json';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
import { GlobalMenu } from '.'; import { GlobalMenu } from '.';
const render = () => { const render = () => {
@ -49,9 +48,7 @@ describe('AccountListItem', () => {
const { getByTestId } = render(); const { getByTestId } = render();
fireEvent.click(getByTestId('global-menu-support')); fireEvent.click(getByTestId('global-menu-support'));
await waitFor(() => { await waitFor(() => {
expect(global.platform.openTab).toHaveBeenCalledWith({ expect(global.platform.openTab).toHaveBeenCalled();
url: SUPPORT_LINK,
});
}); });
}); });