Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CredentialsDownload: React.FC<{ cluster: Cluster }> = ({ cluster }) => {
const clusterWizardContext = useClusterWizardContext();
const [isChecked, setIsChecked] = React.useState<boolean>(false);
const [isDownloading, setIsDownloading] = React.useState(false);
const { addAlert } = useAlerts();
const { addAlert, clearAlerts } = useAlerts();
const { t } = useTranslation();

const downloadSingleFile = async (fileName: string) => {
Expand All @@ -42,6 +42,7 @@ const CredentialsDownload: React.FC<{ cluster: Cluster }> = ({ cluster }) => {
};

const handleDownloadClick = async () => {
clearAlerts();
setIsDownloading(true);

const configSuccess = await downloadSingleFile('kubeconfig');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import React from 'react';
import { TextContent, Text, Split, SplitItem } from '@patternfly/react-core';
import { ASSISTED_INSTALLER_DOCUMENTATION_LINK, ExternalLink, isInOcm } from '../../../common';
import {
ASSISTED_INSTALLER_DOCUMENTATION_LINK,
DeveloperPreview,
ExternalLink,
isInOcm,
} from '../../../common';
import { useFeature } from '../../hooks/use-feature';

export const AssistedInstallerHeader = () => {
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
return (
<TextContent>
<Text component="h1" className="pf-v5-u-display-inline">
Install OpenShift with the Assisted Installer
</Text>
{isSingleClusterFeatureEnabled && <DeveloperPreview />}
<Split hasGutter>
<SplitItem>
<ExternalLink href={ASSISTED_INSTALLER_DOCUMENTATION_LINK}>
Expand Down
3 changes: 3 additions & 0 deletions libs/ui-lib/lib/ocm/components/clusters/ClusterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export const SingleClusterPage = ({
resetModal: React.ReactNode;
}) => (
<AlertsContextProvider>
<PageSection variant={PageSectionVariants.light}>
<AssistedInstallerHeader />
</PageSection>
<ClusterPageGeneric clusterId={clusterId} resetModal={resetModal} />
</AlertsContextProvider>
);
Expand Down
22 changes: 9 additions & 13 deletions libs/ui-lib/lib/ocm/components/clusters/NewClusterPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react';
import React from 'react';
import { PageSectionVariants, PageSection } from '@patternfly/react-core';
import { AlertsContextProvider } from '../../../common';
import ClusterBreadcrumbs from './ClusterBreadcrumbs';
Expand All @@ -13,7 +13,7 @@ import { AssistedInstallerHeader } from './AssistedInstallerHeader';
import { ModalDialogsContextProvider } from '../hosts/ModalDialogsContext';
import { OpenShiftVersionsContextProvider } from '../clusterWizard/OpenShiftVersionsContext';

const NewClusterPageGeneric = ({ pageTitleSection }: { pageTitleSection?: ReactNode }) => {
const NewClusterPageGeneric = ({ children }: React.PropsWithChildren<unknown>) => {
return (
<AlertsContextProvider>
<SentryErrorMonitorContextProvider>
Expand All @@ -24,7 +24,10 @@ const NewClusterPageGeneric = ({ pageTitleSection }: { pageTitleSection?: ReactN
>
<OpenShiftVersionsContextProvider>
<NewFeatureSupportLevelProvider loadingUi={<ClusterLoading />}>
{pageTitleSection}
{children}
<PageSection variant={PageSectionVariants.light}>
<AssistedInstallerHeader />
</PageSection>
<PageSection variant={PageSectionVariants.light} isFilled>
<ClusterWizardContextProvider>
<NewClusterWizard />
Expand All @@ -39,16 +42,9 @@ const NewClusterPageGeneric = ({ pageTitleSection }: { pageTitleSection?: ReactN
);
};

const NewClusterTitleSection = () => (
<>
<ClusterBreadcrumbs clusterName="New cluster" />
<PageSection variant={PageSectionVariants.light}>
<AssistedInstallerHeader />
</PageSection>
</>
);

export const NewSingleClusterPage = () => <NewClusterPageGeneric />;
export const NewClusterPage = () => (
<NewClusterPageGeneric pageTitleSection={<NewClusterTitleSection />} />
<NewClusterPageGeneric>
<ClusterBreadcrumbs clusterName="New cluster" />
</NewClusterPageGeneric>
);