From 1d709e7b241589b40974b7e3a86006131c3dc674 Mon Sep 17 00:00:00 2001 From: Sayali Joshi Date: Tue, 17 Sep 2024 19:29:02 +0530 Subject: [PATCH] [CMG-317] - Destination stack | When creating a new project and going to the destination stack module, open the stack dropdown, select stack, and open the dropdown, showing No options. --- ui/src/components/ContentMapper/index.tsx | 19 +++++++++++++------ .../DestinationStack/Actions/LoadStacks.tsx | 8 +++++--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index bb9e28100..555801d71 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -764,6 +764,16 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re }); setTableData(updatedRows); setSelectedEntries(updatedRows); + + const dropdownChangeState: INewMigration = { + ...newMigrationData, + content_mapping: { + ...newMigrationData?.content_mapping, + isDropDownChanged: true, + otherCmsTitle: otherCmsTitle + } + } + dispatch(updateNewMigrationData((dropdownChangeState))); }; const handleDropDownChange = (value: FieldTypes) => { @@ -884,18 +894,14 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re if(index > -1){ selectedOptions.splice(index,1 ); - } delete existingField[item?.uid] } } - else{ - - + else { setIsFieldDeleted(false); } - setExistingField((prevOptions: ExistingFieldType) => ({ @@ -957,7 +963,8 @@ const ContentMapper = forwardRef(({projectData}: ContentMapperComponentProps, re ...newMigrationData, content_mapping: { ...newMigrationData?.content_mapping, - isDropDownChanged: true + isDropDownChanged: true, + otherCmsTitle: otherCmsTitle } } dispatch(updateNewMigrationData((dropdownChangeState))); diff --git a/ui/src/components/DestinationStack/Actions/LoadStacks.tsx b/ui/src/components/DestinationStack/Actions/LoadStacks.tsx index 7d6055696..5cd2dddf0 100644 --- a/ui/src/components/DestinationStack/Actions/LoadStacks.tsx +++ b/ui/src/components/DestinationStack/Actions/LoadStacks.tsx @@ -76,13 +76,15 @@ const LoadStacks = (props: LoadFileFormatProps) => { useEffect(() => { newMigrationDataRef.current = newMigrationData; }, [newMigrationData]); - useEffect(()=>{ + + useEffect(() => { if(!isEmptyString(newMigrationData?.destination_stack?.selectedStack?.value)){ setSelectedStack(newMigrationData?.destination_stack?.selectedStack); } - setAllStack(newMigrationData?.destination_stack?.stackArray) + // setAllStack(newMigrationData?.destination_stack?.stackArray) },[newMigrationData?.destination_stack?.selectedStack]) + //Handle new stack details const handleOnSave = async (data: Stack) => { @@ -274,7 +276,7 @@ const LoadStacks = (props: LoadFileFormatProps) => { isClearable={newMigrationData?.destination_stack?.stackArray?.length > 0 && !emptyStackValue ? true : false } // hideSelectedOptions={true} - isDisabled={props?.stepComponentProps?.isSummary || false} + // isDisabled={props?.stepComponentProps?.isSummary || false} error={isLoading ? false : isError ? true : false } width="600px" hasAddOption={true}