diff --git a/.talismanrc b/.talismanrc index 9e2f0795..c8a69504 100644 --- a/.talismanrc +++ b/.talismanrc @@ -91,5 +91,9 @@ 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 version: "1.0" \ No newline at end of file diff --git a/ui/src/components/AdvancePropertise/index.scss b/ui/src/components/AdvancePropertise/index.scss index f9127100..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/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: )} - - diff --git a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx index 04ad10a8..be540caa 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); + } } }) @@ -513,7 +520,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 +625,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 +636,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 6941b306..f22dc8ba 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 } 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