Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Fix snapshots & linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rawagner committed Apr 12, 2019
1 parent 447fe88 commit ff3d7b9
Show file tree
Hide file tree
Showing 27 changed files with 116 additions and 86 deletions.
11 changes: 6 additions & 5 deletions sass/components/Dashboard/dashboard.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.kubevirt-dashboard__body {
padding: .75rem;
padding: 0.75rem;
background-color: whitesmoke;
}

.kubevirt-dashboard__card {
margin: .75rem;
.card-pf-title {
font-size:1rem;
}
margin: 0.75rem;
}

.kubevirt-dashboard__card-title {
font-size: 1rem;
}

.kubevirt-dashboard__card-heading {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ exports[`<Alerts /> renders correctly 1`] = `
<DashboardCardHeader
className={null}
>
<DashboardCardTitle>
<DashboardCardTitle
className={null}
>
Alerts
</DashboardCardTitle>
</DashboardCardHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Capacity /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Capacity
</h2>
Expand Down Expand Up @@ -100,7 +100,7 @@ exports[`<Capacity /> renders correctly in Loading state 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Capacity
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Compliance /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Compliance
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Details /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Details
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Events /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading kubevirt-events__card-header"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Events
</h2>
Expand All @@ -18,7 +18,7 @@ exports[`<Events /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Health /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Health
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Health /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Health
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Inventory /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster inventory
</h2>
Expand All @@ -18,7 +18,7 @@ exports[`<Inventory /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand All @@ -42,7 +42,7 @@ exports[`<Inventory /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down Expand Up @@ -84,7 +84,7 @@ exports[`<Inventory /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand All @@ -111,7 +111,7 @@ exports[`<Inventory /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down Expand Up @@ -151,7 +151,7 @@ exports[`<Inventory /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<TopConsumers /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Top Consumers
</h2>
Expand All @@ -18,7 +18,7 @@ exports[`<TopConsumers /> renders correctly 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<Utilization /> renders correctly 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Utilization
</h2>
Expand Down Expand Up @@ -119,7 +119,7 @@ exports[`<Utilization /> renders correctly in Loading state 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Utilization
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Details
</h2>
Expand Down Expand Up @@ -83,7 +83,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster inventory
</h2>
Expand All @@ -93,7 +93,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand All @@ -117,7 +117,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down Expand Up @@ -159,7 +159,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand All @@ -186,7 +186,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down Expand Up @@ -226,7 +226,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-check-circle fa-2x kubevirt-inventory__row-status-item-icon--ok"
class="fa fa-check-circle kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span
class="kubevirt-inventory__row-status-item-text"
Expand Down Expand Up @@ -257,7 +257,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading kubevirt-events__card-header"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Cluster Events
</h2>
Expand All @@ -267,7 +267,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand Down Expand Up @@ -295,7 +295,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
class="card-pf-heading kubevirt-dashboard__card-heading"
>
<h2
class="card-pf-title"
class="card-pf-title kubevirt-dashboard__card-title"
>
Top Consumers
</h2>
Expand All @@ -305,7 +305,7 @@ exports[`<ClusterOverview /> renders correctly with Provider 1`] = `
>
<span
aria-hidden="true"
class="fa fa-info-circle fa-2x"
class="fa fa-info-circle kubevirt-dashboard__icon-sm"
/>
</button>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/Dashboard/DashboardCard/DashboardCardTitle.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { CardTitle } from 'patternfly-react';

const DashboardCardTitle = ({ children, ...props }) => <CardTitle {...props}>{children}</CardTitle>;
const DashboardCardTitle = ({ className, children, ...props }) => (
<CardTitle {...props} className={classNames('kubevirt-dashboard__card-title', className)}>
{children}
</CardTitle>
);

DashboardCardTitle.defaultProps = {
children: null,
className: null,
};

DashboardCardTitle.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
};

export default DashboardCardTitle;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`<DashboardCardTitle /> renders correctly 1`] = `
<CardTitle
className=""
className="kubevirt-dashboard__card-title"
>
content
</CardTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ exports[`<DashboardCardTitleHelp /> renders correctly 1`] = `
disabled={false}
>
<Icon
className="kubevirt-dashboard__icon-sm"
name="info-circle"
size="2x"
type="fa"
/>
</Button>
Expand Down
24 changes: 20 additions & 4 deletions src/components/Dashboard/Inventory/InventoryItemStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ const StatusPropTypes = {

const OkStatus = ({ count }) => (
<div className="kubevirt-inventory__row-status-item">
<Icon type="fa" name="check-circle" className="kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm" />
<Icon
type="fa"
name="check-circle"
className="kubevirt-inventory__row-status-item-icon--ok kubevirt-dashboard__icon-sm"
/>
<span className="kubevirt-inventory__row-status-item-text">{count}</span>
</div>
);
Expand All @@ -17,7 +21,11 @@ OkStatus.propTypes = StatusPropTypes;

const WarnStatus = ({ count }) => (
<div className="kubevirt-inventory__row-status-item">
<Icon type="fa" name="exclamation-triangle" className="kubevirt-inventory__row-status-item-icon--warn kubevirt-dashboard__icon-sm" />
<Icon
type="fa"
name="exclamation-triangle"
className="kubevirt-inventory__row-status-item-icon--warn kubevirt-dashboard__icon-sm"
/>
<span className="kubevirt-inventory__row-status-item-text">{count}</span>
</div>
);
Expand All @@ -26,7 +34,11 @@ WarnStatus.propTypes = StatusPropTypes;

const ErrorStatus = ({ count }) => (
<div className="kubevirt-inventory__row-status-item">
<Icon type="fa" name="exclamation-circle" className="kubevirt-inventory__row-status-item-icon--error kubevirt-dashboard__icon-sm" />
<Icon
type="fa"
name="exclamation-circle"
className="kubevirt-inventory__row-status-item-icon--error kubevirt-dashboard__icon-sm"
/>
<span className="kubevirt-inventory__row-status-item-text">{count}</span>
</div>
);
Expand All @@ -35,7 +47,11 @@ ErrorStatus.propTypes = StatusPropTypes;

const InProgressStatus = ({ count }) => (
<div className="kubevirt-inventory__row-status-item">
<Icon type="pf" name="in-progress" className="kubevirt-inventory__row-status-item-icon--in-progress kubevirt-dashboard__icon-s" />
<Icon
type="pf"
name="in-progress"
className="kubevirt-inventory__row-status-item-icon--in-progress kubevirt-dashboard__icon-sm"
/>
<span className="kubevirt-inventory__row-status-item-text">{count}</span>
</div>
);
Expand Down
Loading

0 comments on commit ff3d7b9

Please sign in to comment.