Skip to content
Merged

Dev #860

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ui/src/components/ContentMapper/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,16 @@ div .table-row {
margin: 0 auto;
}
}

.table-row {
display: flex;
align-items: center;
gap: 8px;
}
.table-row .select {
flex: 1;
}
.advanced-setting-button,
.table-row button {
flex-shrink: 0;
}
16 changes: 6 additions & 10 deletions ui/src/components/LegacyCms/Actions/LoadFileFormat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
isactive: true,
title: extractedFormat === 'zip' ? 'Zip' : extractedFormat.toUpperCase()
};

console.info('LoadFileFormat: DISPATCHING FILE FORMAT:', fileFormatObj);


dispatch(updateNewMigrationData({
...newMigrationData,
legacy_cms: {
Expand All @@ -69,31 +67,29 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
}
}));

setFileIcon(fileFormatObj.title);
setFileIcon(fileFormatObj?.title);
}
} else if (!isEmptyString(currentFormat)) {
setFileIcon(currentFormat);
}
}, [newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath, newMigrationData?.legacy_cms?.selectedFileFormat, dispatch, newMigrationData]);


return (
<div className="p-3">
<div className="col-12">
<label htmlFor="file-format">
<TextInput
value={fileIcon === 'Folder' ? 'DIRECTORY' : fileIcon ? fileIcon : 'file extension not found'}
label="File Format"
value={fileIcon || 'File extension not found'}
version="v2"
isReadOnly={true}
disabled={true}
width="large"
placeholder=""
prefix={
<Icon
icon={fileIcon ? fileIcon : 'CrashedPage'}
icon={fileIcon === 'DIRECTORY' ? 'Folder' : fileIcon ? fileIcon : 'CrashedPage'}
size="medium"
version="v2"
aria-label="fileformat"
aria-label="File format icon"
/>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion upload-api/src/services/fileProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const handleFileProcessing = async (
file_details: config
};
}
} else if (fileExt === 'xml') {
} else if (fileExt === 'xml' && (cmsType === 'wordpress' || cmsType === 'drupal')) {
if (await validator({ data: zipBuffer, type: cmsType, extension: fileExt })) {
const $ = Cheerio.load(zipBuffer, { xmlMode: true });
const fixedXml = $.xml();
Expand Down