Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions ui/src/cmsData/legacyCms.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
},
"title": "Select CMS",
"description": "Select the CMS you are migrating content from",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration",
"lock": false,
"active": true,
"empty_step_placeholder": "No CMS selected..."
Expand All @@ -339,7 +339,7 @@
},
"title": "Add Source Affix",
"description": "Add a 2–5 character affix for the source name. Use only letters, no numbers or special characters",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration",
"lock": false,
"active": false,
"empty_step_placeholder": "No affix Entered..."
Expand All @@ -351,7 +351,7 @@
},
"title": "Select File Format",
"description": "Select the file format compatible with the selected CMS",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration",
"lock": false,
"active": true,
"empty_step_placeholder": "No File Format selected..."
Expand All @@ -363,7 +363,7 @@
},
"title": "Uploaded File",
"description": "This is the file you have uploaded",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.",
"step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration",
"lock": false,
"active": true,
"empty_step_placeholder": "No File Uploaded..."
Expand All @@ -373,7 +373,7 @@
"title": "https://www.contentstack.com/docs/developers/create-content-types/restricted-keywords-for-uids",
"href": "https://www.contentstack.com/docs/developers/create-content-types/restricted-keywords-for-uids"
},
"file_format_checkbox_text": "Please acknowledge that you have read the file export guidelines.",
"file_format_checkbox_text": "Please acknowledge that you have read the file export guidelines",
"restricted_keyword_checkbox_text": "Please acknowledge that you have referred to the Contentstack restricted keywords",
"affix_cta": "Continue",
"file_format_cta": "Continue"
Expand Down
10 changes: 7 additions & 3 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,12 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
useBlockNavigation(isModalOpen);
// Method to fetch content types
const fetchContentTypes = async (searchText: string) => {
setIsLoading(true);

try {
setIsLoading(true);
const { data } = await getContentTypes(projectId || '', 0, 5000, searchContentType || ''); //org id will always present

setIsLoading(false);
setContentTypes(data?.contentTypes);
setCount(data?.contentTypes?.length);
setFilteredContentTypes(data?.contentTypes);
Expand Down Expand Up @@ -670,8 +672,8 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R

const validTableData = data?.fieldMapping?.filter((field: FieldMapType) => field?.otherCmsType !== undefined);

setTableData(validTableData || []);
setSelectedEntries(validTableData);
setTableData(validTableData ?? []);
setSelectedEntries(validTableData ?? []);
setTotalCounts(validTableData?.length);
setInitialRowSelectedData(validTableData?.filter((item: FieldMapType) => !item?.isDeleted))
setIsLoading(false);
Expand Down Expand Up @@ -1072,6 +1074,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
maxWidth="290px"
isClearable={false}
options={option}
menuPlacement="auto"
isDisabled={
data?.otherCmsType === "Group" ||
data?.otherCmsField === 'title' ||
Expand Down Expand Up @@ -1577,6 +1580,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
isClearable={selectedOptions?.includes?.(existingField?.[data?.uid]?.label ?? '')}
options={adjustedOptions}
isDisabled={OptionValue?.isDisabled || newMigrationData?.project_current_step > 4}
menuPlacement="auto"
/>
</div>
{(!OptionValue?.isDisabled || OptionValue?.label === 'Dropdown'||
Expand Down
27 changes: 13 additions & 14 deletions ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Mapper = ({
if (selectedCsOptions?.length === 0) {
setcsOptions(options);
}

}, [options]);

useEffect(() => {
Expand All @@ -79,15 +80,16 @@ const Mapper = ({
useEffect(() => {
const formattedoptions = options?.filter(
(item: { label: string; value: string }) =>
!selectedCsOptions?.some((selected: string) => selected === item?.value)
!selectedCsOptions?.some((selected: string) => selected === item?.value) && !cmsLocaleOptions?.some((locale: {label: string, value: string}) => locale?.label === item?.value)
);

const adjustedOptions = sourceOptions?.filter(
(item: { label: string; value: string }) =>
!selectedSourceOption?.some((selected: string) => selected === item?.label)
);
setcsOptions(formattedoptions);
setsourceoptions(adjustedOptions);
}, [selectedCsOptions, selectedSourceOption]);
}, [selectedCsOptions, selectedSourceOption, options]);

useEffect(() => {
setExistingField((prevExisting: ExistingFieldType) => {
Expand Down Expand Up @@ -117,6 +119,12 @@ const Mapper = ({
type: 'csLocale' | 'sourceLocale'
) => {
const selectedLocaleKey = selectedValue?.value;

if (!selectedValue?.label) {
setselectedCsOption((prevSelected) =>
prevSelected?.filter((item) => item !== existingField?.[index]?.label)
);
}


setExistingField((prevOptions: ExistingFieldType) => {
Expand Down Expand Up @@ -285,6 +293,7 @@ const Mapper = ({
isDisabled={true} // Ensure it's disabled
className="select-container"
noOptionsMessage={() => ''}
menuPlacement="auto"
/>
</div>
</Tooltip>
Expand All @@ -306,6 +315,7 @@ const Mapper = ({
isClearable={true}
isDisabled={isDisabled}
className="select-container"
menuPlacement="auto"
/>
)}
<span className="span">-</span>
Expand Down Expand Up @@ -354,6 +364,7 @@ const Mapper = ({
isClearable={true}
isDisabled={isDisabled}
className="select-container"
menuPlacement="auto"
/>
}
<div className={''}>
Expand Down Expand Up @@ -508,21 +519,9 @@ const LanguageMapper = () => {
isDisabled={newMigrationData?.project_current_step > 2}
/>
}
// footerComponent={
// <Button className="ml-10 mt-10 mb-10"
// buttonType="secondary"
// version={'v2'}
// icon="AddPlus"
// onClick={addRowComp}
// size='small'>
// Add Language
// </Button>

// }
type="Secondary"
/>
<Button
className="mt-10"
buttonType="secondary"
aria-label="add language"
version={'v2'}
Expand Down
13 changes: 2 additions & 11 deletions ui/src/components/DestinationStack/DestinationStack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@
align-items: center;
padding: $px-10;
}
.lang-container {
//display: flex;
//flex-wrap: wrap;
//padding: $px-20;
//padding-bottom: 50px;
}
.language-mapper {
border-top: 1px solid $color-brand-secondary-lightest;
margin-top: 16px;
Expand All @@ -212,7 +206,6 @@
&.Field--full {
.field-content {
width: 100% !important;
//border-left: none !important;
}
}
}
Expand Down Expand Up @@ -250,13 +243,11 @@
margin-top: 10px;
overflow: visible !important;
position: relative;
//width: 120px;
}
.lang-container {
// margin-bottom: 30px;
// margin-left: 10px;
// margin-top: 10px;
display: flex;
margin-bottom: 20px;
margin-top: 10px;
}
.info-tag {
max-width: 500px;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/LegacyCms/Actions/LoadPrefix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
} else if (!isValidPrefix(value)) {
setIsRestrictedKey(false);
setIsError(true);
setErrorMessage('Affix must be 2 to 5 letters, with no numbers or special characters.');
setErrorMessage('Affix must be 2 to 5 letters, with no numbers or special characters');
const newMigrationDataObj: INewMigration = {
...newMigrationData,
legacy_cms: {
Expand Down
Loading