+
+ {{ 'common.name' | translate }}
+ {{ 'catalog.sku' | translate }}
+
+ {{ optionGroup.name }}
+
+ {{ 'catalog.price' | translate }}
+ {{ 'catalog.stock-on-hand' | translate }}
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ {{ option.name }} |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
diff --git a/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.scss b/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.scss
new file mode 100644
index 0000000000..4b880e451c
--- /dev/null
+++ b/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.scss
@@ -0,0 +1,15 @@
+@import "variables";
+
+.placeholder {
+ color: $color-grey-3;
+}
+
+input {
+ width: 100%;
+}
+
+.stock, .price {
+ input {
+ max-width: 96px;
+ }
+}
diff --git a/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.ts b/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.ts
new file mode 100644
index 0000000000..96c14b16d5
--- /dev/null
+++ b/admin-ui/src/app/catalog/components/product-variants-table/product-variants-table.component.ts
@@ -0,0 +1,15 @@
+import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
+import { FormArray } from '@angular/forms';
+import { ProductWithVariants } from 'shared/generated-types';
+
+@Component({
+ selector: 'vdr-product-variants-table',
+ templateUrl: './product-variants-table.component.html',
+ styleUrls: ['./product-variants-table.component.scss'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class ProductVariantsTableComponent {
+ @Input('productVariantsFormArray') formArray: FormArray;
+ @Input() variants: ProductWithVariants.Variants[];
+ @Input() optionGroups: ProductWithVariants.OptionGroups[];
+}
diff --git a/admin-ui/src/app/catalog/components/variant-price-detail/variant-price-detail.component.ts b/admin-ui/src/app/catalog/components/variant-price-detail/variant-price-detail.component.ts
index 02c844974c..592a785d9d 100644
--- a/admin-ui/src/app/catalog/components/variant-price-detail/variant-price-detail.component.ts
+++ b/admin-ui/src/app/catalog/components/variant-price-detail/variant-price-detail.component.ts
@@ -26,10 +26,10 @@ export class VariantPriceDetailComponent implements OnInit, OnChanges {
ngOnInit() {
const taxRates$ = this.dataService.settings
- .getTaxRates(99999, 0)
+ .getTaxRates(99999, 0, 'cache-first')
.mapStream(data => data.taxRates.items);
const activeChannel$ = this.dataService.settings
- .getActiveChannel()
+ .getActiveChannel('cache-first')
.mapStream(data => data.activeChannel);
this.taxRate$ = combineLatest(activeChannel$, taxRates$, this.taxCategoryIdChange$).pipe(
diff --git a/admin-ui/src/app/data/providers/settings-data.service.ts b/admin-ui/src/app/data/providers/settings-data.service.ts
index b80ae700de..a00e6ceafa 100644
--- a/admin-ui/src/app/data/providers/settings-data.service.ts
+++ b/admin-ui/src/app/data/providers/settings-data.service.ts
@@ -1,3 +1,4 @@
+import { FetchPolicy } from 'apollo-client';
import {
AddMembersToZone,
CreateChannel,
@@ -184,13 +185,17 @@ export class SettingsDataService {
);
}
- getTaxRates(take: number = 10, skip: number = 0) {
- return this.baseDataService.query (GET_TAX_RATE_LIST, {
- options: {
- take,
- skip,
+ getTaxRates(take: number = 10, skip: number = 0, fetchPolicy?: FetchPolicy) {
+ return this.baseDataService.query(
+ GET_TAX_RATE_LIST,
+ {
+ options: {
+ take,
+ skip,
+ },
},
- });
+ fetchPolicy,
+ );
}
getTaxRate(id: string) {
@@ -221,9 +226,11 @@ export class SettingsDataService {
});
}
- getActiveChannel() {
+ getActiveChannel(fetchPolicy?: FetchPolicy) {
return this.baseDataService.query(
GET_ACTIVE_CHANNEL,
+ {},
+ fetchPolicy,
);
}
diff --git a/admin-ui/src/app/shared/components/currency-input/currency-input.component.scss b/admin-ui/src/app/shared/components/currency-input/currency-input.component.scss
index a962d1624d..e4fdf774a7 100644
--- a/admin-ui/src/app/shared/components/currency-input/currency-input.component.scss
+++ b/admin-ui/src/app/shared/components/currency-input/currency-input.component.scss
@@ -1,3 +1,8 @@
:host {
padding: 0;
}
+
+input {
+ width: 100%;
+ max-width: 96px;
+}
diff --git a/admin-ui/src/app/shared/components/data-table/data-table.component.html b/admin-ui/src/app/shared/components/data-table/data-table.component.html
index a183c4c08b..9ae31f37cf 100644
--- a/admin-ui/src/app/shared/components/data-table/data-table.component.html
+++ b/admin-ui/src/app/shared/components/data-table/data-table.component.html
@@ -1,4 +1,4 @@
-
+
@@ -23,7 +23,8 @@
itemsPerPage: itemsPerPage,
currentPage: currentPage,
totalItems: totalItems
- })
+ });
+ index as i
"
>
@@ -33,7 +34,9 @@
(selectedChange)="rowSelectChange.emit(item)"
>
|
-
+
diff --git a/admin-ui/src/app/shared/components/data-table/data-table.component.scss b/admin-ui/src/app/shared/components/data-table/data-table.component.scss
index 62615e35bf..c4875ae40a 100644
--- a/admin-ui/src/app/shared/components/data-table/data-table.component.scss
+++ b/admin-ui/src/app/shared/components/data-table/data-table.component.scss
@@ -1,5 +1,11 @@
@import "variables";
+:host {
+ display: block;
+ max-width: 100%;
+ overflow: auto;
+}
+
thead th {
position: sticky;
top: 24px;
diff --git a/admin-ui/src/i18n-messages/en.json b/admin-ui/src/i18n-messages/en.json
index b64f22e800..69d308e134 100644
--- a/admin-ui/src/i18n-messages/en.json
+++ b/admin-ui/src/i18n-messages/en.json
@@ -38,6 +38,8 @@
"create-new-facet": "Create new facet",
"create-new-option-group": "Create new option group",
"create-new-product": "Create new product",
+ "display-variant-cards": "View details",
+ "display-variant-table": "View as table",
"drop-files-to-upload": "Drop files to upload",
"facet-values": "Facet values",
"filter-by-group-name": "Filter by group name",
@@ -61,8 +63,8 @@
"options": "Options",
"original-asset-size": "Source size",
"price": "Price",
- "price-includes-tax-at": "Price includes tax at { rate }%",
- "price-with-tax-in-default-zone": "Price with { rate }% tax: { price }",
+ "price-includes-tax-at": "Includes tax at { rate }%",
+ "price-with-tax-in-default-zone": "Inc. { rate }% tax: { price }",
"private": "Private",
"product-details": "Product details",
"product-name": "Product name",
|