Enable admin to enter installation date on delivery process:

:
This commit is contained in:
Almira Krdzic
2018-11-05 18:18:44 +01:00
parent c23e570399
commit dd53584d20
11 changed files with 221 additions and 102 deletions

View File

@@ -51,9 +51,11 @@ class OrderInfo extends Component {
render() {
const {totalPrice, installationData} = this.props;
const {acceptedDate, proposedDate, isPreliminaryInstallationDate, isInstallationInOrder} = this.state;
const orderPackages = installationData.packages;
const isInstallationInPackage = installationData.isInstallationInPackage;
const orderInfo = this.props.orderInfo;
const orderPackages = orderInfo ? orderInfo.packages : [];
const hasInstallationDates = orderPackages ? !!orderPackages.find(orderPackage => orderPackage.installationDate !== undefined) : false;
return (
<Container fluid={true} id="order-info-description">
@@ -85,36 +87,35 @@ class OrderInfo extends Component {
<span>{orderInfo.tender || '-'}</span>
</div>
</Col>
{ isInstallationInOrder &&
{
orderPackages &&
orderPackages.map(orderPackage => {
if (orderPackage.installationDate) {
}
})
}
{ hasInstallationDates &&
<Col xl="3">
<div>
<div className="subtitle">
{ isPreliminaryInstallationDate
? <h6>{orderTexts.labels.PRELIMINARY_INSTALLATION_DATE_LABEL}:</h6>
: <h6>{orderTexts.labels.INSTALLATION_DATE}:</h6>
}
<h6>{orderTexts.labels.INSTALLATION_DATE}:</h6>
</div>
{ orderPackages &&
orderPackages.map(orderPackage =>
<div key={'package-install-date-' + orderPackage.idOrderPackagePair}>
{ isInstallationInPackage[orderPackage.idOrderPackagePair] &&
<div>
{ orderPackages.length > 1 &&
<span>{orderPackage.packageName}: </span>
}
<span className="installation-date-per-package">
{ acceptedDate && acceptedDate[orderPackage.idOrderPackagePair]
? acceptedDate[orderPackage.idOrderPackagePair]
: proposedDate && proposedDate[orderPackage.idOrderPackagePair]
? proposedDate[orderPackage.idOrderPackagePair]
: orderTexts.labels.NOT_SET
}
orderPackages.map(orderPackage => {
if (orderPackage.installationDate) {
</span>
</div>
}
</div>
)
return (<div key={orderPackage.id}>
<span>{orderPackage.name}: </span>
<span className="installation-date-per-package"> { orderPackage.installationDate } </span>
</div>)
}
return null;
})
}
</div>
</Col>