use new object properties for orders and process
This commit is contained in:
@@ -44,7 +44,7 @@ class ProcessContainer extends Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.dispatch(fetchOrderInfo(this.props.idOrder));
|
this.props.dispatch(fetchOrderInfo(this.props.idOrder));
|
||||||
this.props.dispatch(getAllDataForInstallation(this.props.idOrder, usedForDirective, stepsNameForInstallation, fileType));
|
//this.props.dispatch(getAllDataForInstallation(this.props.idOrder, usedForDirective, stepsNameForInstallation, fileType));
|
||||||
const orderPackagePairs = [];
|
const orderPackagePairs = [];
|
||||||
const isSchedulingDisabled = {};
|
const isSchedulingDisabled = {};
|
||||||
isSchedulingDisabled[this.props.idOrder] = true;
|
isSchedulingDisabled[this.props.idOrder] = true;
|
||||||
@@ -187,12 +187,12 @@ class ProcessContainer extends Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(orderInfo && orderInfo.info && !isLoading) &&
|
(orderInfo && !isLoading) &&
|
||||||
<div>
|
<div>
|
||||||
<WiaasBox
|
<WiaasBox
|
||||||
customHeader={ProcessNavContainer}
|
customHeader={ProcessNavContainer}
|
||||||
customHeaderParams={{
|
customHeaderParams={{
|
||||||
orderInfo: orderInfo.info,
|
orderInfo: orderInfo,
|
||||||
packages: orderInfo.packages,
|
packages: orderInfo.packages,
|
||||||
onViewChange: this.onViewChange,
|
onViewChange: this.onViewChange,
|
||||||
getActiveView: this.getActiveView,
|
getActiveView: this.getActiveView,
|
||||||
@@ -211,7 +211,7 @@ class ProcessContainer extends Component {
|
|||||||
<OrderProcess
|
<OrderProcess
|
||||||
onViewChange={this.onViewChange}
|
onViewChange={this.onViewChange}
|
||||||
orderStatus={orderInfo.status}
|
orderStatus={orderInfo.status}
|
||||||
orderProcess={this.getProcess(orderInfo.process)}/>
|
orderProcess={orderInfo.process}/>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this.state.activeView === 'packages' &&
|
this.state.activeView === 'packages' &&
|
||||||
|
|||||||
@@ -26,15 +26,16 @@ class CustomerAcceptance extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloadDocument(document){
|
downloadDocument(document){
|
||||||
const fileUrl = `${API_SERVER}/utils/api/downloadFile?idDocument=${document.idDocument}&fileName=${document.documentName}.${document.extension}`
|
//const fileUrl = `${API_SERVER}/utils/api/downloadFile?idDocument=${document.idDocument}&fileName=${document.documentName}.${document.extension}`
|
||||||
const fileName = document.documentName + '.' + document.extension;
|
const fileUrl = document.url;
|
||||||
|
const fileName = document.name + '.' + document.extension;
|
||||||
fileHandler.download(fileUrl, fileName);
|
fileHandler.download(fileUrl, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadFile(idOrder, acceptedFiles, rejectedFiles) {
|
uploadFile(idEntry, acceptedFiles, rejectedFiles) {
|
||||||
if(acceptedFiles && acceptedFiles.length){
|
if(acceptedFiles && acceptedFiles.length){
|
||||||
const file = acceptedFiles[0];
|
const file = acceptedFiles[0];
|
||||||
this.props.dispatch(uploadAcceptance(idOrder, file));
|
this.props.dispatch(uploadAcceptance(idEntry, file));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rejectedFiles && rejectedFiles.length) {
|
if(rejectedFiles && rejectedFiles.length) {
|
||||||
@@ -59,9 +60,9 @@ class CustomerAcceptance extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
acceptDeclineInstallation() {
|
acceptDeclineInstallation() {
|
||||||
const {idOrder} = this.props.step;
|
const {idProcess} = this.props.step;
|
||||||
const {actionType, reason} = this.state;
|
const {actionType, reason} = this.state;
|
||||||
this.props.dispatch(acceptDeclineInstallation(idOrder, actionType, reason));
|
this.props.dispatch(acceptDeclineInstallation(idProcess, actionType, reason));
|
||||||
this.setState({reason: ''});
|
this.setState({reason: ''});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ class CustomerAcceptance extends Component {
|
|||||||
'-1' : orderTexts.labels.DECLINED
|
'-1' : orderTexts.labels.DECLINED
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages[customerAcceptance.customerAccepted];
|
return messages[customerAcceptance.status];
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditorChange(reason) {
|
onEditorChange(reason) {
|
||||||
@@ -107,8 +108,8 @@ class CustomerAcceptance extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(){
|
componentDidMount(){
|
||||||
const {idOrder} = this.props.step;
|
const {idProcess} = this.props.step;
|
||||||
this.props.dispatch(fetchCustomerAcceptance(idOrder));
|
this.props.dispatch(fetchCustomerAcceptance(idProcess));
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -121,14 +122,14 @@ class CustomerAcceptance extends Component {
|
|||||||
customerAcceptance &&
|
customerAcceptance &&
|
||||||
<Row>
|
<Row>
|
||||||
<Col className="aceeptance-message">
|
<Col className="aceeptance-message">
|
||||||
{this.getAcceptanceMessage(customerAcceptance)} <div className={'status-icon ' + this.getAcceptanceStatusClass(customerAcceptance.customerAccepted, customerAcceptance.daysDiff)}></div>
|
{this.getAcceptanceMessage(customerAcceptance)} <div className={'status-icon ' + this.getAcceptanceStatusClass(customerAcceptance.status, customerAcceptance.daysDiff)}></div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(customerAcceptance && customerAcceptance.customerAccepted === -1) &&
|
(customerAcceptance && customerAcceptance.status === -1) &&
|
||||||
<Row>
|
<Row>
|
||||||
<Col>{orderTexts.labels.REASON}: {customerAcceptance.customerDeclineReason}</Col>
|
<Col>{orderTexts.labels.REASON}: {customerAcceptance.decline_reason}</Col>
|
||||||
</Row>
|
</Row>
|
||||||
}
|
}
|
||||||
<Row className="acceptance-docs">
|
<Row className="acceptance-docs">
|
||||||
@@ -137,19 +138,19 @@ class CustomerAcceptance extends Component {
|
|||||||
multiple={false}
|
multiple={false}
|
||||||
accept=".pdf,.docx,.doc,.xlsx,.xls,.odt,.ods,.jpg,.png,.jpeg"
|
accept=".pdf,.docx,.doc,.xlsx,.xls,.odt,.ods,.jpg,.png,.jpeg"
|
||||||
activeClassName="upload-file-accept"
|
activeClassName="upload-file-accept"
|
||||||
onDrop={(acceptedFiles, rejectedFiles)=>{this.uploadFile(step.idOrder, acceptedFiles, rejectedFiles)}}>
|
onDrop={(acceptedFiles, rejectedFiles)=>{this.uploadFile(step.idProcess, acceptedFiles, rejectedFiles)}}>
|
||||||
<h5 className="drop-zone-text">{orderTexts.labels.UPLOAD_ACCEPTANCE_LABEL}</h5>
|
<h5 className="drop-zone-text">{orderTexts.labels.UPLOAD_ACCEPTANCE_LABEL}</h5>
|
||||||
</Dropzone>
|
</Dropzone>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xl="4" lg="7" md="8">
|
<Col xl="4" lg="7" md="8">
|
||||||
{
|
{
|
||||||
(customerAcceptance && customerAcceptance.acceptanceDocuments && customerAcceptance.acceptanceDocuments.length > 0) &&
|
(customerAcceptance && customerAcceptance.documents && customerAcceptance.documents.length > 0) &&
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
customerAcceptance.acceptanceDocuments.map(document => <div key={'acceptance-documnet-' + document.idDocument}>
|
customerAcceptance.documents.map((document, index) => <div key={'acceptance-documnet-' + index}>
|
||||||
<span className="document-link"
|
<span className="document-link"
|
||||||
onClick={() => {this.downloadDocument(document)}}>
|
onClick={() => {this.downloadDocument(document)}}>
|
||||||
<i className={'fa fa-file'}></i> {document.documentName} ({document.extension})
|
<i className={'fa fa-file'}></i> {document.name} ({document.extension})
|
||||||
</span>
|
</span>
|
||||||
<span className="document-status">
|
<span className="document-status">
|
||||||
{document.validation} <div className={'status-icon ' + document.validation}></div>
|
{document.validation} <div className={'status-icon ' + document.validation}></div>
|
||||||
@@ -159,7 +160,7 @@ class CustomerAcceptance extends Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(customerAcceptance && !customerAcceptance.acceptanceDocuments) &&
|
(customerAcceptance && (!customerAcceptance.documents || customerAcceptance.documents.length === 0) ) &&
|
||||||
<div>
|
<div>
|
||||||
{orderTexts.labels.NO_DOCUMENTS_UPLOADED}
|
{orderTexts.labels.NO_DOCUMENTS_UPLOADED}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const completedOrdersStatuses = ['production', 'end-of-life'];
|
|||||||
|
|
||||||
class OrderProcess extends Component {
|
class OrderProcess extends Component {
|
||||||
isStepVisible(step) {
|
isStepVisible(step) {
|
||||||
return (step.status === 'in-progress' || step.status === 'done') && step.isVisibleForCustomer === 1;
|
return (step.status === 'pending' || step.status === 'complete') && step.isVisibleForCustomer === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -41,7 +41,7 @@ class OrderProcess extends Component {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col xl="12" lg="12" md="12" xs="12" className="order-package-process">
|
<Col xl="12" lg="12" md="12" xs="12" className="order-package-process">
|
||||||
{
|
{
|
||||||
visibleSteps.map((step, index) => <ProcessStep isStepVisible={this.isStepVisible} stepNumber={visibleSteps.length - index} step={step} key={'step-' + step.idProcess + '-' + step.idProcessStep}/>)
|
visibleSteps.reverse().map((step, index) => <ProcessStep isStepVisible={this.isStepVisible} stepNumber={visibleSteps.length - index} step={step} key={'step-' + step.idProcess + '-' + step.idProcessStep}/>)
|
||||||
}
|
}
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const stepActions = {
|
|||||||
|
|
||||||
class OrderStep extends Component {
|
class OrderStep extends Component {
|
||||||
isActiveStep(status) {
|
isActiveStep(status) {
|
||||||
return status === 'in-progress' ;
|
return status === 'pending' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
getStepTitle(step, stepNumber) {
|
getStepTitle(step, stepNumber) {
|
||||||
|
|||||||
Reference in New Issue
Block a user