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
17 changes: 8 additions & 9 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,21 @@ const Fields: MappingFields = {
options: {
'Dropdown':'dropdown'
},
type: 'dropdown',
type: '',
},
'radio': {
label :'Select',
label :'Radio',
options: {
'Select':'select'
'Radio':'radio'
},
type: 'radio',
type: '',
},
'checkbox': {
label:'Select',
label:'Checkbox',
options: {
'Select':'checkbox'
'Checkbox':'checkbox'
},
type:'checkbox'
type:''
},
'global_field':{
label : 'Global',
Expand Down Expand Up @@ -1532,7 +1532,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
isDisabled: true
}
: (OptionsForRow?.length === 0 || (OptionsForRow?.length > 0 && OptionsForRow?.every((item)=>item?.isDisabled)
&& (!existingField[data?.uid]?.label || ! updatedExstingField[data?.uid]?.label ) ) || (OptionsForRow?.length > 0 && data?.contentstackFieldType === "dropdown"))
&& (!existingField[data?.uid]?.label || ! updatedExstingField[data?.uid]?.label ) ))
? {
label: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
value: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
Expand All @@ -1541,7 +1541,6 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
data?.contentstackFieldType === 'url' ||
data?.backupFieldType === "reference" ||
data?.contentstackFieldType === "global_field" ||
data?.contentstackFieldType === "dropdown" ||
data?.otherCmsType === undefined ||
data?.backupFieldType === 'app' ||
data?.backupFieldType === 'extension'
Expand Down
18 changes: 12 additions & 6 deletions ui/src/components/DestinationStack/Actions/LoadStacks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,22 @@ const LoadStacks = (props: LoadFileFormatProps) => {
const [isError, setIsError] = useState<boolean>(false);
const [errorMessage, setErrorMessage] = useState<string>('');
const [placeholder] = useState<string>('Select a stack');
const [localePlaceholder, setlocalePlaceholder ] = useState<string>('Master Locale will be set after stack selection');
const newMigrationDataRef = useRef(newMigrationData);

useEffect(() => {
newMigrationDataRef.current = newMigrationData;
}, [newMigrationData]);

useEffect(()=>{
if(selectedStack?.value !== undefined && selectedStack?.master_locale){
setlocalePlaceholder('')
}
else{
setlocalePlaceholder('Master Locale will be set after stack selection');
}
},[selectedStack])

useEffect(() => {
if (!isEmptyString(newMigrationData?.destination_stack?.selectedStack?.value)) {
setSelectedStack(newMigrationData?.destination_stack?.selectedStack);
Expand Down Expand Up @@ -336,12 +346,8 @@ const LoadStacks = (props: LoadFileFormatProps) => {
id="master_locale"
aria-label="master_locale"
version={'v2'}
placeholder={
selectedStack?.master_locale
? ''
: 'Master Locale will be set after stack selection'
}
value={selectedStack?.master_locale}
placeholder={localePlaceholder}
value={selectedStack?.value !== undefined ? selectedStack?.master_locale : ''}
width="600px"
className="orgInput"
isReadOnly
Expand Down
3 changes: 2 additions & 1 deletion upload-api/migration-sitecore/libs/contenttypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ const groupFlat = (data, item) => {
contentstackField: item?.meta?.name,
contentstackFieldUid: uidCorrector({ uid: item?.meta?.key }),
contentstackFieldType: 'group',
backupFieldType: 'group'
backupFieldType: 'group',
backupFieldUid: uidCorrector({ uid: item?.meta?.key })
};
flat?.push(group);
data?.schema?.forEach((element) => {
Expand Down
Loading