(this.products);
- this.productsLength = Number(data["hydra:totalItems"]);
- this.productsPaginator.length = this.productsLength;
- }
- );
- }
- /** Announce the change in sort state for assistive technology. */
- onSortChange(sortState: Sort) {
- // Reset page index to first page
- this.productsPageIndex = 0;
-
- let order: OrderFilter;
- if (sortState.direction === "") {
- order = OrderFilter.Undefined;
- } else {
- order = sortState.direction;
- }
-
- // this.nameOrderAsc = OrderFilter.Undefined;
- // this.cityOrderAsc = OrderFilter.Undefined;
- // this.websiteOrderAsc = OrderFilter.Undefined;
- // switch (sortState.active) {
- // case "name":
- // this.nameOrderAsc = order;
- // break;
- // case "address":
- // this.cityOrderAsc = order;
- // break;
- // case "website":
- // this.websiteOrderAsc = order;
- // break;
- // }
- this.getProductsData();
- }
-
- handlePageEvent(e: PageEvent) {
- this.productsPageEvent = e;
- this.productsLength = e.length;
- this.productsPageIndex = e.pageIndex.valueOf();
- this.productsPageSize = e.pageSize.valueOf();
- this.getProductsData();
- }
-
- navigateToProductDetails(element: any) {
- const product: ProductJsonld = element as ProductJsonld;
- this.router.navigate(['/products', this.appHelperService.extractId(product.id)]);
- }
-
- openModalNewProduct() {
- const modalRefProduct = this.modalService.open(NewProductComponent, this.appHelperService.getModalOptions());
- // TODO: Warum muss ich einen leeren String übergeben, damit es funktioniert?
- let product: ProductJsonld = {} as ProductJsonld;
- product.name = "";
- modalRefProduct.componentInstance.product = product;
- modalRefProduct.componentInstance.submit.subscribe((modalStatus: ModalStatus) => {
- if (modalStatus === ModalStatus.Submitted) {
- modalRefProduct.dismiss();
- this.getProductsData();
- }
- });
- }
}
diff --git a/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.html b/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.html
index 2e42519..f4c7f8b 100644
--- a/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.html
+++ b/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.html
@@ -73,7 +73,7 @@
-
+
diff --git a/matsen-tool/src/app/app.component.html b/matsen-tool/src/app/app.component.html
index 3109f46..11cd4e1 100644
--- a/matsen-tool/src/app/app.component.html
+++ b/matsen-tool/src/app/app.component.html
@@ -4,8 +4,8 @@
diff --git a/matsen-tool/src/app/app.module.ts b/matsen-tool/src/app/app.module.ts
index 71a1d84..f5c2e90 100644
--- a/matsen-tool/src/app/app.module.ts
+++ b/matsen-tool/src/app/app.module.ts
@@ -55,6 +55,7 @@ import { TaskListComponent } from './_views/tasks/task-list/task-list.component'
import { SearchInputComponent } from './_components/search-input/search-input.component';
import { PagingComponent } from '@app/_components/paging/paging.component';
import { PartnerListComponent } from './_views/partners/partner-list/partner-list.component';
+import { ProductListComponent } from './_views/products/product-list/product-list.component';
export function apiConfigFactory(): Configuration {
const params: ConfigurationParameters = {
@@ -131,6 +132,7 @@ export function HttpLoaderFactory(http: HttpClient) {
SearchInputComponent,
PagingComponent,
PartnerListComponent,
+ ProductListComponent,
],
providers: [
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},