|
|
@@ -7,31 +7,31 @@
|
|
|
<ng-container *ngIf="formGroupMap.get(variant.id) as formGroup" [formGroup]="formGroup">
|
|
|
<div class="card-block header-row">
|
|
|
<div class="details">
|
|
|
- <vdr-title-input class="sku" [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)">
|
|
|
+ <vdr-title-input class="sku" [readonly]="!(updatePermission | hasPermission)">
|
|
|
<clr-input-container>
|
|
|
<input
|
|
|
clrInput
|
|
|
type="text"
|
|
|
formControlName="sku"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
[placeholder]="'catalog.sku' | translate"
|
|
|
/>
|
|
|
</clr-input-container>
|
|
|
</vdr-title-input>
|
|
|
- <vdr-title-input class="name" [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)">
|
|
|
+ <vdr-title-input class="name" [readonly]="!(updatePermission | hasPermission)">
|
|
|
<clr-input-container>
|
|
|
<input
|
|
|
clrInput
|
|
|
type="text"
|
|
|
formControlName="name"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
[placeholder]="'common.name' | translate"
|
|
|
/>
|
|
|
</clr-input-container>
|
|
|
</vdr-title-input>
|
|
|
</div>
|
|
|
<div class="right-controls">
|
|
|
- <clr-toggle-wrapper *vdrIfPermissions="['UpdateCatalog', 'UpdateProduct']">
|
|
|
+ <clr-toggle-wrapper *vdrIfPermissions="updatePermission">
|
|
|
<input type="checkbox" clrToggle name="enabled" formControlName="enabled" />
|
|
|
<label>{{ 'common.enabled' | translate }}</label>
|
|
|
</clr-toggle-wrapper>
|
|
|
@@ -52,7 +52,7 @@
|
|
|
<div class="variant-form-input-row">
|
|
|
<div class="tax-category">
|
|
|
<clr-select-container
|
|
|
- *vdrIfPermissions="['UpdateCatalog', 'UpdateProduct']; else taxCategoryLabel"
|
|
|
+ *vdrIfPermissions="updatePermission; else taxCategoryLabel"
|
|
|
>
|
|
|
<label>{{ 'catalog.tax-category' | translate }}</label>
|
|
|
<select clrSelect name="options" formControlName="taxCategoryId">
|
|
|
@@ -80,14 +80,14 @@
|
|
|
*ngIf="!channelPriceIncludesTax"
|
|
|
clrInput
|
|
|
[currencyCode]="variant.currencyCode"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
formControlName="price"
|
|
|
></vdr-currency-input>
|
|
|
<vdr-currency-input
|
|
|
*ngIf="channelPriceIncludesTax"
|
|
|
clrInput
|
|
|
[currencyCode]="variant.currencyCode"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
formControlName="priceWithTax"
|
|
|
></vdr-currency-input>
|
|
|
</clr-input-container>
|
|
|
@@ -100,7 +100,7 @@
|
|
|
></vdr-variant-price-detail>
|
|
|
</div>
|
|
|
<div class="variant-form-input-row">
|
|
|
- <clr-select-container *vdrIfPermissions="['UpdateCatalog', 'UpdateProduct']">
|
|
|
+ <clr-select-container *vdrIfPermissions="updatePermission">
|
|
|
<label
|
|
|
>{{ 'catalog.track-inventory' | translate }}
|
|
|
<vdr-help-tooltip
|
|
|
@@ -133,7 +133,7 @@
|
|
|
min="0"
|
|
|
step="1"
|
|
|
formControlName="stockOnHand"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
[vdrDisabled]="inventoryIsNotTracked(formGroup)"
|
|
|
/>
|
|
|
</clr-input-container>
|
|
|
@@ -178,7 +178,7 @@
|
|
|
clrInput
|
|
|
type="number"
|
|
|
[formControl]="formGroup.get('outOfStockThreshold')"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
[vdrDisabled]="
|
|
|
formGroup.get('useGlobalOutOfStockThreshold')?.value !==
|
|
|
false || inventoryIsNotTracked(formGroup)
|
|
|
@@ -192,7 +192,7 @@
|
|
|
name="useGlobalOutOfStockThreshold"
|
|
|
formControlName="useGlobalOutOfStockThreshold"
|
|
|
[vdrDisabled]="
|
|
|
- !(['UpdateCatalog', 'UpdateProduct'] | hasPermission) ||
|
|
|
+ !(updatePermission | hasPermission) ||
|
|
|
inventoryIsNotTracked(formGroup)
|
|
|
"
|
|
|
/>
|
|
|
@@ -216,7 +216,7 @@
|
|
|
entityName="ProductVariant"
|
|
|
[compact]="true"
|
|
|
[customFieldsFormGroup]="formGroup.get('customFields')"
|
|
|
- [readonly]="!(['UpdateCatalog', 'UpdateProduct'] | hasPermission)"
|
|
|
+ [readonly]="!(updatePermission | hasPermission)"
|
|
|
[customField]="customField"
|
|
|
></vdr-custom-field-control>
|
|
|
</ng-container>
|
|
|
@@ -236,7 +236,7 @@
|
|
|
[colorFrom]="optionGroupName(option.groupId)"
|
|
|
[invert]="true"
|
|
|
(iconClick)="editOption(option)"
|
|
|
- [icon]="(['UpdateCatalog', 'UpdateProduct'] | hasPermission) && 'pencil'"
|
|
|
+ [icon]="(updatePermission | hasPermission) && 'pencil'"
|
|
|
>
|
|
|
<span class="option-group-name">{{ optionGroupName(option.groupId) }}</span>
|
|
|
{{ optionName(option) }}
|
|
|
@@ -248,17 +248,17 @@
|
|
|
<vdr-facet-value-chip
|
|
|
*ngFor="let facetValue of existingFacetValues(variant)"
|
|
|
[facetValue]="facetValue"
|
|
|
- [removable]="['UpdateCatalog', 'UpdateProduct'] | hasPermission"
|
|
|
+ [removable]="updatePermission | hasPermission"
|
|
|
(remove)="removeFacetValue(variant, facetValue.id)"
|
|
|
></vdr-facet-value-chip>
|
|
|
<vdr-facet-value-chip
|
|
|
*ngFor="let facetValue of pendingFacetValues(variant)"
|
|
|
[facetValue]="facetValue"
|
|
|
- [removable]="['UpdateCatalog', 'UpdateProduct'] | hasPermission"
|
|
|
+ [removable]="updatePermission | hasPermission"
|
|
|
(remove)="removeFacetValue(variant, facetValue.id)"
|
|
|
></vdr-facet-value-chip>
|
|
|
<button
|
|
|
- *vdrIfPermissions="['UpdateCatalog', 'UpdateProduct']"
|
|
|
+ *vdrIfPermissions="updatePermission"
|
|
|
class="btn btn-sm btn-secondary"
|
|
|
(click)="selectFacetValueClick.emit([variant.id])"
|
|
|
>
|