Skip to content

Commit 5567b82

Browse files
committed
fix:bugs [CMG-536][CMG-537]
1 parent 358a6bb commit 5567b82

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ const LoadFileFormat = (props: LoadFileFormatProps) => {
6161
};
6262

6363
const getFileExtension = (filePath: string): string => {
64+
const normalizedPath = filePath.replace(/\\/g, "/")?.replace(/\/$/, "");
65+
66+
// Use regex to extract the file extension
67+
const match = normalizedPath.match(/\.([a-zA-Z0-9]+)$/);
68+
const ext = match ? match[1].toLowerCase() : "";
69+
6470
const fileName = filePath?.split('/')?.pop();
65-
const ext = fileName?.split('.')?.pop();
71+
//const ext = fileName?.split('.')?.pop();
6672
const validExtensionRegex = /\.(pdf|zip|xml|json)$/i;
6773
return ext && validExtensionRegex?.test(`.${ext}`) ? `${ext}` : '';
6874
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const LoadSelectCms = (props: LoadSelectCmsProps) => {
144144
}
145145
};
146146
//await updateLegacyCMSData(selectedOrganisation.value, projectId, { legacy_cms: newSelectedCard?.cms_id });
147-
dispatch(updateNewMigrationData(newMigrationDataObj));
147+
//dispatch(updateNewMigrationData(newMigrationDataObj));
148148
props?.handleStepChange(props?.currentStep);
149149
}
150150

ui/src/components/LegacyCms/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const LegacyCMSComponent = forwardRef(({ legacyCMSData, isCompleted, handleOnAll
140140
}
141141

142142
//Make Step 2 complete
143-
if (!isEmptyString(selectedCmsData?.cms_id) && !isEmptyString(legacyCMSData?.affix)) {
143+
if (!isEmptyString(selectedCmsData?.cms_id) && (!isEmptyString(legacyCMSData?.affix) || !isEmptyString(newMigrationData?.legacy_cms?.affix))) {
144144
setInternalActiveStepIndex(1);
145145
}
146146

0 commit comments

Comments
 (0)