@@ -1153,7 +1158,7 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re
useEffect(() => {
if (isUpdated) {
- setTableData(updatedRows as FieldMapType[]);
+ setTableData(updatedRows);
setExistingField(updatedExstingField);
setSelectedOptions(updatedSelectedOptions);
setSelectedEntries(updatedRows);
@@ -1284,10 +1289,9 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re
const { status } = await resetToInitialMapping(
orgId,
projectID,
- selectedContentType?.id || '',
+ selectedContentType?.id ?? '',
dataCs
);
- //setOtherContentType();
setExistingField({});
setContentTypeSchema([]);
setContentTypeMapped({});
@@ -1316,14 +1320,17 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re
type: 'error'
});
} else {
- const { data } = await fetchExistingContentType(projectId, otherContentType?.id || '');
+ const { data } = await fetchExistingContentType(projectId, otherContentType?.id ?? '');
const index = contentTypesList.findIndex(ct => ct?.uid === data?.uid);
- if(index != -1){
- contentTypesList[index] = data;
+
+ const contentTypesArr: ContentTypeList[] = contentTypesList;
+
+ if(index != -1) {
+ contentTypesArr[index] = data;
}
- setContentTypesList(contentTypesList)
+ setContentTypesList(contentTypesArr);
setContentTypeSchema(data?.schema)
}
}
@@ -1590,7 +1597,7 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re
rowSelectCheckboxProp={{ key: '_canSelect', value: true }}
name={{
singular: '',
- plural: `${totalCounts === 0 ? `Count` : ''}`
+ plural: `${totalCounts === 0 ? 'Count' : ''}`
}}
/>
diff --git a/ui/src/components/SchemaModal/index.scss b/ui/src/components/SchemaModal/index.scss
index 8065e9dd7..996280089 100644
--- a/ui/src/components/SchemaModal/index.scss
+++ b/ui/src/components/SchemaModal/index.scss
@@ -22,8 +22,9 @@
display: flex;
justify-content: flex-start;
padding: 0;
+ text-align: left;
&:hover {
- .title {
+ .field-title {
color: $color-brand-primary-base;
}
.icons {
@@ -63,7 +64,7 @@
}
}
}
- & > .title {
+ & > .field-title {
color: $color-brand-primary-base;
font-weight: $font-weight-semi-bold;
}
@@ -75,12 +76,9 @@
font-weight: $font-weight-regular;
line-height: $line-height-reset !important;
opacity: 1;
- overflow: hidden;
padding: 0.625rem 0;
- text-overflow: ellipsis;
text-transform: capitalize;
transition: opacity 0.5s linear, width 300ms linear;
- white-space: nowrap;
width: 12.5rem;
}
.icons {
@@ -103,7 +101,7 @@
}
}
& > ul {
- padding-left: 0.125rem;
+ padding-left: 1.125rem;
& > li {
& > ul {
padding-left: 1.5625rem;
diff --git a/ui/src/components/SchemaModal/index.tsx b/ui/src/components/SchemaModal/index.tsx
index 27bf9b88f..d55236a96 100644
--- a/ui/src/components/SchemaModal/index.tsx
+++ b/ui/src/components/SchemaModal/index.tsx
@@ -34,11 +34,11 @@ const getTopLevelIcons = (field: FieldMapType) => {
experience_container: 'PersonalizationLogoGreySmall'
};
- if (field?.ContentstackFieldType === 'Single Line Textbox') {
+ if (field?.ContentstackFieldType === 'Single Line Textbox' || field?.ContentstackFieldType === 'single_line_text') {
return icons['title'];
}
- if (field?.ContentstackFieldType === 'URL' || field?.ContentstackFieldType === 'single_line_text') {
+ if (field?.ContentstackFieldType === 'URL' || field?.ContentstackFieldType === 'url') {
return icons['text'];
}
@@ -54,11 +54,11 @@ const getTopLevelIcons = (field: FieldMapType) => {
return icons['isodate'];
}
- if (field?.ContentstackFieldType === 'Multi Line Textbox') {
+ if (field?.ContentstackFieldType === 'Multi Line Textbox' || field?.ContentstackFieldType === 'multi_line_text') {
return icons['multitext'];
}
- if (field?.ContentstackFieldType === 'HTML Rich text Editor') {
+ if (field?.ContentstackFieldType === 'HTML Rich text Editor' || field?.ContentstackFieldType === 'html') {
return icons['rte'];
}
@@ -77,7 +77,7 @@ const getTopLevelIcons = (field: FieldMapType) => {
return icons['boolean'];
}
- if (field?.ContentstackFieldType === 'Reference') {
+ if (field?.ContentstackFieldType === 'Reference' || field?.ContentstackFieldType === 'refernce') {
return icons['reference'];
}
@@ -98,10 +98,9 @@ const TreeView = ({ schema = [] }: schemaType) => {
if (field?.ContentstackFieldType === 'group') {
groupId = field?.uid;
data?.push({ ...field, child: [] });
- } else {
- if (field?.uid?.startsWith(groupId + '.')) {
+ } else if (field?.uid?.startsWith(groupId + '.')) {
const obj = data[data?.length - 1];
- if (Object.prototype.hasOwnProperty.call(obj, 'child')) {
+ if (Object.hasOwn(obj, 'child')) {
obj?.child?.push(field);
} else {
obj.child = [field];
@@ -109,13 +108,12 @@ const TreeView = ({ schema = [] }: schemaType) => {
} else {
data.push({ ...field, child: [] });
}
- }
});
setNestedList(data);
}, [schema]);
// Check if schema is nested
- const hasNestedValue = (field: FieldMapType) => field && field?.child && field?.child?.length > 0;
+ const hasNestedValue = (field: FieldMapType) => field?.child && field?.child?.length > 0;
// Remove Group name from its child
const getChildFieldName = (text?: string, groupName?: string) => {
@@ -147,7 +145,7 @@ const TreeView = ({ schema = [] }: schemaType) => {
const generateNestedOutline = (item: FieldMapType, index: number) => {
return (
-