Skip to content

Commit e7802ea

Browse files
committed
Formats Fully Qualified Name field
1 parent b90b934 commit e7802ea

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/javascript/components/miq-ae-class/class-form.schema.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { componentTypes } from '@@ddf';
33
const createSchema = (fqname) => ({
44
fields: [
55
{
6-
component: componentTypes.PLAIN_TEXT,
6+
component: componentTypes.TEXT_FIELD,
77
name: 'fqname',
8-
label: `${__('Fully Qualified Name')}:\t ${fqname}`,
8+
label: 'Fully Qualified Name',
9+
value: `${fqname}`,
10+
disabled: true,
911
},
1012
{
1113
component: componentTypes.TEXT_FIELD,

app/javascript/components/miq-ae-class/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import miqRedirectBack from '../../helpers/miq-redirect-back';
88
import miqFlash from '../../helpers/miq-flash';
99

1010
const MiqAeClass = ({ classRecord, fqname }) => {
11+
const formattedFqname = fqname.replace(/\s+/g, '');
1112
const [data, setData] = useState({
1213
isLoading: true,
1314
initialValues: undefined,
@@ -24,7 +25,7 @@ const MiqAeClass = ({ classRecord, fqname }) => {
2425
});
2526
} else {
2627
const initialValues = {
27-
fqname,
28+
formattedFqname,
2829
name: classRecord && classRecord.name,
2930
display_name: classRecord && classRecord.display_name,
3031
description: classRecord && classRecord.description,
@@ -86,7 +87,7 @@ const MiqAeClass = ({ classRecord, fqname }) => {
8687
? (
8788
<div className="dialog-provision-form">
8889
<MiqFormRenderer
89-
schema={createSchema(fqname)}
90+
schema={createSchema(formattedFqname)}
9091
initialValues={data.initialValues}
9192
validatorMapper={customValidatorMapper}
9293
onSubmit={onSubmit}

0 commit comments

Comments
 (0)