All files / src/app/shared/components/basket/basket-merchant-message-view basket-merchant-message-view.component.ts

75% Statements 3/4
0% Branches 0/2
0% Functions 0/1
75% Lines 3/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 325x     5x                         5x                              
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { Requisition } from 'projects/requisition-management/src/app/models/requisition/requisition.model';
 
import { AttributeHelper } from 'ish-core/models/attribute/attribute.helper';
import { Basket } from 'ish-core/models/basket/basket.model';
import { Order } from 'ish-core/models/order/order.model';
 
/**
 * The Basket Merchant Message View Component displays the message to merchant on related pages like basket review, order details and requisition details page.
 *
 */
@Component({
  selector: 'ish-basket-merchant-message-view',
  templateUrl: './basket-merchant-message-view.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasketMerchantMessageViewComponent implements OnChanges {
  @Input({ required: true }) data: Basket | Order | Requisition;
  @Input() editRouterLink: string;
 
  messageToMerchant: string;
 
  ngOnChanges(): void {
    this.messageToMerchant =
      this.data.messageToMerchant ||
      (AttributeHelper.getAttributeValueByAttributeName(
        this.data.attributes,
        'BusinessObjectAttributes#Order_MessageToMerchant'
      ) as string);
  }
}