diff --git a/src/components/contextIcon/__tests__/__snapshots__/contextIcon.test.js.snap b/src/components/contextIcon/__tests__/__snapshots__/contextIcon.test.js.snap index a1ad1def..261bf8e1 100644 --- a/src/components/contextIcon/__tests__/__snapshots__/contextIcon.test.js.snap +++ b/src/components/contextIcon/__tests__/__snapshots__/contextIcon.test.js.snap @@ -45,6 +45,14 @@ exports[`ContextIcon Component should export, and handle icon variants: icon var /> `; +exports[`ContextIcon Component should export, and handle icon variants: icon variant, error 1`] = ` + +`; + exports[`ContextIcon Component should export, and handle icon variants: icon variant, failed 1`] = ` `; +exports[`ContextIcon Component should export, and handle icon variants: icon variant, info 1`] = ` + +`; + exports[`ContextIcon Component should export, and handle icon variants: icon variant, network 1`] = ` `; +exports[`ContextIcon Component should export, and handle icon variants: icon variant, user 1`] = ` + +`; + exports[`ContextIcon Component should export, and handle icon variants: icon variant, vcenter 1`] = ` `; +exports[`ContextIcon Component should export, and handle icon variants: icon variant, warning 1`] = ` + +`; + exports[`ContextIcon Component should export, and handle icon variants: variants 1`] = ` Object { "canceled": "failed", @@ -182,10 +214,12 @@ Object { "completed": "success", "created": "pending", "download": "download", + "error": "failed", "failed": "failed", "idCard": "idCard", + "info": "info", "network": "network", - "paused": "paused", + "paused": "warning", "pencil": "pencil", "pending": "pending", "running": "pending", @@ -196,7 +230,9 @@ Object { "trash": "trash", "unknown": "unknown", "unreachable": "unreachable", + "user": "user", "vcenter": "vcenter", + "warning": "warning", } `; diff --git a/src/components/contextIcon/contextIcon.js b/src/components/contextIcon/contextIcon.js index 5071ff4a..03e0c186 100644 --- a/src/components/contextIcon/contextIcon.js +++ b/src/components/contextIcon/contextIcon.js @@ -3,20 +3,22 @@ import PropTypes from 'prop-types'; import { Spinner } from '@patternfly/react-core'; import { CheckCircleIcon, + ClipboardCheckIcon, + CrosshairsIcon, DisconnectedIcon, DownloadIcon, ErrorCircleOIcon, ExclamationTriangleIcon, IdCardIcon, + InfoCircleIcon, PencilAltIcon, PficonNetworkRangeIcon, PficonSatelliteIcon, PficonVcenterIcon, TrashIcon, UnknownIcon, - IconSize, - ClipboardCheckIcon, - CrosshairsIcon + UserIcon, + IconSize } from '@patternfly/react-icons'; import { global_Color_dark_100 as gray, @@ -40,21 +42,26 @@ const ContextIconColors = { /** * Context icon variants * - * @type {{running: string, canceled: string, paused: string, unreachable: string, success: string, created: string, - * pending: string, cancelled: string, completed: string, failed: string}} + * @type {{paused: string, unreachable: string, sources: string, created: string, idCard: string, pending: string, + * completed: string, failed: string, error: string, pencil: string, network: string, trash: string, unknown: string, + * running: string, canceled: string, download: string, scans: string, success: string, cancelled: string, + * warning: string, vcenter: string, satellite: string, user: string, info: string}} */ const ContextIconVariant = { completed: 'success', success: 'success', + error: 'failed', failed: 'failed', canceled: 'failed', cancelled: 'failed', created: 'pending', pending: 'pending', running: 'pending', - paused: 'paused', + paused: 'warning', + warning: 'warning', download: 'download', idCard: 'idCard', + info: 'info', network: 'network', pencil: 'pencil', satellite: 'satellite', @@ -63,6 +70,7 @@ const ContextIconVariant = { trash: 'trash', unknown: 'unknown', unreachable: 'unreachable', + user: 'user', vcenter: 'vcenter' }; @@ -106,9 +114,11 @@ const ContextIcon = ({ symbol, ...props }) => { return ; case ContextIconVariant.idCard: return ; + case ContextIconVariant.info: + return ; case ContextIconVariant.network: return ; - case ContextIconVariant.paused: + case ContextIconVariant.warning: return ; case ContextIconVariant.pencil: return ; @@ -134,6 +144,8 @@ const ContextIcon = ({ symbol, ...props }) => { return ; case ContextIconVariant.unreachable: return ; + case ContextIconVariant.user: + return ; case ContextIconVariant.vcenter: return ; case ContextIconVariant.unknown: diff --git a/src/components/createScanDialog/__tests__/__snapshots__/createScanDialog.test.js.snap b/src/components/createScanDialog/__tests__/__snapshots__/createScanDialog.test.js.snap index 1f2c635b..1a21b5ae 100644 --- a/src/components/createScanDialog/__tests__/__snapshots__/createScanDialog.test.js.snap +++ b/src/components/createScanDialog/__tests__/__snapshots__/createScanDialog.test.js.snap @@ -88,6 +88,108 @@ exports[`CreateScanDialog Component should handle multiple error responses: name `; +exports[`CreateScanDialog Component should render a component, pending: pending 1`] = ` +
+
+ +
+
+`; + exports[`CreateScanDialog Component should render a connected component with default props: connected 1`] = ``; exports[`CreateScanDialog Component should render a non-connected component: non-connected 1`] = ` diff --git a/src/components/createScanDialog/__tests__/createScanDialog.test.js b/src/components/createScanDialog/__tests__/createScanDialog.test.js index 3f3644e9..dd805d09 100644 --- a/src/components/createScanDialog/__tests__/createScanDialog.test.js +++ b/src/components/createScanDialog/__tests__/createScanDialog.test.js @@ -43,6 +43,17 @@ describe('CreateScanDialog Component', () => { expect(component.render()).toMatchSnapshot('empty'); }); + it('should render a component, pending', () => { + const props = { + pending: true, + show: true, + sources: [{ name: 'test name' }] + }; + + const component = mount(); + expect(component.render()).toMatchSnapshot('pending'); + }); + it('should handle multiple error responses', () => { const props = { show: true, diff --git a/src/components/createScanDialog/createScanDialog.js b/src/components/createScanDialog/createScanDialog.js index 6a69bc27..228fe91c 100644 --- a/src/components/createScanDialog/createScanDialog.js +++ b/src/components/createScanDialog/createScanDialog.js @@ -1,7 +1,16 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Alert, AlertVariant, Button, ButtonVariant, Title } from '@patternfly/react-core'; -import { FieldLevelHelp, Form, Spinner } from 'patternfly-react'; +import { + Alert, + AlertVariant, + Button, + ButtonVariant, + EmptyState, + EmptyStateIcon, + Spinner, + Title +} from '@patternfly/react-core'; +import { FieldLevelHelp, Form } from 'patternfly-react'; import { Modal } from '../modal/modal'; import { connect, reduxActions, reduxTypes, store } from '../../redux'; import { FormState } from '../formState/formState'; @@ -373,10 +382,10 @@ class CreateScanDialog extends React.Component { >
{pending && ( - - -
Scan updating...
-
+ + + Scan updating... + )} {!pending && this.renderErrorMessage(options)} {!pending && this.renderNameSources(options)} diff --git a/src/components/mergeReportsDialog/__tests__/__snapshots__/mergeReportsDialog.test.js.snap b/src/components/mergeReportsDialog/__tests__/__snapshots__/mergeReportsDialog.test.js.snap index f3853431..8a5db2df 100644 --- a/src/components/mergeReportsDialog/__tests__/__snapshots__/mergeReportsDialog.test.js.snap +++ b/src/components/mergeReportsDialog/__tests__/__snapshots__/mergeReportsDialog.test.js.snap @@ -38,12 +38,37 @@ exports[`MergeReportsDialog Component should render a component, pending: pendin >
-
- Merging reports... +
+
@@ -122,10 +147,19 @@ exports[`MergeReportsDialog Component should render a non-connected component, f -

; + let icon = ; let heading; let footer = Once the scan reports are merged, the results will be downloaded to your local machine.; if (validCount < 2) { - icon = ; + icon = ; heading = (

@@ -146,7 +146,7 @@ class MergeReportsDialog extends React.Component { footer = null; } else if (invalidCount > 0) { - icon = ; + icon = ; heading = (

@@ -163,10 +163,10 @@ class MergeReportsDialog extends React.Component { actions={this.renderButtons()} > {pending && ( - - -
Merging reports...
-
+ + + Merging reports... + )} {!pending && (
diff --git a/src/components/pageLayout/__tests__/__snapshots__/pageLayout.test.js.snap b/src/components/pageLayout/__tests__/__snapshots__/pageLayout.test.js.snap index a365dc18..255e4715 100644 --- a/src/components/pageLayout/__tests__/__snapshots__/pageLayout.test.js.snap +++ b/src/components/pageLayout/__tests__/__snapshots__/pageLayout.test.js.snap @@ -92,9 +92,9 @@ exports[`PageLayout Component should render a non-connected component authorized noCaret={false} title={ - lorem @@ -257,9 +257,9 @@ exports[`PageLayout Component should render a non-connected component branded: n noCaret={false} title={ - lorem diff --git a/src/components/pageLayout/pageLayout.js b/src/components/pageLayout/pageLayout.js index 0ae68a3c..4cf31561 100644 --- a/src/components/pageLayout/pageLayout.js +++ b/src/components/pageLayout/pageLayout.js @@ -1,8 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Icon, Masthead, MenuItem, VerticalNav } from 'patternfly-react'; +import { Masthead, MenuItem, VerticalNav } from 'patternfly-react'; import { connectRouter, reduxActions, reduxTypes, store } from '../../redux'; -import helpers from '../../common/helpers'; +import { ContextIcon, ContextIconVariant } from '../contextIcon/contextIcon'; +import { helpers } from '../../common'; import { routes } from '../router/router'; import titleImgBrand from '../../styles/images/title-brand.svg'; import titleImg from '../../styles/images/title.svg'; @@ -62,7 +63,7 @@ class PageLayout extends React.Component { const title = ( - {session && session.username} + {session && session.username} ); diff --git a/src/components/scans/__tests__/__snapshots__/scanDownload.test.js.snap b/src/components/scans/__tests__/__snapshots__/scanDownload.test.js.snap index 0ec5a495..03a0fae6 100644 --- a/src/components/scans/__tests__/__snapshots__/scanDownload.test.js.snap +++ b/src/components/scans/__tests__/__snapshots__/scanDownload.test.js.snap @@ -2,8 +2,11 @@ exports[`ScanDownload Component should handle custom children: custom 1`] = ` + +
@@ -154,8 +156,11 @@ exports[`ScanDownload Component should have an optional tooltip: tooltip 1`] = ` exports[`ScanDownload Component should render a connected component: connected 1`] = ` ); diff --git a/src/components/scans/scanJobsList.js b/src/components/scans/scanJobsList.js index 37f04edf..3cf3c31e 100644 --- a/src/components/scans/scanJobsList.js +++ b/src/components/scans/scanJobsList.js @@ -1,11 +1,11 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Alert, AlertVariant, EmptyState, EmptyStateVariant, Spinner } from '@patternfly/react-core'; +import { Alert, AlertVariant, ButtonVariant, EmptyState, EmptyStateVariant, Spinner } from '@patternfly/react-core'; import { Grid } from 'patternfly-react'; import { IconSize } from '@patternfly/react-icons'; import { connect, reduxActions, reduxSelectors } from '../../redux'; import { ContextIcon, ContextIconColors, ContextIconVariant } from '../contextIcon/contextIcon'; -import { helpers } from '../../common/helpers'; +import { helpers } from '../../common'; import { dictionary } from '../../constants/dictionaryConstants'; import { apiTypes } from '../../constants/apiConstants'; import ScanDownload from './scanDownload'; @@ -103,8 +103,13 @@ class ScanJobsList extends React.Component { {item.reportId > 0 && ( - -  Download + } + variant={ButtonVariant.link} + > + Download )} diff --git a/src/components/tooltip/tooltip.js b/src/components/tooltip/tooltip.js index 698b0f05..8ceb7584 100644 --- a/src/components/tooltip/tooltip.js +++ b/src/components/tooltip/tooltip.js @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Icon } from 'patternfly-react'; import { Popover, Tooltip as PFTooltip } from '@patternfly/react-core'; -import helpers from '../../common/helpers'; +import { ContextIcon, ContextIconVariant } from '../contextIcon/contextIcon'; +import { helpers } from '../../common'; const Tooltip = ({ children, id, placement, isPopover, content, delayShow }) => { const setId = id || helpers.generateId(); @@ -17,14 +17,16 @@ const Tooltip = ({ children, id, placement, isPopover, content, delayShow }) => showClose={false} bodyContent={content} > -
{children || }
+
+ {children || } +
); } return ( -
{children || }
+
{children || }
); };