Skip to content

Commit 962e103

Browse files
committed
fixes
1 parent 548e5f8 commit 962e103

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

src/components/ComponentsSelection/ComponentsSelection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import styles from './ComponentsSelection.module.css';
2121
import { Infobox } from '../Ui/Infobox/Infobox.tsx';
2222
import { useTranslation } from 'react-i18next';
2323
import { ComponentSelectionItem } from '../../lib/api/types/crate/createManagedControlPlane.ts';
24-
import { filterSelectedComponents } from '../Wizards/CreateManagedControlPlaneWizardContainer.tsx';
24+
import { filterSelectedComponents } from './ComponentsSelectionContainer.tsx';
2525

2626
export interface ComponentsSelectionProps {
2727
components: ComponentSelectionItem[];

src/components/ComponentsSelection/ComponentsSelectionContainer.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ export interface ComponentsSelectionProps {
1313
selectedComponents: ComponentSelectionItem[];
1414
setSelectedComponents: (components: ComponentSelectionItem[]) => void;
1515
}
16+
17+
export const filterSelectedComponents = (
18+
components: ComponentSelectionItem[],
19+
) =>
20+
components.filter(
21+
(component) =>
22+
component.isSelected &&
23+
!(
24+
component.name?.includes('provider') &&
25+
components?.find(({ name }) => name === 'crossplane')?.isSelected ===
26+
false
27+
),
28+
);
29+
1630
export const ComponentsSelectionContainer: React.FC<
1731
ComponentsSelectionProps
1832
> = ({ setSelectedComponents, selectedComponents }) => {

src/components/Wizards/CreateManagedControlPlaneWizardContainer.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ import { EditMembers } from '../Members/EditMembers.tsx';
3838
import { useTranslation } from 'react-i18next';
3939
import { MetadataForm } from '../Dialogs/MetadataForm.tsx';
4040
import { IllustratedBanner } from '../Ui/IllustratedBanner/IllustratedBanner.tsx';
41-
import { ComponentsSelectionContainer } from '../ComponentsSelection/ComponentsSelectionContainer.tsx';
41+
import {
42+
ComponentsSelectionContainer,
43+
filterSelectedComponents,
44+
} from '../ComponentsSelection/ComponentsSelectionContainer.tsx';
4245
import { idpPrefix } from '../../utils/idpPrefix.ts';
4346
import { CreateDialogProps } from '../Dialogs/CreateWorkspaceDialogContainer.tsx';
4447

@@ -64,19 +67,6 @@ const wizardStepOrder: WizardStepType[] = [
6467
'success',
6568
];
6669

67-
export const filterSelectedComponents = (
68-
components: ComponentSelectionItem[],
69-
) =>
70-
components.filter(
71-
(component) =>
72-
component.isSelected &&
73-
!(
74-
component.name?.includes('provider') &&
75-
components?.find(({ name }) => name === 'crossplane')?.isSelected ===
76-
false
77-
),
78-
);
79-
8070
export const CreateManagedControlPlaneWizardContainer: FC<
8171
CreateManagedControlPlaneWizardContainerProps
8272
> = ({ isOpen, setIsOpen, projectName = '', workspaceName = '' }) => {

0 commit comments

Comments
 (0)