Skip to content

Commit 4cc217d

Browse files
committed
implement default affix handling on blur and chnaged the affix description
1 parent cd52fc7 commit 4cc217d

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

ui/src/cmsData/legacyCms.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
"uid": "cs6c761d71844ac800"
339339
},
340340
"title": "Add Source Affix",
341-
"description": "Add a 2–5 character affix for the source name. Use only letters, no numbers or special characters",
341+
"description": "Add a 2–5 letter-only affix for the source name. The affix will function as a prefix if the content type UID matches with <a href=\"https://www.contentstack.com/docs/developers/create-content-types/restricted-keywords-for-uids\" target=\"_blank\">restricted UIDs</a>. The affix will function as a suffix for field UIDs. If left blank, \"cs\" will be used by default. Avoid numbers, special characters, and restricted keywords",
342342
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration",
343343
"lock": false,
344344
"active": false,

ui/src/components/LegacyCms/Actions/LoadPrefix.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
100100
}
101101
} else {
102102
setIsError(false);
103+
setErrorMessage('');
104+
setIsRestrictedKey(false);
105+
setPrefix('');
106+
}
107+
});
108+
109+
const handleOnBlur = (value: string) => {
110+
if (isEmptyString(value?.trim())) {
111+
setIsError(false);
112+
setErrorMessage('');
113+
setIsRestrictedKey(false);
114+
setPrefix('cs');
103115
const newMigrationDataObj: INewMigration = {
104116
...newMigrationData,
105117
legacy_cms: {
@@ -110,7 +122,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
110122
};
111123
dispatch(updateNewMigrationData(newMigrationDataObj));
112124
}
113-
});
125+
}
114126

115127
/**** ALL USEEffects HERE ****/
116128

@@ -132,6 +144,11 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
132144
aria-label="affix"
133145
disabled={newMigrationData?.legacy_cms?.uploadedFile?.isValidated}
134146
isReadOnly={newMigrationData?.legacy_cms?.uploadedFile?.isValidated}
147+
onBlur={(e: React.FocusEvent<HTMLInputElement>) => {
148+
handleOnBlur(e.target.value);
149+
150+
}}
151+
135152
/>
136153
{isError && <p className="errorMessage">{errorMessage}</p>}
137154
</div>

ui/src/components/Stepper/VerticalStepper/AutoVerticalStepper.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ const AutoVerticalStepper = React.forwardRef<
9393
</Tooltip>
9494
) : null} */}
9595
</div>
96-
{data.description && <div className="stepper-discription"> {data.description}</div>}
96+
{data.description && (
97+
<div
98+
className="stepper-discription"
99+
dangerouslySetInnerHTML={{ __html: data.description }}
100+
/>
101+
)}
97102
</>
98103
);
99104
};

upload-api/src/config/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
plan: {
33
dropdown: { optionLimit: 100 }
44
},
5-
cmsType: process.env.CMS_TYPE || 'cmsType',
5+
cmsType: process.env.CMS_TYPE || 'aem',
66
isLocalPath: true,
77
awsData: {
88
awsRegion: 'us-east-2',
@@ -12,5 +12,5 @@ export default {
1212
bucketName: '',
1313
bucketKey: ''
1414
},
15-
localPath: process.env.CONTAINER_PATH || 'localPath'
15+
localPath: process.env.CONTAINER_PATH || '/Users/yash.shinde/Documents/Migration/Expample-Data/AEM/aem_data_structure/templates'
1616
};

0 commit comments

Comments
 (0)