Skip to content

Commit 207ceac

Browse files
Fixing spelling
1 parent 28965e1 commit 207ceac

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/components/Wizards/CreateManagedControlPlane/CreateManagedControlPlaneWizardContainer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ import { EditMembers } from '../../Members/EditMembers.tsx';
4040
import { ComponentsSelectionContainer } from '../../ComponentsSelection/ComponentsSelectionContainer.tsx';
4141
import { IllustratedBanner } from '../../Ui/IllustratedBanner/IllustratedBanner.tsx';
4242
import { ManagedControlPlaneTemplate, noTemplateValue } from '../../../lib/api/types/templates/mcpTemplate.ts';
43-
import { buildNameWithPrefixesAndSufixes } from '../../../utils/buildNameWithPrefixesAndSufixes.ts';
4443
import { stripIdpPrefix } from '../../../utils/stripIdpPrefix.ts';
44+
import { buildNameWithPrefixesAndSuffixes } from '../../../utils/buildNameWithPrefixesAndSuffixes.ts';
4545

4646
type CreateManagedControlPlaneWizardContainerProps = {
4747
isOpen: boolean;
@@ -71,7 +71,7 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
7171

7272
const normalizeChargingTargetType = useCallback((val?: string | null) => (val ?? '').trim().toLowerCase(), []);
7373

74-
// Here we will use OnboardingAPI to get all avaliable templates
74+
// Here we will use OnboardingAPI to get all available templates
7575
const templates = useMemo<ManagedControlPlaneTemplate[]>(() => [], []);
7676

7777
const [selectedTemplateValue, setSelectedTemplateValue] = useState<string>(noTemplateValue);
@@ -84,9 +84,9 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
8484
const templateAffixes = useMemo(
8585
() => ({
8686
namePrefix: selectedTemplate?.spec.meta.name?.prefix ?? '',
87-
nameSuffix: selectedTemplate?.spec.meta.name?.sufix ?? '',
87+
nameSuffix: selectedTemplate?.spec.meta.name?.suffix ?? '',
8888
displayNamePrefix: selectedTemplate?.spec.meta.displayName?.prefix ?? '',
89-
displayNameSuffix: selectedTemplate?.spec.meta.displayName?.sufix ?? '',
89+
displayNameSuffix: selectedTemplate?.spec.meta.displayName?.suffix ?? '',
9090
}),
9191
[selectedTemplate],
9292
);
@@ -192,7 +192,7 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
192192
const handleCreateManagedControlPlane = useCallback(
193193
async ({ name, displayName, chargingTarget, members, chargingTargetType }: OnCreatePayload): Promise<boolean> => {
194194
try {
195-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes(name, displayName, templateAffixes);
195+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes(name, displayName, templateAffixes);
196196

197197
const normalizedType = (chargingTargetType ?? '').trim().toUpperCase();
198198
await trigger(

src/lib/api/types/templates/mcpTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export type ManagedControlPlaneTemplate = {
2626
};
2727
displayName: {
2828
prefix?: string;
29-
sufix?: string;
29+
suffix?: string;
3030
};
3131
name: {
3232
prefix?: string;
33-
sufix?: string;
33+
suffix?: string;
3434
};
3535
};
3636
spec: {

src/utils/buildNameWithPrefixesAndSufixes.spec.ts renamed to src/utils/buildNameWithPrefixesAndSuffixes.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { buildNameWithPrefixesAndSufixes } from './buildNameWithPrefixesAndSufixes';
21
import { describe, it, expect } from 'vitest';
2+
import { buildNameWithPrefixesAndSuffixes } from './buildNameWithPrefixesAndSuffixes';
33

4-
describe('buildNameWithPrefixesAndSufixes', () => {
4+
describe('buildNameWithPrefixesAndSuffixes', () => {
55
it('returns provided values when no affixes provided', () => {
6-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes('name', 'Display', {});
6+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes('name', 'Display', {});
77
expect(finalName).to.equal('name');
88
expect(finalDisplayName).to.equal('Display');
99
});
1010

1111
it('applies prefix only', () => {
12-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes('name', 'displayName', {
12+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes('name', 'displayName', {
1313
namePrefix: 'pre-',
1414
displayNamePrefix: 'PRE-',
1515
});
@@ -18,7 +18,7 @@ describe('buildNameWithPrefixesAndSufixes', () => {
1818
});
1919

2020
it('applies suffix only', () => {
21-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes('name', 'displayName', {
21+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes('name', 'displayName', {
2222
nameSuffix: '-suf',
2323
displayNameSuffix: 'SUF',
2424
});
@@ -27,7 +27,7 @@ describe('buildNameWithPrefixesAndSufixes', () => {
2727
});
2828

2929
it('applies both prefix and suffix', () => {
30-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes('name', 'displayName', {
30+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes('name', 'displayName', {
3131
namePrefix: 'pre-',
3232
nameSuffix: '-suf',
3333
displayNamePrefix: 'PRE',
@@ -38,7 +38,7 @@ describe('buildNameWithPrefixesAndSufixes', () => {
3838
});
3939

4040
it('trims whitespace around affixes', () => {
41-
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSufixes('name', 'displayName', {
41+
const { finalName, finalDisplayName } = buildNameWithPrefixesAndSuffixes('name', 'displayName', {
4242
namePrefix: ' pre- ',
4343
nameSuffix: ' -suf ',
4444
displayNamePrefix: ' PRE ',

src/utils/buildNameWithPrefixesAndSufixes.ts renamed to src/utils/buildNameWithPrefixesAndSuffixes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function buildNameWithPrefixesAndSufixes(
1+
export function buildNameWithPrefixesAndSuffixes(
22
name: string | undefined,
33
displayName: string | undefined,
44
affixes?: {

0 commit comments

Comments
 (0)