-
Notifications
You must be signed in to change notification settings - Fork 8
Bugfix/cmg 792 #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Bugfix/cmg 792 #944
Conversation
…ality and consistency. Remove unused interfaces, enhance type definitions, and standardize import statements. Update logging and error handling for better clarity and maintainability across components.
…rror handling in authentication controller and service. Implement fallback responses for failed login and SMS request attempts to improve user experience and stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates dependencies and refines the migration flow to be more data-driven (CMS/file-format selection), with additional fixes around SQL-based validations and advanced field settings persistence, plus some backend error-handling/model updates.
Changes:
- Bump
axiosto^1.13.5acrossapi,ui, andupload-api(including migration sub-packages) and update lockfiles accordingly. - Update UI migration steps to derive selected CMS + file format from
legacyCms.json, including SQL handling driven byselectedFileFormat.fileformat_id. - Backend adjustments for auth error responses, project model fields (taxonomies), and content-mapper logging/formatting changes.
Reviewed changes
Copilot reviewed 19 out of 25 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| upload-api/package.json | Bumps axios dependency version. |
| upload-api/package-lock.json | Updates axios resolved version and transitive deps. |
| upload-api/migration-wordpress/package.json | Bumps axios dependency version. |
| upload-api/migration-wordpress/package-lock.json | Adds lockfile with axios 1.13.5 resolution. |
| upload-api/migration-sitecore/package.json | Bumps axios dependency version. |
| upload-api/migration-contentful/package.json | Bumps axios dependency version. |
| upload-api/migration-contentful/package-lock.json | Adds lockfile with axios 1.13.5 resolution. |
| ui/src/pages/Migration/index.tsx | Adjusts CMS + file-format selection precedence (config vs stored), adds fallback format selection. |
| ui/src/components/LegacyCms/index.tsx | Adds fallback to first allowed file format. |
| ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx | Makes SQL/file rendering and validation more data-driven via selectedFileFormat. |
| ui/src/components/LegacyCms/Actions/LoadSelectCms.tsx | Sets selectedFileFormat from selected CMS’s allowed_file_formats. |
| ui/src/components/LegacyCms/Actions/LoadFileFormat.tsx | Simplifies icon selection logic for file format display. |
| ui/src/components/ContentMapper/index.tsx | Adjusts advanced settings merge + introduces debug-related code near save. |
| ui/src/components/AdvancePropertise/index.tsx | Fixes embedObjects payload handling and taxonomy toggle-state syncing. |
| ui/src/components/AdvancePropertise/advanceProperties.interface.ts | Extends updated settings typing (embedObject). |
| ui/src/cmsData/legacyCms.json | Normalizes file format titles (e.g., XML, Folder). |
| ui/package.json | Bumps axios dependency version. |
| ui/package-lock.json | Updates axios resolved version and transitive deps. |
| api/src/services/contentMapper.service.ts | Adds taxonomies persistence, formatting changes, and debug logging. |
| api/src/services/auth.service.ts | Improves fallback error response shaping when upstream response is missing. |
| api/src/models/project-lowdb.ts | Adds taxonomies to Project model and adjusts typing/formatting. |
| api/src/controllers/auth.controller.ts | Wraps auth handlers with try/catch and safer status defaults. |
| api/package.json | Bumps axios dependency version. |
| api/package-lock.json | Updates axios resolved version and transitive deps. |
Files not reviewed (6)
- api/package-lock.json: Language not supported
- ui/package-lock.json: Language not supported
- upload-api/migration-contentful/package-lock.json: Language not supported
- upload-api/migration-sitecore/package-lock.json: Language not supported
- upload-api/migration-wordpress/package-lock.json: Language not supported
- upload-api/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx:342
- Directory-based uploads (fileformat_id =
directory) will likely be treated as invalid here: whenisSQLis false,extensionis derived fromgetFileExtension(localPath), bututilities/functions.ts#getFileExtensionreturns''for directories (no extension). Consider handlingdirectoryexplicitly (e.g., if selectedFileFormat isdirectory, setextension = 'directory') or updatinggetFileExtensionto detect directories consistently withMigration/index.tsx.
// Derive SQL check from selectedFileFormat (data-driven via legacyCms.json)
const isSQL = newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id?.toLowerCase() === 'sql';
let extension = '';
let isFormatValid = false;
if (isSQL) {
// For SQL connections, check if SQL format is allowed for the CMS
extension = 'sql';
const { all_cms = [] } = migrationData?.legacyCMSData || {};
// Fix: Use file_details.cmsType instead of uploadedFile.cmsType
const cmsTypeValue = newMigrationData?.legacy_cms?.uploadedFile?.file_details?.cmsType ||
newMigrationData?.legacy_cms?.uploadedFile?.cmsType || '';
const filteredCmsData = all_cms?.filter((cms: ICMSType) =>
cms?.parent?.toLowerCase() === cmsTypeValue?.toLowerCase()
);
isFormatValid = filteredCmsData[0]?.allowed_file_formats?.some((format: ICardType) => {
return format?.fileformat_id?.toLowerCase() === 'sql';
}) || false;
} else {
// For file uploads, validate file extension
extension = getFileExtension(newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath || '');
const { all_cms = [] } = migrationData?.legacyCMSData || {};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…File component to improve readability and maintainability. Remove unused debug logging, enhance type safety, and standardize file format checks for better consistency across the application.
No description provided.