@vendure/admin-ui 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/vendure-admin-ui-catalog.umd.js +14 -14
- package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-core.umd.js +1 -1
- package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-login.umd.js +2 -2
- package/bundles/vendure-admin-ui-login.umd.js.map +1 -1
- package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
- package/core/common/version.d.ts +1 -1
- package/core/vendure-admin-ui-core.metadata.json +1 -1
- package/esm2015/catalog/components/product-detail/product-detail.component.js +11 -11
- package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +2 -2
- package/esm2015/core/common/version.js +2 -2
- package/esm2015/login/components/login/login.component.js +3 -3
- package/fesm2015/vendure-admin-ui-catalog.js +11 -11
- package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
- package/fesm2015/vendure-admin-ui-core.js +1 -1
- package/fesm2015/vendure-admin-ui-core.js.map +1 -1
- package/fesm2015/vendure-admin-ui-login.js +2 -2
- package/fesm2015/vendure-admin-ui-login.js.map +1 -1
- package/package.json +2 -2
|
@@ -1420,27 +1420,27 @@ class ProductDetailComponent extends BaseDetailComponent {
|
|
|
1420
1420
|
ngOnInit() {
|
|
1421
1421
|
this.init();
|
|
1422
1422
|
this.product$ = this.entity$;
|
|
1423
|
-
|
|
1424
|
-
this.paginationConfig$ = combineLatest(this.totalItems$, this.itemsPerPage$, this.currentPage$).pipe(map(([totalItems, itemsPerPage, currentPage]) => ({
|
|
1425
|
-
totalItems,
|
|
1426
|
-
itemsPerPage,
|
|
1427
|
-
currentPage,
|
|
1428
|
-
})));
|
|
1429
|
-
const variants$ = this.product$.pipe(map(product => product.variantList.items));
|
|
1430
|
-
const filterTerm$ = this.filterInput.valueChanges.pipe(startWith(''), debounceTime(200), shareReplay());
|
|
1423
|
+
const filterTerm$ = this.filterInput.valueChanges.pipe(startWith(''), debounceTime(200), shareReplay(), tap(() => this.currentPage$.next(1)));
|
|
1431
1424
|
const initialVariants$ = this.product$.pipe(map(p => p.variantList.items));
|
|
1432
|
-
const
|
|
1425
|
+
const variantsList$ = combineLatest(filterTerm$, this.currentPage$, this.itemsPerPage$).pipe(skipUntil(initialVariants$), skip(1), debounceTime(100), switchMap(([term, currentPage, itemsPerPage]) => {
|
|
1433
1426
|
return this.dataService.product
|
|
1434
1427
|
.getProductVariants(Object.assign(Object.assign({ skip: (currentPage - 1) * itemsPerPage, take: itemsPerPage }, (term
|
|
1435
1428
|
? { filter: { name: { contains: term }, sku: { contains: term } } }
|
|
1436
1429
|
: {})), { filterOperator: LogicalOperator.OR }), this.id)
|
|
1437
|
-
.mapStream(({ productVariants }) => productVariants
|
|
1430
|
+
.mapStream(({ productVariants }) => productVariants);
|
|
1438
1431
|
}), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1432
|
+
const updatedVariants$ = variantsList$.pipe(map(result => result.items));
|
|
1439
1433
|
this.variants$ = merge(initialVariants$, updatedVariants$).pipe(tap(variants => {
|
|
1440
1434
|
for (const variant of variants) {
|
|
1441
1435
|
this.productVariantMap.set(variant.id, variant);
|
|
1442
1436
|
}
|
|
1443
1437
|
}));
|
|
1438
|
+
this.totalItems$ = merge(this.product$.pipe(map(product => product.variantList.totalItems)), variantsList$.pipe(map(result => result.totalItems)));
|
|
1439
|
+
this.paginationConfig$ = combineLatest(this.totalItems$, this.itemsPerPage$, this.currentPage$).pipe(map(([totalItems, itemsPerPage, currentPage]) => ({
|
|
1440
|
+
totalItems,
|
|
1441
|
+
itemsPerPage,
|
|
1442
|
+
currentPage,
|
|
1443
|
+
})));
|
|
1444
1444
|
this.taxCategories$ = this.productDetailService.getTaxCategories().pipe(takeUntil(this.destroy$));
|
|
1445
1445
|
this.activeTab$ = this.route.paramMap.pipe(map(qpm => qpm.get('tab')));
|
|
1446
1446
|
combineLatest(updatedVariants$, this.languageCode$)
|
|
@@ -4417,7 +4417,7 @@ class ProductVariantsListComponent {
|
|
|
4417
4417
|
}
|
|
4418
4418
|
onAssetChange(variantId, event) {
|
|
4419
4419
|
this.assetChange.emit(Object.assign({ variantId }, event));
|
|
4420
|
-
const index = this.
|
|
4420
|
+
const index = this.formArray.controls.findIndex(c => c.value.id === variantId);
|
|
4421
4421
|
this.formArray.at(index).markAsDirty();
|
|
4422
4422
|
}
|
|
4423
4423
|
toggleSelectAll() {
|