Remove PF style overrides from card, breadcrumb, sidenav, tooltip, and modal components

This commit is contained in:
Marliana Lara
2020-02-11 11:53:22 -05:00
parent 6df00e1e4c
commit 5d2912605f
26 changed files with 45 additions and 193 deletions

View File

@@ -3,41 +3,6 @@
height: 100%; height: 100%;
} }
//
// sidebar overrides
//
.pf-c-page__sidebar {
--pf-c-page__sidebar--md--Width: 255px;
.pf-c-nav {
overflow-y: auto;
.pf-c-nav__section {
--pf-c-nav__section--MarginTop: 8px;
}
.pf-c-nav__section + .pf-c-nav__section {
--pf-c-nav__section--MarginTop: 8px;
}
.pf-c-nav__simple-list .pf-c-nav__link {
--pf-c-nav__simple-list-link--PaddingBottom: 6px;
--pf-c-nav__simple-list-link--PaddingTop: 6px;
}
.pf-c-nav__section-title {
--pf-c-nav__section-title--PaddingLeft: 24px;
}
.pf-c-nav__link {
display: flex;
align-items: center;
padding-right: 64px;
}
}
}
// //
// data list overrides // data list overrides
// //
@@ -87,102 +52,6 @@
} }
} }
//
// pf modal overrides
//
.awx-c-modal.pf-c-modal-box {
margin: 0;
padding: 24px;
width: 600px;
.pf-c-modal-box__body {
overflow: auto;
}
.pf-c-modal-box__footer > .pf-c-button:not(:last-child) {
margin-right: 20px;
}
}
.pf-c-modal-box__footer {
--pf-c-modal-box__footer--PaddingTop: 20px;
--pf-c-modal-box__footer--PaddingRight: 20px;
--pf-c-modal-box__footer--PaddingBottom: 20px;
--pf-c-modal-box__footer--PaddingLeft: 20px;
--pf-c-modal-box__footer--MarginTop: 24px;
justify-content: flex-end;
}
.pf-c-modal-box__header {
--pf-c-modal-box__header--PaddingTop: 10px;
--pf-c-modal-box__header--PaddingRight: 0;
--pf-c-modal-box__header--PaddingBottom: 0;
--pf-c-modal-box__header--PaddingLeft: 20px;
}
.pf-c-modal-box__body {
--pf-c-modal-box__body--PaddingLeft: 20px;
--pf-c-modal-box__body--PaddingRight: 20px;
--pf-c-modal-box__body--PaddingBottom: 5px;
}
//
// pf tooltip overrides
//
.pf-c-tooltip__content {
--pf-c-tooltip__content--PaddingTop: 0.71rem;
--pf-c-tooltip__content--PaddingRight: 0.71rem;
--pf-c-tooltip__content--PaddingBottom: 0.71rem;
--pf-c-tooltip__content--PaddingLeft: 0.71rem;
}
// higher specificity needed to override PF styles added dynamically to page
.pf-c-tooltip .pf-c-tooltip__content {
text-align: left;
}
//
// pf empty state overrides
//
.pf-c-empty-state {
align-self: center;
}
//
// assorted custom component styles
// note that these should be given a consistent prefix
// and bem style, as well as moved into component-based scss files
//
.awx-c-card {
position: relative;
}
//
// PF Alert notification component overrides
//
.pf-c-alert__title {
--pf-c-alert__title--PaddingTop: 20px;
--pf-c-alert__title--PaddingRight: 20px;
--pf-c-alert__title--PaddingBottom: 20px;
--pf-c-alert__title--PaddingLeft: 20px;
}
.pf-c-alert__description {
--pf-c-alert__description--PaddingRight: 20px;
--pf-c-alert__description--PaddingBottom: 20px;
--pf-c-alert__description--PaddingLeft: 20px;
}
.pf-c-alert {
position: absolute;
width: 100%;
z-index: 20;
}
// //
// AlertModal styles // AlertModal styles
// //
@@ -246,11 +115,3 @@
color: var(--pf-global--success-color--200); color: var(--pf-global--success-color--200);
} }
} }
//
// LoginModal overrides
//
.pf-m-error p.pf-c-form__helper-text {
color: var(--pf-global--danger-color--100);
}

