Skip to content

Commit 84c66b8

Browse files
committed
Enhance UI layout and improve file format handling
- Added flexbox styling to .table-row for better alignment and spacing in ContentMapper component. - Updated LoadFileFormat component to improve file format icon handling and accessibility. - Refined file processing logic to restrict XML handling to specific CMS types (WordPress and Drupal).
2 parents 9b527d0 + 4590803 commit 84c66b8

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

ui/src/components/ContentMapper/index.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,16 @@ div .table-row {
414414
margin: 0 auto;
415415
}
416416
}
417+
418+
.table-row {
419+
display: flex;
420+
align-items: center;
421+
gap: 8px;
422+
}
423+
.table-row .select {
424+
flex: 1;
425+
}
426+
.advanced-setting-button,
427+
.table-row button {
428+
flex-shrink: 0;
429+
}

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
161161
? 'DIRECTORY'
162162
: extractedFormat.toUpperCase()
163163
};
164-
164+
165165
dispatch(updateNewMigrationData({
166166
...newMigrationData,
167167
legacy_cms: {
@@ -178,7 +178,7 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
178178
} else if (extractedFormat === 'directory') {
179179
setFileIcon('Folder');
180180
} else {
181-
setFileIcon(fileFormatObj.title);
181+
setFileIcon(fileFormatObj.title);
182182
}
183183
}
184184
} else if (!isEmptyString(currentFormat)) {
@@ -198,12 +198,12 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
198198
}, 0);
199199
}, [newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath, newMigrationData?.legacy_cms?.selectedFileFormat, dispatch, newMigrationData]);
200200

201-
202201
return (
203202
<div className="p-3">
204203
<div className="col-12">
205204
<label htmlFor="file-format">
206205
<TextInput
206+
label="File Format"
207207
value={
208208
fileIcon === 'SQL' ? 'SQL' :
209209
fileIcon === 'Folder' ? 'DIRECTORY' :
@@ -212,15 +212,13 @@ const LoadFileFormat = (_props: LoadFileFormatProps) => {
212212
}
213213
version="v2"
214214
isReadOnly={true}
215-
disabled={true}
216215
width="large"
217-
placeholder=""
218216
prefix={
219217
<Icon
220-
icon={fileIcon === 'SQL' ? 'ApiTokens' : fileIcon ? fileIcon : 'CrashedPage'}
218+
icon={fileIcon === 'SQL' ? 'ApiTokens' : fileIcon === 'Folder' ? 'Folder' : fileIcon ? fileIcon : 'CrashedPage'}
221219
size="medium"
222220
version="v2"
223-
aria-label="fileformat"
221+
aria-label="File format icon"
224222
/>
225223
}
226224
/>

upload-api/src/services/fileProcessing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const handleFileProcessing = async (
4848
}
4949
};
5050
}
51-
} else if (fileExt === 'xml') {
51+
} else if (fileExt === 'xml' && (cmsType === 'wordpress' || cmsType === 'drupal')) {
5252
if (await validator({ data: zipBuffer, type: cmsType, extension: fileExt })) {
5353
const $ = Cheerio.load(zipBuffer, { xmlMode: true });
5454
const fixedXml = $.xml();

0 commit comments

Comments
 (0)