Skip to content
Merged

Dev #185

Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
546cbc2
[CMG-214] - Destination Stack | Error message is not showing when max…
sayalijoshi27 Jul 9, 2024
7d6658c
Merge pull request #178 from contentstack/feature/CMG-57
v1shalpatel Jul 9, 2024
2231f01
logs details
RohitKini Jul 10, 2024
9754728
logger
RohitKini Jul 10, 2024
7c24b73
Conflict resolved
sayalijoshi27 Jul 10, 2024
3473dea
Merge branch 'feature/profile-design' of https://github.com/contentst…
sayalijoshi27 Jul 10, 2024
b0ac49b
refactor:resolved duplicate mapper fields
AishDani Jul 10, 2024
2e3782b
refactor:removed console
AishDani Jul 10, 2024
5326ca9
Merge pull request #179 from contentstack/feature/legacy-cms
v1shalpatel Jul 10, 2024
a5e30cd
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 Jul 10, 2024
ad2adc9
Test Migration Logger screen completed
sayalijoshi27 Jul 10, 2024
d1531b5
Merge pull request #180 from contentstack/feature/profile-design
v1shalpatel Jul 10, 2024
ef423e9
refactor:legacy cms bugs
AishDani Jul 11, 2024
b04cd02
Merge branch 'dev' of github.com:contentstack/migration-v2-node-serve…
AishDani Jul 11, 2024
01225da
Merge pull request #181 from contentstack/feature/legacy-cms
v1shalpatel Jul 11, 2024
571a1ba
solved functional bugs on dest stack
snehalsankhe Jul 12, 2024
79a9be4
merged from dev
snehalsankhe Jul 12, 2024
29c4c83
Merge pull request #183 from contentstack/layout-changes
v1shalpatel Jul 12, 2024
8da6a61
refactor:destination stack modal bug resolved
AishDani Jul 12, 2024
cddcd75
Merge branch 'dev' of github.com:contentstack/migration-v2-node-serve…
AishDani Jul 12, 2024
520637c
Merge pull request #184 from contentstack/bugs-legacyCMS
v1shalpatel Jul 12, 2024
8d7eb78
refactor:close modal prop added
AishDani Jul 12, 2024
a0c0e38
Merge pull request #186 from contentstack/bugs-legacyCMS
v1shalpatel Jul 12, 2024
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
8 changes: 4 additions & 4 deletions ui/src/components/LegacyCms/Actions/LoadSelectCms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const LoadSelectCms = (props: LoadSelectCmsProps) => {
const [isLoading, setIsLoading] = useState<boolean>(false);

const { projectId = '' } = useParams();

/**** ALL METHODS HERE ****/

//Handle Legacy cms selection
Expand Down Expand Up @@ -214,9 +214,9 @@ const LoadSelectCms = (props: LoadSelectCmsProps) => {
</div>
:
isLoading ? (
<>
<CircularLoader size='small'/>
</>
<div className='loader'>
<CircularLoader/>
</div>
) :
(cmsData && validateArray(cmsData) && (
<div className="service_list_legacy">
Expand Down
9 changes: 7 additions & 2 deletions ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {

//Handle further action on file is uploaded to server
const handleOnFileUploadCompletion = async () => {
setValidationMessage('');
setIsLoading(true);
setProgressPercentage(30);
setShowProgress(true);
setProcessing('Processing..30%')

const res: any = await fileValidation(projectId);
setIsLoading(false);

const newMigrationDataObj: INewMigration = {
...newMigrationData,
Expand Down Expand Up @@ -161,7 +163,6 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
}, projectId);

setShowMessage(true);
setIsLoading(false);
setProgressPercentage(100);
setTimeout(() => {
setProcessing('Processing ...100%')
Expand Down Expand Up @@ -294,6 +295,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
setProcessing(savedState.processing);
}
if (savedState && savedState.isLoading) {

handleOnFileUploadCompletion();
}
},[]);
Expand Down Expand Up @@ -372,7 +374,10 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {

) :

<CircularLoader size='small'/>}
<div className='loader'>
<CircularLoader/>
</div>
}
{showMessage &&
(
<>
Expand Down
3 changes: 1 addition & 2 deletions ui/src/components/LegacyCms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const LegacyCMSComponent = forwardRef(({ legacyCMSData, projectData, isCompleted

//Update New Migration data;
const selectedCmsData: ICMSType = validateArray(data.all_cms)
? data.all_cms?.some((cms: ICMSType) => {
? data.all_cms?.find((cms: ICMSType) => {
return cms?.cms_id === legacyCMSData?.cms})
: DEFAULT_CMS_TYPE;

Expand Down Expand Up @@ -174,7 +174,6 @@ const LegacyCMSComponent = forwardRef(({ legacyCMSData, projectData, isCompleted
dispatch(updateNewMigrationData({
...newMigrationData,
legacy_cms: {
...newMigrationData?.legacy_cms,
currentStep: internalActiveStepIndex,
selectedCms: selectedCmsData,
selectedFileFormat: selectedFileFormatData || newMigrationData?.legacy_cms?.selectedFileFormat ,
Expand Down
8 changes: 8 additions & 0 deletions ui/src/components/LegacyCms/legacyCms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,11 @@
flex-direction: row;
gap: 30px;
}
.loader{
margin-left: 20px;
.CircularLoader--size-small{
width: 2rem !important;
height: 2rem !important;
}

}
8 changes: 4 additions & 4 deletions uplaode-api/migration-sitecore/libs/contenttypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const templatesComponents = ({ path, basePath }) => {
const allFields = [];
const allPaths = read(path?.[i]?.pth)
for (let j = 0; j < allPaths?.length; j++) {
if (allPaths?.[j]?.includes("/data.json") || allPaths?.[j]?.includes("/data.json.json")) {
if (allPaths?.[j]?.endsWith("/data.json")) {
const innerField = [];
const components = helper.readFile(
`${path?.[i]?.pth}/${allPaths?.[j]}`
Expand Down Expand Up @@ -415,7 +415,7 @@ const contentTypeMapper = ({ components, standardValues, content_type, basePath,
const optionsPath = read(`${sitecore_folder}/master/sitecore/content/Common/${isDataSourcePresent}`)
const refName = [];
optionsPath?.forEach((newPath) => {
if (newPath?.includes("data.json.json") | newPath?.includes("data.json")) {
if (newPath?.endsWith("data.json.json")) {
const data = helper.readFile(`${sitecore_folder}/master/sitecore/content/Common/${isDataSourcePresent}/${newPath}`)
if (data?.item?.$?.template) {
refName.push(data?.item?.$?.template)
Expand Down Expand Up @@ -520,7 +520,7 @@ function singleContentTypeCreate({ templatePaths, globalPath, sitecore_folder })
let templatesStandaedValuePath = {};
let templatesMetaDataPath = {};
for (let i = 0; i < newPath?.length; i++) {
if (newPath?.[i]?.includes("data.json") || newPath?.[i]?.includes("/data.json.json")) {
if (newPath?.[i]?.endsWith("data.json")) {
const data = helper?.readFile(`${templatePaths}/${newPath?.[i]}`);
if (data?.item?.$?.template === "template section") {
templatesComponentsPath?.push(
Expand Down Expand Up @@ -562,7 +562,7 @@ function ExtractContentTypes(sitecore_folder) {
const folder = read(sitecore_folder);
const templatePaths = [];
for (let i = 0; i < folder?.length; i++) {
if (folder?.[i]?.includes("templates") && (folder?.[i]?.includes("/data.json") || folder?.[i]?.includes("/data.json.json"))) {
if (folder?.[i]?.includes("templates") && folder?.[i]?.endsWith("/data.json")) {
const data = helper?.readFile(`${sitecore_folder}/${folder?.[i]}`)
if (data?.item?.$?.template === "template") {
templatePaths?.push(`${sitecore_folder}/${folder?.[i]}`?.split("/{")?.[0])
Expand Down