diff --git a/api/src/config/dev.config.ts b/api/src/config/dev.config.ts index 64c424800..094ae98da 100644 --- a/api/src/config/dev.config.ts +++ b/api/src/config/dev.config.ts @@ -4,6 +4,8 @@ export const devConfig = { EU: "https://stag-eu-api.csnonprod.com/v3", AZURE_NA: "https://stag-azure-na-api.csnonprod.com/v3", GCP_NA: "https://stag-gcp-na-api.csnonprod.com/v3", + AU:"https://stag-au-api.csnonprod.com/v3", + GCP_EU: "https://stag-gcp-eu-api.csnonprod.com/v3", }, CS_URL: { NA: "https://app.contentstack.com/#!", @@ -11,6 +13,8 @@ export const devConfig = { AZURE_NA: "https://azure-na-app.contentstack.com/#!", AZURE_EU: "https://azure-eu-app.contentstack.com/#!", GCP_NA: "https://gcp-na-app.contentstack.com/#!", + AU: "https://au-app.contentstack.com/#!", + GCP_EU: "https://gcp-eu-app.contentstack.com/#!", }, LOG_FILE_PATH: process.platform === "win32" ? ".\\combine.log" : "./combine.log", // Replace with the actual path to your log file diff --git a/api/src/config/index.ts b/api/src/config/index.ts index 5290be089..774956ee7 100644 --- a/api/src/config/index.ts +++ b/api/src/config/index.ts @@ -27,6 +27,8 @@ export type ConfigType = { AZURE_NA: string; AZURE_EU?: string; GCP_NA?: string; + AU?: string; + GCP_EU?: string; }; CS_URL: { NA: string; @@ -34,6 +36,8 @@ export type ConfigType = { AZURE_NA: string; AZURE_EU?: string; GCP_NA?: string; + AU?: string; + GCP_EU?: string; }; LOG_FILE_PATH: string; }; diff --git a/api/src/config/prod.config.ts b/api/src/config/prod.config.ts index 07f9ef2af..1c7d6a471 100644 --- a/api/src/config/prod.config.ts +++ b/api/src/config/prod.config.ts @@ -5,6 +5,8 @@ export const prodConfig = { AZURE_NA: "https://azure-na-api.contentstack.com/v3", AZURE_EU: "https://azure-eu-api.contentstack.com/v3", GCP_NA: "https://gcp-na-api.contentstack.com/v3", + AU: "https://au-api.contentstack.com/v3", + GCP_EU: "https://gcp-eu-api.contentstack.com/v3", }, CS_URL: { NA: "https://app.contentstack.com/#!", @@ -12,6 +14,8 @@ export const prodConfig = { AZURE_NA: "https://azure-na-app.contentstack.com/#!", AZURE_EU: "https://azure-eu-app.contentstack.com/#!", GCP_NA: "https://gcp-na-app.contentstack.com/#!", + AU: "https://au-app.contentstack.com/#!", + GCP_EU: "https://gcp-eu-app.contentstack.com/#!", }, LOG_FILE_PATH: process.platform === "win32" ? ".\\sample.log" : "./sample.log", // Replace with the actual path to your log file diff --git a/api/src/constants/index.ts b/api/src/constants/index.ts index f8284c9fc..2ad157f4e 100644 --- a/api/src/constants/index.ts +++ b/api/src/constants/index.ts @@ -1,10 +1,12 @@ -export const CS_REGIONS = ["NA", "EU", "AZURE_NA", "AZURE_EU", "GCP_NA"]; +export const CS_REGIONS = ["NA", "EU", "AZURE_NA", "AZURE_EU", "GCP_NA", "AU", "GCP_EU"]; export const DEVURLS: any = { NA: "developerhub-api.contentstack.com", EU: "eu-developerhub-api.contentstack.com", AZURE_NA: "azure-na-developerhub-api.contentstack.com", AZURE_EU: "azure-eu-developerhub-api.contentstack.com", GCP_NA: "gcp-na-developerhub-api.contentstack.com", + AU: "au-developerhub-api.contentstack.com", + GCP_EU: "gcp-eu-developerhub-api.contentstack.com", }; export const CMS = { CONTENTFUL: "contentful", diff --git a/api/src/services/aem.service.ts b/api/src/services/aem.service.ts index dab652aae..f86871ad3 100644 --- a/api/src/services/aem.service.ts +++ b/api/src/services/aem.service.ts @@ -708,6 +708,21 @@ function processFieldsRecursive( obj[uid] = jsonData; break; } + case 'html': { + const aemFieldName = field?.otherCmsField ? getLastKey(field?.otherCmsField, ' > ') : field?.uid; + const value = getFieldValue(items, aemFieldName); + const uid = getLastKey(field?.contentstackFieldUid); + + let htmlContent = ''; + + if (typeof value === 'string') { + htmlContent = value; + } else if (value && typeof value === 'object') { + htmlContent = value?.text || value?.content || ''; + } + obj[uid] = htmlContent; + break; + } case 'link': { const value = { title: getFieldValue(items, 'title') ?? '', diff --git a/docker-compose.yml b/docker-compose.yml index c223cf244..72ececfa4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: "3.8" + services: api: container_name: migration-api @@ -6,10 +7,18 @@ services: context: ./api ports: - "5001:5001" - restart: always + restart: unless-stopped volumes: - - ${CMS_DATA_PATH}:${CONTAINER_PATH} + - ${DOCKER_MOUNT_PATH:-${CMS_DATA_PATH}}:${CONTAINER_PATH}:ro - shared_data:/app/extracted_files + environment: + - NODE_ENV=${NODE_ENV:-production} + - CMS_TYPE=${CMS_TYPE} + - CONTAINER_PATH=${CONTAINER_PATH} + - CMS_DATA_PATH=${CMS_DATA_PATH} + - AEM_TEMPLATES_DIR=${AEM_TEMPLATES_DIR:-templates} + networks: + - migration-network security_opt: - no-new-privileges:true @@ -19,12 +28,23 @@ services: context: ./upload-api ports: - "4002:4002" - restart: always + restart: unless-stopped volumes: - - ${CMS_DATA_PATH}:${CONTAINER_PATH} + - ${DOCKER_MOUNT_PATH:-${CMS_DATA_PATH}}:${CONTAINER_PATH}:ro - shared_data:/app/extracted_files + environment: + - NODE_ENV=${NODE_ENV:-production} + - CMS_TYPE=${CMS_TYPE} + - CONTAINER_PATH=${CONTAINER_PATH} + - CMS_DATA_PATH=${CMS_DATA_PATH} + - NODE_BACKEND_API=${NODE_BACKEND_API:-http://migration-api:5001} + - AEM_TEMPLATES_DIR=${AEM_TEMPLATES_DIR:-templates} + networks: + - migration-network security_opt: - no-new-privileges:true + depends_on: + - api ui: container_name: migration-ui @@ -32,9 +52,23 @@ services: context: ./ui ports: - "3000:3000" - restart: always + restart: unless-stopped + environment: + - NODE_ENV=${NODE_ENV:-production} + - REACT_APP_API_URL=${REACT_APP_API_URL:-http://localhost:5001} + - REACT_APP_UPLOAD_API_URL=${REACT_APP_UPLOAD_API_URL:-http://localhost:4002} + networks: + - migration-network security_opt: - no-new-privileges:true + depends_on: + - api + - upload-api + +networks: + migration-network: + driver: bridge volumes: shared_data: + driver: local \ No newline at end of file diff --git a/setup-docker.sh b/setup-docker.sh index 35bc8ac4d..08afcb8fb 100755 --- a/setup-docker.sh +++ b/setup-docker.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Choose the CMS (numbers):" -select CMS_TYPE in "sitecore" "contentful" "wordpress"; do +select CMS_TYPE in "sitecore" "contentful" "wordpress" "aem"; do case $CMS_TYPE in sitecore) EXAMPLE_FILE="sitecore.zip" @@ -15,20 +15,26 @@ select CMS_TYPE in "sitecore" "contentful" "wordpress"; do EXAMPLE_FILE="wordpress.xml" break ;; + aem) + EXAMPLE_FILE="aem_data_structure" + break + ;; *) - echo "Invalid option. Please select 1, 2, or 3." + echo "Invalid option. Please select 1, 2, 3, or 4." ;; esac done -read -p "Enter the full path to your $CMS_TYPE data file (e.g., $EXAMPLE_FILE): " CMS_DATA_PATH - -# Remove surrounding quotes if they exist -CMS_DATA_PATH="${CMS_DATA_PATH%\"}" -CMS_DATA_PATH="${CMS_DATA_PATH#\"}" +# Prompt for the CMS data path +echo "Enter the path to your $CMS_TYPE data:" +if [[ "$CMS_TYPE" == "aem" ]]; then + echo "(Path should contain a 'templates' folder with JSON files, or provide direct path to templates folder)" +fi +read -r CMS_DATA_PATH -# Store original Windows path for Docker volume mounting +# Store original path for Docker (Windows paths work with Docker Desktop) ORIGINAL_PATH="$CMS_DATA_PATH" +DOCKER_MOUNT_PATH="$CMS_DATA_PATH" # Path to mount in Docker # Convert Windows path to Unix format for Git Bash file operations ONLY UNIX_PATH="$CMS_DATA_PATH" @@ -39,15 +45,60 @@ if [[ "$CMS_DATA_PATH" =~ ^[A-Za-z]:\\ ]]; then UNIX_PATH=$(echo "$UNIX_PATH" | sed 's/^\([A-Za-z]\):/\/\L\1/') fi -# Check if file exists using the converted path -if [ ! -f "$UNIX_PATH" ]; then - echo "❌ File does not exist: $UNIX_PATH" - exit 1 +# Check if file/directory exists using the converted path +if [[ "$CMS_TYPE" == "aem" ]]; then + # For AEM, check if it's a directory + if [ ! -d "$UNIX_PATH" ]; then + echo "❌ Directory does not exist: $UNIX_PATH" + echo "Please provide the path to your AEM data structure folder" + exit 1 + fi + + # Check if the provided path IS the templates folder + if [[ "$(basename "$UNIX_PATH")" == "templates" ]]; then + # User provided the templates folder directly + TEMPLATES_PATH="$UNIX_PATH" + # Get parent directory for Docker mounting + UNIX_MOUNT_PATH="$(dirname "$UNIX_PATH")" + DOCKER_MOUNT_PATH="$(dirname "$ORIGINAL_PATH")" + echo "ℹ️ Detected direct templates path, using parent folder for Docker mounting" + else + # User provided the parent folder + TEMPLATES_PATH="$UNIX_PATH/templates" + UNIX_MOUNT_PATH="$UNIX_PATH" + + # Verify templates folder exists + if [ ! -d "$TEMPLATES_PATH" ]; then + echo "❌ 'templates' folder not found in: $UNIX_PATH" + echo "Expected structure: your-folder/templates/*.json" + echo "Or provide the direct path to the templates folder" + exit 1 + fi + fi + + # Check if templates folder contains JSON files + JSON_COUNT=$(find "$TEMPLATES_PATH" -maxdepth 1 -name "*.json" -type f 2>/dev/null | wc -l) + if [ "$JSON_COUNT" -eq 0 ]; then + echo "❌ No JSON files found in templates folder: $TEMPLATES_PATH" + echo "Please ensure your templates folder contains template JSON files" + exit 1 + fi + + echo "✅ Found $JSON_COUNT JSON template file(s) in templates folder" + + FILENAME=$(basename "$UNIX_MOUNT_PATH") + CONTAINER_PATH="/data/$FILENAME" +else + # For other CMS types, check if it's a file + if [ ! -f "$UNIX_PATH" ]; then + echo "❌ File does not exist: $UNIX_PATH" + exit 1 + fi + + FILENAME=$(basename "$UNIX_PATH") + CONTAINER_PATH="/data/$FILENAME" fi -FILENAME=$(basename "$UNIX_PATH") -CONTAINER_PATH="/data/$FILENAME" - export CMS_TYPE export CMS_DATA_PATH="$ORIGINAL_PATH" export CONTAINER_PATH @@ -73,11 +124,19 @@ set_env_var() { } set_env_var "CMS_TYPE" "$CMS_TYPE" -# Use original Windows path for Docker volume mounting +# Save the full path to templates (what user provided) set_env_var "CMS_DATA_PATH" "$ORIGINAL_PATH" +# Save the Docker mount path (may be parent directory for AEM) +set_env_var "DOCKER_MOUNT_PATH" "$DOCKER_MOUNT_PATH" set_env_var "CONTAINER_PATH" "$CONTAINER_PATH" set_env_var "NODE_BACKEND_API" "http://migration-api:5001" +# Set AEM-specific environment variables +if [[ "$CMS_TYPE" == "aem" ]]; then + set_env_var "AEM_TEMPLATES_DIR" "templates" + echo "ℹ️ Set AEM_TEMPLATES_DIR to: templates" +fi + # Check if docker-compose.yml exists before running if [ ! -f "docker-compose.yml" ]; then echo "❌ docker-compose.yml not found in current directory" @@ -87,10 +146,30 @@ if [ ! -f "docker-compose.yml" ]; then exit 1 fi +# Check if Docker is running +if ! docker info > /dev/null 2>&1; then + echo "" + echo "❌ Docker is not running!" + echo "Please start Docker Desktop and try again." + exit 1 +fi + +echo "" echo "✅ Starting Docker Compose with the following configuration:" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "CMS_TYPE: $CMS_TYPE" -echo "CMS_DATA_PATH (for Docker): $ORIGINAL_PATH" -echo "CMS_DATA_PATH (for file check): $UNIX_PATH" -echo "CONTAINER_PATH: $CONTAINER_PATH" +echo "CMS_DATA_PATH: $ORIGINAL_PATH" +if [[ "$CMS_TYPE" == "aem" ]]; then + echo "DOCKER_MOUNT_PATH: $DOCKER_MOUNT_PATH" + echo "CONTAINER_PATH: $CONTAINER_PATH" + echo "Templates accessible at: $CONTAINER_PATH/templates" +else + echo "CONTAINER_PATH: $CONTAINER_PATH" +fi +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" + +# Export for docker-compose +export DOCKER_MOUNT_PATH MSYS_NO_PATHCONV=1 docker compose up --build \ No newline at end of file diff --git a/upload-api/migration-aem/libs/contentType/components/BreadcrumbComponent.ts b/upload-api/migration-aem/libs/contentType/components/BreadcrumbComponent.ts index 10735f12c..627539f12 100644 --- a/upload-api/migration-aem/libs/contentType/components/BreadcrumbComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/BreadcrumbComponent.ts @@ -29,13 +29,13 @@ export class BreadcrumbComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), object: (key, schemaProp) => { // For breadcrumb, handle the link object @@ -44,7 +44,7 @@ export class BreadcrumbComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp?.properties?.url?.value + defaultValue: "" }).toContentstack(); } return null; diff --git a/upload-api/migration-aem/libs/contentType/components/ButtonComponent.ts b/upload-api/migration-aem/libs/contentType/components/ButtonComponent.ts index 2bb78761b..ab5cd5cb5 100644 --- a/upload-api/migration-aem/libs/contentType/components/ButtonComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/ButtonComponent.ts @@ -51,14 +51,14 @@ export class ButtonComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: (key, schemaProp) => { const urlValue = schemaProp?.properties?.url?.value; @@ -67,7 +67,7 @@ export class ButtonComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: urlValue + defaultValue: "" }).toContentstack(); } return null; diff --git a/upload-api/migration-aem/libs/contentType/components/CarouselComponent.ts b/upload-api/migration-aem/libs/contentType/components/CarouselComponent.ts index 8e04f7234..ee9212c0d 100644 --- a/upload-api/migration-aem/libs/contentType/components/CarouselComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/CarouselComponent.ts @@ -32,20 +32,20 @@ export class CarouselComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: (fieldKey: string, schemaProp: SchemaProperty): any => { const normalizedUid = uidCorrector(fieldKey) diff --git a/upload-api/migration-aem/libs/contentType/components/ImageComponent.ts b/upload-api/migration-aem/libs/contentType/components/ImageComponent.ts index f43f5569a..80219b181 100644 --- a/upload-api/migration-aem/libs/contentType/components/ImageComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/ImageComponent.ts @@ -38,20 +38,20 @@ export class ImageComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack() }, boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value, + defaultValue: "", isNumber: true }).toContentstack(), object: () => null, diff --git a/upload-api/migration-aem/libs/contentType/components/NavigationComponent.ts b/upload-api/migration-aem/libs/contentType/components/NavigationComponent.ts index c784d8cde..4f96669a7 100644 --- a/upload-api/migration-aem/libs/contentType/components/NavigationComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/NavigationComponent.ts @@ -51,20 +51,20 @@ export class NavigationComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: (key, schemaProp) => { const urlValue = schemaProp?.properties?.url?.value; @@ -73,7 +73,7 @@ export class NavigationComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: urlValue + defaultValue: "" }).toContentstack(); } return null; diff --git a/upload-api/migration-aem/libs/contentType/components/ProductListingComponent.ts b/upload-api/migration-aem/libs/contentType/components/ProductListingComponent.ts index dfa82f586..018d107cd 100644 --- a/upload-api/migration-aem/libs/contentType/components/ProductListingComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/ProductListingComponent.ts @@ -37,20 +37,20 @@ export class ProductListingComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: () => null, array: () => null diff --git a/upload-api/migration-aem/libs/contentType/components/SearchComponent.ts b/upload-api/migration-aem/libs/contentType/components/SearchComponent.ts index c888ca814..1c2539206 100644 --- a/upload-api/migration-aem/libs/contentType/components/SearchComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/SearchComponent.ts @@ -1,5 +1,5 @@ import { ContentstackComponent } from '../fields'; -import { BooleanField, GroupField, TextField } from '../fields/contentstackFields'; +import { BooleanField, GroupField, TextField } from '../fields/contentstackFields'; // ADD NumberField import { SchemaProperty } from './index.interface'; const searchExclude = [ @@ -33,20 +33,19 @@ export class SearchComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", - isNumber: true, - defaultValue: schemaProp.value + defaultValue: null }).toContentstack(), object: () => null, array: () => null diff --git a/upload-api/migration-aem/libs/contentType/components/SpacerComponent.ts b/upload-api/migration-aem/libs/contentType/components/SpacerComponent.ts index 4c63e4f34..0ca93775f 100644 --- a/upload-api/migration-aem/libs/contentType/components/SpacerComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/SpacerComponent.ts @@ -32,20 +32,20 @@ export class SpacerComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: () => null, array: () => null diff --git a/upload-api/migration-aem/libs/contentType/components/TeaserComponent.ts b/upload-api/migration-aem/libs/contentType/components/TeaserComponent.ts index 48f56d2a9..b8e583315 100644 --- a/upload-api/migration-aem/libs/contentType/components/TeaserComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/TeaserComponent.ts @@ -53,20 +53,19 @@ export class TeaserComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", - isNumber: true, - defaultValue: schemaProp.value + defaultValue: null }).toContentstack(), object: (key, schemaProp) => { const data = { convertedSchema: schemaProp } @@ -80,7 +79,7 @@ export class TeaserComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: urlValue + defaultValue: "" }).toContentstack(); } return null; diff --git a/upload-api/migration-aem/libs/contentType/components/TextBannerComponent.ts b/upload-api/migration-aem/libs/contentType/components/TextBannerComponent.ts index a22d33daf..04fd54c99 100644 --- a/upload-api/migration-aem/libs/contentType/components/TextBannerComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/TextBannerComponent.ts @@ -31,27 +31,27 @@ export class TextBannerComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack() : new TextField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack() }, boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: () => null, array: (key, schemaProp) => { diff --git a/upload-api/migration-aem/libs/contentType/components/TextComponent.ts b/upload-api/migration-aem/libs/contentType/components/TextComponent.ts index 65654b219..66dbd2e48 100644 --- a/upload-api/migration-aem/libs/contentType/components/TextComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/TextComponent.ts @@ -66,7 +66,7 @@ export class TextComponent extends ContentstackComponent { const name = 'text'; const type = 'Rich Text'; const uid = 'text'; - const default_value = component?.convertedSchema?.properties?.text?.value || ''; + const default_value = ''; const isRichText = this.processTextComponents(component) ?? this.isText(component); if (isRichText) { diff --git a/upload-api/migration-aem/libs/contentType/components/TitleComponent.ts b/upload-api/migration-aem/libs/contentType/components/TitleComponent.ts index d946cecc5..9266dcd30 100644 --- a/upload-api/migration-aem/libs/contentType/components/TitleComponent.ts +++ b/upload-api/migration-aem/libs/contentType/components/TitleComponent.ts @@ -48,20 +48,20 @@ export class TitleComponent extends ContentstackComponent { uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), boolean: (key, schemaProp) => new BooleanField({ uid: key, displayName: key, description: "", - defaultValue: schemaProp.value + defaultValue: false }).toContentstack(), integer: (key, schemaProp) => new TextField({ uid: key, displayName: key, description: "", isNumber: true, - defaultValue: schemaProp.value + defaultValue: "" }).toContentstack(), object: () => null, array: () => null