Skip to content

Commit 35b478b

Browse files
fix changes requested
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
1 parent 141fea8 commit 35b478b

2 files changed

Lines changed: 20 additions & 54 deletions

File tree

clients/ui/frontend/src/app/pages/modelCatalogSettings/components/YamlSection.tsx

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ const YamlSection: React.FC<YamlSectionProps> = ({
110110
</FormHelperText>
111111
);
112112

113+
const expectedFormatButton = onToggleExpectedFormatDrawer ? (
114+
<Button
115+
variant="link"
116+
isInline
117+
onClick={onToggleExpectedFormatDrawer}
118+
data-testid="view-expected-yaml-format-link"
119+
icon={<OpenDrawerRightIcon />}
120+
iconPosition="end"
121+
>
122+
{EXPECTED_YAML_FORMAT_LABEL}
123+
</Button>
124+
) : null;
125+
113126
return (
114127
<FormSection data-testid="yaml-section">
115128
{fileUploadError && (
@@ -129,60 +142,14 @@ const YamlSection: React.FC<YamlSectionProps> = ({
129142
alignItems={{ default: 'alignItemsCenter' }}
130143
className="pf-v6-u-mb-sm"
131144
>
132-
<FlexItem>
133-
{FORM_LABELS.YAML_CONTENT}
134-
<span className="pf-v6-c-form__label-required" aria-hidden="true">
135-
{' '}
136-
*
137-
</span>
138-
</FlexItem>
139-
{onToggleExpectedFormatDrawer && (
140-
<FlexItem>
141-
<Button
142-
variant="link"
143-
isInline
144-
onClick={onToggleExpectedFormatDrawer}
145-
data-testid="view-expected-yaml-format-link"
146-
icon={<OpenDrawerRightIcon />}
147-
iconPosition="end"
148-
>
149-
{EXPECTED_YAML_FORMAT_LABEL}
150-
</Button>
151-
</FlexItem>
152-
)}
145+
<FlexItem>{FORM_LABELS.YAML_CONTENT}</FlexItem>
146+
<FlexItem>{expectedFormatButton}</FlexItem>
153147
</Flex>
154148
)}
155149
<FormGroup
156-
label={
157-
!isMUITheme ? (
158-
<Flex
159-
justifyContent={{ default: 'justifyContentSpaceBetween' }}
160-
alignItems={{ default: 'alignItemsCenter' }}
161-
>
162-
<FlexItem>
163-
{FORM_LABELS.YAML_CONTENT}
164-
<span className="pf-v6-c-form__label-required" aria-hidden="true">
165-
{' '}
166-
*
167-
</span>
168-
</FlexItem>
169-
{onToggleExpectedFormatDrawer && (
170-
<FlexItem>
171-
<Button
172-
variant="link"
173-
isInline
174-
onClick={onToggleExpectedFormatDrawer}
175-
data-testid="view-expected-yaml-format-link"
176-
icon={<OpenDrawerRightIcon />}
177-
iconPosition="end"
178-
>
179-
{EXPECTED_YAML_FORMAT_LABEL}
180-
</Button>
181-
</FlexItem>
182-
)}
183-
</Flex>
184-
) : undefined
185-
}
150+
label={!isMUITheme ? FORM_LABELS.YAML_CONTENT : undefined}
151+
labelInfo={!isMUITheme ? expectedFormatButton : undefined}
152+
isRequired
186153
fieldId="yaml-content"
187154
>
188155
<FormFieldset component={yamlInput} field="YAML" />

clients/ui/frontend/src/app/pages/modelCatalogSettings/constants.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ export const ERROR_MESSAGES = {
6969
FILE_UPLOAD_FAILED_BODY:
7070
"The YAML file couldn't be uploaded. Check its syntax and structure, then try again.",
7171
VALIDATION_FAILED: 'Validation failed',
72-
VALIDATION_FAILED_BODY:
73-
'The system cannot establish a connection to the source. Ensure that the organization is accurate, then try again.',
72+
VALIDATION_FAILED_BODY: 'The system cannot establish a connection to the source.',
7473
} as const;
7574

7675
export const SUCCESS_MESSAGES = {
@@ -89,7 +88,7 @@ export const TABLE_COLUMN_LABELS = {
8988

9089
export const TABLE_COLUMN_POPOVERS = {
9190
ORGANIZATION:
92-
'Applies only to Hugging Face sources. Shows the organization the source syncs models from (for example, Google). Only models within this organization are included in the catalog.',
91+
'Applies only to Hugging Face sources. Shows the organization the source syncs models from (for example, meta-llama). Only models within this organization are included in the catalog.',
9392
ENABLE:
9493
'Enable a source to make its models available to users in your organization from the model catalog.',
9594
} as const;

0 commit comments

Comments
 (0)