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

Use console quick start drawer #53

Merged
merged 1 commit into from
Aug 16, 2023
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
14 changes: 9 additions & 5 deletions locales/en/plugin__clustertemplates-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
"Apply labels to the ManagedClusters created from this template.": "Apply labels to the ManagedClusters created from this template.",
"Required": "Required",
"Create": "Create",
"Download YAML": "Download YAML",
"Failed to download YAML": "Failed to download YAML",
"Failed to load template {{templateName}}": "Failed to load template {{templateName}}",
"Failed to parse template status {{templateName}}": "Failed to parse template status {{templateName}}",
"Some of the Helm parameters are none primitives and cannot be set in the UI": "Some of the Helm parameters are none primitives and cannot be set in the UI",
Expand Down Expand Up @@ -163,15 +165,15 @@
"Templates": "Templates",
"Consumption in use": "Consumption in use",
"Edit": "Edit",
"This certificate authority is utilized by all repositories with the host {{hostname}}": "This certificate authority is utilized by all repositories with the host {{hostname}}",
"This certificate authority is utilized by all repositories with the host {{hostname}}_plural": "This certificate authority is utilized by all repositories with the host {{hostname}}",
"This certificate authority is utilized by all repositories with the host {{hostname}}.": "This certificate authority is utilized by all repositories with the host {{hostname}}.",
"This certificate authority is utilized by all repositories with the host {{hostname}}._plural": "This certificate authority is utilized by all repositories with the host {{hostname}}.",
"Any modifications made to the certificate authority will impact the following repository:": "Any modifications made to the certificate authority will impact the following repository:",
"Any modifications made to the certificate authority will impact the following repository:_plural": "Any modifications made to the certificate authority will impact the following repositories:",
"Failed to get the available Certificate Authorities": "Failed to get the available Certificate Authorities",
"Failed to load repositories": "Failed to load repositories",
"Allow self-signed certificates": "Allow self-signed certificates",
"Certificate authority": "Certificate authority",
"Certificate authority field loading": "Certificate authority field loading",
"Skip certificate verification": "Skip certificate verification",
"Custom certificate authority": "Custom certificate authority",
"Custom certificate authority field loading": "Custom certificate authority field loading",
"Edit {{repoName}} repository": "Edit {{repoName}} repository",
"Type": "Type",
"Repository name and URL": "Repository name and URL",
Expand Down Expand Up @@ -236,6 +238,8 @@
"markdown": "markdown",
"preview": "preview",
"Template processing failed": "Template processing failed",
"Download instance YAML": "Download instance YAML",
"Failed to download instance YAML": "Failed to download instance YAML",
"Community templates cannot be modified": "Community templates cannot be modified",
"Community templates cannot be deleted": "Community templates cannot be deleted",
"To fix this, edit the template and reselect the repository": "To fix this, edit the template and reselect the repository",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { getResourceVendor } from '../../utils/clusterTemplateDataUtils';
import useClusterTemplateActions from '../../hooks/useClusterTemplateActions';
import useClusterTemplateDeserializer from '../../hooks/useClusterTemplateDeserializer';
import Alerts from '../../alerts/Alerts';
import WithClusterTemplateQuickStarts from '../ClusterTemplatesGettingStarted/WithClusterTemplateQuickStarts';
Copy link
Collaborator

Choose a reason for hiding this comment

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

WithClusterTemplateQuickStarts can be removed completely, right ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right. deleted.


