diff --git a/apps/merchandise/src/app/merchandise/merchandise.component.css b/apps/merchandise/src/app/merchandise/merchandise.component.css index 545a8e9..b860f3a 100644 --- a/apps/merchandise/src/app/merchandise/merchandise.component.css +++ b/apps/merchandise/src/app/merchandise/merchandise.component.css @@ -30,6 +30,10 @@ line-height: 2.3rem; } +.mat-raised-button { + min-width: 1rem; +} + .spinner-container { position: fixed; left: 50%; diff --git a/apps/merchandise/src/app/merchandise/merchandise.component.html b/apps/merchandise/src/app/merchandise/merchandise.component.html index 31059f1..86bbce3 100644 --- a/apps/merchandise/src/app/merchandise/merchandise.component.html +++ b/apps/merchandise/src/app/merchandise/merchandise.component.html @@ -19,7 +19,7 @@ + matSort matSortActive="id" matSortDirection="asc" matSortDisableClear> @@ -63,7 +63,7 @@ - + diff --git a/apps/merchandise/src/app/merchandise/merchandise.component.ts b/apps/merchandise/src/app/merchandise/merchandise.component.ts index 56c5cfd..46b6d07 100644 --- a/apps/merchandise/src/app/merchandise/merchandise.component.ts +++ b/apps/merchandise/src/app/merchandise/merchandise.component.ts @@ -59,7 +59,7 @@ export class MerchandiseComponent implements OnInit, AfterViewInit { ngOnInit() { this.dataSource = new MerchandiseDataSource(this.merchandiseService); - this.dataSource.loadProducts('', 'id', 'desc', 0, 20); + this.dataSource.loadProducts('', 'id', 'asc', 0, 5); this.dataSource.connect(null) .subscribe(data => { diff --git a/apps/merchandise/src/app/services/merchandise.service.ts b/apps/merchandise/src/app/services/merchandise.service.ts index b7f9380..74f45a8 100644 --- a/apps/merchandise/src/app/services/merchandise.service.ts +++ b/apps/merchandise/src/app/services/merchandise.service.ts @@ -25,8 +25,8 @@ export class MerchandiseService { constructor(private http: HttpClient) { } findProducts( - filter = '', sortBy = 'id', sortOrder = 'desc', - pageNumber = 0, pageSize = 20): Observable { + filter = '', sortBy = 'id', sortOrder = 'asc', + pageNumber = 0, pageSize = 5): Observable { return this.http.get('/teespring/api/products', { observe: 'response', @@ -56,6 +56,7 @@ export class MerchandiseService { return of([]); }), + /* FIXME: preloading is not working map(data => { let urls = data.map(x => x.product.variants.map(v => [v.front_url, v.back_url])) .reduce((acc, cur) => acc.concat(cur)).reduce((acc, cur) => acc.concat(cur)); @@ -68,6 +69,7 @@ export class MerchandiseService { return data; }), + */ map(data => ({ products: data.map(x => x.product), totalCount: data.length > 0 ? data[0].totalCount : 0