File

feature-libs/organization/administration/components/shared/table/limit/limit-cell.component.ts

Extends

CellComponent

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-org-limit-cell
templateUrl ./limit-cell.component.html

Index

Accessors

Accessors

isTimeSpanThreshold
getisTimeSpanThreshold()
isOrderThreshold
getisOrderThreshold()
isExceedPermission
getisExceedPermission()
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Permission } from '@spartacus/organization/administration/core';
import { CellComponent } from '../cell.component';

@Component({
  selector: 'cx-org-limit-cell',
  templateUrl: './limit-cell.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LimitCellComponent extends CellComponent {
  get isTimeSpanThreshold(): boolean {
    return (
      (this.model as Permission).orderApprovalPermissionType?.code ===
      'B2BOrderThresholdTimespanPermission'
    );
  }

  get isOrderThreshold(): boolean {
    return (
      (this.model as Permission).orderApprovalPermissionType?.code ===
      'B2BOrderThresholdPermission'
    );
  }

  get isExceedPermission(): boolean {
    return (
      (this.model as Permission).orderApprovalPermissionType?.code ===
      'B2BBudgetExceededPermission'
    );
  }
}
<a
  *ngIf="linkable; else threshold"
  [routerLink]="{ cxRoute: route, params: routeModel } | cxUrl"
  [tabindex]="tabIndex"
>
  <ng-container *ngTemplateOutlet="threshold"></ng-container>
</a>

<ng-template #threshold>
  <span
    class="text"
    title="{{ model.threshold }} {{ model.currency?.symbol }} {{
      'orgPurchaseLimit.per.' + model.periodRange | cxTranslate
    }}"
    *ngIf="isTimeSpanThreshold"
  >
    {{ model.threshold }} {{ model.currency?.symbol }}
    {{ 'orgPurchaseLimit.per.' + model.periodRange | cxTranslate }}
  </span>

  <span
    class="text"
    title="{{ model.threshold }} {{ model.currency?.symbol }}"
    *ngIf="isOrderThreshold"
  >
    {{ model.threshold }} {{ model.currency?.symbol }}
  </span>

  <span
    class="text"
    title="{{ model.orderApprovalPermissionType.name }}"
    *ngIf="isExceedPermission"
  >
    {{ model.orderApprovalPermissionType.name }}
  </span>
</ng-template>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""