Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
225996f
fix: ensure newMigrationData is dispatched correctly after processing
aishwarya-cstk Mar 28, 2026
66bb7a7
refactor: update MySQL details structure in LoadUploadFile component …
aishwarya-cstk Mar 30, 2026
fad1080
Merge branch 'dev' of https://github.com/contentstack/migration-v2 in…
aishwarya-cstk Mar 30, 2026
374f542
chore: update package-lock.json files to reflect dependency version c…
aishwarya-cstk Mar 30, 2026
42af9d1
chore: update package.json to include undici dependency and clean up …
aishwarya-cstk Mar 30, 2026
753577a
chore: update package-lock.json to reflect dependency version upgrade…
aishwarya-cstk Mar 30, 2026
c49c205
chore: update package-lock.json to include license information and up…
aishwarya-cstk Mar 30, 2026
510d9b0
chore: remove unnecessary dev flags from package-lock.json entries
aishwarya-cstk Mar 30, 2026
dc3ca14
chore: add @testing-library/dom dependency and update related test to…
aishwarya-cstk Mar 30, 2026
d19167f
chore: mark json-parse-even-better-errors and text-table as developme…
aishwarya-cstk Mar 30, 2026
1c0fe7f
chore: remove development flags from json-parse-even-better-errors an…
aishwarya-cstk Mar 30, 2026
a71e151
chore: downgrade several dependencies in package-lock.json and remove…
aishwarya-cstk Mar 30, 2026
952c362
chore: update package-lock.json to upgrade @apollo/client and @babel …
aishwarya-cstk Mar 30, 2026
d619502
chore: update package-lock.json to add support for additional platfor…
aishwarya-cstk Mar 30, 2026
2100686
chore: mark json-parse-even-better-errors and text-table as developme…
aishwarya-cstk Mar 30, 2026
b9877c4
chore: clean up package-lock.json by removing unused esbuild platform…
aishwarya-cstk Mar 30, 2026
fd0b6c2
chore: update package-lock.json to add new esbuild platform entries f…
aishwarya-cstk Mar 31, 2026
4b32bea
chore: update yaml dependency version in package-lock.json from 1.10.…
aishwarya-cstk Mar 31, 2026
eaddf66
chore: update package-lock.json to mark yaml as a development depende…
aishwarya-cstk Mar 31, 2026
ac22d27
chore: add @emnapi dependencies to package.json and package-lock.json
aishwarya-cstk Mar 31, 2026
47332d8
refactor:changed the mysql spelling
aishwarya-cstk Mar 31, 2026
1b1e46f
refactor: update MySQL configuration keys to use mySQLDetails
aishwarya-cstk Mar 31, 2026
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
4,964 changes: 3,555 additions & 1,409 deletions api/package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@
"php-serialize": "^5.1.3",
"socket.io": "^4.7.5",
"uuid": "^9.0.1",
"winston": "^3.11.0"
"winston": "^3.11.0",
"@emnapi/core": "1.9.1",
"@emnapi/runtime" : "1.9.1",
"@emnapi/wasi-threads": "1.2.0"
},
"devDependencies": {
"@types/cors": "^2.8.17",
Expand Down Expand Up @@ -95,7 +98,8 @@
"glob": ">=11.1.0",
"rollup": ">=4.59.0",
"tar": ">=7.5.8",
"@tootallnate/once": ">=3.0.1"
"@tootallnate/once": ">=3.0.1",
"undici": ">=7.24.0"
},
"keywords": []
}
584 changes: 474 additions & 110 deletions package-lock.json

Large diffs are not rendered by default.

1,546 changes: 517 additions & 1,029 deletions ui/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@contentstack/json-rte-serializer": "^3.0.5",
"@contentstack/venus-components": "^3.0.3",
"@contentstack/venus-components": "^3.0.4",
"@reduxjs/toolkit": "^2.8.2",
"@types/react": "^18.3.21",
"@types/react-dom": "^18.2.13",
Expand Down Expand Up @@ -43,6 +43,7 @@
"coverage:ui": "npx serve coverage -l 3939"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
Expand Down
36 changes: 12 additions & 24 deletions ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ const FileComponent = ( { fileDetails, fileFormatId }: Props ) =>
<div>
{ isSQL ? (
// ✅ SQL format (from legacyCms.json allowed_file_formats): show MySQL details
fileDetails?.mySQLDetails && (
fileDetails?.mysql && (
<div>
<p className="pb-2">Host: { fileDetails?.mySQLDetails?.host }</p>
<p className="pb-2">Database: { fileDetails?.mySQLDetails?.database }</p>
<p className="pb-2">User: { fileDetails?.mySQLDetails?.user }</p>
<p className="pb-2">Host: { fileDetails?.mysql?.host }</p>
<p className="pb-2">Database: { fileDetails?.mysql?.database }</p>
<p className="pb-2">User: { fileDetails?.mysql?.user }</p>
</div>
)
) : fileDetails?.isLocalPath ? (
Expand Down Expand Up @@ -176,11 +176,11 @@ const LoadUploadFile = ( props: LoadUploadFileProps ) =>
bucketName: responseFileDetails?.awsData?.bucketName,
bucketKey: responseFileDetails?.awsData?.bucketKey
},
mySQLDetails: {
host: responseFileDetails?.mySQLDetails?.host,
user: responseFileDetails?.mySQLDetails?.user,
database: responseFileDetails?.mySQLDetails?.database,
port: responseFileDetails?.mySQLDetails?.port
mysql: {
host: responseFileDetails?.mysql?.host,
user: responseFileDetails?.mysql?.user,
database: responseFileDetails?.mysql?.database,
port: responseFileDetails?.mysql?.port
},
assetsConfig: {
base_url: responseFileDetails?.assetsConfig?.base_url,
Expand All @@ -206,7 +206,7 @@ const LoadUploadFile = ( props: LoadUploadFileProps ) =>

// Update the ref immediately before dispatching to avoid stale data in subsequent operations
newMigrationDataRef.current = newMigrationDataObj;
dispatch( updateNewMigrationData( newMigrationDataObj ) );


// Derive SQL check from selectedFileFormat (data-driven via legacyCms.json)
const currentFormatId = newMigrationDataObj?.legacy_cms?.selectedFileFormat?.fileformat_id?.toLowerCase();
Expand Down Expand Up @@ -295,6 +295,7 @@ const LoadUploadFile = ( props: LoadUploadFileProps ) =>
setProcessing( 'Processing...100%' );

await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) );
dispatch( updateNewMigrationData( newMigrationDataObj ) );

setTimeout( () =>
{
Expand Down Expand Up @@ -437,24 +438,11 @@ const LoadUploadFile = ( props: LoadUploadFileProps ) =>
}
};

// Update fileDetails whenever Redux state changes
useEffect( () =>
{
const latestFileDetails = newMigrationData?.legacy_cms?.uploadedFile?.file_details;

// Always update fileDetails from Redux, even if it's empty (to clear stale data)
setFileDetails( latestFileDetails );

}, [ newMigrationData?.legacy_cms?.uploadedFile?.file_details ] );

useEffect( () =>
{
getConfigDetails();
}, [
// Re-run when selectedFileFormat or file_details change (e.g., after LoadSelectCms or fetchProjectData dispatches)
newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id,
newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath
] );
}, [] );

