Skip to content
Merged

Dev #191

Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added documenting
  • Loading branch information
RohitKini committed Jul 12, 2024
commit f594909ece660d4575bbf684103d4d08cc95f409
35 changes: 0 additions & 35 deletions ui/src/components/MainHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const MainHeader = () => {
const [orgsList, setOrgsList] = useState<IDropDown[]>([]);
const [isModalOpen, setIsModalOpen] = useState(false);


const location = useLocation();
const navigate = useNavigate();
const dispatch = useDispatch();
Expand Down Expand Up @@ -115,7 +114,6 @@ const MainHeader = () => {
setDataInLocalStorage('organization', data?.value);
};

<<<<<<< Updated upstream
useEffect(()=>{
const handlePopState = (event: PopStateEvent) => {
event.preventDefault();
Expand All @@ -138,19 +136,11 @@ const MainHeader = () => {


const handleonClick = async () => {
=======
/**
* Handles the click event on the main header.
* Navigates to the appropriate page based on the current step and selected organization.
*/
const handleonClick = async () => {
>>>>>>> Stashed changes
const currentIndex = newMigrationData?.legacy_cms?.currentStep + 1;
const pathSegments = location?.pathname.split('/');
const lastPathSegment = pathSegments[pathSegments.length - 4];
const response = await getProject(selectedOrganisation?.uid || '', lastPathSegment);
const current_step = response?.data?.current_step;
<<<<<<< Updated upstream
if(isModalOpen) return;

const goback = () => {
Expand Down Expand Up @@ -178,31 +168,6 @@ const MainHeader = () => {
}
else{
dispatch(updateNewMigrationData(DEFAULT_NEW_MIGRATION))
=======

const goback = () => {
dispatch(updateNewMigrationData(DEFAULT_NEW_MIGRATION));
navigate(`/projects`, { replace: true });
};

if (
-1 < currentIndex &&
currentIndex < 4 &&
(!isEmptyString(newMigrationData?.legacy_cms?.selectedCms?.cms_id) ||
!isEmptyString(newMigrationData?.legacy_cms?.affix) ||
newMigrationData?.legacy_cms?.uploadedFile?.isValidated) &&
current_step === 1
) {
return cbModal({
component: (props: ModalObj) => <NotificationModal goBack={goback} {...props} />,
modalProps: {
size: 'xsmall',
shouldCloseOnOverlayClick: false
}
});
} else {
dispatch(updateNewMigrationData(DEFAULT_NEW_MIGRATION));
>>>>>>> Stashed changes
navigate(`/projects`, { replace: true });
}
};
Expand Down