Skip to content

Conversation

@sauravraw
Copy link
Contributor

No description provided.

…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.
@sauravraw sauravraw requested a review from a team as a code owner February 10, 2026 13:47
@sauravraw sauravraw changed the base branch from main to dev February 10, 2026 13:47
…rror handling in authentication controller and service. Implement fallback responses for failed login and SMS request attempts to improve user experience and stability.
Copy link
Contributor

Copilot AI left a 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 axios to ^1.13.5 across api, ui, and upload-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 by selectedFileFormat.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: when isSQL is false, extension is derived from getFileExtension(localPath), but utilities/functions.ts#getFileExtension returns '' for directories (no extension). Consider handling directory explicitly (e.g., if selectedFileFormat is directory, set extension = 'directory') or updating getFileExtension to detect directories consistently with Migration/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant