diff --git a/ui/src/cmsData/legacyCms.json b/ui/src/cmsData/legacyCms.json index 7befa1f9..9e866e61 100644 --- a/ui/src/cmsData/legacyCms.json +++ b/ui/src/cmsData/legacyCms.json @@ -327,7 +327,7 @@ }, "title": "Select CMS", "description": "Select the CMS you are migrating content from", - "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", + "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration", "lock": false, "active": true, "empty_step_placeholder": "No CMS selected..." @@ -339,7 +339,7 @@ }, "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.", + "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 affix Entered..." @@ -351,7 +351,7 @@ }, "title": "Select File Format", "description": "Select the file format compatible with the selected CMS", - "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", + "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration", "lock": false, "active": true, "empty_step_placeholder": "No File Format selected..." @@ -363,7 +363,7 @@ }, "title": "Uploaded File", "description": "This is the file you have uploaded", - "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", + "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration", "lock": false, "active": true, "empty_step_placeholder": "No File Uploaded..." @@ -373,7 +373,7 @@ "title": "https://www.contentstack.com/docs/developers/create-content-types/restricted-keywords-for-uids", "href": "https://www.contentstack.com/docs/developers/create-content-types/restricted-keywords-for-uids" }, - "file_format_checkbox_text": "Please acknowledge that you have read the file export guidelines.", + "file_format_checkbox_text": "Please acknowledge that you have read the file export guidelines", "restricted_keyword_checkbox_text": "Please acknowledge that you have referred to the Contentstack restricted keywords", "affix_cta": "Continue", "file_format_cta": "Continue" diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index dfbbf1bf..042ea146 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -612,10 +612,12 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R useBlockNavigation(isModalOpen); // Method to fetch content types const fetchContentTypes = async (searchText: string) => { + setIsLoading(true); + try { - setIsLoading(true); const { data } = await getContentTypes(projectId || '', 0, 5000, searchContentType || ''); //org id will always present + setIsLoading(false); setContentTypes(data?.contentTypes); setCount(data?.contentTypes?.length); setFilteredContentTypes(data?.contentTypes); @@ -670,8 +672,8 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R const validTableData = data?.fieldMapping?.filter((field: FieldMapType) => field?.otherCmsType !== undefined); - setTableData(validTableData || []); - setSelectedEntries(validTableData); + setTableData(validTableData ?? []); + setSelectedEntries(validTableData ?? []); setTotalCounts(validTableData?.length); setInitialRowSelectedData(validTableData?.filter((item: FieldMapType) => !item?.isDeleted)) setIsLoading(false); @@ -1072,6 +1074,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R maxWidth="290px" isClearable={false} options={option} + menuPlacement="auto" isDisabled={ data?.otherCmsType === "Group" || data?.otherCmsField === 'title' || @@ -1577,6 +1580,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R isClearable={selectedOptions?.includes?.(existingField?.[data?.uid]?.label ?? '')} options={adjustedOptions} isDisabled={OptionValue?.isDisabled || newMigrationData?.project_current_step > 4} + menuPlacement="auto" /> {(!OptionValue?.isDisabled || OptionValue?.label === 'Dropdown'|| diff --git a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx index 8fea8fce..529c62e7 100644 --- a/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx +++ b/ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx @@ -68,6 +68,7 @@ const Mapper = ({ if (selectedCsOptions?.length === 0) { setcsOptions(options); } + }, [options]); useEffect(() => { @@ -79,15 +80,16 @@ const Mapper = ({ useEffect(() => { const formattedoptions = options?.filter( (item: { label: string; value: string }) => - !selectedCsOptions?.some((selected: string) => selected === item?.value) + !selectedCsOptions?.some((selected: string) => selected === item?.value) && !cmsLocaleOptions?.some((locale: {label: string, value: string}) => locale?.label === item?.value) ); + const adjustedOptions = sourceOptions?.filter( (item: { label: string; value: string }) => !selectedSourceOption?.some((selected: string) => selected === item?.label) ); setcsOptions(formattedoptions); setsourceoptions(adjustedOptions); - }, [selectedCsOptions, selectedSourceOption]); + }, [selectedCsOptions, selectedSourceOption, options]); useEffect(() => { setExistingField((prevExisting: ExistingFieldType) => { @@ -117,6 +119,12 @@ const Mapper = ({ type: 'csLocale' | 'sourceLocale' ) => { const selectedLocaleKey = selectedValue?.value; + + if (!selectedValue?.label) { + setselectedCsOption((prevSelected) => + prevSelected?.filter((item) => item !== existingField?.[index]?.label) + ); + } setExistingField((prevOptions: ExistingFieldType) => { @@ -285,6 +293,7 @@ const Mapper = ({ isDisabled={true} // Ensure it's disabled className="select-container" noOptionsMessage={() => ''} + menuPlacement="auto" /> @@ -306,6 +315,7 @@ const Mapper = ({ isClearable={true} isDisabled={isDisabled} className="select-container" + menuPlacement="auto" /> )} - @@ -354,6 +364,7 @@ const Mapper = ({ isClearable={true} isDisabled={isDisabled} className="select-container" + menuPlacement="auto" /> }
@@ -508,21 +519,9 @@ const LanguageMapper = () => { isDisabled={newMigrationData?.project_current_step > 2} /> } - // footerComponent={ - // - - // } type="Secondary" />