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

Create Cluster Details Card #271

Merged
merged 1 commit into from
Mar 20, 2019
Merged

Conversation

rawagner
Copy link
Contributor

@rawagner rawagner commented Mar 18, 2019

Create Cluster Details Card
Add loading state to Details item

@rawagner
Copy link
Contributor Author

@lizsurette @andybraren

if any item in details card is too long, we want to set text-overflow to ellipsis and show a popup tooltip with full value, right ?
details_overflow

@@ -8,51 +9,57 @@ import {
DashboardCardTitle,
} from '../../Dashboard/DashboardCard';
import { ClusterOverviewContextGenericConsumer } from '../ClusterOverviewContext';
import { Loading } from '../../Loading';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loading component still has blank-slate-pf style inside. I would suggest to make two component <Loading> and <InlineLoading>

@coveralls
Copy link

coveralls commented Mar 18, 2019

Pull Request Test Coverage Report for Build 1050

  • 30 of 32 (93.75%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 86.769%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/ClusterOverview/Details/ClusterDetails.js 20 21 95.24%
src/components/Loading/Loading.js 3 4 75.0%
Totals Coverage Status
Change from base Build 1046: -0.1%
Covered Lines: 2788
Relevant Lines: 3069

💛 - Coveralls

@rawagner
Copy link
Contributor Author

@suomiy @mareklibra I have issues with cosmos fixtures as it seems Provider for some reason does not work correctly, it does not pass props and always returns undefined. Any ideas ? It also does not work on master, every component just renders loading which is due to defaultProps. https://kubevirt.io/web-ui-components/?component=p&fixture=ClusterOverview

@atiratree
Copy link
Contributor

atiratree commented Mar 18, 2019

@suomiy @mareklibra I have issues with cosmos fixtures as it seems Provider for some reason does not work correctly, it does not pass props and always returns undefined. Any ideas ?

You have to wrap the fixture props in value:

const ClusterOverview = props => (
  <ClusterOverviewContext.Provider value={props}>
    <ClusterOverviewComponent />
  </ClusterOverviewContext.Provider>
);

export const InlineLoading = ({ text, id }) => (
<div id={id} key={prefixedId(id, 'progress') || 'progress'}>
<div className="spinner spinner-lg blank-slate-pf-icon" />
{text && <h3 className="blank-slate-pf-main-action">{text}</h3>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably do not want h3 text inside the InlineLoading. I do not think the text is necessary at all.

also, not sure if it would make sense to have a span instead of a div.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or 2nd option: having the text inline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text is now removed and I also made spinner size configurable

@rawagner
Copy link
Contributor Author

@suomiy @mareklibra I have issues with cosmos fixtures as it seems Provider for some reason does not work correctly, it does not pass props and always returns undefined. Any ideas ?

You have to wrap the fixture props in value:

const ClusterOverview = props => (
  <ClusterOverviewContext.Provider value={props}>
    <ClusterOverviewComponent />
  </ClusterOverviewContext.Provider>
);

Thanks! I was expecting that it will be something small and fishy :)

</DashboardCardBody>
</DashboardCard>
);

Details.defaultProps = {
loaded: false,
LoadingComponent: Loading,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is not published yet, but please use the InlineLoading component here

@rawagner rawagner changed the title Improve Overview Details Card Create Cluster Details Card Mar 19, 2019
@rawagner rawagner force-pushed the details_card branch 2 times, most recently from 293c15c to 7c1b4a9 Compare March 19, 2019 10:35
if (result) {
let item = result;
if (Array.isArray(result)) {
[item] = result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use more obvious syntax here, please?
Sort of

item = result[0]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const item = Array.isArray(result) ? result[0] : result

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mareklibra updated

Add loading state to Details item
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants