Skip to content

Commit 9ea266c

Browse files
authored
Merge pull request #773 from contentstack/bugfix/beta-release
Bugfix/beta release
2 parents dfd52cc + 5317254 commit 9ea266c

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

.talismanrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,7 @@ fileignoreconfig:
9191
checksum: 38d2188de3b4df88ed5e195c13b77ad7c469fe5c4d1265f1ffb868dbe3844ae1
9292
- filename: api/package-lock.json
9393
checksum: 09b36877f7e86bb806a9657f852a448dc32fa1dfb350d0fde5fd843c54a27bf0
94+
- filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx
95+
checksum: 4e9bd6dcdb08fab85a3d8200e0dffa0d003743ebbb42d5043228cfd46f7e91da
9496

9597
version: "1.0"

ui/src/components/AdvancePropertise/index.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@
105105
position: relative;
106106
z-index: 10000;
107107
}
108-
.Select__control--menu-is-open {
109-
position: relative;
110-
border: 2px solid red;
111-
z-index: 10000;
112-
}
113108
}
114109
.Radio-class {
115110
display: flex;

ui/src/components/ContentMapper/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,8 @@ div .table-row {
317317
.filterButton-color{
318318
color: $color-brand-primary-base;
319319
font-weight: $font-weight-bold;
320+
}
321+
.icon-padding{
322+
padding: 10px 10px;
323+
margin-left: 6px;
320324
}

ui/src/components/ContentMapper/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,17 +2470,17 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
24702470
/>
24712471
</div>
24722472

2473-
<Tooltip content={'Fetch content types from destination stack'} position="left">
2474-
<Button buttonType="light" icon={onlyIcon ? "v2-FetchTemplate" : ''}
2473+
<Tooltip content={'Fetch content types from destination stack'} position="top">
2474+
<Button className='icon-padding' buttonType="light" icon={onlyIcon ? "v2-FetchTemplate" : ''}
24752475
version="v2" onlyIcon={true} onlyIconHoverColor={'primary'}
24762476
size='small' onClick={handleFetchContentType}>
24772477
</Button>
24782478
</Tooltip>
24792479
</>
24802480
)}
24812481

2482-
<Tooltip content={'Reset to system mapping'} position="left">
2483-
<Button buttonType="light" icon={onlyIcon ? "v2-ResetReverse" : ''}
2482+
<Tooltip content={'Reset to system mapping'} position="top">
2483+
<Button className='icon-padding' buttonType="light" icon={onlyIcon ? "v2-ResetReverse" : ''}
24842484
version="v2" onlyIcon={true} onlyIconHoverColor={'primary'}
24852485
size='small' onClick={handleResetContentType}></Button>
24862486
</Tooltip>

ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ const Mapper = ({
163163
setSelectedMappings(updatedSelectedMappings);
164164

165165
}
166+
else if ( !isLabelMismatch && !isStackChanged ) {
167+
const key = `${locale?.label}-master_locale`
168+
updatedSelectedMappings = {
169+
[key]: updatedSelectedMappings?.[`${locale?.label}-master_locale`] ? updatedSelectedMappings?.[`${locale?.label}-master_locale`] : '',
170+
};
171+
setSelectedMappings(updatedSelectedMappings);
172+
}
166173
}
167174
})
168175

@@ -513,7 +520,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => {
513520
const [options, setoptions] = useState<{ label: string; value: string }[]>([]);
514521
const [cmsLocaleOptions, setcmsLocaleOptions] = useState<{ label: string; value: string }[]>([]);
515522
const [sourceLocales, setsourceLocales] = useState<{ label: string; value: string }[]>([]);
516-
const [isLoading, setisLoading] = useState<boolean>(false);
523+
const [isLoading, setisLoading] = useState<boolean>(true);
517524
const [currentStack, setCurrentStack] = useState<IDropDown>(stack);
518525
const [previousStack, setPreviousStack] = useState<IDropDown>();
519526
const [isStackChanged, setisStackChanged] = useState<boolean>(false);
@@ -618,6 +625,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => {
618625
// return await getStackLocales(newMigrationData?.destination_stack?.selectedOrg?.value);
619626
// };
620627
const addRowComp = () => {
628+
setisStackChanged(false);
621629
setcmsLocaleOptions((prevList: { label: string; value: string }[]) => [
622630
...prevList, // Keep existing elements
623631
{
@@ -628,6 +636,7 @@ const LanguageMapper = ({stack, uid} :{ stack : IDropDown, uid : string}) => {
628636
};
629637

630638
const handleDeleteLocale = (id: number, locale: { label: string; value: string }) => {
639+
setisStackChanged(false);
631640
setcmsLocaleOptions((prevList) => {
632641
return prevList?.filter(
633642
(item: { label: string; value: string }) => item?.label !== locale?.label

ui/src/pages/Login/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FC, useEffect, useState } from 'react';
33
import { useNavigate, useLocation } from 'react-router-dom';
44
import { useDispatch, useSelector } from 'react-redux';
55

6-
import { getUserDetails, setAuthToken, setUser } from '../../store/slice/authSlice';
6+
import { clearOrganisationData, getUserDetails, setAuthToken, setUser } from '../../store/slice/authSlice';
77
import {
88
Button,
99
Field,
@@ -157,6 +157,11 @@ const Login: FC<IProps> = () => {
157157
if (response?.status === 200 && response?.data?.message === LOGIN_SUCCESSFUL_MESSAGE) {
158158
setIsLoading(false);
159159
setDataInLocalStorage('app_token', response?.data?.app_token);
160+
161+
// Clear any previous organization data to ensure fresh organization selection for new user
162+
localStorage?.removeItem('organization');
163+
dispatch(clearOrganisationData());
164+
160165
const authenticationObj = {
161166
authToken: response?.data?.app_token,
162167
isAuthenticated: true

ui/src/store/slice/authSlice.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ const authSlice = createSlice({
9797
},
9898
setSelectedOrganisation: (state, action) => {
9999
state.selectedOrganisation = action?.payload;
100+
},
101+
clearOrganisationData: (state) => {
102+
state.organisationsList = [];
103+
state.selectedOrganisation = DEFAULT_DROPDOWN;
100104
}
101105

102106

@@ -116,7 +120,7 @@ const authSlice = createSlice({
116120

117121
},
118122
})
119-
export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser } = authSlice.actions;
123+
export const { setAuthToken, reInitiliseState, setOrganisationsList, setSelectedOrganisation, setUser, clearOrganisationData } = authSlice.actions;
120124

121125
export {getUserDetails};
122126
export default authSlice.reducer;

0 commit comments

Comments
 (0)