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

Update Text import paths: /ui #20076

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Jul 18, 2023

Explanation

Currently, there are deprecated instances of the Text component that use the JavaScript version of the Box component. This PR updates those deprecated import paths to the new component in the ui/components/ui folder as well as snapshots. There should be no visual or component API difference between the two. Just className changes which will touch many snapshots

Screenshots/Screencaps

I have added Before/After screencasts to ensure no visual regressions have occurred to components with some significant updates other than snapshot updates in the code comments

Manual Testing Steps

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@georgewrmarshall georgewrmarshall self-assigned this Jul 18, 2023
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Jul 18, 2023
@georgewrmarshall georgewrmarshall force-pushed the part/19986/update-text-import-paths-ui branch from b704a97 to ccafb3a Compare July 18, 2023 15:21
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #20076 (875ae63) into develop (8f8613a) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #20076      +/-   ##
===========================================
- Coverage    69.46%   69.46%   -0.01%     
===========================================
  Files          992      992              
  Lines        37452    37452              
  Branches     10042    10042              
===========================================
- Hits         26015    26013       -2     
- Misses       11437    11439       +2     
Impacted Files Coverage Δ
...nts/app/custom-spending-cap/custom-spending-cap.js 78.41% <ø> (ø)
ui/components/ui/callout/callout.js 61.11% <ø> (ø)
...precated-test-networks/deprecated-test-networks.js 83.33% <ø> (ø)
ui/components/ui/editable-label/editable-label.js 60.87% <ø> (ø)
...-text-container/export-text-container.component.js 100.00% <ø> (ø)
ui/components/ui/form-field/form-field.js 94.59% <ø> (ø)
ui/components/ui/icon-button/icon-button.js 87.50% <ø> (ø)
ui/components/ui/menu/menu-item.js 87.50% <ø> (ø)
...components/ui/new-network-info/new-network-info.js 76.32% <ø> (ø)
ui/components/ui/nft-info/nft-info.js 0.00% <ø> (ø)
... and 5 more

... and 1 file with indirect coverage changes

@metamaskbot
Copy link
Collaborator

Builds ready [ccafb3a]
Page Load Metrics (1403 ± 27 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint102165116146
domContentLoaded1339158114035727
load1339158114035727
domInteractive1339158114035727
Bundle size diffs
  • background: 0 bytes
  • ui: -1821 bytes
  • common: 0 bytes

garrettbear
garrettbear previously approved these changes Jul 18, 2023
@georgewrmarshall georgewrmarshall marked this pull request as ready for review July 18, 2023 17:51
@georgewrmarshall georgewrmarshall requested review from a team as code owners July 18, 2023 17:51
@@ -24,7 +24,7 @@ exports[`CustomSpendingCap should match snapshot 1`] = `
class="mm-box form-field__heading-title mm-box--display-flex mm-box--align-items-baseline"
>
<h6
class="box mm-text mm-text--body-sm-bold box--display-inline-block box--flex-direction-row box--color-text-default"
class="mm-box mm-text mm-text--body-sm-bold mm-box--display-inline-block mm-box--color-text-default"
for="custom-spending-cap"
tag="label"
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be passed to the html element

@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';

import { BackgroundColor } from '../../../helpers/constants/design-system';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

import Card from '../card';
import Box from '../box';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Box from component-library

@@ -3,8 +3,14 @@ import PropTypes from 'prop-types';
import { I18nContext } from '../../../contexts/i18n';
import Box from '../box';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Box from component-library

@georgewrmarshall georgewrmarshall force-pushed the part/19986/update-text-import-paths-ui branch 7 times, most recently from cd83d39 to 661641f Compare July 18, 2023 21:50
import { ButtonLink, Icon, IconName } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { ButtonLink, Icon, IconName, Text } from '../../component-library';

import {
AlignItems,
TextAlign,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No visual regressions

Screenshot 2023-07-18 at 2 53 12 PM Screenshot 2023-07-18 at 2 53 22 PM

@@ -4,8 +4,7 @@ import classnames from 'classnames';
import InfoIconInverted from '../icon/info-icon-inverted.component';
import { Severity, TextColor } from '../../../helpers/constants/design-system';
import { MILLISECOND } from '../../../../shared/constants/time';
import { ButtonIcon, IconName, IconSize } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
import { ButtonIcon, IconName, IconSize, Text } from '../../component-library';

/**
* @deprecated `<Callout />` has been deprecated in favor of the `<BannerAlert />`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No visual regressions

Screenshot 2023-07-18 at 2 54 30 PM Screenshot 2023-07-18 at 2 54 49 PM

IconName,
Text,
Box,
} from '../../component-library';

export default class EditableLabel extends Component {
static propTypes = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No visual regressions

Screenshot 2023-07-18 at 2 58 13 PM Screenshot 2023-07-18 at 2 58 28 PM

display={DISPLAY.FLEX}
justifyContent={JustifyContent.CENTER}
display={Display.Flex}
justifyContent={JustifyContent.center}
className="notranslate"
variant={TextVariant.bodyLgMedium}
data-testid="srp_text"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 2 59 28 PM Screenshot 2023-07-18 at 2 59 37 PM

as="h6"
variant={TextVariant.bodySm}
color={TextColor.textAlternative}
display={Display.InlineBlock}
>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 00 39 PM Screenshot 2023-07-18 at 3 00 27 PM

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';
import { TextVariant } from '../../../helpers/constants/design-system';
import Tooltip from '../tooltip/tooltip';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 12 00 PM

{t('view')}
</Text>
<Button className="nft-info__button" variant={BUTTON_VARIANT.LINK}>
{t('view')}
</Button>
</Box>
</Box>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 13 32 PM Screenshot 2023-07-18 at 3 14 02 PM

@@ -6,7 +6,7 @@ import {
TextVariant,
} from '../../../helpers/constants/design-system';
import { DECIMAL_REGEX } from '../../../../shared/constants/tokens';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

export default function NumericInput({
detailText = '',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 15 26 PM Screenshot 2023-07-18 at 3 15 37 PM

IconName,
IconSize,
Text,
} from '../../component-library';

const defaultHeaderProps = {
padding: [6, 4, 4],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 16 28 PM Screenshot 2023-07-18 at 3 16 46 PM

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { I18nContext } from '../../../contexts/i18n';
import { Color, TextVariant } from '../../../helpers/constants/design-system';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

function Connector({ isFirst, isLast }) {
if (isFirst) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 17 35 PM ![Uploading Screenshot 2023-07-18 at 3.17.46 PM.png…]()

@@ -9,7 +9,7 @@ import {
} from '../../../helpers/constants/design-system';

import InfoTooltip from '../info-tooltip/info-tooltip';
import { Text } from '../../component-library/text/deprecated';
import { Text } from '../../component-library';

const styles = {
root: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-18 at 3 18 28 PM Screenshot 2023-07-18 at 3 18 38 PM

@georgewrmarshall georgewrmarshall force-pushed the part/19986/update-text-import-paths-ui branch 2 times, most recently from 40c6f62 to 23696d1 Compare July 18, 2023 22:34
@@ -49,8 +49,7 @@ exports[`Add Network Modal should render 1`] = `
class="mm-box form-field__heading-title mm-box--display-flex mm-box--align-items-baseline"
>
<h6
class="box mm-text mm-text--body-sm-bold box--display-inline-block box--flex-direction-row box--color-text-default"
tag="label"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes prop being passed down to html attribute

@@ -58,8 +58,7 @@ exports[`Onboarding Create Password Render should match snapshot 1`] = `
class="mm-box form-field__heading-title mm-box--display-flex mm-box--align-items-baseline"
>
<h6
class="box mm-text mm-text--body-sm-bold box--display-inline-block box--flex-direction-row box--color-text-default"
tag="label"
class="mm-box mm-text mm-text--body-sm-bold mm-box--display-inline-block mm-box--color-text-default"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes prop being passed down to html attribute

@georgewrmarshall georgewrmarshall force-pushed the part/19986/update-text-import-paths-ui branch from 173a3e6 to 05f6764 Compare July 19, 2023 01:58
@metamaskbot
Copy link
Collaborator

Builds ready [875ae63]
Page Load Metrics (1563 ± 103 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1021981292411
domContentLoaded141323741563214103
load141323741563214103
domInteractive141323741563214103
Bundle size diffs
  • background: 0 bytes
  • ui: -2146 bytes
  • common: 0 bytes

@garrettbear garrettbear merged commit f9649a2 into develop Jul 19, 2023
@garrettbear garrettbear deleted the part/19986/update-text-import-paths-ui branch July 19, 2023 17:55
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2023
@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Jul 19, 2023
@Gudahtt Gudahtt added release-11.1.0 Issue or pull request that will be included in release 11.1.0 and removed release-10.36.0 Issue or pull request that will be included in release 10.36.0 labels Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.1.0 Issue or pull request that will be included in release 11.1.0 team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants