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
14 changes: 7 additions & 7 deletions ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"jsxBracketSameLine": true
}
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"jsxBracketSameLine": true
}
8 changes: 2 additions & 6 deletions ui/packaga-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -6905,9 +6905,7 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz",
"integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==",
"engines": [
"node >= 0.8.0"
],
"engines": ["node >= 0.8.0"],
"bin": {
"ansi-html": "bin/ansi-html"
}
Expand Down Expand Up @@ -11330,9 +11328,7 @@
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"os": ["darwin"],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
Expand Down
6 changes: 0 additions & 6 deletions ui/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ const CardList = ({ project }: ProjectType) => {
<span className="ProjectCard__stats-number">Project Status</span>
<span className="ProjectCard__stats-category">{project?.status}</span>
</div>
<div className="ProjectCard__unit">
<span className="ProjectCard__stats-number">Current Status</span>
<span className="ProjectCard__stats-category validation-color">
Validation Failed
</span>
</div>
</div>
</div>
<div className="ProjectCard__footer">
Expand Down
31 changes: 14 additions & 17 deletions ui/src/components/DestinationStack/Actions/LoadStacks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Icon, Select, cbModal } from '@contentstack/venus-components';

import { AppContext } from '../../../context/app/app.context';
import { DEFAULT_DROPDOWN, IDropDown, INewMigration } from '../../../context/app/app.interface';
import { isEmptyString, validateArray } from '../../../utilities/functions';
import { isEmptyString, validateArray, validateObject } from '../../../utilities/functions';
import { createStacksInOrg, getAllStacksInOrg } from '../../../services/api/stacks.service';
import { getAllLocales } from '../../../services/api/user.service';
import { StackResponse } from '../../../services/api/service.interface';
Expand Down Expand Up @@ -44,7 +44,7 @@ const LoadStacks = (props: LoadFileFormatProps) => {
}
];
const [allStack, setAllStack] = useState<IDropDown[]>(loadingOption);
const [allLocales] = useState<IDropDown[]>([]);
const [allLocales, setAllLocales] = useState<IDropDown[]>([]);

const [isSaving, setIsSaving] = useState<boolean>(false);

Expand Down Expand Up @@ -143,19 +143,18 @@ const LoadStacks = (props: LoadFileFormatProps) => {

//fetch all locales
const response = await getAllLocales(newMigrationData?.destination_stack?.selectedOrg?.value); //org id will always be there

// const rawMappedLocalesMapped =
// validateObject(response?.data) && response?.data?.locales
// ? Object.keys(data?.locales)?.map((key) => ({
// uid: key,
// label: data?.locales[key],
// value: key,
// locale: key,
// created_at: key
// }))
// : [];

// setAllLocales(rawMappedLocalesMapped);
const rawMappedLocalesMapped =
validateObject(response?.data) && response?.data?.locales
? Object?.keys(response?.data?.locales)?.map((key) => ({
uid: key,
label: response?.data?.locales[key],
value: key,
locale: key,
created_at: key
}))
: [];

setAllLocales(rawMappedLocalesMapped);

const stackArray = validateArray(stackData?.data?.stacks)
? stackData?.data?.stacks?.map((stack: StackResponse) => ({
Expand Down Expand Up @@ -194,7 +193,6 @@ const LoadStacks = (props: LoadFileFormatProps) => {

updateNewMigrationData(newMigrationDataObj);
};

const handleCreateNewStack = () => {
cbModal({
component: (props: LoadFileFormatProps) => (
Expand All @@ -218,7 +216,6 @@ const LoadStacks = (props: LoadFileFormatProps) => {
}
});
};

/**** ALL USEEffects HERE ****/

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions ui/src/components/LegacyCms/Actions/LoadFileFormat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const LoadFileFormat = (props: LoadFileFormatProps) => {

const handleBtnClick = (e: MouseEvent) => {
e.preventDefault();
if (!isEmptyString(selectedCard.fileformat_id) && isCheckedBoxChecked) {
if (!isEmptyString(selectedCard?.fileformat_id) && isCheckedBoxChecked) {
updateNewMigrationData({
...newMigrationData,
legacy_cms: {
Expand All @@ -64,7 +64,7 @@ const LoadFileFormat = (props: LoadFileFormatProps) => {
});

//call for Step Change
props.handleStepChange(props.currentStep);
props.handleStepChange(props?.currentStep);
}
};

Expand Down Expand Up @@ -116,7 +116,7 @@ const LoadFileFormat = (props: LoadFileFormatProps) => {
{validateArray(allowed_file_formats) ? (
allowed_file_formats?.map((data: ICardType, index: number) => (
<Card
key={data.fileformat_id || index}
key={data?.fileformat_id || index}
data={data}
selectedCard={data?.fileformat_id}
idField="fileformat_id"
Expand All @@ -130,7 +130,7 @@ const LoadFileFormat = (props: LoadFileFormatProps) => {
)}
</div>
</div>
<div className="col-12 pt-2">
<div className="col-12 pt-3 pl-0">
<Button version="v2" disabled={!isCheckedBoxChecked} onClick={handleBtnClick}>
{migrationData?.legacyCMSData?.file_format_cta}
</Button>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/LegacyCms/Actions/LoadPrefix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
setIsError(false);

//API call for saving Affix
updateAffixData(selectedOrganisation.value, projectId, { affix: prefix });
updateAffixData(selectedOrganisation?.value, projectId, { affix: prefix });
affixConfirmation(selectedOrganisation?.value, projectId, {
affix_confirmation: isCheckedBoxChecked
});
Expand Down Expand Up @@ -129,7 +129,7 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
error={isError}
/>
</div>
<div className="col-12">
<div className="col-12 pt-2">
<Button version="v2" disabled={!isCheckedBoxChecked} onClick={handleOnBlur}>
{migrationData?.legacyCMSData?.affix_cta}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/LegacyCms/Summary/PreFixSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PreFixSummary = (props: PreFixSummaryProps): JSX.Element => {
{!isEmptyString(newMigrationData?.legacy_cms?.affix) ? (
<div className="col-12 pb-2">
<div className="stackselect affix-container">
<span className="summary-title">{newMigrationData?.legacy_cms?.affix || ''}</span>
<span className="summary-title px-2">{newMigrationData?.legacy_cms?.affix || ''}</span>
</div>
</div>
) : (
Expand Down
11 changes: 9 additions & 2 deletions ui/src/components/LegacyCms/Summary/summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@
.Checkbox input:disabled ~ .Checkbox__label {
opacity: 1;
}

.Checkbox.Checkbox--state-checked {
display: flex;
}
.Checkbox .Checkbox__tick svg {
display: block;
}
.Checkbox.Checkbox--state-checked.Checkbox--state-disabled {
color: #212121;
opacity: 1;
}

.Checkbox-wrapper .Checkbox {
display: flex;
}
.Checkbox input:disabled:checked ~ .Checkbox__label,
.Checkbox input:disabled:indeterminate ~ .Checkbox__label {
color: #212121;
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
2 changes: 1 addition & 1 deletion uplaode-api/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export default {
bucketName: 'migartion-test',
buketKey: 'project/package 45.zip'
},
localPath: '/Users/aishwarya.dani/Desktop/contentful.json'
localPath: '/Users/snehal.pimple/Desktop/contentful.json'
};