diff --git a/api/src/models/project-lowdb.ts b/api/src/models/project-lowdb.ts
index c7fb3c394..683c60c56 100644
--- a/api/src/models/project-lowdb.ts
+++ b/api/src/models/project-lowdb.ts
@@ -14,6 +14,13 @@ interface LegacyCMS {
type: string;
path: string;
};
+ awsDetails: {
+ awsRegion: string;
+ bucketName: string;
+ buketKey: string;
+}
+ file_path: string;
+ is_fileValid: boolean;
}
interface ExecutionLog {
diff --git a/api/src/services/projects.service.ts b/api/src/services/projects.service.ts
index 83d2121bc..337f05fa9 100644
--- a/api/src/services/projects.service.ts
+++ b/api/src/services/projects.service.ts
@@ -83,7 +83,13 @@ const createProject = async (req: Request) => {
destination_stack_id: "",
test_stacks: [],
current_test_stack_id: "",
- legacy_cms: {},
+ legacy_cms: {
+ "is_fileValid":false,
+ awsDetails: {
+ awsRegion: "",
+ bucketName: "",
+ buketKey: ""
+ } },
content_mapper: [],
execution_log: [],
created_by: user_id,
@@ -346,10 +352,8 @@ const affixConfirmation = async (req: Request) => {
const updateFileFormat = async (req: Request) => {
const { orgId, projectId } = req.params;
- const { token_payload, file_format } = req.body;
+ const { token_payload, file_format,file_path,is_fileValid,awsDetails } = req.body;
const srcFunc = "updateFileFormat";
-
- await ProjectModelLowdb.read();
const projectIndex = (await getProjectUtil(
projectId,
{
@@ -390,11 +394,16 @@ const updateFileFormat = async (req: Request) => {
}
try {
- ProjectModelLowdb.update((data: any) => {
+ ProjectModelLowdb.update((data: any) => {
data.projects[projectIndex].legacy_cms.file_format = file_format;
+ data.projects[projectIndex].legacy_cms.file_path = file_path;
+ data.projects[projectIndex].legacy_cms.is_fileValid = is_fileValid;
data.projects[projectIndex].current_step = STEPPER_STEPS.LEGACY_CMS;
data.projects[projectIndex].status = NEW_PROJECT_STATUS[0];
data.projects[projectIndex].updated_at = new Date().toISOString();
+ data.projects[projectIndex].legacy_cms.awsDetails.awsRegion = awsDetails.awsRegion;
+ data.projects[projectIndex].legacy_cms.awsDetails.bucketName = awsDetails.bucketName;
+ data.projects[projectIndex].legacy_cms.awsDetails.buketKey = awsDetails.buketKey;
});
logger.info(
diff --git a/ui/package.json b/ui/package.json
index ca22c2f2f..e578593c2 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@contentstack/json-rte-serializer": "^2.0.5",
- "@contentstack/venus-components": "1.5.1",
+ "@contentstack/venus-components": "^2.2.4",
"@reduxjs/toolkit": "^2.2.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
@@ -65,4 +65,4 @@
"last 1 safari version"
]
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/cmsData/content_mapping.json b/ui/src/cmsData/content_mapping.json
index a0eba06ec..034d76f1e 100644
--- a/ui/src/cmsData/content_mapping.json
+++ b/ui/src/cmsData/content_mapping.json
@@ -142,7 +142,8 @@
],
"_version": 3
},
- "search_placeholder": "Search",
+ "table_search_placeholder": "Search in Fields...",
+ "search_placeholder": "Search for content types...",
"tags": [],
"title": "Content Mapping",
"updated_at": "2024-01-25T12:13:32.967Z",
diff --git a/ui/src/cmsData/destinationStack.json b/ui/src/cmsData/destinationStack.json
index 9a4b8a46f..9f1267f77 100644
--- a/ui/src/cmsData/destinationStack.json
+++ b/ui/src/cmsData/destinationStack.json
@@ -1,6 +1,7 @@
{
- "title": "Destination Stack",
+ "title": "Destination Stack Details",
"cta": "Continue To Content Mapping",
+ "description":"To proceed with your data migration, please select the appropriate stack from the designated organization.",
"new_stack": {
"save_stack_cta": "Save",
"new_stack_input": "Enter Stack Details Below",
@@ -10,19 +11,18 @@
{
"step_id": "Step1",
"_metadata": { "uid": "cs45d60445c89ed302" },
- "title": "Select Organisation",
- "description": "Select your organisation maintained on Contentstack.",
- "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
- "lock": true,
+ "title": "Organization",
+ "ifReadonly": true,
+ "description": "",
+ "lock": false,
"active": true,
"empty_step_placeholder": "No Organisation selected..."
},
{
"step_id": "Step2",
"_metadata": { "uid": "cs1979790a8619e118" },
- "title": "Select Stack",
- "description": "Select the corresponding stack for data migrations.",
- "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
+ "title": "Stack",
+ "description": "",
"lock": false,
"active": true,
"empty_step_placeholder": "No Stack selected..."
diff --git a/ui/src/cmsData/legacyCms.json b/ui/src/cmsData/legacyCms.json
index ad07c4b3c..f3359ecc9 100644
--- a/ui/src/cmsData/legacyCms.json
+++ b/ui/src/cmsData/legacyCms.json
@@ -13,7 +13,7 @@
"title": "https://www.contentstack.com/",
"href": "https://www.contentstack.com/"
},
- "parent": "",
+ "parent": "Contentstack",
"isactive": true,
"allowed_file_formats": [
{
@@ -50,7 +50,7 @@
"title": "https://www.contentful.com/",
"href": "https://www.contentful.com/"
},
- "parent": "",
+ "parent": "Contentful",
"isactive": true,
"allowed_file_formats": [
{
@@ -77,7 +77,7 @@
"title": "https://wordpress.com/",
"href": "https://wordpress.com/"
},
- "parent": "",
+ "parent": "Wordpress",
"isactive": true,
"allowed_file_formats": [
{
@@ -85,7 +85,7 @@
"_metadata": {
"uid": "csacaafbc5e52ee0ef"
},
- "title": "XML",
+ "title": "Xml",
"description": "",
"group_name": "xml",
"isactive": true
@@ -108,17 +108,71 @@
"isactive": true,
"allowed_file_formats": [
{
- "fileformat_id": "sql",
+ "fileformat_id": "zip",
"_metadata": {
"uid": "cs5d9c8914dc21ea80"
},
- "title": "SQL",
+ "title": "Zip",
"description": "",
- "group_name": "sql",
+ "group_name": "zip",
"isactive": true
}
]
},
+ {
+ "cms_id": "drupal v7",
+ "title": "Drupal v7",
+ "description": "",
+ "group_name": "lightning",
+ "doc_url": {
+ "title": "https://www.drupal.org/",
+ "href": "https://www.drupal.org/"
+ },
+ "parent": "Drupal",
+ "isactive": true,
+ "allowed_file_formats": [
+ {
+ "fileformat_id": "sql",
+ "title": "Sql",
+ "description": "",
+ "group_name": "sql",
+ "isactive": true,
+ "_metadata": {
+ "uid": "csceba83e388748bf1"
+ }
+ }
+ ],
+ "_metadata": {
+ "uid": "cs88cc83ef30625782"
+ }
+ },
+ {
+ "cms_id": "drupal v8+",
+ "title": "Drupal v8+",
+ "description": "",
+ "group_name": "lightning",
+ "doc_url": {
+ "title": "https://www.drupal.org/",
+ "href": "https://www.drupal.org/"
+ },
+ "parent": "Drupal",
+ "isactive": true,
+ "allowed_file_formats": [
+ {
+ "fileformat_id": "sql",
+ "title": "Sql",
+ "description": "",
+ "group_name": "sql",
+ "isactive": true,
+ "_metadata": {
+ "uid": "csce12ba4b8be62108"
+ }
+ }
+ ],
+ "_metadata": {
+ "uid": "cs65a0fe53fc587481"
+ }
+ },
{
"cms_id": "aem",
"_metadata": {
@@ -135,23 +189,47 @@
"isactive": true,
"allowed_file_formats": [
{
- "fileformat_id": "json",
+ "fileformat_id": "zip",
"_metadata": {
"uid": "cs08dadd206cfa53b4"
},
- "title": "JSON",
+ "title": "Zip",
"description": "",
- "group_name": "json",
+ "group_name": "zip",
"isactive": true
}
]
},
{
- "cms_id": "sitecore",
- "_metadata": {
- "uid": "cs1c20c0a62eaf4b89"
+ "cms_id": "sitecore v8",
+ "title": "Sitecore v8",
+ "description": "",
+ "group_name": "lightning",
+ "doc_url": {
+ "title": "https://www.sitecore.com/",
+ "href": "https://www.sitecore.com/"
},
- "title": "Sitecore",
+ "parent": "Sitecore",
+ "isactive": true,
+ "allowed_file_formats": [
+ {
+ "fileformat_id": "zip",
+ "title": "Zip",
+ "description": "",
+ "group_name": "zip",
+ "isactive": true,
+ "_metadata": {
+ "uid": "cs7b44e4f248dbdc92"
+ }
+ }
+ ],
+ "_metadata": {
+ "uid": "csef3e4691c7e23a2d"
+ }
+ },
+ {
+ "cms_id": "sitecore v9",
+ "title": "Sitecore v9",
"description": "",
"group_name": "lightning",
"doc_url": {
@@ -163,15 +241,45 @@
"allowed_file_formats": [
{
"fileformat_id": "zip",
+ "title": "Zip",
+ "description": "",
+ "group_name": "zip",
+ "isactive": true,
"_metadata": {
- "uid": "csd2c76964ab6c1fdb"
- },
+ "uid": "cs47d2095581add21f"
+ }
+ }
+ ],
+ "_metadata": {
+ "uid": "cse88f8602ab676db3"
+ }
+ },
+ {
+ "cms_id": "sitecore v10",
+ "title": "Sitecore v10",
+ "description": "",
+ "group_name": "lightning",
+ "doc_url": {
+ "title": "https://www.sitecore.com/",
+ "href": "https://www.sitecore.com/"
+ },
+ "parent": "Sitecore",
+ "isactive": true,
+ "allowed_file_formats": [
+ {
+ "fileformat_id": "zip",
"title": "Zip",
"description": "",
"group_name": "zip",
- "isactive": true
+ "isactive": true,
+ "_metadata": {
+ "uid": "cs882b321665f69cfd"
+ }
}
- ]
+ ],
+ "_metadata": {
+ "uid": "cs67770c22aae86b7b"
+ }
},
{
"cms_id": "othercms",
@@ -189,13 +297,13 @@
"isactive": true,
"allowed_file_formats": [
{
- "fileformat_id": "json",
+ "fileformat_id": "zip",
"_metadata": {
"uid": "cs751db98402e685fe"
},
- "title": "JSON",
+ "title": "Zip",
"description": "",
- "group_name": "json",
+ "group_name": "zip",
"isactive": true
}
]
@@ -205,10 +313,10 @@
"locale": "en-us",
"uid": "blt1f83a8b93dd822ae",
"created_by": "blt7710245564fbf52b",
- "updated_by": "blt7710245564fbf52b",
+ "updated_by": "blt74f496d523384141",
"created_at": "2024-01-23T09:41:52.061Z",
- "updated_at": "2024-02-22T11:28:29.742Z",
- "_version": 24,
+ "updated_at": "2024-06-07T09:23:01.470Z",
+ "_version": 25,
"_in_progress": false,
"cta": "Proceed to Destination Stack",
"all_steps": [
@@ -217,7 +325,7 @@
"_metadata": {
"uid": "cs752bfd62296e4791"
},
- "title": "Select CMS",
+ "title": "CMS",
"description": "Select your current Content Management System from available options.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"lock": false,
@@ -241,7 +349,7 @@
"_metadata": {
"uid": "cs7c935e15de9ea7c8"
},
- "title": "Select CMS File Format",
+ "title": "File Format",
"description": "Click to read the document and subsequently continue with migration process.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"lock": false,
@@ -253,7 +361,7 @@
"_metadata": {
"uid": "cs0279f1f0ce13e83e"
},
- "title": "Upload File",
+ "title": "Imported File",
"description": "Select File to upload CMS Data.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"lock": false,
@@ -269,4 +377,4 @@
"restricted_keyword_checkbox_text": "Please acknowledge that you have referred to the Contentstack restricted keywords",
"affix_cta": "Continue",
"file_format_cta": "Continue"
-}
+}
\ No newline at end of file
diff --git a/ui/src/components/Card/index.tsx b/ui/src/components/Card/index.tsx
index d8b316ccc..32c6c3fd9 100644
--- a/ui/src/components/Card/index.tsx
+++ b/ui/src/components/Card/index.tsx
@@ -6,7 +6,6 @@ import { useNavigate } from 'react-router-dom';
// Utilities
import { NEW_PROJECT_STATUS } from '../../utilities/constants';
import { getDays, isEmptyString } from '../../utilities/functions';
-import { AppContext } from '../../context/app/app.context';
// Interface
import { ProjectType } from './card.interface';
import { getProject } from '../../services/api/project.service';
diff --git a/ui/src/components/Common/Card/card.scss b/ui/src/components/Common/Card/card.scss
index 9e57a1630..6d90f2822 100644
--- a/ui/src/components/Common/Card/card.scss
+++ b/ui/src/components/Common/Card/card.scss
@@ -5,6 +5,8 @@
display: flex;
flex-wrap: wrap;
gap: $px-12;
+ margin-left: 10px !important;
+ margin-bottom: 10px;
}
.trigger_list {
@@ -22,12 +24,15 @@
.connector_list,
.action_list,
.trigger_list {
- border: 1px solid $color-base-gray-40;
+ //border: 1px solid $color-base-gray-40;
+ border: 1px solid #6C5CE766;
border-radius: $px-6;
flex: 0 10%;
cursor: pointer;
min-width: $px-117;
text-align: center;
+ height: 128px;
+ gap: 12px;
}
.connector_list .tippy-box-light #automationConnectorsHelpText {
@@ -62,3 +67,6 @@
margin-top: 3.5rem;
z-index: 8;
}
+.centered-card-title{
+ margin: 10px;
+}
diff --git a/ui/src/components/Common/Card/card.tsx b/ui/src/components/Common/Card/card.tsx
index 1f5363774..178e68d20 100644
--- a/ui/src/components/Common/Card/card.tsx
+++ b/ui/src/components/Common/Card/card.tsx
@@ -55,27 +55,23 @@ const Card = ({ data, selectedCard, onCardClick, cardType, idField = 'id' }: Car
)}
- {/*
- {isHovered || selectedCard[idField] === data[idField] ? (
-
+ {isHovered || selectedCard[idField] === data?.[idField] ? (
+
) : (
<>>
)}
- */}
+
-
-
diff --git a/ui/src/components/Common/ProgressBar/index.tsx b/ui/src/components/Common/ProgressBar/index.tsx
new file mode 100644
index 000000000..f15ae7d4b
--- /dev/null
+++ b/ui/src/components/Common/ProgressBar/index.tsx
@@ -0,0 +1,100 @@
+import React from 'react'
+import './progressBar.scss'
+import cn from 'classnames'
+
+
+type ProgressBarProps = {
+ percentage: number
+ color?: string
+ /**
+ * Height of the Progress bar in pixel
+ */
+ height?: number
+ /**
+ * Border radius in pixel
+ */
+ borderRadius?: number
+ type?: 'bar' | 'circle',
+ stroke?: number
+ radius?: number | undefined
+ bgColor?: string
+}
+
+type IStyle = {
+ [key: string]: string
+}
+
+const ProgressBar = (props: ProgressBarProps) => {
+ const { percentage, color, height, borderRadius, type, radius, stroke, bgColor } = props
+
+ const containerStyle: IStyle = {}
+ const barStyle: IStyle = {
+ width: '0%',
+ };
+
+ if (height) {
+ containerStyle.height = `${height}px`
+ }
+
+ if (borderRadius) {
+ containerStyle.borderRadius = `${borderRadius}px`
+ }
+
+ if (percentage) {
+ barStyle.width = `${percentage}%`
+ }
+
+ if (color) {
+ barStyle.backgroundColor = color
+ }
+ if (type === 'circle') {
+ const normalizedRadius: any = (radius || 0 - (stroke || 0)) * 2;
+ const circumference: any = normalizedRadius * 2 * Math.PI;
+ const strokeDashoffset: any = circumference - percentage / 100 * circumference;
+ return (
+ <>
+
+ >
+ );
+ }
+ return (
+
+ )
+}
+
+ProgressBar.defaultProps = {
+ color: '#52c0ff',
+ borderRadius: 4,
+ height: 5,
+ type: "bar",
+ stroke: 4,
+ radius: 20,
+ bgColor: "white"
+} as Partial
+
+export default ProgressBar
\ No newline at end of file
diff --git a/ui/src/components/Common/ProgressBar/progressBar.scss b/ui/src/components/Common/ProgressBar/progressBar.scss
new file mode 100644
index 000000000..fc0310e27
--- /dev/null
+++ b/ui/src/components/Common/ProgressBar/progressBar.scss
@@ -0,0 +1,19 @@
+@import '../../../scss//variables';
+
+.ProgressBar {
+ border-radius: $space-4;
+
+ overflow: hidden;
+ &__bar {
+
+ border-radius: inherit;
+ height: inherit;
+ transition: width 100ms linear;
+ }
+ &__circle{
+ stroke-width: 5%;
+ transform: rotate(-90deg);
+ transform-origin: 50% 50%;
+ transition: stroke-dashoffset 1s;
+ }
+}
\ No newline at end of file
diff --git a/ui/src/components/ContentMapper/index.scss b/ui/src/components/ContentMapper/index.scss
index 33ca9ad58..591460fed 100644
--- a/ui/src/components/ContentMapper/index.scss
+++ b/ui/src/components/ContentMapper/index.scss
@@ -4,14 +4,19 @@
.content-types-list-wrapper {
display: flex;
flex-direction: column;
- max-height: calc(100vh - 173px);
- max-width: 27%;
+ max-width: 25%;
overflow: hidden;
width: 100%;
}
.content-types-list-header {
+ background-color: $color-base-white-10;
border-bottom: 1px solid $color-brand-secondary-lightest;
- padding: 18px $space-12;
+ padding: $px-20 $space-12;
+ h2 {
+ color: $color-font-base;
+ font-size: $size-font-20;
+ font-weight: $font-weight-semi-bold;
+ }
.Search {
margin: $space-20 0 $space-12;
width: 100%;
@@ -20,21 +25,37 @@
}
}
}
-.ct-list {
- list-style-type: none;
- padding: 15px 0;
+.ct-search-wrapper {
+ border-bottom: 1px solid $color-brand-secondary-lightest;
+ padding: $px-8 $px-12;
+ .Search__v2 {
+ height: 2.5rem;
+ width: 100%!important;
+ .Search-input-show {
+ width: 100%!important;
+ }
+ }
+}
+.ct-list-wrapper {
+ height: calc(100vh - 375px);
overflow-y: auto;
overflow-x: hidden;
+}
+.ct-list {
+ border-right: 1px solid $color-brand-secondary-lightest;
+ list-style-type: none;
+ margin: 0 0 0 $px-12;
+ padding: 15px 12px 15px 0;
li {
align-items: center;
border: 1px solid transparent;
cursor: pointer;
display: flex;
- font-size: $size-font-large;
+ font-size: $size-font-xl;
justify-content: space-between;
line-height: normal;
min-height: 42px;
- padding: $space-10 35px;
+ padding: $px-8 $px-12;
&.active-ct {
background-color: $color-brand-white-base;
border: 1px solid $color-brand-primary-base;
@@ -42,14 +63,18 @@
}
}
}
+.dropdown-align {
+ .Dropdown__menu--primary {
+ right: 0.25rem;
+ }
+}
.content-type-list {
padding-left: 12px;
}
.content-types-fields-wrapper {
- border-left: 1px solid $color-brand-secondary-lightest;
display: flex;
flex-direction: column;
- max-width: 73%;
+ max-width: 75%;
width: 100%;
padding: 0px;
}
@@ -72,12 +97,16 @@
padding: 0 1.25rem;
}
.cms-field {
- font-weight: $font-weight-semi-bold;
+ text-transform: capitalize;
}
.InstructionText {
+ font-size: $size-font-small;
margin: 0;
}
}
+ .import-cta {
+ margin: 0;
+ }
}
.disabled-field {
color: $color-font-disabled;
@@ -96,7 +125,6 @@
flex-direction: column;
margin-top: 0;
margin-left: 0px;
- // margin-bottom: 20px;
width: 100%;
}
.saveButton {
@@ -105,10 +133,13 @@
.btnWrapper {
margin-left: 20px;
}
-div .select .Select {
- width: $px-50;
- max-width: $px-50 !important;
-}
+div .select {
+ width: calc(100% - 30px);
+ .Select {
+ width: 100%;
+ max-width: 100% !important;
+ }
+}
div .table-row {
display: flex;
justify-content: space-between;
diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx
index f0ca20704..19680ce80 100644
--- a/ui/src/components/ContentMapper/index.tsx
+++ b/ui/src/components/ContentMapper/index.tsx
@@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate, useParams } from 'react-router-dom';
import {
- Heading,
InfiniteScrollTable,
Select,
ButtonGroup,
@@ -16,7 +15,8 @@ import {
InstructionText,
ModalHeader,
ModalBody,
- ModalFooter
+ ModalFooter,
+ Dropdown
} from '@contentstack/venus-components';
import { jsonToHtml } from '@contentstack/json-rte-serializer';
import HTMLReactParser from 'html-react-parser';
@@ -34,13 +34,14 @@ import {
} from '../../services/api/migration.service';
import { getStackStatus } from '../../services/api/stacks.service';
+// Redux
+import { RootState } from '../../store';
+import { updateMigrationData, updateNewMigrationData } from '../../store/slice/migrationDataSlice';
+
// Utilities
import { CS_ENTRIES } from '../../utilities/constants';
import { validateArray } from '../../utilities/functions';
-// Context
-import { AppContext } from '../../context/app/app.context';
-
// Interface
import { DEFAULT_CONTENT_MAPPING_DATA, INewMigration } from '../../context/app/app.interface';
import {
@@ -66,9 +67,6 @@ import AdvanceSettings from '../AdvancePropertise';
// Styles
import './index.scss';
-import { RootState } from '../../store';
-import { setNewMigrationData, updateMigrationData, updateNewMigrationData } from '../../store/slice/migrationDataSlice';
-import { setMigrationData } from '../../store/slice/migrationDataSlice';
const Fields: Mapping = {
'Single Line Textbox': [
@@ -107,12 +105,12 @@ const Fields: Mapping = {
CheckBox: 'Select',
global_field: 'Global'
};
-
interface ModalProps {
e: React.MouseEvent;
newIndex: number;
closeModal: () => void;
}
+
const ContentMapper = () => {
/** ALL CONTEXT HERE */
@@ -126,14 +124,13 @@ const ContentMapper = () => {
contentMappingData: {
content_types_heading: contentTypesHeading,
description,
- action_cta: actionCta,
- cta,
- search_placeholder: searchPlaceholder
- }
+ // action_cta: actionCta,
+ // cta,
+ search_placeholder: searchPlaceholder,
+ table_search_placeholder: tableSearchPlaceholder
+ }= {}
} = migrationData;
- const parseDescription = HTMLReactParser(jsonToHtml(description ?? {}));
-
const [tableData, setTableData] = useState([]);
const [loading, setLoading] = useState(false);
const [itemStatusMap, updateItemStatusMap] = useState({});
@@ -217,8 +214,8 @@ const ContentMapper = () => {
useEffect(() => {
if (contentTypeMapped && otherCmsTitle) {
setOtherContentType({
- label: contentTypeMapped?.[otherCmsTitle] ?? 'Select Content Type',
- value: contentTypeMapped?.[otherCmsTitle] ?? 'Select Content Type'
+ label: contentTypeMapped?.[otherCmsTitle] ?? 'Select content type from existing stack',
+ value: contentTypeMapped?.[otherCmsTitle] ?? 'Select content type from existing stack'
});
}
}, [contentTypeMapped, otherCmsTitle]);
@@ -250,7 +247,7 @@ const ContentMapper = () => {
// Method to fetch content types
const fetchContentTypes = async (searchText: string) => {
- const { data } = await getContentTypes(projectId || '', 0, 10, searchContentType || ''); //org id will always present
+ const { data } = await getContentTypes(projectId || '', 0, 5000, searchContentType || ''); //org id will always present
setContentTypes(data?.contentTypes);
setSelectedContentType(data?.contentTypes?.[0]);
@@ -279,7 +276,7 @@ const ContentMapper = () => {
const handleSearch = async (searchCT: string) => {
setSearchContentType(searchCT);
- const { data } = await getContentTypes(projectId, 0, 5, searchCT || ''); //org id will always present
+ const { data } = await getContentTypes(projectId, 0, 1000, searchCT || ''); //org id will always present
setContentTypes(data?.contentTypes);
setSelectedContentType(data?.contentTypes?.[0]);
@@ -369,40 +366,7 @@ const ContentMapper = () => {
setSelectedContentType(contentTypes?.[i]);
};
- //function to handle previous content type navigation
- const handlePrevClick = (e: React.MouseEvent) => {
- const newIndex = currentIndex > 0 ? currentIndex - 1 : 0;
- if (isDropDownChanged) {
- handleSaveContentTypeModal(e, newIndex);
- } else {
- setCurrentIndex(newIndex);
- openContentType(e, newIndex);
- document.querySelectorAll('.ct-list li').forEach((ctLi, ind) => {
- if (newIndex === ind) {
- ctLi?.classList?.add('active-ct');
- }
- });
- }
- };
-
- // function to handle next content type navigation
- const handleNextClick = (e: React.MouseEvent) => {
- if (currentIndex < contentTypes?.length - 1) {
- const newIndex = currentIndex + 1;
-
- if (isDropDownChanged) {
- handleSaveContentTypeModal(e, newIndex);
- } else {
- setCurrentIndex(newIndex);
- openContentType(e, newIndex);
- document.querySelectorAll('.ct-list li').forEach((ctLi, ind) => {
- if (newIndex === ind) {
- ctLi?.classList?.add('active-ct');
- }
- });
- }
- }
- };
+ // Function to Save the Content Type
const SaveContentType = (props: ModalProps) => {
return (
<>
@@ -478,15 +442,12 @@ const ContentMapper = () => {
setTableData(newTableData);
};
- const handleOnClick = (title: string) => {
+ const handleSchemaPreview = (title: string) => {
return cbModal({
component: (props: ModalObj) => (
{
- // return;
- // }}
{...props}
/>
),
@@ -531,7 +492,6 @@ const ContentMapper = () => {
setRowIds(selectedObj);
setSelectedEntries(selectedData);
-
};
// Function to find unchecked field
@@ -605,8 +565,6 @@ const ContentMapper = () => {
const SelectAccessor = (data: FieldMapType) => {
const OptionsForRow = Fields[data?.backupFieldType as keyof Mapping];
-
-
const option = Array.isArray(OptionsForRow)
? OptionsForRow.map((option) => ({ label: option, value: option }))
: [{ label: OptionsForRow, value: OptionsForRow }];
@@ -619,7 +577,7 @@ const ContentMapper = () => {