const useActiveNavItem = (clusterTemplate: DeserializedClusterTemplate | undefined) => {
const history = useHistory();
Expand Down Expand Up @@ -153,37 +152,33 @@ const ClusterTemplateDetailsPage = ({ match }: { match: { params: { name: string
<ErrorBoundary>
<AlertsContextProvider>
<PageLoader loaded={loaded} error={error}>
<WithClusterTemplateQuickStarts>
{deserializedTemplate && (
<Page>
<PageHeader clusterTemplate={deserializedTemplate} />
{deserializedTemplate && (
<Page>
<PageHeader clusterTemplate={deserializedTemplate} />

{activeNavItem !== 'yaml' && (
<PageSection>
<Stack hasGutter>
<StackItem>
<Alerts />
</StackItem>
<StackItem>
{activeNavItem === 'overview' && (
<OverviewTab clusterTemplate={deserializedTemplate} />
)}
{activeNavItem === 'quotas' && (
<DetailsQuotasTab clusterTemplate={clusterTemplate} />
)}
{activeNavItem === 'instances' && (
<InstancesTab clusterTemplate={clusterTemplate} />
)}
</StackItem>
</Stack>
</PageSection>
)}
{activeNavItem === 'yaml' && (
<ResourceYAMLEditor initialResource={clusterTemplate} />
)}
</Page>
)}
</WithClusterTemplateQuickStarts>
{activeNavItem !== 'yaml' && (
<PageSection>
<Stack hasGutter>
<StackItem>
<Alerts />
</StackItem>
<StackItem>
{activeNavItem === 'overview' && (
<OverviewTab clusterTemplate={deserializedTemplate} />
)}
{activeNavItem === 'quotas' && (
<DetailsQuotasTab clusterTemplate={clusterTemplate} />
)}
{activeNavItem === 'instances' && (
<InstancesTab clusterTemplate={clusterTemplate} />
)}
</StackItem>
</Stack>
</PageSection>
)}
{activeNavItem === 'yaml' && <ResourceYAMLEditor initialResource={clusterTemplate} />}
</Page>
)}
</PageLoader>
</AlertsContextProvider>
</ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const CreateTemplateCard = ({ description }: { description: string }) =>
const { t } = useTranslation();
if (!qsCtx || !qsCtx.setActiveQuickStart) {
return (
<ErrorState error={'QuickStartContext should be used without QuickStartContextProvider'} />
<ErrorState error={'QuickStartContext should be used within QuickStartContextProvider'} />
);
}

Expand Down

This file was deleted.

33 changes: 15 additions & 18 deletions src/components/ClusterTemplatesPage/ClusterTemplatesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import ClusterTemplatesTab from './ClusterTemplatesTab';
import QuotasTab from './QuotasTab';
import RepositoriesTable from './RepositoriesTab';
import './hack.css';
import WithClusterTemplateQuickStarts from '../ClusterTemplatesGettingStarted/WithClusterTemplateQuickStarts';
import { AlertsContextProvider } from '../../alerts/AlertsContext';
import Alerts from '../../alerts/Alerts';
import ErrorBoundary from '../../helpers/ErrorBoundary';
Expand Down Expand Up @@ -90,23 +89,21 @@ const ClusterTemplatesPage = () => {
return (
<ErrorBoundary>
<AlertsContextProvider>
<WithClusterTemplateQuickStarts>
<Page>
<PageHeader />
<PageSection>
<Stack hasGutter>
<StackItem>
<Alerts />
</StackItem>
<StackItem>
{activeTab === 'templates' && <ClusterTemplatesTab />}
{activeTab === 'repositories' && <RepositoriesTable />}
{activeTab === 'quotas' && <QuotasTab />}
</StackItem>
</Stack>
</PageSection>
</Page>
</WithClusterTemplateQuickStarts>
<Page>
<PageHeader />
<PageSection>
<Stack hasGutter>
<StackItem>
<Alerts />
</StackItem>
<StackItem>
{activeTab === 'templates' && <ClusterTemplatesTab />}
{activeTab === 'repositories' && <RepositoriesTable />}
{activeTab === 'quotas' && <QuotasTab />}
</StackItem>
</Stack>
</PageSection>
</Page>
</AlertsContextProvider>
</ErrorBoundary>
);
Expand Down
19 changes: 8 additions & 11 deletions src/components/Quotas/QuotaEditor/QuotaFormPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { getClusterTemplatesPageUrl } from '../../../hooks/useNavigation';
import { useTranslation } from '../../../hooks/useTranslation';
import { AlertsContextProvider } from '../../../alerts/AlertsContext';
import Alerts from '../../../alerts/Alerts';
import WithClusterTemplateQuickStarts from '../../ClusterTemplatesGettingStarted/WithClusterTemplateQuickStarts';

const PageHeader = ({ quota }: { quota?: Quota }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -37,16 +36,14 @@ const QuotaFormPage = ({ quota }: { quota?: Quota }) => {
return (
<ErrorBoundary>
<AlertsContextProvider>
<WithClusterTemplateQuickStarts>
<Page>
<PageHeader quota={quota} />
<Divider />
<Alerts />
<PageSection variant={PageSectionVariants.light}>
<QuotaForm quota={quota} />
</PageSection>
</Page>
</WithClusterTemplateQuickStarts>
<Page>
<PageHeader quota={quota} />
<Divider />
<Alerts />
<PageSection variant={PageSectionVariants.light}>
<QuotaForm quota={quota} />
</PageSection>
</Page>
</AlertsContextProvider>
</ErrorBoundary>
);
Expand Down