Skip to content

Commit

Permalink
Merge pull request #240 from nimble-platform/staging
Browse files Browse the repository at this point in the history
Pull Request for Release 17.0.4
  • Loading branch information
dogukan10 authored May 7, 2020
2 parents b962f8d + 8aefc29 commit c2d6459
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
13 changes: 13 additions & 0 deletions src/app/bpe/bp-view/bp-data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,19 @@ export class BPDataService {
return companyWorkflow[companyWorkflow.length - 1] == processId;
}

// checks whether the given process is in the workflow or not
isProcessPresentInTheWorkflow(processId: string, sellerSettings: CompanySettings = null) {
if (sellerSettings == null) {
sellerSettings = this.getCompanySettings();
}
let companyWorkflow = sellerSettings.negotiationSettings.company.processID;
// if there is no workflow specified, then consider the default flow which contains the all processes
if (!companyWorkflow || companyWorkflow.length == 0) {
return true;
}
return companyWorkflow.indexOf(processId) != -1;
}

// it retrieves the company's business workflow through settings and construct a workflow map
// key is the id of process and value is true/false (whether this process is included in company's workflow or not)
getCompanyWorkflowMap(companyWorkflow: string[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<div class="col-3" *ngIf="!(processMetadata && processMetadata.isBeingUpdated)">
<span [ngbTooltip]="getValidationError()" [placement]="'auto'" title="">
<button class="btn btn-primary action" [disabled]="isLoading() || !isFormValid()" (click)="onSendRequest()" singleClick>
<span *ngIf="!doesManufacturerOfferHasPrice() || isNegotiatingAnyTerm() || bpDataService.isFinalProcessInTheWorkflow('Negotiation')" [innerHTML]="'Send Request' | translate"></span>
<span *ngIf="!(!doesManufacturerOfferHasPrice() || isNegotiatingAnyTerm() || bpDataService.isFinalProcessInTheWorkflow('Negotiation'))" [innerHTML]="'Continue With Manufacturer\'s Terms' | translate"></span>
<span *ngIf="!doesManufacturerOfferHasPrice() || isNegotiatingAnyTerm() || !bpDataService.isProcessPresentInTheWorkflow('Order')" [innerHTML]="'Send Request' | translate"></span>
<span *ngIf="!(!doesManufacturerOfferHasPrice() || isNegotiatingAnyTerm() || !bpDataService.isProcessPresentInTheWorkflow('Order'))" [innerHTML]="'Continue With Manufacturer\'s Terms' | translate"></span>
</button>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class NegotiationRequestComponent implements OnInit {
}
}

if (!this.doesManufacturerOfferHasPrice() || this.isNegotiatingAnyTerm() || this.bpDataService.isFinalProcessInTheWorkflow("Negotiation")) {
if (!this.doesManufacturerOfferHasPrice() || this.isNegotiatingAnyTerm() || !this.bpDataService.isProcessPresentInTheWorkflow('Order')) {
// final check on the rfq
const rfq: RequestForQuotation = this.rfq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</div>

<div class="row actions-row" *ngIf="userRole === 'buyer' && !readonly">
<div class="{{bpDataService.isFinalProcessInTheWorkflow('Negotiation') ? 'col-7':'col-5'}} call-status-col">
<div class="{{!bpDataService.isProcessPresentInTheWorkflow('Order') ? 'col-7':'col-5'}} call-status-col">
<call-status [callStatus]="callStatus"></call-status>
</div>
<div class="col-2">
Expand All @@ -100,7 +100,7 @@
<span [innerHTML]="'Request new Quotation' | translate"></span>
</button>
</div>
<div *ngIf="!bpDataService.isFinalProcessInTheWorkflow('Negotiation')" class="col-2">
<div *ngIf="bpDataService.isProcessPresentInTheWorkflow('Order')" class="col-2">
<span [ngbTooltip]="getAcceptAndOrderButtonValidationMessages()" [placement]="'auto'" title="">
<button class="btn btn-primary action" [disabled]="isAcceptAndOrderDisabled()" (click)="onAcceptAndOrder()">
<span [innerHTML]="'Accept & Order' | translate"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class NegotiationResponseComponent implements OnInit {

isRequestNewQuotationDisabled(): boolean {
return this.isLoading() || this.isThereADeletedProduct() || this.processMetadata.collaborationStatus == "COMPLETED" || this.processMetadata.collaborationStatus == "CANCELLED"
|| (this.bpDataService.isFinalProcessInTheWorkflow('Negotiation') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED);
|| (!this.bpDataService.isProcessPresentInTheWorkflow('Order') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED);
}

isAcceptAndOrderDisabled(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ <h5 [ngClass]="{'bg-danger text-white':isNoteUpdated()}"><span [innerHTML]="'Not
</div>

<div class="row actions-row" *ngIf="userRole === 'buyer' && !readonly">
<div class="{{bpDataService.isFinalProcessInTheWorkflow('Negotiation') ? 'col-7' : 'col-5' }} call-status-col">
<div class="{{!bpDataService.isProcessPresentInTheWorkflow('Transport_Execution_Plan') ? 'col-7' : 'col-5' }} call-status-col">
<call-status [callStatus]="callStatus"></call-status>
</div>
<div class="col-2">
Expand All @@ -258,7 +258,7 @@ <h5 [ngClass]="{'bg-danger text-white':isNoteUpdated()}"><span [innerHTML]="'Not
</button>
</div>
<!-- Order step exists only for transport services-->
<div *ngIf="!bpDataService.isFinalProcessInTheWorkflow('Negotiation') && isTransportService" class="col-2">
<div *ngIf="bpDataService.isProcessPresentInTheWorkflow('Transport_Execution_Plan') && isTransportService" class="col-2">
<button class="btn btn-primary action" [disabled]="isLoading() || processMetadata.collaborationStatus == 'COMPLETED' || quotation.documentStatusCode.name == 'Rejected'" (click)="onAcceptAndOrder()">
<span [innerHTML]="'Accept & Order' | translate"></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class TransportNegotiationResponseComponent implements OnInit {

isRequestNewQuotationDisabled(): boolean {
return this.isLoading() || this.processMetadata.collaborationStatus == "COMPLETED" || this.processMetadata.collaborationStatus == "CANCELLED"
|| (this.bpDataService.isFinalProcessInTheWorkflow('Negotiation') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED);
|| (!this.bpDataService.isProcessPresentInTheWorkflow('Transport_Execution_Plan') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED);
}

isLoading(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/app/bpe/shopping-cart/shopping-cart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export class ShoppingCartComponent implements OnInit {
let sellerId: string = UBLModelUtils.getLinePartyId(cartLine);
return !component.wrapper.lineDiscountPriceWrapper.itemPrice.hasPrice() ||
component.isNegotiatingAnyTerm() ||
this.bpDataService.isFinalProcessInTheWorkflow('Negotiation', this.sellersSettings.get(sellerId));
!this.bpDataService.isProcessPresentInTheWorkflow('Order', this.sellersSettings.get(sellerId));
}
}
}
Expand Down

0 comments on commit c2d6459

Please sign in to comment.