Move status icon into separate directory

* Remove ButtonGroup export
This commit is contained in:
Marliana Lara 2020-02-20 13:04:31 -05:00
parent 4ebc2573a3
commit 9013dcfea7
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
26 changed files with 41 additions and 59 deletions

View File

@ -4,7 +4,7 @@ import { Button, Split, SplitItem } from '@patternfly/react-core';
import styled from 'styled-components';
import { yamlToJson, jsonToYaml, isJson } from '@util/yaml';
import CodeMirrorInput from './CodeMirrorInput';
import { ButtonGroup } from '.';
import ButtonGroup from './ButtonGroup';
import { JSON_MODE, YAML_MODE } from './constants';
function formatJson(jsonString) {

View File

@ -2,7 +2,7 @@ import React from 'react';
import { oneOf, func } from 'prop-types';
import styled from 'styled-components';
import { Button } from '@patternfly/react-core';
import { ButtonGroup } from '.';
import ButtonGroup from './ButtonGroup';
const SmallButton = styled(Button)`
padding: 3px 8px;

View File

@ -4,4 +4,3 @@ export default CodeMirrorInput;
export { default as VariablesDetail } from './VariablesDetail';
export { default as VariablesInput } from './VariablesInput';
export { default as VariablesField } from './VariablesField';
export { default as ButtonGroup } from './ButtonGroup';

View File

@ -184,9 +184,7 @@ class ToolbarDeleteButton extends React.Component {
</Button>,
]}
>
<div css="margin-bottom: 16px;">
{i18n._(t`This action will delete the following:`)}
</div>
<div>{i18n._(t`This action will delete the following:`)}</div>
{itemsToDelete.map(item => (
<span key={item.id}>
<strong>{item.name || item.username}</strong>

View File

@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { arrayOf, object } from 'prop-types';
import { withI18n } from '@lingui/react';
import { Link as _Link } from 'react-router-dom';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { Tooltip } from '@patternfly/react-core';
import styled from 'styled-components';
import { t } from '@lingui/macro';

View File

@ -1,2 +1 @@
export { default as Sparkline } from './Sparkline';
export { default as StatusIcon } from './StatusIcon';
export { default } from './Sparkline';

View File

@ -12,8 +12,12 @@ const Pulse = keyframes`
`;
const Wrapper = styled.div`
width: 14px;
align-items: center;
display: flex;
flex-flow: column nowrap;
height: 14px;
margin: 5px 0;
width: 14px;
`;
const WhiteTop = styled.div`

View File

@ -0,0 +1 @@
export { default } from './StatusIcon';

View File

@ -4,7 +4,7 @@ import WorkflowActionTooltipItem from './WorkflowActionTooltipItem';
describe('WorkflowActionTooltipItem', () => {
test('successfully mounts', () => {
const wrapper = mount(<WorkflowActionTooltipItem />);
const wrapper = mount(<WorkflowActionTooltipItem id="node" />);
expect(wrapper).toHaveLength(1);
});
});

View File

@ -9,7 +9,7 @@ import AlertModal from '@components/AlertModal';
import ErrorDetail from '@components/ErrorDetail';
import { DetailList, Detail, UserDateDetail } from '@components/DetailList';
import { VariablesDetail } from '@components/CodeMirrorInput';
import { Sparkline } from '@components/Sparkline';
import Sparkline from '@components/Sparkline';
import DeleteButton from '@components/DeleteButton';
import { HostsAPI } from '@api';
@ -107,7 +107,6 @@ function HostDetail({ host, i18n, onUpdateHost }) {
<DetailList gutter="sm">
<Detail label={i18n._(t`Name`)} value={name} />
<Detail
css="display: flex; flex: 1;"
value={<Sparkline jobs={recentPlaybookJobs} />}
label={i18n._(t`Activity`)}
/>

View File

@ -16,7 +16,7 @@ import {
import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons';
import { Sparkline } from '@components/Sparkline';
import Sparkline from '@components/Sparkline';
import { Host } from '@types';
import styled from 'styled-components';

View File

@ -15,7 +15,7 @@ import {
} from '@patternfly/react-core';
import { Link } from 'react-router-dom';
import { PencilAltIcon } from '@patternfly/react-icons';
import { Sparkline } from '@components/Sparkline';
import Sparkline from '@components/Sparkline';
import { Host } from '@types';
import styled from 'styled-components';

View File

@ -60,7 +60,7 @@ const InventoryGroupsDeleteModal = ({
return <ListItem key={group.id}>{group.name}</ListItem>;
})}
</div>
<div css="padding-left: 1px;">
<div>
<Radio
id="radio-delete"
key="radio-delete"

View File

@ -13,7 +13,7 @@ import { VariablesInput as _VariablesInput } from '@components/CodeMirrorInput';
import DeleteButton from '@components/DeleteButton';
import ErrorDetail from '@components/ErrorDetail';
import LaunchButton from '@components/LaunchButton';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { toTitleCase } from '@util/strings';
import { formatDateString } from '@util/dates';
import { Job } from '@types';

View File

@ -1,6 +1,5 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import {
@ -15,15 +14,11 @@ import {
} from '@patternfly/react-core';
import { RocketIcon } from '@patternfly/react-icons';
import LaunchButton from '@components/LaunchButton';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { toTitleCase } from '@util/strings';
import { formatDateString } from '@util/dates';
import { JOB_TYPE_URL_SEGMENTS } from '@constants';
const PaddedIcon = styled(StatusIcon)`
margin: 6px 20px 0 0;
`;
class JobListItem extends Component {
render() {
const { i18n, job, isSelected, onSelect } = this.props;
@ -40,8 +35,10 @@ class JobListItem extends Component {
/>
<DataListItemCells
dataListCells={[
<DataListCell key="status" isFilled={false}>
{job.status && <StatusIcon status={job.status} />}
</DataListCell>,
<DataListCell key="name" css="display: inline-flex;">
{job.status && <PaddedIcon status={job.status} />}
<span>
<Link
to={`/jobs/${JOB_TYPE_URL_SEGMENTS[job.type]}/${job.id}`}

View File

@ -4,7 +4,7 @@ import CodeMirrorInput from '@components/CodeMirrorInput';
import ContentEmpty from '@components/ContentEmpty';
import PropTypes from 'prop-types';
import { DetailList, Detail } from '@components/DetailList';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import styled from 'styled-components';

View File

@ -16,7 +16,7 @@ import { CardBody } from '@components/Card';
import ContentError from '@components/ContentError';
import ContentLoading from '@components/ContentLoading';
import ErrorDetail from '@components/ErrorDetail';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import JobEvent from './JobEvent';
import JobEventSkeleton from './JobEventSkeleton';

View File

@ -5,7 +5,7 @@ import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import styled from 'styled-components';
import { func, shape } from 'prop-types';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { WorkflowNodeTypeLetter } from '@components/Workflow';
import { secondsToHHMMSS } from '@util/dates';
import { constants as wfConstants } from '@components/Workflow/WorkflowUtils';

View File

@ -8,7 +8,7 @@ import { t } from '@lingui/macro';
import { shape } from 'prop-types';
import { Badge as PFBadge, Button, Tooltip } from '@patternfly/react-core';
import { CompassIcon, WrenchIcon } from '@patternfly/react-icons';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import styled from 'styled-components';
const Toolbar = styled.div`

View File

@ -18,14 +18,10 @@ import styled from 'styled-components';
import ClipboardCopyButton from '@components/ClipboardCopyButton';
import ProjectSyncButton from '../shared/ProjectSyncButton';
import { StatusIcon } from '@components/Sparkline';
import StatusIcon from '@components/StatusIcon';
import { toTitleCase } from '@util/strings';
import { Project } from '@types';
const PaddedIcon = styled(StatusIcon)`
margin: 6px 20px 0 0;
`;
const DataListAction = styled(_DataListAction)`
align-items: center;
display: grid;
@ -84,7 +80,7 @@ class ProjectListItem extends React.Component {
/>
<DataListItemCells
dataListCells={[
<DataListCell key="name" css="display: inline-flex">
<DataListCell key="status" isFilled={false}>
{project.summary_fields.last_job && (
<Tooltip
position="top"
@ -96,12 +92,14 @@ class ProjectListItem extends React.Component {
<Link
to={`/jobs/project/${project.summary_fields.last_job.id}`}
>
<PaddedIcon
<StatusIcon
status={project.summary_fields.last_job.status}
/>
</Link>
</Tooltip>
)}
</DataListCell>,
<DataListCell key="name">
<Link id={labelId} to={`${detailUrl}`}>
<b>{project.name}</b>
</Link>

View File

@ -19,7 +19,7 @@ import {
} from '@patternfly/react-icons';
import LaunchButton from '@components/LaunchButton';
import { Sparkline } from '@components/Sparkline';
import Sparkline from '@components/Sparkline';
import { toTitleCase } from '@util/strings';
import styled from 'styled-components';

View File

@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Link, useHistory } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import { WorkflowJobTemplatesAPI } from '@api';
import {
Chip,
ChipGroup,
@ -13,17 +14,16 @@ import {
Label,
} from '@patternfly/react-core';
import { CardBody, CardActionsRow } from '@components/Card';
import ContentLoading from '@components/ContentLoading';
import { WorkflowJobTemplatesAPI } from '@api';
import AlertModal from '@components/AlertModal';
import ErrorDetail from '@components/ErrorDetail';
import { DetailList, Detail, UserDateDetail } from '@components/DetailList';
import { CardBody, CardActionsRow } from '@components/Card';
import { VariablesDetail } from '@components/CodeMirrorInput';
import LaunchButton from '@components/LaunchButton';
import ContentLoading from '@components/ContentLoading';
import DeleteButton from '@components/DeleteButton';
import { DetailList, Detail, UserDateDetail } from '@components/DetailList';
import ErrorDetail from '@components/ErrorDetail';
import LaunchButton from '@components/LaunchButton';
import Sparkline from '@components/Sparkline';
import { toTitleCase } from '@util/strings';
import { Sparkline } from '@components/Sparkline';
function WorkflowJobTemplateDetail({ template, i18n, webHookKey }) {
const {
@ -104,7 +104,6 @@ function WorkflowJobTemplateDetail({ template, i18n, webHookKey }) {
<Detail label={i18n._(t`Description`)} value={description} />
{summary_fields.recent_jobs?.length > 0 && (
<Detail
css="display: flex; flex: 1;"
value={<Sparkline jobs={recentPlaybookJobs} />}
label={i18n._(t`Activity`)}
/>
@ -223,7 +222,7 @@ function WorkflowJobTemplateDetail({ template, i18n, webHookKey }) {
{deletionError && (
<AlertModal
isOpen={deletionError}
variant="danger"
variant="error"
title={i18n._(t`Error!`)}
onClose={() => setDeletionError(null)}
>

View File

@ -12,13 +12,6 @@ import JobTemplatesList from './JobTemplatesList';
import ProjectsList from './ProjectsList';
import WorkflowJobTemplatesList from './WorkflowJobTemplatesList';
const Divider = styled.div`
height: 1px;
background-color: var(--pf-global--Color--light-300);
border: 0;
flex-shrink: 0;
`;
const TimeoutInput = styled(TextInput)`
width: 200px;
:not(:first-of-type) {
@ -91,7 +84,6 @@ function NodeTypeStep({
/>
</div>
</div>
<Divider component="div" />
{nodeType === 'job_template' && (
<JobTemplatesList
nodeResource={nodeResource}

View File

@ -234,7 +234,7 @@ function VisualizerGraph({ i18n, readOnly }) {
{linkHelp && <WorkflowLinkHelp link={linkHelp} />}
</WorkflowHelp>
)}
<WorkflowSVG id="workflow-svg" ref={svgRef} css="">
<WorkflowSVG id="workflow-svg" ref={svgRef}>
<defs>
<marker
className="WorkflowChart-noPointerEvents"

View File

@ -80,11 +80,7 @@ function UserForm({ user, handleCancel, handleSubmit, submitError, i18n }) {
onSubmit={handleValidateAndSubmit}
>
{formik => (
<Form
autoComplete="off"
onSubmit={formik.handleSubmit}
css="padding: 0 24px"
>
<Form autoComplete="off" onSubmit={formik.handleSubmit}>
<FormRow>
<FormField
id="user-username"