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
6 changes: 4 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ fileignoreconfig:
checksum: 4abcc89c75b7ddca8128fd72faafbb9b159f02611d96325bcd355283074ce287
- filename: ui/src/components/ContentMapper/index.scss
checksum: 46f8fde3b745feba40943f00d8d52714d0f320202c86b62f6c5ded73c2dbcf4c


- filename: ui/src/utilities/constants.ts
checksum: faac1367b4d80e022d4b7a165f9d2ac8bfd428f1a91af849064992ae2b3d6b1f
- filename: ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx
checksum: 988d93b93768ef0909305590ab0b89456333b9937ec12828edf23163f8640dfc
fileignoreconfig:
- filename: api/src/services/migration.service.ts
checksum: abae249cacfab5c67e2d18a645c852649da2339954f26ae0f88c8698bdc016e6
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/globalField.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const createGlobalField = async ({
const filePath = path.join(process.cwd(),globalSave, GLOBAL_FIELDS_FILE_NAME);
const globalfields = res?.data?.global_fields || [];

let fileGlobalFields : any[]= []
let fileGlobalFields = []
if (fs.existsSync(filePath)) {
const globalFieldSchema = await fs.promises.readFile(filePath, 'utf8');
try {
Expand Down
5 changes: 1 addition & 4 deletions api/src/services/migration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,7 @@ const getAuditData = async (req: Request): Promise<any> => {
if (!safeEntriesSelectFieldPath.startsWith(auditLogPath)) {
throw new BadRequestError('Access to this file is not allowed.');
}
// Additional path traversal prevention
if (!safeEntriesSelectFieldPath.startsWith(auditLogPath) || safeEntriesSelectFieldPath.includes('..')) {
throw new BadRequestError('Access to this file is not allowed.');
}

const fileContent = await fsPromises?.readFile(safeEntriesSelectFieldPath, 'utf8');
try {
if (typeof fileContent === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/AdvancePropertise/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const AdvancePropertise = (props: SchemaProps) => {
value: item
}));

const referencedItems = props?.data?.refrenceTo?.map((item: string) => ({
const referencedItems = props?.data?.referenceTo?.map((item: string) => ({
label: item,
value: item
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface FieldMapType {
contentstackUid: string;
_invalid?: boolean;
backupFieldUid: string;
refrenceTo: string[];
referenceTo: string[];
}

export interface Advanced {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
// Make title and url field non editable
useEffect(() => {
tableData?.forEach((field) => {
if(field?.backupFieldType === 'reference' && field?.refrenceTo?.length === 0) {
if(field?.backupFieldType === 'reference' && field?.referenceTo?.length === 0) {
field._canSelect = false;
}
else if (field?.backupFieldType !== 'text' && field?.backupFieldType !== 'url') {
Expand Down Expand Up @@ -850,8 +850,8 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
setIsDropDownChanged(checkBoxChanged);
const newTableData = tableData?.map?.((row: any) => {
if (row?.uid === rowId && row?.contentstackFieldUid === rowContentstackFieldUid) {
if (row?.refrenceTo) {
row.refrenceTo = updatedSettings?.referenedItems;
if (row?.referenceTo) {
row.referenceTo = updatedSettings?.referenedItems;
}
return { ...row, advanced: { ...row?.advanced, ...updatedSettings } };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { RootState } from '../../../store';
import { updateNewMigrationData } from '../../../store/slice/migrationDataSlice';
import { DEFAULT_DROPDOWN, IDropDown, INewMigration } from '../../../context/app/app.interface';
import {CS_ENTRIES} from '../../../utilities/constants';

export type ExistingFieldType = {
[key: string]: { label: string; value: string };
Expand Down Expand Up @@ -222,9 +223,9 @@ const Mapper = ({
}
else if (type === 'csLocale' && selectedLocaleKey) {

if(updatedMappings?.['undefined'] === existingLocale?.[index]?.label){
if(updatedMappings?.[CS_ENTRIES?.UNMAPPED_LOCALE_KEY] === existingLocale?.[index]?.label){
updatedMappings[selectedLocaleKey] = existingLocale?.[index]?.label;
delete updatedMappings?.['undefined'];
delete updatedMappings?.[CS_ENTRIES?.UNMAPPED_LOCALE_KEY];
}else{
updatedMappings[selectedLocaleKey] = existingLocale?.[index]?.label
? existingLocale?.[index]?.label
Expand Down
3 changes: 2 additions & 1 deletion ui/src/utilities/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export const CS_ENTRIES = {
url: '500'
},
ERROR_HANDLER: 'error_handler',
ADD_STACK: 'add_stack'
ADD_STACK: 'add_stack',
UNMAPPED_LOCALE_KEY: 'undefined'
};

export const UPLOAD_FILE_RELATIVE_URL = process.env.REACT_APP_UPLOAD_SERVER;
Expand Down