Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 0 additions & 5 deletions ui/src/components/AdvancePropertise/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions ui/src/components/ContentMapper/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +321 to 324
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The padding shorthand 10px 10px can be simplified to just 10px since both vertical and horizontal values are the same.

Copilot uses AI. Check for mistakes.
8 changes: 4 additions & 4 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2470,17 +2470,17 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
/>
</div>

<Tooltip content={'Fetch content types from destination stack'} position="left">
<Button buttonType="light" icon={onlyIcon ? "v2-FetchTemplate" : ''}
<Tooltip content={'Fetch content types from destination stack'} position="top">
<Button className='icon-padding' buttonType="light" icon={onlyIcon ? "v2-FetchTemplate" : ''}
version="v2" onlyIcon={true} onlyIconHoverColor={'primary'}
size='small' onClick={handleFetchContentType}>
</Button>
</Tooltip>
</>
)}

<Tooltip content={'Reset to system mapping'} position="left">
<Button buttonType="light" icon={onlyIcon ? "v2-ResetReverse" : ''}
<Tooltip content={'Reset to system mapping'} position="top">
<Button className='icon-padding' buttonType="light" icon={onlyIcon ? "v2-ResetReverse" : ''}
version="v2" onlyIcon={true} onlyIconHoverColor={'primary'}
size='small' onClick={handleResetContentType}></Button>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Comment on lines +166 to +172
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapping logic duplicates the key construction ${locale?.label}-master_locale and has inconsistent indentation. Consider extracting the key to a variable and fixing the indentation of the object assignment.

Copilot uses AI. Check for mistakes.
}
})

Expand Down Expand Up @@ -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<boolean>(false);
const [isLoading, setisLoading] = useState<boolean>(true);
const [currentStack, setCurrentStack] = useState<IDropDown>(stack);
const [previousStack, setPreviousStack] = useState<IDropDown>();
const [isStackChanged, setisStackChanged] = useState<boolean>(false);
Expand Down Expand Up @@ -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
{
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion ui/src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -157,6 +157,11 @@ const Login: FC<IProps> = () => {
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
Expand Down
6 changes: 5 additions & 1 deletion ui/src/store/slice/authSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ const authSlice = createSlice({
},
setSelectedOrganisation: (state, action) => {
state.selectedOrganisation = action?.payload;
},
clearOrganisationData: (state) => {
state.organisationsList = [];
state.selectedOrganisation = DEFAULT_DROPDOWN;
}


Expand All @@ -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;