View File

@@ -30,6 +30,7 @@ export default ({ variant, children, ...props }) => {
props.isOpen = Boolean(isOpen); props.isOpen = Boolean(isOpen);
return ( return (
<Modal <Modal
isLarge
className={`awx-c-modal${variant && className={`awx-c-modal${variant &&
` at-c-alertModal at-c-alertModal--${variant}`}`} ` at-c-alertModal at-c-alertModal--${variant}`}`}
{...props} {...props}

View File

@@ -5,7 +5,7 @@ import {
PageSectionVariants, PageSectionVariants,
Breadcrumb, Breadcrumb,
BreadcrumbItem, BreadcrumbItem,
BreadcrumbHeading as PFBreadcrumbHeading, BreadcrumbHeading,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import { Link, Route, withRouter } from 'react-router-dom'; import { Link, Route, withRouter } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';
@@ -15,12 +15,6 @@ const PageSection = styled(PFPageSection)`
padding-bottom: 10px; padding-bottom: 10px;
`; `;
const BreadcrumbHeading = styled(PFBreadcrumbHeading)`
--pf-c-breadcrumb__heading--FontSize: 20px;
line-height: 24px;
flex: 100%;
`;
const Breadcrumbs = ({ breadcrumbConfig }) => { const Breadcrumbs = ({ breadcrumbConfig }) => {
const { light } = PageSectionVariants; const { light } = PageSectionVariants;

View File

@@ -10,7 +10,7 @@ import {
import { CubesIcon } from '@patternfly/react-icons'; import { CubesIcon } from '@patternfly/react-icons';
const ContentEmpty = ({ i18n, title = '', message = '' }) => ( const ContentEmpty = ({ i18n, title = '', message = '' }) => (
<EmptyState> <EmptyState variant="full">
<EmptyStateIcon icon={CubesIcon} /> <EmptyStateIcon icon={CubesIcon} />
<Title size="lg">{title || i18n._(t`No items found.`)}</Title> <Title size="lg">{title || i18n._(t`No items found.`)}</Title>
<EmptyStateBody>{message}</EmptyStateBody> <EmptyStateBody>{message}</EmptyStateBody>

View File

@@ -39,7 +39,7 @@ function ContentError({ error, children, isNotFound, i18n }) {
{is401 ? ( {is401 ? (
<Redirect to="/login" /> <Redirect to="/login" />
) : ( ) : (
<EmptyState> <EmptyState variant="full">
<EmptyStateIcon icon={ExclamationTriangleIcon} /> <EmptyStateIcon icon={ExclamationTriangleIcon} />
<Title size="lg"> <Title size="lg">
{is404 ? i18n._(t`Not Found`) : i18n._(t`Something went wrong...`)} {is404 ? i18n._(t`Not Found`) : i18n._(t`Something went wrong...`)}

View File

@@ -5,7 +5,7 @@ import { EmptyState, EmptyStateBody } from '@patternfly/react-core';
// TODO: Better loading state - skeleton lines / spinner, etc. // TODO: Better loading state - skeleton lines / spinner, etc.
const ContentLoading = ({ className, i18n }) => ( const ContentLoading = ({ className, i18n }) => (
<EmptyState className={className}> <EmptyState variant="full" className={className}>
<EmptyStateBody>{i18n._(t`Loading...`)}</EmptyStateBody> <EmptyStateBody>{i18n._(t`Loading...`)}</EmptyStateBody>
</EmptyState> </EmptyState>
); );

View File

@@ -139,7 +139,7 @@ function Lookup(props) {
</ChipHolder> </ChipHolder>
</InputGroup> </InputGroup>
<Modal <Modal
className="awx-c-modal" isLarge
title={i18n._(t`Select ${header || i18n._(t`Items`)}`)} title={i18n._(t`Select ${header || i18n._(t`Items`)}`)}
isOpen={isModalOpen} isOpen={isModalOpen}
onClose={closeModal} onClose={closeModal}
@@ -148,9 +148,7 @@ function Lookup(props) {
key="select" key="select"
variant="primary" variant="primary"
onClick={save} onClick={save}
style={ isDisabled={required && selectedItems.length === 0}
required && selectedItems.length === 0 ? { display: 'none' } : {}
}
> >
{i18n._(t`Select`)} {i18n._(t`Select`)}
</Button>, </Button>,

View File

@@ -27,7 +27,7 @@ export default function PaginatedDataListItem({ item }) {
<DataListItemRow> <DataListItemRow>
<DataListItemCells <DataListItemCells
dataListCells={[ dataListCells={[
<DataListCell key="team-name"> <DataListCell key="name">
<DetailWrapper> <DetailWrapper>
<Link to={{ pathname: item.url }}> <Link to={{ pathname: item.url }}>
<b id={`items-list-item-${item.id}`}>{item.name}</b> <b id={`items-list-item-${item.id}`}>{item.name}</b>

View File

@@ -73,7 +73,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-describedby="pf-modal-0" aria-describedby="pf-modal-0"
aria-label="Remove {0} Access" aria-label="Remove {0} Access"
aria-modal="true" aria-modal="true"
class="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger" class="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger pf-m-lg"
role="dialog" role="dialog"
> >
<button <button
@@ -154,7 +154,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
className="awx-c-modal at-c-alertModal at-c-alertModal--danger" className="awx-c-modal at-c-alertModal at-c-alertModal--danger"
hideTitle={false} hideTitle={false}
isFooterLeftAligned={false} isFooterLeftAligned={false}
isLarge={false} isLarge={true}
isOpen={true} isOpen={true}
isSmall={false} isSmall={false}
onClose={[Function]} onClose={[Function]}
@@ -174,7 +174,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-describedby="pf-modal-0" aria-describedby="pf-modal-0"
aria-label="Remove {0} Access" aria-label="Remove {0} Access"
aria-modal="true" aria-modal="true"
class="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger" class="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger pf-m-lg"
role="dialog" role="dialog"
> >
<button <button
@@ -274,7 +274,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
hideTitle={false} hideTitle={false}
id="pf-modal-0" id="pf-modal-0"
isFooterLeftAligned={false} isFooterLeftAligned={false}
isLarge={false} isLarge={true}
isOpen={true} isOpen={true}
isSmall={false} isSmall={false}
onClose={[Function]} onClose={[Function]}
@@ -303,7 +303,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
<ModalBox <ModalBox
className="awx-c-modal at-c-alertModal at-c-alertModal--danger" className="awx-c-modal at-c-alertModal at-c-alertModal--danger"
id="pf-modal-0" id="pf-modal-0"
isLarge={false} isLarge={true}
isSmall={false} isSmall={false}
style={Object {}} style={Object {}}
title="Remove {0} Access" title="Remove {0} Access"
@@ -312,7 +312,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-describedby="pf-modal-0" aria-describedby="pf-modal-0"
aria-label="Remove {0} Access" aria-label="Remove {0} Access"
aria-modal="true" aria-modal="true"
className="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger" className="pf-c-modal-box awx-c-modal at-c-alertModal at-c-alertModal--danger pf-m-lg"
role="dialog" role="dialog"
style={Object {}} style={Object {}}
> >

View File

@@ -75,7 +75,7 @@ const SkippedBottom = styled.div`
const StatusIcon = ({ status, ...props }) => { const StatusIcon = ({ status, ...props }) => {
return ( return (
<div className="at-c-statusIcon" {...props}> <div {...props}>
{status === 'running' && <RunningJob />} {status === 'running' && <RunningJob />}
{(status === 'new' || {(status === 'new' ||
status === 'pending' || status === 'pending' ||

View File

@@ -63,7 +63,7 @@ function Credential({ i18n, setBreadcrumb }) {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response && contentError.response.status === 404 && ( {contentError.response && contentError.response.status === 404 && (
<span> <span>
@@ -79,7 +79,7 @@ function Credential({ i18n, setBreadcrumb }) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -117,7 +117,7 @@ function Host({ inventory, i18n, setBreadcrumb }) {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response && contentError.response.status === 404 && ( {contentError.response && contentError.response.status === 404 && (
<span> <span>
@@ -141,7 +141,7 @@ function Host({ inventory, i18n, setBreadcrumb }) {
); );
return ( return (
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
{redirect} {redirect}

View File

@@ -92,7 +92,7 @@ function Inventory({ i18n, setBreadcrumb }) {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -108,7 +108,7 @@ function Inventory({ i18n, setBreadcrumb }) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -88,7 +88,7 @@ class SmartInventory extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -105,7 +105,7 @@ class SmartInventory extends Component {
} }
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -26,7 +26,7 @@ function InventoryGroupForm({
}; };
return ( return (
<Card className="awx-c-card"> <Card>
<CardBody> <CardBody>
<Formik initialValues={initialValues} onSubmit={handleSubmit}> <Formik initialValues={initialValues} onSubmit={handleSubmit}>
{formik => ( {formik => (

View File

@@ -83,7 +83,7 @@ class Job extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>

View File

@@ -34,10 +34,9 @@ const VariablesInput = styled(_VariablesInput)`
const StatusDetailValue = styled.div` const StatusDetailValue = styled.div`
align-items: center; align-items: center;
display: inline-flex; display: inline-grid;
.at-c-statusIcon { grid-gap: 10px;
margin-right: 10px; grid-template-columns: auto auto;
}
`; `;
const VERBOSITY = { const VERBOSITY = {

View File

@@ -26,10 +26,9 @@ const Modal = styled(PFModal)`
const HostNameDetailValue = styled.div` const HostNameDetailValue = styled.div`
align-items: center; align-items: center;
display: inline-flex; display: inline-grid;
.at-c-statusIcon { grid-gap: 10px;
margin-right: 10px; grid-template-columns: auto auto;
}
`; `;
const Tabs = styled(PFTabs)` const Tabs = styled(PFTabs)`

View File

@@ -54,7 +54,7 @@ class JobTypeRedirect extends Component {
if (error) { if (error) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{error === NOT_FOUND ? ( {error === NOT_FOUND ? (
<ContentError isNotFound> <ContentError isNotFound>
<Link to="/jobs">{i18n._(`View all Jobs`)}</Link> <Link to="/jobs">{i18n._(`View all Jobs`)}</Link>

View File

@@ -5,7 +5,7 @@ import ContentError from '@components/ContentError';
function NotFound() { function NotFound() {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError isNotFound /> <ContentError isNotFound />
</Card> </Card>
</PageSection> </PageSection>

View File

@@ -147,7 +147,7 @@ class Organization extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -165,7 +165,7 @@ class Organization extends Component {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -167,7 +167,7 @@ class Project extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -183,7 +183,7 @@ class Project extends Component {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect from="/projects/:id" to="/projects/:id/details" exact /> <Redirect from="/projects/:id" to="/projects/:id/details" exact />

View File

@@ -59,7 +59,7 @@ function Team({ i18n, setBreadcrumb }) {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -75,7 +75,7 @@ function Team({ i18n, setBreadcrumb }) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect from="/teams/:id" to="/teams/:id/details" exact /> <Redirect from="/teams/:id" to="/teams/:id/details" exact />

View File

@@ -135,7 +135,7 @@ class Template extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -150,7 +150,7 @@ class Template extends Component {
} }
return ( return (
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -79,7 +79,7 @@ class WorkflowJobTemplate extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -94,7 +94,7 @@ class WorkflowJobTemplate extends Component {
} }
return ( return (
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect <Redirect

View File

@@ -96,7 +96,7 @@ class User extends Component {
if (!hasContentLoading && contentError) { if (!hasContentLoading && contentError) {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
<ContentError error={contentError}> <ContentError error={contentError}>
{contentError.response.status === 404 && ( {contentError.response.status === 404 && (
<span> <span>
@@ -112,7 +112,7 @@ class User extends Component {
return ( return (
<PageSection> <PageSection>
<Card className="awx-c-card"> <Card>
{cardHeader} {cardHeader}
<Switch> <Switch>
<Redirect from="/users/:id" to="/users/:id/details" exact /> <Redirect from="/users/:id" to="/users/:id/details" exact />