diff --git a/src/components/blocks/DateSelect.js b/src/components/blocks/DateSelect.js index 588527c8..06958f14 100644 --- a/src/components/blocks/DateSelect.js +++ b/src/components/blocks/DateSelect.js @@ -69,6 +69,7 @@ const DateSelect = ({ { if (newValue) { diff --git a/src/components/forms/CreateUnitsForm.js b/src/components/forms/CreateUnitsForm.js index 7a27852c..c5185437 100644 --- a/src/components/forms/CreateUnitsForm.js +++ b/src/components/forms/CreateUnitsForm.js @@ -70,7 +70,7 @@ const CreateUnitsForm = withRouter(({ onClose, left, top, width, height }) => { marketplaceIdentifier: '', unitTags: '', unitStatusReason: '', - vintageYear: 2020, + vintageYear: '', unitRegistryLink: '', unitType: '', unitStatus: '', @@ -152,7 +152,7 @@ const CreateUnitsForm = withRouter(({ onClose, left, top, width, height }) => { if (!_.isEmpty(newLabels) && tabValue === 1) { if (newLabels.length > 0) { setLabelFormsValid([]); - let labelFormValid = newLabels.map(async label => { + _.map(newLabels, async label => { const validLabel = await labelSchema.isValid(label); return setLabelFormsValid(prev => [...prev, validLabel]); }); @@ -164,7 +164,6 @@ const CreateUnitsForm = withRouter(({ onClose, left, top, width, height }) => { return setTabValue(prev => prev + 1); } } - console.log(labelFormValid); } labelRef.current(); @@ -574,7 +573,12 @@ const CreateUnitsForm = withRouter(({ onClose, left, top, width, height }) => { options={selectUnitTypeOptions} selected={ newUnits.unitType - ? [{ value: newUnits.unitType, label: newUnits.unitType }] + ? [ + { + value: newUnits.unitType, + label: newUnits.unitType, + }, + ] : undefined } onChange={selectedOptions => @@ -761,7 +765,12 @@ const CreateUnitsForm = withRouter(({ onClose, left, top, width, height }) => { options={selectUnitStatusOptions} selected={ newUnits.unitStatus - ? [{ label: newUnits.unitStatus, value: newUnits.unitStatus }] + ? [ + { + label: newUnits.unitStatus, + value: newUnits.unitStatus, + }, + ] : undefined } onChange={selectedOptions => diff --git a/src/components/forms/LabelsValidation.js b/src/components/forms/LabelsValidation.js index 5ff20508..cb62be13 100644 --- a/src/components/forms/LabelsValidation.js +++ b/src/components/forms/LabelsValidation.js @@ -9,19 +9,14 @@ export const labelSchema = yup.object().shape({ .required('Required Field'), creditingPeriodEndDate: yup .date() - .min( - yup.ref('creditingPeriodStartDate'), - "End date can't be before start date", - ) .typeError('Invalid Date') .required('Required Field'), - validityPeriodStartDate: yup.string().required('Required Field'), + validityPeriodStartDate: yup + .date() + .typeError('Invalid Date') + .required('Required Field'), validityPeriodEndDate: yup .date() - .min( - yup.ref('validityPeriodStartDate'), - "End date can't be before start date", - ) .typeError('Invalid Date') .required('Required Field'), unitQuantity: yup diff --git a/src/pages/Units/index.js b/src/pages/Units/index.js index 2e9da3b1..f3ced781 100644 --- a/src/pages/Units/index.js +++ b/src/pages/Units/index.js @@ -36,23 +36,22 @@ import { } from '../../components'; const headings = [ + 'projectLocationId', + 'unitOwner', 'countryJurisdictionOfOwner', 'inCountryJurisdictionOfOwner', 'serialNumberBlock', - 'unitIdentifier', - 'unitType', - 'intendedBuyerOrgUid', + 'serialNumberPattern', 'marketplace', - 'tags', - 'unitStatus', - 'unitTransactionType', - 'unitStatusReason', - 'tokenIssuanceHash', + 'marketplaceLink', 'marketplaceIdentifier', - 'unitsIssuanceLocation', + 'unitTags', + 'unitStatusReason', + 'vintageYear', 'unitRegistryLink', - 'unitMarketplaceLink', - 'cooresponingAdjustmentDeclaration', + 'unitType', + 'unitStatus', + 'correspondingAdjustmentDeclaration', 'correspondingAdjustmentStatus', ];