{steps?.map(({ id, title }, idx: number) => {
diff --git a/ui/src/hooks/userNavigation.tsx b/ui/src/hooks/userNavigation.tsx
new file mode 100644
index 00000000..58e8bfef
--- /dev/null
+++ b/ui/src/hooks/userNavigation.tsx
@@ -0,0 +1,39 @@
+import { useEffect, useRef } from 'react';
+import { useLocation, useNavigate } from 'react-router-dom';
+
+const useBlockNavigation = (isModalOpen: boolean) => {
+ const location = useLocation();
+ const navigate = useNavigate();
+ const initialPathnameRef = useRef(location.pathname);
+
+ useEffect(() => {
+ const handlePopState = (event: PopStateEvent) => {
+ if (isModalOpen) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ window.history.replaceState(null, '', window.location.pathname);
+ navigate(location.pathname);
+ }
+ };
+
+ if (isModalOpen) {
+ initialPathnameRef.current = location.pathname;
+ window.history.pushState(null, '', window.location.pathname);
+ window.addEventListener('popstate', handlePopState);
+ } else {
+ window.removeEventListener('popstate', handlePopState);
+ }
+
+ return () => {
+ window.removeEventListener('popstate', handlePopState);
+ };
+ }, [isModalOpen, navigate, location.pathname]);
+
+ useEffect(() => {
+ if (!isModalOpen) {
+ initialPathnameRef.current = location.pathname;
+ }
+ }, [isModalOpen, location.pathname]);
+};
+
+export default useBlockNavigation;
diff --git a/ui/src/pages/Migration/index.tsx b/ui/src/pages/Migration/index.tsx
index 5fd4822c..8b65bc9c 100644
--- a/ui/src/pages/Migration/index.tsx
+++ b/ui/src/pages/Migration/index.tsx
@@ -146,15 +146,14 @@ const Migration = () => {
]
return steps;
}
- const handleClick = () => {
+ const handleClick = () => {
// Call handleStepChange function
const x : string | undefined= params.stepId
const currentStep : number = parseInt(x || '');
stepperRef?.current?.handleStepChange(currentStep-1);
};
-
const handleStepChange = (currentStep: number) => {
if (stepperRef?.current) {
stepperRef.current.handleStepChange(currentStep-1);
@@ -166,146 +165,155 @@ const Migration = () => {
setIsCompleted(flag);
};
- // handle on proceed to destination stack
- const handleOnClickLegacyCms = async (event: MouseEvent ) => {
- setIsLoading(true);
- if(isCompleted){
- event.preventDefault();
-
- //Update Data in backend
- await updateLegacyCMSData(selectedOrganisation?.value, projectId, {
- legacy_cms: newMigrationData?.legacy_cms?.selectedCms?.cms_id
- });
- await updateAffixData(selectedOrganisation?.value, projectId, { affix: newMigrationData?.legacy_cms?.affix });
- await fileformatConfirmation(selectedOrganisation?.value, projectId, {
- fileformat_confirmation: true
- });
- await updateFileFormatData(selectedOrganisation?.value, projectId, {
- file_format: newMigrationData?.legacy_cms?.selectedCms?.allowed_file_formats[0]?.fileformat_id?.toString() ,
- file_path: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath,
- is_fileValid: newMigrationData?.legacy_cms?.uploadedFile?.isValidated,
- is_localPath: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.isLocalPath,
- awsDetails:{
- awsRegion: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.awsRegion,
- bucketName: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.bucketName,
- buketKey: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.buketKey
- }
- });
- const res = await updateCurrentStepData(selectedOrganisation.value, projectId);
- handleStepChange(1);
- if (res) {
- setIsLoading(false);
-
- const url = `/projects/${projectId}/migration/steps/2`;
- navigate(url, { replace: true });
- }
+ // handle on proceed to destination stack
+ const handleOnClickLegacyCms = async (event: MouseEvent ) => {
+ setIsLoading(true);
+ if(isCompleted){
+ event.preventDefault();
+ //Update Data in backend
+ await updateLegacyCMSData(selectedOrganisation?.value, projectId, {
+ legacy_cms: newMigrationData?.legacy_cms?.selectedCms?.cms_id
+ });
+ await updateAffixData(selectedOrganisation?.value, projectId, { affix: newMigrationData?.legacy_cms?.affix });
+ await fileformatConfirmation(selectedOrganisation?.value, projectId, {
+ fileformat_confirmation: true
+ });
+ await updateFileFormatData(selectedOrganisation?.value, projectId, {
+ file_format: newMigrationData?.legacy_cms?.selectedCms?.allowed_file_formats[0]?.fileformat_id?.toString() ,
+ file_path: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.localPath,
+ is_fileValid: newMigrationData?.legacy_cms?.uploadedFile?.isValidated,
+ is_localPath: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.isLocalPath,
+ awsDetails:{
+ awsRegion: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.awsRegion,
+ bucketName: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.bucketName,
+ buketKey: newMigrationData?.legacy_cms?.uploadedFile?.file_details?.awsData?.buketKey
}
- else{
- setIsLoading(false);
+ });
+ const res = await updateCurrentStepData(selectedOrganisation.value, projectId);
+ handleStepChange(1);
+ if (res) {
+ setIsLoading(false);
- if (legacyCMSRef?.current) {
- const currentIndex = legacyCMSRef?.current?.getInternalActiveStepIndex() + 1;
- let result;
- switch (currentIndex ) {
- case 0:
- result = 'CMS';
- break;
- case 1:
- result = 'Enter Affix';
- break;
- case 2:
- result = 'Imported File';
- break;
- }
- if (currentIndex !== 3 || currentIndex !== 4) {
- Notification({
- notificationContent: { text: `Please complete ${result} step` },
- type: 'warning'
- });
- }
- }
+ const url = `/projects/${projectId}/migration/steps/2`;
+ navigate(url, { replace: true });
+ }
- }
-
- };
+ }
+ else{
+ setIsLoading(false);
- // handle on proceed to content mapping
- const handleOnClickDestinationStack = async (event: MouseEvent) => {
- setIsLoading(true);
-
- if(isCompleted && !isEmptyString(newMigrationData?.destination_stack?.selectedStack?.value)){
- event?.preventDefault();
- //Update Data in backend
- await updateDestinationStack(selectedOrganisation?.value, projectId, {
- stack_api_key: newMigrationData?.destination_stack?.selectedStack?.value
- });
- handleStepChange(2);
- const res = await updateCurrentStepData(selectedOrganisation?.value, projectId);
- if (res) {
- setIsLoading(false);
- const url = `/projects/${projectId}/migration/steps/3`;
- navigate(url, { replace: true });
+ if (legacyCMSRef?.current) {
+ const currentIndex = legacyCMSRef?.current?.getInternalActiveStepIndex() + 1;
+ let result;
+ switch (currentIndex ) {
+ case 0:
+ result = 'CMS';
+ break;
+ case 1:
+ result = 'Enter Affix';
+ break;
+ case 2:
+ result = 'Imported File';
+ break;
+ }
+ if (currentIndex !== 3 || currentIndex !== 4) {
+ Notification({
+ notificationContent: { text: `Please complete ${result} step` },
+ type: 'warning'
+ });
}
- } else{
- setIsLoading(false);
- Notification({
- notificationContent: { text: 'Please select a stack to proceed further' },
- type: 'warning'
- });
}
- };
- const handleOnClickContentMapper = async (event: MouseEvent) => {
- setIsLoading(true);
+ }
+
+ };
- event.preventDefault();
+ // handle on proceed to content mapping
+ const handleOnClickDestinationStack = async (event: MouseEvent) => {
+ setIsLoading(true);
- const data = {
- name: newMigrationData?.destination_stack?.selectedStack?.label,
- description: 'test migration stack',
- master_locale: newMigrationData?.destination_stack?.selectedStack?.master_locale
- };
-
- const res = await createTestStack(
- newMigrationData?.destination_stack?.selectedOrg?.value,
- projectId,
- data
- );
-
- const newMigrationDataObj: INewMigration = {
- ...newMigrationData,
- test_migration: { stack_link: res?.data?.data?.url, stack_api_key: res?.data?.data?.data?.stack?.api_key }
- };
-
- dispatch(updateNewMigrationData((newMigrationDataObj)));
- if (res?.status) {
+ if(isCompleted && !isEmptyString(newMigrationData?.destination_stack?.selectedStack?.value)){
+ event?.preventDefault();
+ //Update Data in backend
+ await updateDestinationStack(selectedOrganisation?.value, projectId, {
+ stack_api_key: newMigrationData?.destination_stack?.selectedStack?.value
+ });
+ handleStepChange(2);
+ const res = await updateCurrentStepData(selectedOrganisation?.value, projectId);
+ if (res) {
setIsLoading(false);
-
- const url = `/projects/${projectId}/migration/steps/4`;
+ const url = `/projects/${projectId}/migration/steps/3`;
navigate(url, { replace: true });
-
- await updateCurrentStepData(selectedOrganisation.value, projectId);
- handleStepChange(3);
}
+ } else{
+ setIsLoading(false);
+ Notification({
+ notificationContent: { text: 'Please select a stack to proceed further' },
+ type: 'warning'
+ });
}
+ };
+
+ const handleOnClickContentMapper = async (event: MouseEvent) => {
+ setIsLoading(true);
- const handleOnClickTestMigration = async () => {
+ event.preventDefault();
+
+ const data = {
+ name: newMigrationData?.destination_stack?.selectedStack?.label,
+ description: 'test migration stack',
+ master_locale: newMigrationData?.destination_stack?.selectedStack?.master_locale
+ };
+
+ const res = await createTestStack(
+ newMigrationData?.destination_stack?.selectedOrg?.value,
+ projectId,
+ data
+ );
+
+ const newMigrationDataObj: INewMigration = {
+ ...newMigrationData,
+ test_migration: { stack_link: res?.data?.data?.url, stack_api_key: res?.data?.data?.data?.stack?.api_key }
+ };
+
+ dispatch(updateNewMigrationData((newMigrationDataObj)));
+ if (res?.status) {
setIsLoading(false);
- const url = `/projects/${projectId}/migration/steps/5`;
+ const url = `/projects/${projectId}/migration/steps/4`;
navigate(url, { replace: true });
await updateCurrentStepData(selectedOrganisation.value, projectId);
- handleStepChange(4);
+ handleStepChange(3);
}
+ }
- const handleOnClickFunctions = [
- handleOnClickLegacyCms,
- handleOnClickDestinationStack,
- handleOnClickContentMapper,
- handleOnClickTestMigration
- ];
+ const handleOnClickTestMigration = async () => {
+ setIsLoading(false);
+
+ const url = `/projects/${projectId}/migration/steps/5`;
+ navigate(url, { replace: true });
+
+ await updateCurrentStepData(selectedOrganisation.value, projectId);
+ handleStepChange(4);
+ }
+
+ const handleOnClickFunctions = [
+ handleOnClickLegacyCms,
+ handleOnClickDestinationStack,
+ handleOnClickContentMapper,
+ handleOnClickTestMigration
+ ];
+
+ const changeDropdownState = () =>{
+ const newMigrationDataObj: INewMigration = {
+ ...newMigrationData,
+ content_mapping: { ...newMigrationData?.content_mapping, isDropDownChanged: false }
+ };
+
+ dispatch(updateNewMigrationData((newMigrationDataObj)));
+ }
return (
@@ -313,7 +321,7 @@ const Migration = () => {
{ projectData &&
-
+
}
diff --git a/ui/src/pages/Projects/index.tsx b/ui/src/pages/Projects/index.tsx
index bfc9f6fc..2ba3960b 100644
--- a/ui/src/pages/Projects/index.tsx
+++ b/ui/src/pages/Projects/index.tsx
@@ -34,6 +34,7 @@ import { NO_PROJECTS, NO_PROJECTS_SEARCH } from '../../common/assets';
// styles
import './index.scss';
import { getUserDetails } from '../../store/slice/authSlice';
+import useBlockNavigation from '../../hooks/userNavigation';
const Projects = () => {
@@ -60,6 +61,7 @@ const Projects = () => {
const [allProjects, setAllProjects] = useState
([]);
const [loadStatus, setLoadStatus] = useState(true);
const [searchText, setSearchText] = useState(search);
+ const [isModalOpen, setIsModalOpen] = useState(false);
useEffect(()=>{
dispatch(getUserDetails());
@@ -132,9 +134,11 @@ const Projects = () => {
const onClose = () => {
fetchProjects();
};
-
+ useBlockNavigation(isModalOpen)
// Function for open modal
const openModal = () => {
+ setIsModalOpen(true);
+
cbModal({
component: (props: ModalObj) => (
{
createProjectModal && validateObject(createProjectModal) ? createProjectModal : {}
}
selectedOrg={selectedOrganisation}
+ isOpen={setIsModalOpen}
{...props}
/>
),
diff --git a/ui/src/pages/RegionalLogin/index.scss b/ui/src/pages/RegionalLogin/index.scss
index 2e8ad1f3..1a4bce16 100644
--- a/ui/src/pages/RegionalLogin/index.scss
+++ b/ui/src/pages/RegionalLogin/index.scss
@@ -31,7 +31,7 @@
word-wrap: break-word;
background-color: $color-base-white-5;
background-clip: border-box;
- border-radius: 0.5rem;
+ border-radius: 20px;
&:hover {
border: 3px solid #7c4dff;
[class*='link-arrow'] {
@@ -45,21 +45,23 @@
}
.cardBody {
color: $color-font-black;
+ display: flex;
flex: 1 1 auto;
- padding: 1.25rem 1.25rem;
+ flex-direction: column;
+ padding: 1.25rem 1.25rem 17px;
h2 {
font-size: 1.25rem;
font-weight: 700;
letter-spacing: 0;
}
p {
- color: $color-font-black;
+ color: $color-font-gray;
}
}
.CardFooter {
background-color: rgba(0, 0, 0, 0);
border-top: 0 solid rgba(34, 34, 34, 0.125);
- padding: 0.625rem 1.25rem;
+ padding: 0 1.25rem 0.625rem;
.stretched-link {
line-height: $line-height-default;
}
diff --git a/ui/src/pages/RegionalLogin/index.tsx b/ui/src/pages/RegionalLogin/index.tsx
index 2af72a93..9a9416cb 100644
--- a/ui/src/pages/RegionalLogin/index.tsx
+++ b/ui/src/pages/RegionalLogin/index.tsx
@@ -48,6 +48,9 @@ const RegionalLogin = () => {
case regionName === 'Europe' && serviceName === 'Microsoft Azure':
loginUrl = `/login?region=${REGIONS.AZURE_EU}`;
break;
+ case regionName === 'North America' && serviceName === 'Google Cloud Platform':
+ loginUrl = `/login?region=${REGIONS.GCP_NA}`;
+ break;
default:
loginUrl = `/login?region=${REGIONS.NA}`;
break;
@@ -63,52 +66,50 @@ const RegionalLogin = () => {
{heading &&
{heading}
}
{description && description != '' && (
-
{parse(description)}
+
{parse(description)}
)}
-
-
- {regions &&
- validateArray(regions) &&
- regions?.map((region, index) => (
-
-
-
-
- {region?.service_icon?.url && (
-

- )}
- {region?.service_title && (
-
{region?.service_title}
- )}
-
- {region?.region_title &&
{region?.region_title}
}
+
+ {regions &&
+ validateArray(regions) &&
+ regions?.map((region, index) => (
+
+
+
+
+ {region?.service_icon?.url && (
+

+ )}
+ {region?.service_title && (
+
{region?.service_title}
+ )}
- {region?.cta?.title && (
-
- )}
+ {region?.region_title &&
{region?.region_title}
}
+ {region?.cta?.title && (
+
+ )}
- ))}
-
+
+ ))}
diff --git a/ui/src/scss/App.scss b/ui/src/scss/App.scss
index 486af9c0..4e749a23 100644
--- a/ui/src/scss/App.scss
+++ b/ui/src/scss/App.scss
@@ -340,6 +340,9 @@ h2 {
.mb-30 {
margin-bottom: $space-30;
}
+.lh-condensed {
+ line-height: 1.3;
+}
.migration-steps-wrapper {
border-top: 1px solid $color-brand-secondary-lightest;
margin-top: 3.5rem;
diff --git a/ui/src/utilities/constants.ts b/ui/src/utilities/constants.ts
index 98529d75..01cdf591 100644
--- a/ui/src/utilities/constants.ts
+++ b/ui/src/utilities/constants.ts
@@ -25,7 +25,8 @@ export const REGIONS = {
NA: 'NA',
AZURE_NA: 'AZURE_NA',
EU: 'EU',
- AZURE_EU: 'AZURE_EU'
+ AZURE_EU: 'AZURE_EU',
+ GCP_NA: 'GCP_NA',
};
export const HEADERS = {
diff --git a/uplaode-api/migration-sitecore/libs/reference.js b/uplaode-api/migration-sitecore/libs/reference.js
index 898c560d..d4f3ba13 100644
--- a/uplaode-api/migration-sitecore/libs/reference.js
+++ b/uplaode-api/migration-sitecore/libs/reference.js
@@ -96,9 +96,9 @@ function ExtractRef() {
otherCmsType: "reference",
contentstackField: newKey,
contentstackFieldUid: uidCorrector({ uid: newKey }),
- ContentstackFieldType: "global_field",
+ ContentstackFieldType: "refernce",
isDeleted: false,
- backupFieldType: "global_field",
+ backupFieldType: "reference",
refrenceTo: key,
}
contentType.fieldMapping.push(schemaObject)