diff --git a/.talismanrc b/.talismanrc index 9e2f07953..cb27ca95e 100644 --- a/.talismanrc +++ b/.talismanrc @@ -91,5 +91,11 @@ fileignoreconfig: checksum: 38d2188de3b4df88ed5e195c13b77ad7c469fe5c4d1265f1ffb868dbe3844ae1 - filename: api/package-lock.json checksum: 09b36877f7e86bb806a9657f852a448dc32fa1dfb350d0fde5fd843c54a27bf0 + - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx + checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da + - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx + checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da + - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx + checksum: dde885393dfdd813f1dace88ce8ce79e3fb438801ee5e7bf19855fe1394cb78c version: "1.0" \ No newline at end of file diff --git a/api/package-lock.json b/api/package-lock.json index a6480f9e3..a24d1e7fd 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -13,7 +13,7 @@ "@contentstack/cli-utilities": "^1.12.0", "@contentstack/json-rte-serializer": "^2.0.7", "@contentstack/marketplace-sdk": "^1.2.4", - "axios": "^1.8.2", + "axios": "^1.12.0", "chokidar": "^3.6.0", "cors": "^2.8.5", "dotenv": "^16.3.1", @@ -4799,12 +4799,12 @@ } }, "node_modules/axios": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", - "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, diff --git a/api/package.json b/api/package.json index dc864e161..157ad6532 100644 --- a/api/package.json +++ b/api/package.json @@ -29,7 +29,7 @@ "@contentstack/cli-utilities": "^1.12.0", "@contentstack/json-rte-serializer": "^2.0.7", "@contentstack/marketplace-sdk": "^1.2.4", - "axios": "^1.8.2", + "axios": "^1.12.0", "chokidar": "^3.6.0", "cors": "^2.8.5", "dotenv": "^16.3.1", diff --git a/ui/package-lock.json b/ui/package-lock.json index 7731b4530..7b9402506 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -17,7 +17,7 @@ "@types/react": "^18.3.21", "@types/react-dom": "^18.2.13", "@types/react-redux": "^7.1.33", - "axios": "^1.8.3", + "axios": "^1.12.0", "bootstrap": "^5.3.6", "chokidar": "^3.6.0", "final-form": "^4.20.10", @@ -6091,12 +6091,12 @@ } }, "node_modules/axios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", - "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, diff --git a/ui/package.json b/ui/package.json index 862210464..66cffde8a 100644 --- a/ui/package.json +++ b/ui/package.json @@ -12,7 +12,7 @@ "@types/react": "^18.3.21", "@types/react-dom": "^18.2.13", "@types/react-redux": "^7.1.33", - "axios": "^1.8.3", + "axios": "^1.12.0", "bootstrap": "^5.3.6", "chokidar": "^3.6.0", "final-form": "^4.20.10", diff --git a/ui/public/favicon.ico b/ui/public/favicon.ico index 3efd5e491..49c0d216c 100644 Binary files a/ui/public/favicon.ico and b/ui/public/favicon.ico differ diff --git a/ui/public/images/ContentstackLogo.png b/ui/public/images/ContentstackLogo.png deleted file mode 100644 index d2552da4e..000000000 Binary files a/ui/public/images/ContentstackLogo.png and /dev/null differ diff --git a/ui/public/images/contentstack.png b/ui/public/images/contentstack.png deleted file mode 100644 index b4232675a..000000000 Binary files a/ui/public/images/contentstack.png and /dev/null differ diff --git a/ui/src/cmsData/main_header.json b/ui/src/cmsData/main_header.json index f5760d37d..fcbb56a5a 100644 --- a/ui/src/cmsData/main_header.json +++ b/ui/src/cmsData/main_header.json @@ -21,13 +21,13 @@ "content_type": "image/svg+xml", "file_size": "10160", "tags": [], - "filename": "icon-cs-mobile.svg", - "url": "https://images.contentstack.io/v3/assets/blt7359e2a55efae483/blt0b9a8281aeac3ec0/664c27d3c9024c35b5ad593a/CS_logo.png", + "filename": "contentstack-logo.svg", + "url": "https://images.contentstack.io/v3/assets/blt77d44a06c81b1730/blt2e24a315fedaeaf7/68bc10f25f14881bc908b6c2/CS_OnlyLogo.webp", "ACL": [], "is_dir": false, "parent_uid": "blt8e7f7872baa3a09e", "_version": 1, - "title": "icon-cs-mobile.svg" + "title": "Contentstack" }, "url": "/projects" } diff --git a/ui/src/components/AdvancePropertise/index.scss b/ui/src/components/AdvancePropertise/index.scss index f9127100f..3f7925766 100644 --- a/ui/src/components/AdvancePropertise/index.scss +++ b/ui/src/components/AdvancePropertise/index.scss @@ -105,11 +105,6 @@ position: relative; z-index: 10000; } - .Select__control--menu-is-open { - position: relative; - border: 2px solid red; - z-index: 10000; - } } .Radio-class { display: flex; diff --git a/ui/src/components/ContentMapper/index.scss b/ui/src/components/ContentMapper/index.scss index 495799a5e..c1c3cc8b8 100644 --- a/ui/src/components/ContentMapper/index.scss +++ b/ui/src/components/ContentMapper/index.scss @@ -317,4 +317,8 @@ div .table-row { .filterButton-color{ color: $color-brand-primary-base; font-weight: $font-weight-bold; +} +.icon-padding{ + padding: 10px 10px; + margin-left: 6px; } \ No newline at end of file diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index c85b9f9a8..e97190064 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -2470,8 +2470,8 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref: /> - - @@ -2479,8 +2479,8 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref: )} - - diff --git a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx index 04ad10a81..b1b4a99a1 100644 --- a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx +++ b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx @@ -163,6 +163,13 @@ const Mapper = ({ setSelectedMappings(updatedSelectedMappings); } + else if ( !isLabelMismatch && !isStackChanged ) { + const key = `${locale?.label}-master_locale` + updatedSelectedMappings = { + [key]: updatedSelectedMappings?.[`${locale?.label}-master_locale`] ? updatedSelectedMappings?.[`${locale?.label}-master_locale`] : '', + }; + setSelectedMappings(updatedSelectedMappings); + } } }) @@ -227,9 +234,13 @@ const Mapper = ({ updatedMappings[selectedLocaleKey] = existingLocale?.[index]?.label; delete updatedMappings?.[CS_ENTRIES?.UNMAPPED_LOCALE_KEY]; }else{ - updatedMappings[selectedLocaleKey] = existingLocale?.[index]?.label - ? existingLocale?.[index]?.label - : ''; + const oldlabel = Object?.keys?.(updatedMappings)?.[index - 1]; + + // Delete old key and assign to new key + delete updatedMappings?.[oldlabel]; + updatedMappings[selectedLocaleKey] = existingLocale?.[index]?.label + ? existingLocale?.[index]?.label + : ''; } } @@ -288,7 +299,7 @@ const Mapper = ({ } else if (selectedLocaleKey) { - updatedMappings[existingLabel?.value] = selectedValue?.label + updatedMappings[existingLabel?.value ?? index] = selectedValue?.label ? selectedValue?.label : ''; } @@ -513,7 +524,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => { const [options, setoptions] = useState<{ label: string; value: string }[]>([]); const [cmsLocaleOptions, setcmsLocaleOptions] = useState<{ label: string; value: string }[]>([]); const [sourceLocales, setsourceLocales] = useState<{ label: string; value: string }[]>([]); - const [isLoading, setisLoading] = useState(false); + const [isLoading, setisLoading] = useState(true); const [currentStack, setCurrentStack] = useState(stack); const [previousStack, setPreviousStack] = useState(); const [isStackChanged, setisStackChanged] = useState(false); @@ -618,6 +629,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => { // return await getStackLocales(newMigrationData?.destination_stack?.selectedOrg?.value); // }; const addRowComp = () => { + setisStackChanged(false); setcmsLocaleOptions((prevList: { label: string; value: string }[]) => [ ...prevList, // Keep existing elements { @@ -628,6 +640,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => { }; const handleDeleteLocale = (id: number, locale: { label: string; value: string }) => { + setisStackChanged(false); setcmsLocaleOptions((prevList) => { return prevList?.filter( (item: { label: string; value: string }) => item?.label !== locale?.label diff --git a/ui/src/components/MainHeader/index.scss b/ui/src/components/MainHeader/index.scss index 31cc2ac2c..d8ceba49e 100644 --- a/ui/src/components/MainHeader/index.scss +++ b/ui/src/components/MainHeader/index.scss @@ -40,7 +40,6 @@ a { align-items: center; display: flex; - height: 2.5rem; justify-content: center; padding: 0.5rem; text-decoration: none; diff --git a/ui/src/components/MainHeader/index.tsx b/ui/src/components/MainHeader/index.tsx index 90f29bcee..bfb7b21aa 100644 --- a/ui/src/components/MainHeader/index.tsx +++ b/ui/src/components/MainHeader/index.tsx @@ -169,7 +169,7 @@ const MainHeader = () => {
e.preventDefault()}> - Contentstack + Contentstack
diff --git a/ui/src/pages/Login/index.tsx b/ui/src/pages/Login/index.tsx index 6941b3069..adebbcb48 100644 --- a/ui/src/pages/Login/index.tsx +++ b/ui/src/pages/Login/index.tsx @@ -3,7 +3,7 @@ import { FC, useEffect, useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; -import { getUserDetails, setAuthToken, setUser } from '../../store/slice/authSlice'; +import { clearOrganisationData, getUserDetails, setAuthToken, setUser, clearAuthToken } from '../../store/slice/authSlice'; import { Button, Field, @@ -22,7 +22,7 @@ import { TFA_VIA_SMS_MESSAGE, CS_ENTRIES } from '../../utilities/constants'; -import { failtureNotification, setDataInLocalStorage } from '../../utilities/functions'; +import { clearLocalStorage, failtureNotification, setDataInLocalStorage } from '../../utilities/functions'; // API Service import { getCMSDataFromFile } from '../../cmsData/cmsSelector'; @@ -153,10 +153,16 @@ const Login: FC = () => { setIsLoading(false); failtureNotification(response?.data?.error_message || response?.data?.error?.message); } - + dispatch(clearAuthToken()); + localStorage?.removeItem('app_token'); if (response?.status === 200 && response?.data?.message === LOGIN_SUCCESSFUL_MESSAGE) { setIsLoading(false); setDataInLocalStorage('app_token', response?.data?.app_token); + + // Clear any previous organization data to ensure fresh organization selection for new user + localStorage?.removeItem('organization'); + dispatch(clearOrganisationData()); + const authenticationObj = { authToken: response?.data?.app_token, isAuthenticated: true diff --git a/ui/src/pages/Migration/index.tsx b/ui/src/pages/Migration/index.tsx index 07f6d8ea0..b9d20c5e0 100644 --- a/ui/src/pages/Migration/index.tsx +++ b/ui/src/pages/Migration/index.tsx @@ -587,7 +587,8 @@ const Migration = () => { value !== '' && value !== null && value !== undefined && - label !== 'undefined' + label !== 'undefined' && + isNaN(Number(label)) ); const master_locale: LocalesType = {}; diff --git a/ui/src/services/api/migration.service.ts b/ui/src/services/api/migration.service.ts index 3723190b7..ee701c669 100644 --- a/ui/src/services/api/migration.service.ts +++ b/ui/src/services/api/migration.service.ts @@ -3,15 +3,15 @@ import { API_VERSION, EXECUTION_LOGS_ERROR_TEXT } from '../../utilities/constant import { getDataFromLocalStorage } from '../../utilities/functions'; import { getCall, postCall, putCall, patchCall } from './service'; -const options = { +const options = () => ({ headers: { app_token: getDataFromLocalStorage('app_token') } -}; +}); export const getMigrationData = (orgId: string, projectId: string) => { try { - return getCall(`${API_VERSION}/org/${orgId}/project/${projectId}/`, options); + return getCall(`${API_VERSION}/org/${orgId}/project/${projectId}`, options()); } catch (error) { if (error instanceof Error) { throw new Error(`Error in getting migrationData: ${error.message}`); @@ -23,7 +23,7 @@ export const getMigrationData = (orgId: string, projectId: string) => { export const updateLegacyCMSData = (orgId: string, projectId: string, data: ObjectType) => { try { - return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/legacy-cms`, data, options); + return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/legacy-cms`, data, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -35,7 +35,7 @@ export const updateLegacyCMSData = (orgId: string, projectId: string, data: Obje export const updateAffixData = (orgId: string, projectId: string, data: ObjectType) => { try { - return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/affix`, data, options); + return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/affix`, data, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -47,7 +47,7 @@ export const updateAffixData = (orgId: string, projectId: string, data: ObjectTy export const updateFileFormatData = (orgId: string, projectId: string, data: ObjectType) => { try { - return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/file-format`, data, options); + return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/file-format`, data, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -62,7 +62,7 @@ export const updateDestinationStack = (orgId: string, projectId: string, data: O return putCall( `${API_VERSION}/org/${orgId}/project/${projectId}/destination-stack`, data, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -75,7 +75,7 @@ export const updateDestinationStack = (orgId: string, projectId: string, data: O export const updateCurrentStepData = (orgId: string, projectId: string, data: ObjectType = {}) => { try { - return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/current-step`, data, options); + return putCall(`${API_VERSION}/org/${orgId}/project/${projectId}/current-step`, data, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -90,7 +90,7 @@ export const affixConfirmation = (orgId: string, projectId: string, data: Object return putCall( `${API_VERSION}/org/${orgId}/project/${projectId}/affix_confirmation`, data, - options + options() ); } catch (error) { return error; @@ -102,7 +102,7 @@ export const fileformatConfirmation = (orgId: string, projectId: string, data: O return putCall( `${API_VERSION}/org/${orgId}/project/${projectId}/fileformat_confirmation`, data, - options + options() ); } catch (error) { return error; @@ -119,7 +119,7 @@ export const getContentTypes = ( const encodedSearchText = encodeURIComponent(searchText); return getCall( `${API_VERSION}/mapper/contentTypes/${projectId}/${skip}/${limit}/${encodedSearchText}?`, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -141,7 +141,7 @@ export const getFieldMapping = async ( const encodedSearchText = encodeURIComponent(searchText); return await getCall( `${API_VERSION}/mapper/fieldMapping/${projectId}/${contentTypeId}/${skip}/${limit}/${encodedSearchText}?`, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -187,7 +187,7 @@ export const updateContentType = async ( return await putCall( `${API_VERSION}/mapper/contentTypes/${orgId}/${projectId}/${contentTypeId}`, data, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -208,7 +208,7 @@ export const resetToInitialMapping = async ( return await putCall( `${API_VERSION}/mapper/resetFields/${orgId}/${projectId}/${contentTypeId}`, data, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -221,7 +221,7 @@ export const resetToInitialMapping = async ( export const getExistingContentTypes = async (projectId: string, contentTypeUid?: string) => { try { - return await getCall(`${API_VERSION}/mapper/${projectId}/contentTypes/${contentTypeUid ?? ''}`, options); + return await getCall(`${API_VERSION}/mapper/${projectId}/contentTypes/${contentTypeUid ?? ''}`, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -233,7 +233,7 @@ export const getExistingContentTypes = async (projectId: string, contentTypeUid? export const getExistingGlobalFields = async (projectId: string, globalFieldUid?: string) => { try { - return await getCall(`${API_VERSION}/mapper/${projectId}/globalFields/${globalFieldUid ?? ''}`, options); + return await getCall(`${API_VERSION}/mapper/${projectId}/globalFields/${globalFieldUid ?? ''}`, options()); } catch (error) { if (error instanceof Error) { throw new Error(`${error.message}`); @@ -246,7 +246,7 @@ export const getExistingGlobalFields = async (projectId: string, globalFieldUid? export const removeContentMapper = async (orgId: string, projectId: string) => { try { - return await getCall(`${API_VERSION}/mapper/${orgId}/${projectId}/content-mapper`, options); + return await getCall(`${API_VERSION}/mapper/${orgId}/${projectId}/content-mapper`, options()); } catch (error) { return error; @@ -264,7 +264,7 @@ export const updateContentMapper = async ( return await patchCall( `${API_VERSION}/mapper/${orgId}/${projectId}/mapper_keys`, mapperKeys, - options + options() ); } catch (error) { if (error instanceof Error) { @@ -278,7 +278,7 @@ export const updateContentMapper = async ( export const updateStackDetails = async (orgId: string, projectId: string, data: ObjectType) => { try { const Data = { stack_details: data }; - return await patchCall(`${API_VERSION}/org/${orgId}/project/${projectId}/stack-details`, Data, options); + return await patchCall(`${API_VERSION}/org/${orgId}/project/${projectId}/stack-details`, Data, options()); } catch (error) { return error; @@ -287,7 +287,7 @@ export const updateStackDetails = async (orgId: string, projectId: string, data: export const getOrgDetails = async (orgId: string) => { try { - return await getCall(`${API_VERSION}/org/${orgId}/get_org_details`, options); + return await getCall(`${API_VERSION}/org/${orgId}/get_org_details`, options()); } catch (error) { return error; } @@ -298,7 +298,7 @@ export const createTestStack = async (orgId: string, projectId: string, data: Ob return await postCall( `${API_VERSION}/migration/create-test-stack/${orgId}/${projectId}`, data, - options + options() ); } catch (error) { return error; @@ -308,7 +308,7 @@ export const createTestStack = async (orgId: string, projectId: string, data: Ob export const createTestMigration = async (orgId: string, projectId: string) => { try { return await postCall( - `${API_VERSION}/migration/test-stack/${orgId}/${projectId}`, {}, options); + `${API_VERSION}/migration/test-stack/${orgId}/${projectId}`, {}, options()); } catch (error) { return error; } @@ -317,7 +317,7 @@ export const createTestMigration = async (orgId: string, projectId: string) => { export const startMigration = async (orgId: string, projectId: string) => { try { return await postCall( - `${API_VERSION}/migration/start/${orgId}/${projectId}`, {}, options); + `${API_VERSION}/migration/start/${orgId}/${projectId}`, {}, options()); } catch (error) { return error; } @@ -326,7 +326,7 @@ export const startMigration = async (orgId: string, projectId: string) => { export const updateMigrationKey = async (orgId: string, projectId: string) => { try { return await putCall( - `${API_VERSION}/org/${orgId}/project/${projectId}/migration-excution`, {}, options); + `${API_VERSION}/org/${orgId}/project/${projectId}/migration-excution`, {}, options()); } catch (error) { return error; } @@ -335,7 +335,7 @@ export const updateMigrationKey = async (orgId: string, projectId: string) => { export const updateLocaleMapper = async(projectId: string, data: any) => { try { return await postCall( - `${API_VERSION}/migration/updateLocales/${projectId}`, data, options); + `${API_VERSION}/migration/updateLocales/${projectId}`, data, options()); } catch (error) { return error; } @@ -345,7 +345,7 @@ export const getMigrationLogs = async (orgId: string, projectId: string, stackId try { return await getCall( `${API_VERSION}/migration/get_migration_logs/${orgId}/${projectId}/${stackId}/${skip}/${limit}/${startIndex}/${stopIndex}/${searchText}/${filter}`, - options + options() ); } catch (error) { if (error instanceof Error) { diff --git a/ui/src/services/api/stacks.service.ts b/ui/src/services/api/stacks.service.ts index bc0528402..324fd9bc4 100644 --- a/ui/src/services/api/stacks.service.ts +++ b/ui/src/services/api/stacks.service.ts @@ -3,15 +3,15 @@ import { getDataFromLocalStorage } from '../../utilities/functions'; import { getCall, postCall } from './service'; import { Stack } from '../../components/Common/AddStack/addStack.interface'; -const options = { +const options = () => ({ headers: { app_token: getDataFromLocalStorage('app_token') } -}; +}); export const getAllStacksInOrg = async (orgId: string, searchText: string) => { try { - return await getCall(`${API_VERSION}/org/${orgId}/stacks/${searchText}?`, options); + return await getCall(`${API_VERSION}/org/${orgId}/stacks/${searchText}?`, options()); } catch (error) { return error; } @@ -19,7 +19,7 @@ export const getAllStacksInOrg = async (orgId: string, searchText: string) => { export const createStacksInOrg = async (orgId: string, data: Stack) => { try { - return await postCall(`${API_VERSION}/org/${orgId}/stacks`, data, options); + return await postCall(`${API_VERSION}/org/${orgId}/stacks`, data, options()); } catch (error) { if (error instanceof Error) { throw new Error(`Error in userSession: ${error.message}`); @@ -34,7 +34,7 @@ export const getStackStatus = async (orgId: string, data: string) => { const stack_api = { stack_api_key: data }; - return await postCall(`${API_VERSION}/org/${orgId}/stack_status`, stack_api, options); + return await postCall(`${API_VERSION}/org/${orgId}/stack_status`, stack_api, options()); } catch (error) { if (error instanceof Error) { throw new Error(`Error in userSession: ${error.message}`); diff --git a/ui/src/store/slice/authSlice.tsx b/ui/src/store/slice/authSlice.tsx index 6542abe6c..8f0bbb145 100644 --- a/ui/src/store/slice/authSlice.tsx +++ b/ui/src/store/slice/authSlice.tsx @@ -97,6 +97,14 @@ const authSlice = createSlice({ }, setSelectedOrganisation: (state, action) => { state.selectedOrganisation = action?.payload; + }, + clearOrganisationData: (state) => { + state.organisationsList = []; + state.selectedOrganisation = DEFAULT_DROPDOWN; + }, + clearAuthToken: (state) => { + state.authToken = ''; + state.isAuthenticated = false; } @@ -116,7 +124,7 @@ const authSlice = createSlice({ }, }) -export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser } = authSlice.actions; +export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser, clearOrganisationData, clearAuthToken } = authSlice.actions; export {getUserDetails}; export default authSlice.reducer; \ No newline at end of file diff --git a/upload-api/migration-contentful/package-lock.json b/upload-api/migration-contentful/package-lock.json index 4d911879d..bea625787 100644 --- a/upload-api/migration-contentful/package-lock.json +++ b/upload-api/migration-contentful/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", - "axios": "^1.8.3", + "axios": "^1.12.0", "jsdom": "^19.0.0", "jsonpath": "^1.1.1", "lodash": "^4.17.21", @@ -152,12 +152,12 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, diff --git a/upload-api/migration-contentful/package.json b/upload-api/migration-contentful/package.json index 8058068b6..116a7247b 100644 --- a/upload-api/migration-contentful/package.json +++ b/upload-api/migration-contentful/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", - "axios": "^1.8.3", + "axios": "^1.12.0", "jsdom": "^19.0.0", "jsonpath": "^1.1.1", "lodash": "^4.17.21", diff --git a/upload-api/migration-sitecore/package-lock.json b/upload-api/migration-sitecore/package-lock.json index acb4accc9..278d031d5 100644 --- a/upload-api/migration-sitecore/package-lock.json +++ b/upload-api/migration-sitecore/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.2", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.12", "cli-progress": "^3.11.1", @@ -96,6 +96,15 @@ "node": ">= 10" } }, + "node_modules/@types/node": { + "version": "24.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", + "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", + "peer": true, + "dependencies": { + "undici-types": "~7.12.0" + } + }, "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", @@ -220,12 +229,12 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", - "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -1872,6 +1881,12 @@ "node": ">=18.17" } }, + "node_modules/undici-types": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", + "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "peer": true + }, "node_modules/universalify": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", diff --git a/upload-api/migration-sitecore/package.json b/upload-api/migration-sitecore/package.json index 4a5e70174..ec6c1bcd9 100644 --- a/upload-api/migration-sitecore/package.json +++ b/upload-api/migration-sitecore/package.json @@ -21,7 +21,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.2", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.12", "cli-progress": "^3.11.1", diff --git a/upload-api/migration-wordpress/package-lock.json b/upload-api/migration-wordpress/package-lock.json index e01935ddb..65d74e1c6 100644 --- a/upload-api/migration-wordpress/package-lock.json +++ b/upload-api/migration-wordpress/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cli-progress": "^3.11.1", "fs-extra": "^11.2.0", @@ -84,6 +84,15 @@ "node": ">= 10" } }, + "node_modules/@types/node": { + "version": "24.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", + "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", + "peer": true, + "dependencies": { + "undici-types": "~7.12.0" + } + }, "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", @@ -208,12 +217,12 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", - "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -1506,6 +1515,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/undici-types": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", + "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "peer": true + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", diff --git a/upload-api/migration-wordpress/package.json b/upload-api/migration-wordpress/package.json index 74fd005de..c510a8b64 100644 --- a/upload-api/migration-wordpress/package.json +++ b/upload-api/migration-wordpress/package.json @@ -21,7 +21,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cli-progress": "^3.11.1", "fs-extra": "^11.2.0", diff --git a/upload-api/package-lock.json b/upload-api/package-lock.json index 7ae610fed..494a00ccd 100644 --- a/upload-api/package-lock.json +++ b/upload-api/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@aws-sdk/client-s3": "^3.529.0", "@contentstack/cli-utilities": "^1.0.3", - "axios": "^1.8.2", + "axios": "^1.12.0", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.12", "cors": "^2.8.5", @@ -53,7 +53,7 @@ "license": "ISC", "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", - "axios": "^1.8.3", + "axios": "^1.12.0", "jsdom": "^19.0.0", "jsonpath": "^1.1.1", "lodash": "^4.17.21", @@ -81,7 +81,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.2", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.12", "cli-progress": "^3.11.1", @@ -142,7 +142,7 @@ "dependencies": { "@contentstack/json-rte-serializer": "^2.0.0", "ansi-colors": "^4.1.3", - "axios": "^1.8.3", + "axios": "^1.12.0", "chalk": "^4.1.0", "cli-progress": "^3.11.1", "fs-extra": "^11.2.0", @@ -3414,9 +3414,9 @@ } }, "node_modules/axios": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", - "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", diff --git a/upload-api/package.json b/upload-api/package.json index 99cbd9091..67de7f4b4 100644 --- a/upload-api/package.json +++ b/upload-api/package.json @@ -34,7 +34,7 @@ "dependencies": { "@aws-sdk/client-s3": "^3.529.0", "@contentstack/cli-utilities": "^1.0.3", - "axios": "^1.8.2", + "axios": "^1.12.0", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.12", "cors": "^2.8.5",