diff --git a/frontend/packages/operator-lifecycle-manager/locales/en/olm.json b/frontend/packages/operator-lifecycle-manager/locales/en/olm.json index 817402c0c5..03f220218c 100644 --- a/frontend/packages/operator-lifecycle-manager/locales/en/olm.json +++ b/frontend/packages/operator-lifecycle-manager/locales/en/olm.json @@ -80,6 +80,7 @@ "Installed Operators are represented by ClusterServiceVersions within this Namespace.": "Installed Operators are represented by ClusterServiceVersions within this Namespace.", " For more information, see the <3>Understanding Operators documentation. Or create an Operator and ClusterServiceVersion using the <6>Operator SDK.": " For more information, see the <3>Understanding Operators documentation. Or create an Operator and ClusterServiceVersion using the <6>Operator SDK.", "Required": "Required", + "No description available": "No description available", "Create instance": "Create instance", "No Kubernetes APIs are being provided by this Operator.": "No Kubernetes APIs are being provided by this Operator.", "{{initializationResourceKind}} required": "{{initializationResourceKind}} required", diff --git a/frontend/packages/operator-lifecycle-manager/src/components/__tests__/clusterserviceversion.spec.tsx b/frontend/packages/operator-lifecycle-manager/src/components/__tests__/clusterserviceversion.spec.tsx index ede5d70cc4..6211dc1945 100644 --- a/frontend/packages/operator-lifecycle-manager/src/components/__tests__/clusterserviceversion.spec.tsx +++ b/frontend/packages/operator-lifecycle-manager/src/components/__tests__/clusterserviceversion.spec.tsx @@ -58,7 +58,7 @@ jest.mock('../../utils/useClusterServiceVersionPath', () => ({ jest.mock('@console/internal/components/utils', () => ({ ...jest.requireActual('@console/internal/components/utils'), - AsyncComponent: ({ children }) => children || null, + AsyncComponent: ({ content, emptyMsg }) => {content || emptyMsg || null}, })); jest.mock('@console/internal/components/conditions', () => ({ @@ -276,6 +276,21 @@ describe('CRDCard', () => { expect(screen.queryByRole('link', { name: 'Create instance' })).not.toBeInTheDocument(); }); + + it('renders crd description when provided', () => { + const crdWithDescription = { ...crd, description: 'This is a test CRD description' }; + renderWithProviders(); + + expect(screen.getByText('This is a test CRD description')).toBeVisible(); + }); + + it('renders "No description available" when crd description is missing', () => { + const crdWithoutDescription = { ...crd }; + delete crdWithoutDescription.description; + renderWithProviders(); + + expect(screen.getByText('No description available')).toBeVisible(); + }); }); describe('CSVSubscription', () => { diff --git a/frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx b/frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx index 8429d635d4..f55164463b 100644 --- a/frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx +++ b/frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx @@ -825,6 +825,7 @@ export const MarkdownView = (props: { styles?: string; exactHeight?: boolean; truncateContent?: boolean; + emptyMsg?: string; }) => { return ( = ({ csv, crd, required, ...rest }) => { - + {canCreate && createRoute && (