Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose DataSource List and Details Page #681

Merged
merged 4 commits into from
Jul 4, 2022

Conversation

glekner
Copy link
Contributor

@glekner glekner commented Jun 28, 2022

  • init
  • add init actions
  • add init details page
  • add list page

📝 Description

Expose DataSource List and Details Page

🎥 Demo

Screen Shot 2022-06-28 at 15 08 08

@openshift-ci openshift-ci bot requested review from pcbailey and tnisan June 28, 2022 13:44
@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Jun 28, 2022
@glekner glekner changed the title WIP: datasource feature Expose DataSource List and Details Page Jul 4, 2022
@glekner glekner force-pushed the datasource-feature branch 3 times, most recently from 992c717 to 9e7e43f Compare July 4, 2022 09:14
@@ -0,0 +1,34 @@
import * as React from 'react';
import { K8sResourceCondition } from 'src/views/clusteroverview/overview/components/details-card/utils/types';
Copy link
Member

Choose a reason for hiding this comment

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

please fix import

@@ -0,0 +1,30 @@
import * as React from 'react';
import { K8sResourceCondition } from 'src/views/clusteroverview/overview/components/details-card/utils/types';
Copy link
Member

Choose a reason for hiding this comment

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

please fix import

@@ -0,0 +1,44 @@
import { K8sResourceCondition } from 'src/views/clusteroverview/overview/components/details-card/utils/types';
Copy link
Member

Choose a reason for hiding this comment

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

those auto imports... :)

'data-test-id': testId,
}) => {
const { t } = useKubevirtTranslation();
const NotAvailable = <MutedTextSpan text={t('Not available')} />;
Copy link
Member

Choose a reason for hiding this comment

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

i think we already have this kind of generic component... please check. @avivtur

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i copied @avivtur 's component and made it generic. we should use this one instead of his

Comment on lines 53 to 104
const getItemHeader = () => {
if (isPopover && bodyContent) {
return (
<Popover
headerContent={descriptionHeader}
bodyContent={
<>
{bodyContent}
{moreInfoURL && (
<>
{t('More info: ')}
<Link to={moreInfoURL}>{moreInfoURL}</Link>
</>
)}
{breadcrumb && (
<Breadcrumb>
{breadcrumb.split('.').map((item) => (
<BreadcrumbItem key={item}>{item}</BreadcrumbItem>
))}
</Breadcrumb>
)}
</>
}
>
<DescriptionListTermHelpTextButton>
{' '}
{descriptionHeader}{' '}
</DescriptionListTermHelpTextButton>
</Popover>
);
}

return <DescriptionListTerm>{descriptionHeader}</DescriptionListTerm>;
};

const description = (
<Button
type="button"
isInline
isDisabled={isDisabled}
onClick={onEditClick}
variant="link"
data-test-id={testId}
>
<Flex spaceItems={{ default: 'spaceItemsNone' }}>
<FlexItem>{descriptionData ?? NotAvailable}</FlexItem>
<FlexItem>
<PencilAltIcon className="co-icon-space-l pf-c-button-icon--plain" />
</FlexItem>
</Flex>
</Button>
);
Copy link
Member

Choose a reason for hiding this comment

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

consider exporting to new components, in same folder or nested folder as Title..

<div className="pf-c-page__main-breadcrumb">
<Breadcrumb className="pf-c-breadcrumb co-breadcrumb">
<BreadcrumbItem>
<Button
Copy link
Member

@metalice metalice Jul 4, 2022

Choose a reason for hiding this comment

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

maybe we can just use Link here?

Comment on lines +17 to +24
const loading = (
<Bullseye>
<Loading />
</Bullseye>
);
return !dataSource ? (
loading
) : (
Copy link
Member

Choose a reason for hiding this comment

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

maybe const loading is redundent? simply put content ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should avoid popcorn loading, which is the current behavior in the vm details page, where data pops up everywhere in random timing.

Copy link
Member

Choose a reason for hiding this comment

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

Wont we get the same? with or without const? i don't see a logic difference..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops i thought u were talking about another file :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we had some crashes so this fixed it, right @avivtur ?

Copy link
Member

Choose a reason for hiding this comment

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

its was about React.suspense , not related to const loading :)

<DescriptionItem
descriptionHeader={t('Managed by')}
descriptionData={
dataImportCron && (
Copy link
Member

Choose a reason for hiding this comment

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

what happen if no dataImportCron? we show empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes Not available

Copy link
Member

@metalice metalice left a comment

Choose a reason for hiding this comment

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

awesome work! left some minor comments

@glekner
Copy link
Contributor Author

glekner commented Jul 4, 2022

@metalice

  • changed to Link
  • Fixed K8sResourceCondition import

@metalice
Copy link
Member

metalice commented Jul 4, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Jul 4, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 4, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: glekner, metalice

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit a57518e into kubevirt-ui:main Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is something we want to fix lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants