Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 1 deletion api/src/services/contentMapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ const updateContentMapper = async (req: Request) => {
)) as number;

try {
ProjectModelLowdb.update((data: any) => {
await ProjectModelLowdb.update((data: any) => {
data.projects[projectIndex].mapperKeys = content_mapper;
data.projects[projectIndex].updated_at = new Date().toISOString();
});
Expand Down
10 changes: 5 additions & 5 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const Fields: MappingFields = {
options: {
'Reference':'reference'
},
type: 'reference',
type: '',
},
'dropdown': {
label:'Dropdown',
Expand Down Expand Up @@ -205,12 +205,12 @@ const Fields: MappingFields = {
'app':{
label: 'Marketplace app',
options: {'Marketplace app':'app'},
type:'app'
type:''
},
'extension':{
label: 'Extension',
options: {'Extension':'extension'},
type:'extension'
type:''
}

}
Expand Down Expand Up @@ -1240,7 +1240,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R

//utility function to map the source cms field type to content type field type
function checkConditions(fieldTypeToMatch: string | string[], value: ContentTypesSchema, data: FieldMapType) {
const fieldTypes = new Set(['number', 'isodate', 'file', 'reference', 'boolean', 'group', 'link','global_field']);
const fieldTypes = new Set(['number', 'isodate', 'file', 'reference', 'boolean', 'group', 'link','global_field','json','blocks']);
switch (fieldTypeToMatch) {
case 'text':
return (
Expand All @@ -1266,7 +1266,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
case 'isodate':
return value?.data_type === 'isodate';
case 'json':
return value?.data_type === 'json';
return value?.data_type === 'json' && value?.field_metadata?.allow_json_rte;
// case 'enum':
// return 'enum' in value;
case 'radio':
Expand Down