Skip to content

Commit ac18582

Browse files
Merge pull request #849 from contentstack/feature/aem-final
copilot comments resolved
2 parents d6d57d5 + 72bb064 commit ac18582

File tree

8 files changed

+10
-41
lines changed

8 files changed

+10
-41
lines changed

api/src/services/contentMapper.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ const resetToInitialMapping = async (req: Request) => {
751751
const fieldMappingData = contentTypeData.fieldMapping.map((itemId: any) => {
752752
const fieldData = FieldMapperModel.chain
753753
.get("field_mapper")
754-
.find({ id: itemId, projectId: projectId , contentTypeId: contentTypeId})
754+
.find({ id: itemId, projectId: projectId, contentTypeId: contentTypeId})
755755
.value();
756756
return fieldData;
757757
});
@@ -771,7 +771,7 @@ const resetToInitialMapping = async (req: Request) => {
771771
//await FieldMapperModel.read();
772772
(fieldMappingData || []).forEach((field: any) => {
773773
const fieldIndex = FieldMapperModel.data.field_mapper.findIndex(
774-
(f: any) => f?.id === field?.id && f?.projectId === projectId && f?.contentTypeId === contentTypeId
774+
(f: any) => f?.id === field?.id && f?.projectId === projectId && f?.contentTypeId === contentTypeId
775775
);
776776
if (fieldIndex > -1) {
777777
FieldMapperModel.update((data: any) => {

api/src/services/sitecore.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ const uidCorrector = ({ uid } :{uid : string}) => {
119119
newUid = newUid
120120
.replace(/[ -]/g, '_') // Replace spaces and hyphens with underscores
121121
.replace(/[^a-zA-Z0-9_]+/g, '_') // Replace non-alphanumeric characters (except underscore)
122-
.replace(/\$/g, '') // Remove dollar signs
123-
.toLowerCase() // Convert to lowercase
124122
.replace(/([A-Z])/g, (match) => `_${match.toLowerCase()}`) // Handle camelCase
123+
.toLowerCase() // Convert to lowercase
125124
.replace(/_+/g, '_') // Replace multiple underscores with single
126125
.replace(/^_|_$/g, ''); // Remove leading/trailing underscores
127126

api/src/utils/content-type-creator.utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ const uidCorrector = ({ uid } : {uid : string}) => {
8888
newUid = newUid
8989
.replace(/[ -]/g, '_') // Replace spaces and hyphens with underscores
9090
.replace(/[^a-zA-Z0-9_]+/g, '_') // Replace non-alphanumeric characters (except underscore)
91-
.replace(/\$/g, '') // Remove dollar signs
92-
.toLowerCase() // Convert to lowercase
9391
.replace(/([A-Z])/g, (match) => `_${match.toLowerCase()}`) // Handle camelCase
92+
.toLowerCase() // Convert to lowercase
9493
.replace(/_+/g, '_') // Replace multiple underscores with single
9594
.replace(/^_|_$/g, ''); // Remove leading/trailing underscores
9695

ui/src/components/ContentMapper/index.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,7 @@
152152
.Table {
153153
border-left: 0 none;
154154
min-height: 26.25rem;
155-
// &__rowgroup {
156-
// display: flex;
157-
// flex: 1;
158-
// flex-direction: column;
159-
// }
160155
.Table__body__row {
161-
// height: auto!important;
162-
// min-height: 80px;
163156
.Table-select-body {
164157
>.checkbox-wrapper {
165158
align-items: flex-start;

ui/src/components/ContentMapper/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,20 +2645,6 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
26452645
initialRowSelectedData={initialRowSelectedData}
26462646
initialSelectedRowIds={rowIds}
26472647
itemSize={80}
2648-
// v2Features={{
2649-
// isNewEmptyState: true
2650-
// }}
2651-
// customEmptyState={
2652-
// <EmptyState
2653-
// forPage="list"
2654-
// heading={<div className="empty_search_heading">No Fields available</div>}
2655-
// moduleIcon="NoSearchResult"
2656-
// description="Try changing the search query to find what you are looking for."
2657-
// version="v2"
2658-
// testId="no-results-found-page"
2659-
// className="custom-empty-state"
2660-
// />
2661-
// }
26622648
withExportCta={{
26632649
component: (
26642650
<div className='d-flex align-items-center'>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
122122
};
123123
dispatch(updateNewMigrationData(newMigrationDataObj));
124124
}
125-
}
125+
};
126126

127127
/**** ALL USEEffects HERE ****/
128128

@@ -146,9 +146,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
146146
isReadOnly={newMigrationData?.legacy_cms?.uploadedFile?.isValidated}
147147
onBlur={(e: React.FocusEvent<HTMLInputElement>) => {
148148
handleOnBlur(e.target.value);
149-
150149
}}
151-
152150
/>
153151
{isError && <p className="errorMessage">{errorMessage}</p>}
154152
</div>

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,12 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
357357
setShowMessage(true);
358358
setValidationMessage('File validated successfully.');
359359
setIsDisabled(true);
360+
if (
360361
!isEmptyString(newMigrationData?.legacy_cms?.selectedCms?.cms_id) ||
361-
(!isEmptyString(newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id) &&
362-
props.handleStepChange(props?.currentStep, true));
362+
!isEmptyString(newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id)
363+
) {
364+
props.handleStepChange(props?.currentStep, true);
365+
}
363366
}
364367
if (newMigrationData?.legacy_cms?.uploadedFile?.reValidate) {
365368
setValidationMessage('');
@@ -368,10 +371,6 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
368371
setIsDisabled(false);
369372
}
370373
setReValidate(newMigrationData?.legacy_cms?.uploadedFile?.reValidate || false);
371-
372-
// else{
373-
// setIsValidated(false);
374-
// }
375374
}, [isValidated, newMigrationData]);
376375

377376

ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,6 @@ const HorizontalStepper = forwardRef(
159159
shouldCloseOnOverlayClick: false
160160
}
161161
});
162-
} else if (
163-
-1 < newMigrationData?.legacy_cms?.currentStep &&
164-
newMigrationData?.legacy_cms?.currentStep < 2
165-
) {
166-
// showNotification(newMigrationData?.legacy_cms?.currentStep + 1);
167162
} else if (
168163
newMigrationData?.destination_stack?.selectedStack === undefined ||
169164
newMigrationData?.destination_stack?.selectedStack === null ||

0 commit comments

Comments
 (0)