Skip to content

Commit

Permalink
feat(27256): add hidden console for prod test in about page
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDDanica committed Nov 28, 2024
1 parent 9bddc8d commit 0e78bb0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
11 changes: 11 additions & 0 deletions ui/pages/settings/info-tab/info-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import {
} from '../../../../shared/lib/ui-utils';

export default class InfoTab extends PureComponent {
static propTypes = {
remoteFeatureFlags: PropTypes.array,
};

state = {
version: process.env.METAMASK_VERSION,
};
Expand All @@ -53,6 +57,13 @@ export default class InfoTab extends PureComponent {
componentDidMount() {
const { t } = this.context;
handleSettingsRefs(t, t('about'), this.settingsRefs);
if (this.props.remoteFeatureFlags.length > 0) {
// eslint-disable-next-line no-console
console.log(
'Feature flag fetched successfully',
this.props.remoteFeatureFlags,
);
}
}

renderInfoLinks() {
Expand Down
4 changes: 3 additions & 1 deletion ui/pages/settings/info-tab/info-tab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ describe('InfoTab', () => {
let getByText: (text: string) => HTMLElement;

beforeEach(() => {
const renderResult = renderWithProvider(<InfoTab />);
const renderResult = renderWithProvider(
<InfoTab remoteFeatureFlags={[]} />,
);
getByText = renderResult.getByText;
});

Expand Down
9 changes: 8 additions & 1 deletion ui/pages/settings/settings.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SettingsPage extends PureComponent {
pathnameI18nKey: PropTypes.string,
toggleNetworkMenu: PropTypes.func.isRequired,
useExternalServices: PropTypes.bool,
remoteFeatureFlags: PropTypes.array,
};

static contextTypes = {
Expand Down Expand Up @@ -382,7 +383,13 @@ class SettingsPage extends PureComponent {
/>
)}
/>
<Route exact path={ABOUT_US_ROUTE} component={InfoTab} />
<Route
exact
path={ABOUT_US_ROUTE}
render={() => (
<InfoTab remoteFeatureFlags={this.props.remoteFeatureFlags} />
)}
/>
<Route exact path={ADVANCED_ROUTE} component={AdvancedTab} />
<Route
exact
Expand Down
4 changes: 3 additions & 1 deletion ui/pages/settings/settings.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
getAddressBookEntryOrAccountName,
getRemoteFeatureFlags,
getUseExternalServices,
} from '../../selectors';
import { ENVIRONMENT_TYPE_POPUP } from '../../../shared/constants/app';
Expand Down Expand Up @@ -60,7 +61,7 @@ const mapStateToProps = (state, ownProps) => {
const {
metamask: { currencyRates },
} = state;

const remoteFeatureFlags = getRemoteFeatureFlags(state);
const conversionDate = currencyRates[ticker]?.conversionDate;

const pathNameTail = pathname.match(/[^/]+$/u)[0];
Expand Down Expand Up @@ -113,6 +114,7 @@ const mapStateToProps = (state, ownProps) => {
isPopup,
mostRecentOverviewPage: getMostRecentOverviewPage(state),
pathnameI18nKey,
remoteFeatureFlags,
useExternalServices,
};
};
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6301,12 +6301,12 @@ __metadata:

"@metamask/remote-feature-flag-controller@file:../core/packages/remote-feature-flag-controller::locator=metamask-crx%40workspace%3A.":
version: 0.0.0
resolution: "@metamask/remote-feature-flag-controller@file:../core/packages/remote-feature-flag-controller#../core/packages/remote-feature-flag-controller::hash=fceb11&locator=metamask-crx%40workspace%3A."
resolution: "@metamask/remote-feature-flag-controller@file:../core/packages/remote-feature-flag-controller#../core/packages/remote-feature-flag-controller::hash=d194c6&locator=metamask-crx%40workspace%3A."
dependencies:
"@metamask/base-controller": "npm:^7.0.2"
"@metamask/utils": "npm:^10.0.0"
cockatiel: "npm:^3.1.2"
checksum: 10/4cdf15ef3c2aafc3c9d9d7a224d1af72c7c06535b5d1227d509ccef9d8c240211a97b7e021f957b630473937c1107097017b7c660456c1bde1f95055ff3524b6
checksum: 10/869c51ff53622acc9fa039a0911523acdaea44144de85113532e3e47e3e4754becd1789002a78a4bbfcf404479e85ab4a38e76bc811af2a76da882cbede009a9
languageName: node
linkType: hard

Expand Down

0 comments on commit 0e78bb0

Please sign in to comment.