Skip to content

Commit

Permalink
Backport #3536 to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealJon committed Feb 19, 2020
1 parent bfd9dae commit d7a6f3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
33 changes: 17 additions & 16 deletions frontend/public/components/operator-hub/operator-hub-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import { OperatorHubItem, OperatorHubCSVAnnotations } from './index';
export const OperatorHubList: React.SFC<OperatorHubListProps> = (props) => {
const {operatorGroup, subscription, loaded, loadError, namespace = ''} = props;
const marketplaceItems = _.get(props.marketplacePackageManifest, 'data', [] as PackageManifestKind[]);
const localItems = _.get(props.packageManifest, 'data', [] as PackageManifestKind[]);
const localItems = _.get(props, 'packagManifest.data', [] as PackageManifestKind[]);
const items = marketplaceItems.concat(localItems).map(pkg => {
const {currentCSVDesc} = _.get(pkg, 'status.channels[0]', {});
const { channels, defaultChannel } = _.get(pkg, 'status');
const { currentCSVDesc } = _.find(channels || [], { name: defaultChannel });
const currentCSVAnnotations: OperatorHubCSVAnnotations = _.get(currentCSVDesc, 'annotations', {});

return {
Expand Down Expand Up @@ -54,19 +55,19 @@ export const OperatorHubList: React.SFC<OperatorHubListProps> = (props) => {
});

return <StatusBox
skeleton={skeletonCatalog}
data={items}
loaded={loaded}
loadError={loadError}
label="Resources"
EmptyMsg={() => (
<MsgBox
title="No OperatorHub Items Found"
detail={<span>Please check that the OperatorHub is running and that you have created a valid OperatorSource. For more information about OperatorHub, please click <ExternalLink href="https://github.com/operator-framework/operator-marketplace" text="here" />.</span>}
/>
)}>
<OperatorHubTileView items={items} namespace={namespace} />
</StatusBox>;
skeleton={skeletonCatalog}
data={items}
loaded={loaded}
loadError={loadError}
label="Resources"
EmptyMsg={() => (
<MsgBox
title="No OperatorHub Items Found"
detail={<span>Please check that the OperatorHub is running and that you have created a valid OperatorSource. For more information about OperatorHub, please click <ExternalLink href="https://github.com/operator-framework/operator-marketplace" text="here" />.</span>}
/>
)}>
<OperatorHubTileView items={items} namespace={namespace} />
</StatusBox>;
};

export const OperatorHubPage = withFallback((props: OperatorHubPageProps) => <React.Fragment>
Expand All @@ -80,7 +81,7 @@ export const OperatorHubPage = withFallback((props: OperatorHubPageProps) => <Re
Once installed, the capabilities provided by the Operator appear in the <a href="/catalog">Developer Catalog</a>,
providing a self-service experience.</p>
<div className="co-catalog-connect">
<Firehose resources={[{
<Firehose resources={[{
isList: true,
kind: referenceForModel(OperatorGroupModel),
prop: 'operatorGroup',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export type PackageManifestKind = {
name: string;
currentCSV: string;
currentCSVDesc: {
description?: string;
displayName: string;
icon: {mediatype: string, base64data: string}[];
version: string;
Expand Down

0 comments on commit d7a6f3a

Please sign in to comment.