Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
refactor:resolved PR comments
  • Loading branch information
AishDani committed May 2, 2024
commit 479f677ebaab8574e5f7fd4635d6bc145835ccb6
4 changes: 2 additions & 2 deletions ui/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const CardList = ({ project }: ProjectType) => {
useEffect(() => {
const fetchProject = async () => {
if (selectedOrganisation?.value && project?.id) {
const { data, status } = await getProject(selectedOrganisation.value, project.id);
const { data, status } = await getProject(selectedOrganisation?.value, project?.id);
if (status === 200 && data?.legacy_cms) {
setprojectDetails(data.legacy_cms.cms);
setprojectDetails(data?.legacy_cms.cms);
}
}
};
Expand Down
14 changes: 7 additions & 7 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const ContentMapper = () => {
if (isContentTypeSaved) {
tableData?.forEach((row) => {
if (row?.contentstackField) {
updatedExstingField[row.uid] = {
updatedExstingField[row?.uid] = {
label: row?.contentstackField,
value: row?.contentstackField
};
Expand Down Expand Up @@ -295,7 +295,7 @@ const ContentMapper = () => {

const otherTitle = contentTypes?.[i]?.otherCmsTitle;
setOtherCmsTitle(otherTitle);
const option = contentTypeMapped?.[otherTitle] ?? 'select Content Type';
const option = contentTypeMapped?.[otherTitle] ?? 'Select Content Type';
setOtherContentType({ label: option, value: option });

setContentTypeUid(contentTypes?.[i]?.id);
Expand Down Expand Up @@ -386,8 +386,8 @@ const ContentMapper = () => {
const handleValueChange = (value: FieldTypes, rowIndex: string) => {
setisDropDownCHanged(true);
setFieldValue(value);
const updatedRows = tableData.map((row) => {
if (row.uid === rowIndex) {
const updatedRows = tableData?.map((row) => {
if (row?.uid === rowIndex) {
return { ...row, ContentstackFieldType: value?.value };
}
return row;
Expand Down Expand Up @@ -489,12 +489,12 @@ const ContentMapper = () => {
if (isDropDownChanged && isContentTypeSaved) {
setSelectedOptions((prevSelected) => {
const newValue = selectedValue?.label;
return prevSelected.includes(newValue) ? prevSelected : [...prevSelected, newValue];
return prevSelected?.includes(newValue) ? prevSelected : [...prevSelected, newValue];
});
}

const updatedRows = tableData.map((row) => {
if (row.uid === rowIndex) {
if (row?.uid === rowIndex) {
return { ...row, contentstackField: selectedValue?.label };
}
return row;
Expand Down Expand Up @@ -786,7 +786,7 @@ const ContentMapper = () => {

const adjustedOption = options.map((option: any) => ({
...option,
isDisabled: contentTypeMapped && Object.values(contentTypeMapped).includes(option.label)
isDisabled: contentTypeMapped && Object.values(contentTypeMapped).includes(option?.label)
}));

const [SelectedAssets, updateSelectedAssets] = useState({});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
};
updateNewMigrationData(newMigrationDataObj);

props.handleStepChange(props.currentStep, true);
props.handleStepChange(props?.currentStep, true);
};

const allowedFileExtentions = `.${
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/LegacyCms/Summary/UploadFileSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const UploadFileSummary = ({
</span>

{!newMigrationData?.legacy_cms?.uploadedFile?.isValidated ? (
<p className=" ValidationMessage__v2">Please upload the correct file</p>
<p className="ValidationMessage__v2">Please upload the correct file</p>
) : (
<></>
)}
Expand All @@ -54,7 +54,7 @@ const UploadFileSummary = ({
<div className="col-12 bg-white">
<span className="summary-title">{stepData?.empty_step_placeholder}</span>
{!newMigrationData?.legacy_cms?.uploadedFile?.isValidated ? (
<p className=" ValidationMessage__v2">Please upload the correct file</p>
<p className="ValidationMessage__v2">Please upload the correct file</p>
) : (
<></>
)}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/LegacyCms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const LegacyCMSComponent = ({ legacyCMSData, projectData }: LegacyCMSComponentPr
steps={getLegacyCMSSteps(
isCompleted,
isMigrationLocked,
migrationData.legacyCMSData.all_steps
migrationData?.legacyCMSData.all_steps
)}
isEdit={!isMigrationLocked}
handleOnAllStepsComplete={handleOnAllStepsComplete}
Expand Down