From 9c9d4aca7aa13c5f6f17c92ed1925584907275fb Mon Sep 17 00:00:00 2001 From: AishDani Date: Thu, 21 Aug 2025 11:47:09 +0530 Subject: [PATCH 1/7] refactor:resolved the bug [CMG-697]:UI overlapping issue --- ui/src/components/AdvancePropertise/index.scss | 10 +++++----- ui/src/components/ContentMapper/index.scss | 4 ++++ ui/src/components/ContentMapper/index.tsx | 8 ++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ui/src/components/AdvancePropertise/index.scss b/ui/src/components/AdvancePropertise/index.scss index f9127100..948831d9 100644 --- a/ui/src/components/AdvancePropertise/index.scss +++ b/ui/src/components/AdvancePropertise/index.scss @@ -105,11 +105,11 @@ position: relative; z-index: 10000; } - .Select__control--menu-is-open { - position: relative; - border: 2px solid red; - 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 495799a5..c1c3cc8b 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 c85b9f9a..e9719006 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: )} - - From d65df9925b9470de2ca0d8d2d23b771b9d611cbc Mon Sep 17 00:00:00 2001 From: AishDani Date: Thu, 21 Aug 2025 14:46:33 +0530 Subject: [PATCH 2/7] refactor:resolved [CMG-699] login switch issue --- ui/src/pages/Login/index.tsx | 7 ++++++- ui/src/store/slice/authSlice.tsx | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/src/pages/Login/index.tsx b/ui/src/pages/Login/index.tsx index 6941b306..f7d7a0a1 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 { getUserDetails, setAuthToken, setUser, clearOrganisationData } from '../../store/slice/authSlice'; import { Button, Field, @@ -157,6 +157,11 @@ const Login: FC = () => { 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/store/slice/authSlice.tsx b/ui/src/store/slice/authSlice.tsx index 6542abe6..c501979d 100644 --- a/ui/src/store/slice/authSlice.tsx +++ b/ui/src/store/slice/authSlice.tsx @@ -97,6 +97,10 @@ const authSlice = createSlice({ }, setSelectedOrganisation: (state, action) => { state.selectedOrganisation = action?.payload; + }, + clearOrganisationData: (state) => { + state.organisationsList = []; + state.selectedOrganisation = DEFAULT_DROPDOWN; } @@ -116,7 +120,7 @@ const authSlice = createSlice({ }, }) -export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser } = authSlice.actions; +export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser, clearOrganisationData } = authSlice.actions; export {getUserDetails}; export default authSlice.reducer; \ No newline at end of file From e7316ba6fc4bbcb4112c22f7dc87b77cc4396685 Mon Sep 17 00:00:00 2001 From: AishDani Date: Mon, 25 Aug 2025 18:43:47 +0530 Subject: [PATCH 3/7] refactor:resolved language mapper bugs --- .../DestinationStack/Actions/LoadLanguageMapper.tsx | 10 +++++++++- ui/src/pages/Login/index.tsx | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx index 04ad10a8..89b9a92c 100644 --- a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx +++ b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx @@ -163,6 +163,12 @@ const Mapper = ({ setSelectedMappings(updatedSelectedMappings); } + else if(!isLabelMismatch && !isStackChanged){ + updatedSelectedMappings = { + [`${locale?.label}-master_locale`]: updatedSelectedMappings?.[`${locale?.label}-master_locale`] ? updatedSelectedMappings?.[`${locale?.label}-master_locale`]: '', + }; + setSelectedMappings(updatedSelectedMappings); + } } }) @@ -513,7 +519,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 +624,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 +635,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/pages/Login/index.tsx b/ui/src/pages/Login/index.tsx index f7d7a0a1..dc4e5f56 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, clearOrganisationData } from '../../store/slice/authSlice'; +import { clearOrganisationData, getUserDetails, setAuthToken, setUser } from '../../store/slice/authSlice'; import { Button, Field, From bd7c5fa011cd815011ee74b2e041a4629b9aef0f Mon Sep 17 00:00:00 2001 From: AishDani Date: Mon, 25 Aug 2025 18:52:46 +0530 Subject: [PATCH 4/7] refactor:removed commented code --- ui/src/components/AdvancePropertise/index.scss | 5 ----- ui/src/pages/Login/index.tsx | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/src/components/AdvancePropertise/index.scss b/ui/src/components/AdvancePropertise/index.scss index 948831d9..3f792576 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/pages/Login/index.tsx b/ui/src/pages/Login/index.tsx index dc4e5f56..f22dc8ba 100644 --- a/ui/src/pages/Login/index.tsx +++ b/ui/src/pages/Login/index.tsx @@ -159,7 +159,7 @@ const Login: FC = () => { setDataInLocalStorage('app_token', response?.data?.app_token); // Clear any previous organization data to ensure fresh organization selection for new user - localStorage.removeItem('organization'); + localStorage?.removeItem('organization'); dispatch(clearOrganisationData()); const authenticationObj = { From 517d442a0a7dc7bea10c6cdd1ca05219353e0792 Mon Sep 17 00:00:00 2001 From: AishDani Date: Fri, 29 Aug 2025 11:42:57 +0530 Subject: [PATCH 5/7] refactor:resolved copilot reviews --- .../DestinationStack/Actions/LoadLanguageMapper.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx index 89b9a92c..be540caa 100644 --- a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx +++ b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx @@ -163,9 +163,10 @@ const Mapper = ({ setSelectedMappings(updatedSelectedMappings); } - else if(!isLabelMismatch && !isStackChanged){ + else if ( !isLabelMismatch && !isStackChanged ) { + const key = `${locale?.label}-master_locale` updatedSelectedMappings = { - [`${locale?.label}-master_locale`]: updatedSelectedMappings?.[`${locale?.label}-master_locale`] ? updatedSelectedMappings?.[`${locale?.label}-master_locale`]: '', + [key]: updatedSelectedMappings?.[`${locale?.label}-master_locale`] ? updatedSelectedMappings?.[`${locale?.label}-master_locale`] : '', }; setSelectedMappings(updatedSelectedMappings); } From 5317254901224a87c8642f006bf2ef7874ea33a9 Mon Sep 17 00:00:00 2001 From: AishDani Date: Fri, 29 Aug 2025 11:44:10 +0530 Subject: [PATCH 6/7] refactor:added LoadLanguageMapper.tsx to fileignoreconfig --- .talismanrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.talismanrc b/.talismanrc index 9e2f0795..300970da 100644 --- a/.talismanrc +++ b/.talismanrc @@ -91,5 +91,7 @@ fileignoreconfig: checksum: 38d2188de3b4df88ed5e195c13b77ad7c469fe5c4d1265f1ffb868dbe3844ae1 - filename: api/package-lock.json checksum: 09b36877f7e86bb806a9657f852a448dc32fa1dfb350d0fde5fd843c54a27bf0 + - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx + checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da version: "1.0" \ No newline at end of file From 8a29620b0ed1464b70d3ecfbd7ae1b14bd45d940 Mon Sep 17 00:00:00 2001 From: AishDani Date: Mon, 1 Sep 2025 11:43:49 +0530 Subject: [PATCH 7/7] refactor:updated talisman file --- .talismanrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.talismanrc b/.talismanrc index 300970da..c8a69504 100644 --- a/.talismanrc +++ b/.talismanrc @@ -93,5 +93,7 @@ fileignoreconfig: checksum: 09b36877f7e86bb806a9657f852a448dc32fa1dfb350d0fde5fd843c54a27bf0 - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da + - filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx + checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da version: "1.0" \ No newline at end of file