useEffect( () =>
{
Expand Down
2 changes: 1 addition & 1 deletion ui/src/context/app/app.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface FileDetails {
bucketName?: string;
bucketKey?: string;
};
mySQLDetails?: {
mysql?: {
host?: string;
user?: string;
database?: string;
Expand Down
34 changes: 32 additions & 2 deletions ui/src/pages/Migration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ const Migration = () => {
awsRegion: data?.awsData?.awsRegion,
bucketName: data?.awsData?.bucketName,
bucketKey: data?.awsData?.bucketKey
},
mysql: {
host: data?.mysql?.host,
user: data?.mysql?.user,
database: data?.mysql?.database,
port: data?.mysql?.port
},
assetsConfig: {
base_url: data?.assetsConfig?.base_url,
public_path: data?.assetsConfig?.public_path
}
},
cmsType: data?.cmsType
Expand Down Expand Up @@ -382,7 +392,17 @@ const Migration = () => {
bucketName: projectData?.legacy_cms?.awsDetails?.bucketName,
bucketKey: projectData?.legacy_cms?.awsDetails?.bucketKey
},
isLocalPath: projectData?.legacy_cms?.is_localPath
isLocalPath: projectData?.legacy_cms?.is_localPath,
mysql: {
host: projectData?.legacy_cms?.mySQLDetails?.host,
user: projectData?.legacy_cms?.mySQLDetails?.user,
database: projectData?.legacy_cms?.mySQLDetails?.database,
port: projectData?.legacy_cms?.mySQLDetails?.port
},
assetsConfig: {
base_url: projectData?.legacy_cms?.assetsConfig?.base_url,
public_path: projectData?.legacy_cms?.assetsConfig?.public_path
}
},
isValidated: projectData?.legacy_cms?.is_fileValid,
reValidate: newMigrationData?.legacy_cms?.uploadedFile?.reValidate,
Expand All @@ -400,7 +420,17 @@ const Migration = () => {
awsRegion: uploadObj?.file_details?.awsData?.awsRegion || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.awsData?.awsRegion,
bucketName: uploadObj?.file_details?.awsData?.bucketName || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.awsData?.bucketName,
bucketKey: uploadObj?.file_details?.awsData?.bucketKey || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.awsData?.bucketKey,
}
},
mysql: {
host: uploadObj?.file_details?.mysql?.host || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.mysql?.host,
user: uploadObj?.file_details?.mysql?.user || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.mysql?.user,
database: uploadObj?.file_details?.mysql?.database || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.mysql?.database,
port: uploadObj?.file_details?.mysql?.port || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.mysql?.port,
},
assetsConfig: {
base_url: uploadObj?.file_details?.assetsConfig?.base_url || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.assetsConfig?.base_url,
public_path: uploadObj?.file_details?.assetsConfig?.public_path || newMigrationDataRef?.current?.legacy_cms?.uploadedFile?.file_details?.assetsConfig?.public_path,
}
}
},
isFileFormatCheckboxChecked: true,
Expand Down
15 changes: 10 additions & 5 deletions ui/tests/unit/store/authSlice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,19 @@ describe('store/slice/authSlice', () => {
});

it('should reset state on error', async () => {
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
vi.mocked(getUser).mockRejectedValue(new Error('Network error'));

const store = createTestStore();
store.dispatch(setAuthToken({ authToken: 'old-token', isAuthenticated: true }));
await store.dispatch(getUserDetails());
try {
const store = createTestStore();
store.dispatch(setAuthToken({ authToken: 'old-token', isAuthenticated: true }));
await store.dispatch(getUserDetails());

const state = store.getState().authentication;
expect(state.authToken).toBe('');
const state = store.getState().authentication;
expect(state.authToken).toBe('');
} finally {
consoleSpy.mockRestore();
}
});
});
});
19 changes: 0 additions & 19 deletions upload-api/migration-aem/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading