Skip to content

Commit

Permalink
NO TICKET - Resolution of several build, start and test warnings (#1552)
Browse files Browse the repository at this point in the history
* updates prop references to tsx files as jsx files for these no longer exist

* updates caniuse definitions for latest browsers solving npx browser update warning on build

* Updates functions to allow for undefined props (they accept none) solving docgen warning

* updates ellipses component definition to allow for empty props solving docgen warning (it has no props)

* allow deBrokerName to be undefined to allow for fallback functionality to work, solves test warning as well

* resolves build error recommending flex-end instead of end

* componentWillMount is deprecated, change guidelines to reflect use of componentDidMount

* NavigationMenu was using the deprecated Hamburger icon, changed to use MenuIconThin solving test warning

* button variation 'secondary' doesn't exit on button types, changed to transparent to match dialog close button for h.gov, also updated title to heading which was causing the heading to not be displayed at all previously, fixes several test warnings

* simpler way to do this, and updating privacy button size to use default

* fixes for linting errors
  • Loading branch information
Forrest Baer authored Feb 1, 2022
1 parent 8cafc13 commit bc2ccec
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion guides/CODING-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ JavaScript coding guidelines are enforced using [Nava's ESLint ruleset](https://
- Build components that are safe to render server-side. This means components must be pure functions of their `props` and `state`, and you only have access to a subset of lifecycle methods:
- `getInitialState()`
- `getDefaultProps()`
- `componentWillMount()`
- `componentDidMount()`
- `render()`
- Each component is exported twice, to support different ways developers might import it:
- A named export. For example: `export function Button(props) {`
Expand Down
6 changes: 4 additions & 2 deletions packages/design-system/src/components/Pagination/Ellipses.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from 'react';

export default function Ellipses(): React.ReactElement {
const Ellipses: React.FC<unknown> = (props) => {
return (
<li>
<span className="ds-c-pagination__overflow">&hellip;</span>
</li>
);
}
};

export default Ellipses;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $pagination-overflow-color: $color-gray;
$pagination-page-count-color: $color-gray;

.ds-c-pagination {
align-items: end;
align-items: flex-end;
display: flex;
justify-content: space-between;
ul {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Available classes:
@react-example Logo.example.jsx
@react-props Logo.jsx
@react-props Logo.tsx
Style guide: components.logo
*/
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Style guide: patterns.header
@react-example Header.example.jsx
@react-props Header.jsx
@react-props Header.tsx
@responsive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { TFunction } from 'react-i18next';

interface DeConsumerMessageProps {
deBrokerName: string;
deBrokerName?: string;
/**
* @hide-props
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const LogoEnSvg = function () {
const LogoEnSvg: React.FC<unknown> = (props) => {
// prettier-ignore
return (
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="25" viewBox="0 0 253.05 31.65" aria-labelledby="hc-c-logo__title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const LogoEsSvg = function () {
const LogoEsSvg: React.FC<unknown> = (props) => {
// prettier-ignore
return (
<svg xmlns="http://www.w3.org/2000/svg" width="237" height="25" viewBox="0 0 313.54 31.74" aria-labelledby="hc-c-logo__title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ export const PrivacySettingsDialog = (props: PrivacySettingsDialogProps) => {
return (
<Dialog
{...dialogProps}
title={t('privacy.dialogTitle')}
heading={t('privacy.dialogTitle')}
size="full"
closeButtonSize="small"
// @ts-ignore: TODO: We probably shouldn't be using secondary here, as it's supposed to be deprecated
closeButtonVariation="secondary"
closeButtonVariation="transparent"
actionsClassName="ds-u-text-align--right"
actions={
<Button variation="primary" onClick={savePrivacySettings}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Button } from '@cmsgov/design-system';
import { Close, Hamburger } from '../Icons';
import { Close } from '../Icons';
import React from 'react';
import uniqueId from 'lodash/uniqueId';
import { MenuIconThin } from '@cmsgov/design-system';

export interface NavigationMenuProps {
alwaysShowMenuButton?: boolean;
Expand Down Expand Up @@ -49,7 +50,11 @@ export default class NavigationMenu extends React.PureComponent<
onClick={this.toggleMenu}
variation="transparent"
>
{this.state.menuOpen ? <Close /> : <Hamburger />}
{this.state.menuOpen ? (
<Close />
) : (
<MenuIconThin className="ds-c-icon-color--primary" />
)}
</Button>
</div>
<nav role="navigation" id="menu-container" aria-labelledby={this.id} className={navClasses}>
Expand Down
18 changes: 4 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7303,20 +7303,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000971, caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001219:
version "1.0.30001235"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001235.tgz#ad5ca75bc5a1f7b12df79ad806d715a43a5ac4ed"
integrity sha512-zWEwIVqnzPkSAXOUlQnPW2oKoYb2aLQ4Q5ejdjBcnH63rfypaW34CxaeBn1VMya2XaEU3P/R2qHpWyj+l0BT1A==

caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125:
version "1.0.30001278"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001278.tgz#51cafc858df77d966b17f59b5839250b24417fff"
integrity sha512-mpF9KeH8u5cMoEmIic/cr7PNS+F5LWBk0t2ekGT60lFf0Wq+n9LspAj0g3P+o7DQhD3sUdlMln4YFAWhFYn9jg==

caniuse-lite@^1.0.30001251, caniuse-lite@^1.0.30001274:
version "1.0.30001277"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001277.tgz#9416dae5e075f47eacd8e0475ae1dcc5a20e9ca5"
integrity sha512-J2WtYj2Pl6LBEG214XmbGw1gzZEsYuinQFPqYtpZDB3/vm49qNlrcbJrTMkHKmdRDdmXYwkG0tgOBJsuI+J12Q==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000971, caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001251, caniuse-lite@^1.0.30001274:
version "1.0.30001302"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001302.tgz"
integrity sha512-YYTMO+tfwvgUN+1ZnRViE53Ma1S/oETg+J2lISsqi/ZTNThj3ZYBOKP2rHwJc37oCsPqAzJ3w2puZHn0xlLPPw==

capture-exit@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit bc2ccec

Please sign in to comment.