diff --git a/ui/src/cmsData/legacyCms.json b/ui/src/cmsData/legacyCms.json index f0e34be8b..a4ca87405 100644 --- a/ui/src/cmsData/legacyCms.json +++ b/ui/src/cmsData/legacyCms.json @@ -337,12 +337,12 @@ "_metadata": { "uid": "cs6c761d71844ac800" }, - "title": "Add Source Prefix", - "description": "Add a 2–5 character prefix for the source name. Use only letters, no numbers or special characters.", + "title": "Add Source Affix", + "description": "Add a 2–5 character affix for the source name. Use only letters, no numbers or special characters.", "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", "lock": false, "active": false, - "empty_step_placeholder": "No Prefix Entered..." + "empty_step_placeholder": "No affix Entered..." }, { "step_id": "Step3", diff --git a/ui/src/cmsData/projects.json b/ui/src/cmsData/projects.json index 06089f465..7c8516da2 100644 --- a/ui/src/cmsData/projects.json +++ b/ui/src/cmsData/projects.json @@ -53,7 +53,7 @@ "uid": "5ff5db2c09b54cf994ac9c0684d9a9eb", "children": [ { - "text": "Let's get started on streamlining your content migration process! Simply follow the steps and unlock a seamless transfer experience." + "text": "Begin your content migration journey by creating a new project. Follow the steps to ensure a smooth and efficient transfer of your content." } ] }, diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index efe14ce77..16ffd6b8d 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -236,7 +236,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R nonLocalizable: false }); - const [active, setActive] = useState(0); + const [active, setActive] = useState(0); const [searchContentType, setSearchContentType] = useState(''); @@ -613,16 +613,16 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R const openContentType = (i: number) => { setIsFieldDeleted(false); setActive(i); - const otherTitle = contentTypes?.[i]?.otherCmsTitle; + const otherTitle = filteredContentTypes?.[i]?.otherCmsTitle; setOtherCmsTitle(otherTitle); - setContentTypeUid(contentTypes?.[i]?.id ?? ''); - fetchFields(contentTypes?.[i]?.id ?? '', searchText || ''); - setOtherCmsUid(contentTypes?.[i]?.otherCmsUid); - setSelectedContentType(contentTypes?.[i]); - setIsContentType(contentTypes?.[i]?.type === "content_type"); + setContentTypeUid(filteredContentTypes?.[i]?.id ?? ''); + fetchFields(filteredContentTypes?.[i]?.id ?? '', searchText || ''); + setOtherCmsUid(filteredContentTypes?.[i]?.otherCmsUid); + setSelectedContentType(filteredContentTypes?.[i]); + setIsContentType(filteredContentTypes?.[i]?.type === "content_type"); setOtherContentType({ - label: contentTypeMapped?.[otherTitle] ?? `Select ${contentTypes?.[i]?.type === "content_type" ? 'Content Type' : 'Global Field'} from existing stack`, - value: contentTypeMapped?.[otherTitle] ?? `Select ${contentTypes?.[i]?.type === "content_type" ? 'Content Type' : 'Global Field'} from existing stack` + label: contentTypeMapped?.[otherTitle] ?? `Select ${filteredContentTypes?.[i]?.type === "content_type" ? 'Content Type' : 'Global Field'} from existing stack`, + value: contentTypeMapped?.[otherTitle] ?? `Select ${filteredContentTypes?.[i]?.type === "content_type" ? 'Content Type' : 'Global Field'} from existing stack` }); } @@ -641,19 +641,25 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R setSelectedEntries(newTableData); }; - const handleSchemaPreview = (title: string) => { - return cbModal({ - component: (props: ModalObj) => ( - - ), - modalProps: { - shouldCloseOnOverlayClick: true - } - }); + const handleSchemaPreview = async (title: string, contentTypeId: string) => { + try { + const { data } = await getFieldMapping(contentTypeId ?? '', 0, 30, searchText ?? '', projectId); + return cbModal({ + component: (props: ModalObj) => ( + + ), + modalProps: { + shouldCloseOnOverlayClick: true + } + }); + } catch (err) { + console.log(err); + return err; + } }; const accessorCall = (data: FieldMapType) => { @@ -1760,9 +1766,20 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R if (value !== 'All') { setFilteredContentTypes(filteredCT); setCount(filteredCT?.length); + + if (filteredCT?.some((ct) => ct?.otherCmsUid === otherCmsUid)) { + const selectedIndex = filteredCT.findIndex(ct => ct?.otherCmsUid === otherCmsUid); + setActive(selectedIndex); + } else { + setActive(null) + } + } else { setFilteredContentTypes(contentTypes); setCount(contentTypes?.length); + + const selectedIndex = contentTypes.findIndex(ct => ct?.otherCmsUid === otherCmsUid); + setActive(selectedIndex); } setShowFilter(false); } @@ -1895,7 +1912,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R - + diff --git a/ui/src/components/LegacyCms/Actions/LoadPrefix.tsx b/ui/src/components/LegacyCms/Actions/LoadPrefix.tsx index f9d9c54ef..f7c0ab76a 100644 --- a/ui/src/components/LegacyCms/Actions/LoadPrefix.tsx +++ b/ui/src/components/LegacyCms/Actions/LoadPrefix.tsx @@ -69,7 +69,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => { } else if (!isValidPrefix(value)) { setIsRestrictedKey(false); setIsError(true); - setErrorMessage('Prefix must be 2 to 5 letters, with no numbers or special characters.'); + setErrorMessage('Affix must be 2 to 5 letters, with no numbers or special characters.'); } else { setPrefix(value); setIsError(false); @@ -123,7 +123,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => { value={prefix} autoFocus={true} width="large" - placeholder={'Add Prefix'} + placeholder={'Add Affix'} version="v2" error={isError} aria-label='affix' diff --git a/ui/src/components/MigrationExecution/index.tsx b/ui/src/components/MigrationExecution/index.tsx index 9f0cbfd25..2302830d8 100644 --- a/ui/src/components/MigrationExecution/index.tsx +++ b/ui/src/components/MigrationExecution/index.tsx @@ -97,6 +97,7 @@ const MigrationExecution = () => { name="stackKey" value={getPlaceHolder(item?.title)} version="v2" + disabled // width="regular" /> diff --git a/ui/src/components/SchemaModal/index.tsx b/ui/src/components/SchemaModal/index.tsx index fe06078d9..0ddc07573 100644 --- a/ui/src/components/SchemaModal/index.tsx +++ b/ui/src/components/SchemaModal/index.tsx @@ -46,7 +46,7 @@ const getTopLevelIcons = (field: FieldMapType) => { return icons['tag']; } - if (field?.contentstackFieldType === 'Select' || field?.contentstackFieldType === 'dropdown') { + if (field?.contentstackFieldType === 'Select' || field?.contentstackFieldType === 'dropdown' || field?.contentstackFieldType === 'checkbox' || field?.contentstackFieldType === 'radio') { return icons['select']; } @@ -180,7 +180,7 @@ const TreeView = ({ schema = [] }: schemaType) => { ); }; - + return (
@@ -192,7 +192,6 @@ const TreeView = ({ schema = [] }: schemaType) => { outlineName = item?.uid?.replace(/\.+/g, '_'); } const hasNested = hasNestedValue(item); - return (
  • { // to disable buttons as per isMigrated state useEffect(() => { - if (newMigrationData?.testStacks.find((stack) => stack?.stackUid === newMigrationData?.test_migration?.stack_api_key)?.isMigrated === false) { + if (newMigrationData?.testStacks?.find((stack) => stack?.stackUid === newMigrationData?.test_migration?.stack_api_key)?.isMigrated === false) { setDisableCreateStack(true); } - if (newMigrationData?.testStacks.find((stack) => stack?.stackUid === newMigrationData?.test_migration?.stack_api_key)?.isMigrated === true) { + if (newMigrationData?.testStacks?.find((stack) => stack?.stackUid === newMigrationData?.test_migration?.stack_api_key)?.isMigrated === true) { setdisableTestMigration(true); } }, [newMigrationData]); @@ -76,7 +76,7 @@ const TestMigration = () => { //get org plan details try { const orgDetails = await getOrgDetails(selectedOrganisation?.value); - const stacks_details_key = Object.keys(orgDetails?.data?.organization?.plan?.features).find(key => orgDetails?.data?.organization?.plan?.features[key].uid === 'stacks') || ''; + const stacks_details_key = Object.keys(orgDetails?.data?.organization?.plan?.features)?.find(key => orgDetails?.data?.organization?.plan?.features[key].uid === 'stacks') || ''; const max_stack_limit = orgDetails?.data?.organization?.plan?.features[stacks_details_key]?.max_limit; diff --git a/ui/src/pages/Projects/index.scss b/ui/src/pages/Projects/index.scss index 0fecb227f..b6273e4d8 100644 --- a/ui/src/pages/Projects/index.scss +++ b/ui/src/pages/Projects/index.scss @@ -35,6 +35,7 @@ .EmptyState__description { p { color: $color-font-base; + margin: $px-5 0; } } diff --git a/ui/src/pages/Projects/index.tsx b/ui/src/pages/Projects/index.tsx index 62cbc3d4e..f7b07c42c 100644 --- a/ui/src/pages/Projects/index.tsx +++ b/ui/src/pages/Projects/index.tsx @@ -192,7 +192,7 @@ const Projects = () => { ))} -
    - {HTMLReactParser(jsonToHtml(emptystate?.help_text ?? {}))} -
    )}