Skip to content

Commit 5b2a87b

Browse files
committed
Remove Firehose Component and Fix and Cleanup Impacted Types
1 parent 31dcb9d commit 5b2a87b

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

frontend/packages/console-shared/src/components/formik-fields/ResourceDropdownField.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { FC } from 'react';
2+
import { useMemo } from 'react';
23
import { FormGroup, FormHelperText, HelperText, HelperTextItem } from '@patternfly/react-core';
34
import type { FormikValues } from 'formik';
45
import { useField, useFormikContext } from 'formik';
@@ -49,6 +50,19 @@ const ResourceDropdownField: FC<ResourceDropdownFieldProps> = ({
4950

5051
useFormikValidationFix(field.value);
5152

53+
// ResourceDropdown expects these as top-level props to manage loading state
54+
const { loaded, loadError } = useMemo(() => {
55+
if (!resources) {
56+
return { loaded: true, loadError: undefined };
57+
}
58+
const allLoaded = resources.every((r) => r.loaded);
59+
const resourceWithLoadError = resources.find((r) => r.loadError);
60+
return {
61+
loaded: allLoaded,
62+
loadError: resourceWithLoadError?.loadError,
63+
};
64+
}, [resources]);
65+
5266
return (
5367
<FormGroup fieldId={fieldId} label={label} isRequired={required} data-test={dataTest}>
5468
<ResourceDropdown
@@ -60,6 +74,8 @@ const ResourceDropdownField: FC<ResourceDropdownFieldProps> = ({
6074
onLoad={onLoad}
6175
resourceFilter={resourceFilter}
6276
resources={resources}
77+
loaded={loaded}
78+
loadError={loadError}
6379
onChange={(value: string, name: string | object, resource: K8sResourceKind) => {
6480
props.onChange && props.onChange(value, name, resource);
6581
setFieldValue(props.name, value);

frontend/packages/integration-tests-cypress/views/details-page.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export const detailsPage = {
1313
clickPageActionButton: (action: string) => {
1414
cy.byLegacyTestID('details-actions').contains(action).click();
1515
},
16-
isLoaded: () => cy.byTestID('skeleton-detail-view').should('not.exist'),
16+
isLoaded: () => {
17+
cy.byTestID('skeleton-detail-view').should('not.exist');
18+
cy.get('[data-test-id="resource-title"]', { timeout: 30000 }).should('not.be.empty');
19+
},
1720
breadcrumb: (breadcrumbIndex: number) => cy.byLegacyTestID(`breadcrumb-link-${breadcrumbIndex}`),
1821
selectTab: (name: string) => {
1922
cy.get(`a[data-test-id="horizontal-link-${name}"]`).should('exist').click();

frontend/packages/operator-lifecycle-manager/src/components/operator-install-page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ const OperatorInstallStatus: FC<OperatorInstallPageProps> = ({ resources }) => {
390390
const launchModal = useOverlay();
391391
const { currentCSV, targetNamespace } = useParams<OperatorInstallStatusPageRouteParams>();
392392

393-
const loadError = Object.values(resources || {}).find((r) => r?.loadError)?.loadError;
393+
const subscriptionLoadError = resources?.subscription?.loadError;
394+
const csvLoadError = resources?.clusterServiceVersion?.loadError;
395+
const loadError = subscriptionLoadError || (csvLoadError && !resources?.subscription?.data);
394396

395397
let loading = true;
396398
let status = '';

frontend/public/components/cron-job.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ export const CronJobsPage: FC<CronJobsPageProps> = (props) => (
412412

413413
export const CronJobsDetailsPage: FC = (props) => {
414414
const customActionMenu = (kindObj, obj) => {
415+
if (!kindObj || !obj) {
416+
return null;
417+
}
415418
const resourceKind = referenceForModel(kindObj);
416419
const context = { [resourceKind]: obj };
417420
return (

0 commit comments

Comments
 (0)