Skip to content

Commit ac877b9

Browse files
PR requested changes
1 parent 207ceac commit ac877b9

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

src/components/Dialogs/CreateProjectWorkspaceDialog.module.css renamed to src/components/Dialogs/MetadataForm.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
.affixRow {
2+
display: flex;
3+
gap: 8px;
4+
align-items: center;
5+
}
6+
17
.input {
28
width: 100%;
39
margin-bottom: 2rem;

src/components/Dialogs/MetadataForm.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
Ui5CustomEvent,
1313
InputDomRef,
1414
} from '@ui5/webcomponents-react';
15-
import styles from './CreateProjectWorkspaceDialog.module.css';
15+
16+
import styles from './MetadataForm.module.css';
1617
import React from 'react';
1718

1819
export interface MetadataFormProps {
@@ -74,10 +75,10 @@ export function MetadataForm({
7475
const resolvedDisplayNameSuffix = (propDisplayNameSuffix || '').trim();
7576

7677
const computeCore = (full: string, prefix: string, suffix: string) => {
77-
let v = full ?? '';
78-
if (prefix && v.startsWith(prefix)) v = v.slice(prefix.length);
79-
if (suffix && v.endsWith(suffix)) v = v.slice(0, v.length - suffix.length);
80-
return v;
78+
let name = full ?? '';
79+
if (prefix && name.startsWith(prefix)) name = name.slice(prefix.length);
80+
if (suffix && name.endsWith(suffix)) name = name.slice(0, name.length - suffix.length);
81+
return name;
8182
};
8283

8384
const nameCore = computeCore(currentName, resolvedNamePrefix, resolvedNameSuffix);
@@ -109,7 +110,7 @@ export function MetadataForm({
109110
</Label>
110111

111112
{resolvedNamePrefix || resolvedNameSuffix ? (
112-
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
113+
<div className={styles.affixRow}>
113114
{resolvedNamePrefix ? (
114115
<Input
115116
className={styles.input}
@@ -154,7 +155,7 @@ export function MetadataForm({
154155
<Label for={'displayName'}>{t('CreateProjectWorkspaceDialog.displayNameLabel')}</Label>
155156

156157
{resolvedDisplayNamePrefix || resolvedDisplayNameSuffix ? (
157-
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
158+
<div className={styles.affixRow}>
158159
{resolvedDisplayNamePrefix ? (
159160
<Input
160161
className={styles.input}

src/components/Wizards/CreateManagedControlPlane/CreateManagedControlPlaneWizardContainer.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
186186

187187
const hasMissingComponentVersions = useMemo(() => {
188188
const list = (componentsList ?? []) as ComponentsListItem[];
189-
return list.some((c) => c?.isSelected && !c?.selectedVersion);
189+
return list.some(({ isSelected, selectedVersion }) => isSelected && !selectedVersion);
190190
}, [componentsList]);
191191

192192
const handleCreateManagedControlPlane = useCallback(
@@ -261,10 +261,10 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
261261
hasMissingComponentVersions,
262262
]);
263263

264-
const normalizeMemberRole = useCallback((r?: string | null) => {
265-
const v = (r ?? '').toString().trim().toLowerCase();
266-
if (v === 'admin' || v === 'administrator') return MemberRoles.admin;
267-
if (v === 'viewer' || v === 'view' || v === 'read' || v === 'readonly' || v === 'read-only') {
264+
const normalizeMemberRole = useCallback((roleInput?: string | null) => {
265+
const normalizedRole = (roleInput ?? '').toString().trim().toLowerCase();
266+
if (normalizedRole === 'admin' || normalizedRole === 'administrator') return MemberRoles.admin;
267+
if (normalizedRole === 'viewer' || normalizedRole === 'view' || normalizedRole === 'readonly') {
268268
return MemberRoles.view;
269269
}
270270
return MemberRoles.view;
@@ -317,9 +317,9 @@ export const CreateManagedControlPlaneWizardContainer: FC<CreateManagedControlPl
317317
}
318318
}, [selectedStep]);
319319

320-
const normalizeMemberKind = useCallback((k?: string | null) => {
321-
const v = (k ?? '').toString().trim().toLowerCase();
322-
return v === 'serviceaccount' ? 'ServiceAccount' : 'User';
320+
const normalizeMemberKind = useCallback((kindInput?: string | null) => {
321+
const normalizedKind = (kindInput ?? '').toString().trim().toLowerCase();
322+
return normalizedKind === 'serviceaccount' ? 'ServiceAccount' : 'User';
323323
}, []);
324324

325325
const appliedTemplateMembersRef = useRef(false);

0 commit comments

Comments
 (0)