diff --git a/matsen-tool/src/app/_views/products/new-product/new-product.component.html b/matsen-tool/src/app/_views/products/new-product/new-product.component.html index fb8489c..4d951e0 100644 --- a/matsen-tool/src/app/_views/products/new-product/new-product.component.html +++ b/matsen-tool/src/app/_views/products/new-product/new-product.component.html @@ -1,35 +1,37 @@ -

{{'basic.new-product' | translate}}

-

{{'basic.edit-product' | translate}}

+

{{ 'basic.new-product' | translate }}

+

{{ 'basic.edit-product' | translate }}

- - + +
- {{'form.name' | translate}} {{'form.mandatory' | translate}}. + {{ 'form.name' | translate }} {{ 'form.mandatory' | translate }}.
- - -
- {{'form.description' | translate}} {{'form.mandatory' | translate}}. + + +
+ {{ 'form.description' | translate }} {{ 'form.mandatory' | translate }}.
- - + +
- -

{{'system.delete-image' | translate}}

+ {{product.name}} +

{{ 'system.delete-image' | translate }}

- +
diff --git a/matsen-tool/src/app/_views/products/new-product/new-product.component.ts b/matsen-tool/src/app/_views/products/new-product/new-product.component.ts index de29956..7236561 100644 --- a/matsen-tool/src/app/_views/products/new-product/new-product.component.ts +++ b/matsen-tool/src/app/_views/products/new-product/new-product.component.ts @@ -2,7 +2,6 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {MediaObjectService, ProductJsonld, ProductService} from "@app/core/api/v1"; import {ModalStatus} from "@app/_helpers/modal.states"; import {FormGroup} from "@angular/forms"; -import {Subscription} from "rxjs"; import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; import {productForm} from "@app/_forms/apiForms"; import {AppHelperService} from "@app/_helpers/app-helper.service"; @@ -18,10 +17,7 @@ export class NewProductComponent implements OnInit { @Output() public submit: EventEmitter = new EventEmitter(); protected productForm: FormGroup; - protected productSub: Subscription; - protected selectedImage: File | null; - protected mediaSub: Subscription; constructor( private productService: ProductService, @@ -30,10 +26,7 @@ export class NewProductComponent implements OnInit { protected appHelperService: AppHelperService, ) { this.productForm = productForm; - this.productSub = new Subscription(); - this.selectedImage = null; - this.mediaSub = new Subscription(); } ngOnInit(): void { @@ -42,7 +35,7 @@ export class NewProductComponent implements OnInit { onSubmit() { if (this.selectedImage !== null) { - this.mediaSub = this.mediaObjectService.mediaObjectsPost( + this.mediaObjectService.mediaObjectsPost( this.selectedImage ).subscribe( data => { @@ -59,7 +52,7 @@ export class NewProductComponent implements OnInit { if (this.productForm.valid) { if (this.product.id === null || this.product.id === undefined) { // Create new product - this.productSub = this.productService.productsPost( + this.productService.productsPost( this.productForm.value as ProductJsonld ).subscribe( data => { @@ -69,7 +62,7 @@ export class NewProductComponent implements OnInit { ); } else { // Edit product - this.productSub = this.productService.productsIdPatch( + this.productService.productsIdPatch( this.appHelperService.extractId(this.product.id), this.productForm.value as ProductJsonld ).subscribe( diff --git a/matsen-tool/src/app/_views/products/product-list/product-list.component.html b/matsen-tool/src/app/_views/products/product-list/product-list.component.html index 8f2c369..1fe3374 100644 --- a/matsen-tool/src/app/_views/products/product-list/product-list.component.html +++ b/matsen-tool/src/app/_views/products/product-list/product-list.component.html @@ -1,13 +1,17 @@
- - + +
-
\ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/products/product-list/product-list.component.ts b/matsen-tool/src/app/_views/products/product-list/product-list.component.ts index 9504f50..7e043d1 100644 --- a/matsen-tool/src/app/_views/products/product-list/product-list.component.ts +++ b/matsen-tool/src/app/_views/products/product-list/product-list.component.ts @@ -21,16 +21,16 @@ import {ListComponent} from "@app/_components/list/list.component"; import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; @Component({ - selector: 'app-product-list', - templateUrl: './product-list.component.html', - styleUrl: './product-list.component.scss' + selector: 'app-product-list', + templateUrl: './product-list.component.html', + styleUrl: './product-list.component.scss' }) export class ProductListComponent implements OnInit, AfterViewInit { @Input() public user!: UserJsonld; @Input() public partner!: PartnerJsonld; @Input() public contact!: ContactJsonld; - @ViewChild("listComponent", { static: false }) listComponent!: ListComponent; + @ViewChild("listComponent", {static: false}) listComponent!: ListComponent; protected bShowNewProductButton: boolean; protected nameOrderFilter: OrderFilter; @@ -50,7 +50,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { this.nameOrderFilter = OrderFilter.Asc; } - ngOnInit(){ + ngOnInit() { this.listColDefinitions = []; let withSubResource: boolean = (this.partner !== undefined || this.contact !== undefined || this.user !== undefined); this.listColDefinitions = [ @@ -99,7 +99,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { this.listComponent.getData(); } - getProducts: ListGetDataFunctionType = (index: number, pageSize: number, term?: string): Observable => { + getProducts: ListGetDataFunctionType = (index: number, pageSize: number, term?: string): Observable => { return this.productService.productsGetCollection( index, pageSize, @@ -159,7 +159,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { this.listComponent.getData(); } - navigateToProductDetails = (element: any, column?: any)=> { + navigateToProductDetails = (element: any, column?: any) => { let product: ProductJsonld; if (this.user !== undefined || this.partner !== undefined || this.contact !== undefined) { product = element['product']; @@ -171,14 +171,14 @@ export class ProductListComponent implements OnInit, AfterViewInit { openModalNewProduct() { let product: ProductJsonld = {} as ProductJsonld; - this.appHelperService.openModal(NewProductComponent, { 'product': product }, this.listComponent.getData); + this.appHelperService.openModal(NewProductComponent, {'product': product}, this.listComponent.getData); } openModalAssignProduct() { if (this.user !== undefined) { this.appHelperService.openModal( AssignProductComponent, - { 'user' : this.user }, + {'user': this.user}, this.listComponent.getData ); } else if (this.partner !== undefined) { @@ -186,7 +186,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { partnerProduct.partnerIri = this.partner.id!; this.appHelperService.openModal( AssignProductComponent, - { 'partnerProduct' : partnerProduct }, + {'partnerProduct': partnerProduct}, this.listComponent.getData ); } else if (this.contact !== undefined) { @@ -194,7 +194,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { contactPartnerProduct.contactIri = this.contact.id!; this.appHelperService.openModal( AssignProductComponent, - { 'contactPartnerProduct' : contactPartnerProduct, 'partnerIri' : this.contact.partnerIri }, + {'contactPartnerProduct': contactPartnerProduct, 'partnerIri': this.contact.partnerIri}, this.listComponent.getData ); } else { @@ -202,7 +202,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { } } - unassignProduct = (element: any)=> { + unassignProduct = (element: any) => { let confirmMessage = ""; this.translateService.get('system.confirm-unassign').subscribe((translation: string) => { confirmMessage = translation; diff --git a/matsen-tool/src/app/_views/products/products-detail/products-detail.component.html b/matsen-tool/src/app/_views/products/products-detail/products-detail.component.html index a385eb3..442ee51 100644 --- a/matsen-tool/src/app/_views/products/products-detail/products-detail.component.html +++ b/matsen-tool/src/app/_views/products/products-detail/products-detail.component.html @@ -60,13 +60,13 @@ - - \ No newline at end of file + diff --git a/matsen-tool/src/app/_views/products/products-detail/products-detail.component.ts b/matsen-tool/src/app/_views/products/products-detail/products-detail.component.ts index 82ec046..7cb624b 100644 --- a/matsen-tool/src/app/_views/products/products-detail/products-detail.component.ts +++ b/matsen-tool/src/app/_views/products/products-detail/products-detail.component.ts @@ -1,20 +1,17 @@ import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; import {environment} from "@environments/environment"; import {ActivatedRoute} from "@angular/router"; -import {Subscription, switchMap} from "rxjs"; +import {switchMap} from "rxjs"; import { ProductJsonld, ProductService, UserProductJsonld, UserProductService } from "@app/core/api/v1"; -import {ModalStatus} from "@app/_helpers/modal.states"; -import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; import {NewProductComponent} from "@app/_views/products/new-product/new-product.component"; import {User} from "@app/_models"; import {AccountService} from "@app/_services"; import {AppHelperService} from "@app/_helpers/app-helper.service"; -import {NewSaleComponent} from "@app/_views/sales/new-sale/new-sale.component"; import {ToggleComponent} from "@app/_components/toggle/toggle.component"; import {PartnerListComponent} from "@app/_views/partners/partner-list/partner-list.component"; import {SaleListComponent} from "@app/_views/sales/sale-list/sale-list.component"; @@ -26,21 +23,19 @@ import {SaleListComponent} from "@app/_views/sales/sale-list/sale-list.component }) export class ProductsDetailComponent implements OnInit, AfterViewInit { - @ViewChild("toggleCustomers", { static: true }) toggleCustomers!: ToggleComponent; - @ViewChild("customerListComponent", { static: false }) customerListComponent!: PartnerListComponent; - @ViewChild("toggleSuppliers", { static: true }) toggleSuppliers!: ToggleComponent; - @ViewChild("suppliersListComponent", { static: false }) suppliersListComponent!: PartnerListComponent; - @ViewChild("toggleServices", { static: true }) toggleServices!: ToggleComponent; - @ViewChild("servicesListComponent", { static: false }) servicesListComponent!: PartnerListComponent; - @ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; - @ViewChild("salesListComponent", { static: false }) salesListComponent!: SaleListComponent; + @ViewChild("toggleCustomers", {static: true}) toggleCustomers!: ToggleComponent; + @ViewChild("customerListComponent", {static: false}) customerListComponent!: PartnerListComponent; + @ViewChild("toggleSuppliers", {static: true}) toggleSuppliers!: ToggleComponent; + @ViewChild("suppliersListComponent", {static: false}) suppliersListComponent!: PartnerListComponent; + @ViewChild("toggleServices", {static: true}) toggleServices!: ToggleComponent; + @ViewChild("servicesListComponent", {static: false}) servicesListComponent!: PartnerListComponent; + @ViewChild("toggleSales", {static: true}) toggleSales!: ToggleComponent; + @ViewChild("salesListComponent", {static: false}) salesListComponent!: SaleListComponent; protected readonly environment = environment; protected productId: string; - protected productDetailSub: Subscription; protected product: ProductJsonld; - protected userProductSub: Subscription; protected userProduct: UserProductJsonld | null; protected user: User | null; @@ -53,10 +48,8 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit { ) { this.productId = ""; this.user = this.accountService.userValue; - this.productDetailSub = new Subscription(); this.product = {} as ProductJsonld; - this.userProductSub = new Subscription(); this.userProduct = null; } @@ -73,7 +66,7 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit { } getData = () => { - this.productDetailSub = this.productService.productsIdGet( + this.productService.productsIdGet( this.productId ).pipe( switchMap(data => { @@ -98,7 +91,7 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit { followProduct(event: any) { if (this.userProduct === null) { - this.userProductSub = this.userProductService.userProductsPost( + this.userProductService.userProductsPost( { user: this.user?.id, productIri: this.product.id, @@ -109,7 +102,7 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit { } ); } else { - this.userProductSub = this.userProductService.userProductsIdDelete( + this.userProductService.userProductsIdDelete( this.appHelperService.extractId(this.userProduct.id) ).subscribe( data => { @@ -120,6 +113,6 @@ export class ProductsDetailComponent implements OnInit, AfterViewInit { } openModalEditProduct() { - this.appHelperService.openModal(NewProductComponent, { 'product': this.product }, this.getData); + this.appHelperService.openModal(NewProductComponent, {'product': this.product}, this.getData); } } diff --git a/matsen-tool/src/app/_views/products/products.component.html b/matsen-tool/src/app/_views/products/products.component.html index d99550c..b506819 100644 --- a/matsen-tool/src/app/_views/products/products.component.html +++ b/matsen-tool/src/app/_views/products/products.component.html @@ -2,7 +2,5 @@

{{ 'basic.products' | translate }}

- + \ No newline at end of file diff --git a/matsen-tool/src/app/_views/products/products.component.ts b/matsen-tool/src/app/_views/products/products.component.ts index db1352f..87d87da 100644 --- a/matsen-tool/src/app/_views/products/products.component.ts +++ b/matsen-tool/src/app/_views/products/products.component.ts @@ -19,6 +19,4 @@ export class ProductsComponent implements OnInit, AfterViewInit { ngAfterViewInit(): void { } - - } diff --git a/matsen-tool/src/app/_views/profile/profile.component.html b/matsen-tool/src/app/_views/profile/profile.component.html index f72266c..3846160 100644 --- a/matsen-tool/src/app/_views/profile/profile.component.html +++ b/matsen-tool/src/app/_views/profile/profile.component.html @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/matsen-tool/src/app/_views/profile/profile.component.ts b/matsen-tool/src/app/_views/profile/profile.component.ts index 1f1f402..6a7d254 100644 --- a/matsen-tool/src/app/_views/profile/profile.component.ts +++ b/matsen-tool/src/app/_views/profile/profile.component.ts @@ -5,13 +5,13 @@ import {UserDetailComponent} from "@app/_views/user/user-detail/user-detail.comp import {AppHelperService} from "@app/_helpers/app-helper.service"; @Component({ - selector: 'app-profile', - templateUrl: './profile.component.html', - styleUrl: './profile.component.scss' + selector: 'app-profile', + templateUrl: './profile.component.html', + styleUrl: './profile.component.scss' }) export class ProfileComponent implements OnInit, AfterViewInit { - @ViewChild("userDetailComponent", { static: false }) userDetailComponent!: UserDetailComponent; + @ViewChild("userDetailComponent", {static: false}) userDetailComponent!: UserDetailComponent; protected user!: UserJsonld; @@ -40,5 +40,4 @@ export class ProfileComponent implements OnInit, AfterViewInit { } - } 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 27fafc0..5250e71 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 @@ -6,12 +6,12 @@
@@ -20,12 +20,12 @@
@@ -33,7 +33,7 @@
- +
{{ 'form.turnover' | translate }} {{ 'form.mandatory' | translate }}.
@@ -41,12 +41,12 @@
- +
- +
@@ -58,4 +58,3 @@
- diff --git a/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.ts b/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.ts index b698dd6..c115a35 100644 --- a/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.ts +++ b/matsen-tool/src/app/_views/sales/new-sale/new-sale.component.ts @@ -1,23 +1,19 @@ import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import { PartnerJsonld, - PartnerService, ProductJsonld, + PartnerService, ProductService, SaleJsonld, SaleService } from "@app/core/api/v1"; import {ModalStatus} from "@app/_helpers/modal.states"; import {FormGroup} from "@angular/forms"; -import {Observable, Subscription} from "rxjs"; +import {Observable} from "rxjs"; import {TranslateService} from "@ngx-translate/core"; import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; import {saleForm} from "@app/_forms/apiForms"; import {AppHelperService} from "@app/_helpers/app-helper.service"; import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; -import {MatTableDataSource} from "@angular/material/table"; -import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; -import {ListComponent} from "@app/_components/list/list.component"; -import {ListColDefinition} from "@app/_components/list/list-col-definition"; @Component({ selector: 'app-new-sale', @@ -28,8 +24,8 @@ export class NewSaleComponent implements OnInit, AfterViewInit { @Input() public sale!: SaleJsonld; @Input() public partner!: PartnerJsonld; @Output() public submit: EventEmitter = new EventEmitter(); - @ViewChild('partnerSearchSelect', { static: false }) partnerSearchSelect!: SearchSelectComponent; - @ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent; + @ViewChild('partnerSearchSelect', {static: false}) partnerSearchSelect!: SearchSelectComponent; + @ViewChild('productSearchSelect', {static: false}) productSearchSelect!: SearchSelectComponent; protected readonly SearchSelectComponent = SearchSelectComponent; protected saleForm: FormGroup; diff --git a/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html b/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html index a47348f..cb2dedd 100644 --- a/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html +++ b/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.html @@ -1,6 +1,8 @@
- +
-
\ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts b/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts index f0edd41..f83f948 100644 --- a/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts +++ b/matsen-tool/src/app/_views/sales/sale-list/sale-list.component.ts @@ -1,12 +1,8 @@ import {AfterViewInit, Component, Input, OnInit, ViewChild} from '@angular/core'; -import {Subscription} from "rxjs"; -import {PartnerJsonld, ProductJsonld, SaleJsonld, SaleService, SaleSummaryJsonld, UserJsonld} from "@app/core/api/v1"; -import {TranslateService} from "@ngx-translate/core"; +import {PartnerJsonld, ProductJsonld, SaleJsonld, SaleService, UserJsonld} from "@app/core/api/v1"; import {Router} from "@angular/router"; import {AppHelperService} from "@app/_helpers/app-helper.service"; -import {MatSort, Sort} from "@angular/material/sort"; -import {MatTableDataSource} from "@angular/material/table"; -import {PagingComponent} from "@app/_components/paging/paging.component"; +import {Sort} from "@angular/material/sort"; import {NewSaleComponent} from "@app/_views/sales/new-sale/new-sale.component"; import {OrderFilter} from "@app/_models/orderFilter"; import {AccountService} from "@app/_services"; @@ -14,16 +10,16 @@ import {ListComponent} from "@app/_components/list/list.component"; import {ListColDefinition} from "@app/_components/list/list-col-definition"; @Component({ - selector: 'app-sale-list', - templateUrl: './sale-list.component.html', - styleUrl: './sale-list.component.scss' + selector: 'app-sale-list', + templateUrl: './sale-list.component.html', + styleUrl: './sale-list.component.scss' }) export class SaleListComponent implements OnInit, AfterViewInit { @Input() public user!: UserJsonld; @Input() public product!: ProductJsonld; @Input() public partner!: PartnerJsonld; - @ViewChild("listComponent", { static: false }) listComponent!: ListComponent; + @ViewChild("listComponent", {static: false}) listComponent!: ListComponent; protected listColDefinitions!: ListColDefinition[]; @@ -101,7 +97,7 @@ export class SaleListComponent implements OnInit, AfterViewInit { ); } - onSortChange = (sortState: Sort)=> { + onSortChange = (sortState: Sort) => { // Reset page index to first page let order: OrderFilter; if (sortState.direction === "") { @@ -120,7 +116,10 @@ export class SaleListComponent implements OnInit, AfterViewInit { openModalNewSale() { let sale: SaleJsonld = {} as SaleJsonld; - this.appHelperService.openModal(NewSaleComponent, { 'sale': sale, 'partner': this.partner }, this.listComponent.getData); + this.appHelperService.openModal(NewSaleComponent, { + 'sale': sale, + 'partner': this.partner + }, this.listComponent.getData); } -} +} \ No newline at end of file diff --git a/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.html b/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.html index 2efb69f..a9f214f 100644 --- a/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.html +++ b/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.html @@ -1,5 +1,7 @@ \ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.ts b/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.ts index e81e3ce..79c4497 100644 --- a/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.ts +++ b/matsen-tool/src/app/_views/sales/sale-summary/sale-summary.component.ts @@ -1,15 +1,14 @@ import {AfterViewInit, Component, Input, OnInit} from '@angular/core'; import {Subscription} from "rxjs"; -import {SaleJsonld, SaleSummaryJsonld, SaleSummaryService, UserJsonld} from "@app/core/api/v1"; +import {SaleSummaryJsonld, SaleSummaryService, UserJsonld} from "@app/core/api/v1"; import {AppHelperService} from "@app/_helpers/app-helper.service"; -import {Router} from "@angular/router"; @Component({ - selector: 'app-sale-summary', - templateUrl: './sale-summary.component.html', - styleUrl: './sale-summary.component.scss' + selector: 'app-sale-summary', + templateUrl: './sale-summary.component.html', + styleUrl: './sale-summary.component.scss' }) -export class SaleSummaryComponent implements OnInit, AfterViewInit { +export class SaleSummaryComponent implements OnInit, AfterViewInit { @Input() public user!: UserJsonld; @@ -68,4 +67,4 @@ export class SaleSummaryComponent implements OnInit, AfterViewInit { } return 0; } -} +} \ No newline at end of file diff --git a/matsen-tool/src/app/_views/sales/sales-detail/sales-detail.component.ts b/matsen-tool/src/app/_views/sales/sales-detail/sales-detail.component.ts index e1f372e..8fc6c81 100644 --- a/matsen-tool/src/app/_views/sales/sales-detail/sales-detail.component.ts +++ b/matsen-tool/src/app/_views/sales/sales-detail/sales-detail.component.ts @@ -1,18 +1,15 @@ -import {AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; +import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; import {Subscription} from "rxjs"; import {MatTableDataSource} from "@angular/material/table"; import {CommentJsonld, PostJsonld, PostService, SaleJsonld, SaleService} from "@app/core/api/v1"; -import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; import {User} from "@app/_models"; import {AccountService} from "@app/_services"; import {NewPostComponent} from "@app/_views/posts/new-post/new-post.component"; -import {ModalStatus} from "@app/_helpers/modal.states"; import {NewCommentComponent} from "@app/_views/posts/new-comment/new-comment.component"; import {NewSaleComponent} from "@app/_views/sales/new-sale/new-sale.component"; import {ActivatedRoute} from "@angular/router"; import {AppHelperService} from "@app/_helpers/app-helper.service"; import {PagingComponent} from "@app/_components/paging/paging.component"; -import {NewTaskComponent} from "@app/_views/tasks/new-task/new-task.component"; @Component({ selector: 'app-sales-detail', @@ -132,5 +129,4 @@ export class SalesDetailComponent implements OnInit, AfterViewInit { this.commentsVisibility.set(post.id, !currentVisibility); } } - -} +} \ No newline at end of file diff --git a/matsen-tool/src/app/_views/sales/sales.component.ts b/matsen-tool/src/app/_views/sales/sales.component.ts index 497ad69..54cc0f7 100644 --- a/matsen-tool/src/app/_views/sales/sales.component.ts +++ b/matsen-tool/src/app/_views/sales/sales.component.ts @@ -18,11 +18,10 @@ registerLocaleData(localeDe); ], }) export class SalesComponent implements OnInit, AfterViewInit { - @ViewChild("saleSummary", { static: false }) saleSummary!: SaleSummaryComponent; - @ViewChild("saleList", { static: false }) saleList!: SaleListComponent; + @ViewChild("saleSummary", {static: false}) saleSummary!: SaleSummaryComponent; + @ViewChild("saleList", {static: false}) saleList!: SaleListComponent; - constructor( - ) { + constructor() { } ngOnInit() { diff --git a/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.html b/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.html index 99b1b47..81374b6 100644 --- a/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.html +++ b/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.html @@ -28,7 +28,8 @@

{{ 'form.contact-type' | translate }}:

- +
-
- diff --git a/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.ts b/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.ts index f2efe27..67461ce 100644 --- a/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.ts +++ b/matsen-tool/src/app/_views/tasks/new-task-note/new-task-note.component.ts @@ -1,6 +1,5 @@ import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import { - ContactJsonld, ContactService, TaskJsonld, TaskNoteJsonld, @@ -8,13 +7,10 @@ import { } from "@app/core/api/v1"; import {ModalStatus} from "@app/_helpers/modal.states"; import {FormGroup} from "@angular/forms"; -import {Subscription} from "rxjs"; import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; import {AppHelperService} from "@app/_helpers/app-helper.service"; import {taskNoteForm} from "@app/_forms/apiForms"; import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; -import {MatTableDataSource} from "@angular/material/table"; -import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; @Component({ @@ -26,7 +22,7 @@ export class NewTaskNoteComponent implements OnInit, AfterViewInit { @Input() public task!: TaskJsonld; @Input() public taskNote!: TaskNoteJsonld; @Output() public submit: EventEmitter = new EventEmitter(); - @ViewChild('contactSearchSelect', { static: false }) contactSearchSelect!: SearchSelectComponent; + @ViewChild('contactSearchSelect', {static: false}) contactSearchSelect!: SearchSelectComponent; protected readonly SearchSelectComponent = SearchSelectComponent; protected taskNoteForm: FormGroup; diff --git a/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts b/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts index 1536b02..ec5b98e 100644 --- a/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts +++ b/matsen-tool/src/app/_views/tasks/new-task/new-task.component.ts @@ -1,23 +1,16 @@ import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import { - PartnerService, - ProductJsonld, ProductService, TaskJsonld, TaskService, - UserJsonld, UserService } from "@app/core/api/v1"; import {ModalStatus} from "@app/_helpers/modal.states"; import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer"; import {FormGroup} from "@angular/forms"; -import {debounceTime, distinctUntilChanged, Observable, OperatorFunction, Subscription, switchMap} from "rxjs"; import {taskForm} from "@app/_forms/apiForms"; import {AppHelperService} from "@app/_helpers/app-helper.service"; -import {filter, map} from "rxjs/operators"; -import {MatTableDataSource} from "@angular/material/table"; import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; -import {SearchInputColDef} from "@app/_components/search-input/search-input-col-def"; import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; @Component({ @@ -28,8 +21,8 @@ import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-funct export class NewTaskComponent implements OnInit, AfterViewInit { @Input() public task!: TaskJsonld; @Output() public submit: EventEmitter = new EventEmitter(); - @ViewChild('userSearchSelect', { static: false }) userSearchSelect!: SearchSelectComponent; - @ViewChild('productSearchSelect', { static: false }) productSearchSelect!: SearchSelectComponent; + @ViewChild('userSearchSelect', {static: false}) userSearchSelect!: SearchSelectComponent; + @ViewChild('productSearchSelect', {static: false}) productSearchSelect!: SearchSelectComponent; protected readonly SearchSelectComponent = SearchSelectComponent; protected taskForm: FormGroup; diff --git a/matsen-tool/src/app/_views/tasks/task-list/task-list.component.html b/matsen-tool/src/app/_views/tasks/task-list/task-list.component.html index f7b68de..a4aec90 100644 --- a/matsen-tool/src/app/_views/tasks/task-list/task-list.component.html +++ b/matsen-tool/src/app/_views/tasks/task-list/task-list.component.html @@ -20,11 +20,13 @@
-
+
-
- {{ task.dueAt | date:'dd.MM.YYYY - HH:mm':'GMT+0000' }} Uhr + {{ task.dueAt | date:'dd.MM.YYYY - HH:mm':'GMT+0000' }} + Uhr

@@ -86,8 +89,10 @@

{{ task.headline }}

- +
-

- +

+ + - - mit + mit +

{{ taskNote.createdAt | date:'dd.MM.YYYY - HH:mm':'GMT+0000' }} Uhr

@@ -121,7 +129,8 @@

-
@@ -132,4 +141,4 @@
-
\ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/tasks/task-list/task-list.component.ts b/matsen-tool/src/app/_views/tasks/task-list/task-list.component.ts index d0acb62..c208e69 100644 --- a/matsen-tool/src/app/_views/tasks/task-list/task-list.component.ts +++ b/matsen-tool/src/app/_views/tasks/task-list/task-list.component.ts @@ -17,15 +17,15 @@ import {AccountService} from "@app/_services"; import {User} from "@app/_models"; @Component({ - selector: 'app-task-list', - templateUrl: './task-list.component.html', - styleUrl: './task-list.component.scss' + selector: 'app-task-list', + templateUrl: './task-list.component.html', + styleUrl: './task-list.component.scss' }) export class TaskListComponent implements OnInit, AfterViewInit { @Input() public partner!: PartnerJsonld; @Input() public user!: UserJsonld | undefined; - @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; + @ViewChild("pagingComponent", {static: false}) pagingComponent!: PagingComponent; protected currentUser: User | null; protected tasks: Array; @@ -138,24 +138,24 @@ export class TaskListComponent implements OnInit, AfterViewInit { let task: TaskJsonld = {} as TaskJsonld; task.partnerIri = this.partner.id; task.completed = false; - this.appHelperService.openModal(NewTaskComponent, { 'task': task }, this.getTasksData); + this.appHelperService.openModal(NewTaskComponent, {'task': task}, this.getTasksData); } openModalEditTask(task: TaskJsonld) { - this.appHelperService.openModal(NewTaskComponent, { 'task': task }, this.getTasksData); + this.appHelperService.openModal(NewTaskComponent, {'task': task}, this.getTasksData); } openModalNewTaskNote(task: TaskJsonld) { let taskNote: TaskNoteJsonld = {} as TaskNoteJsonld; taskNote.taskIri = task.id ?? null; this.appHelperService.openModal( - NewTaskNoteComponent, { 'taskNote': taskNote, 'task': task }, this.afterCommentCreation, task.id + NewTaskNoteComponent, {'taskNote': taskNote, 'task': task}, this.afterCommentCreation, task.id ); } openModalEditTaskNote(taskNote: TaskNoteJsonld, task: TaskJsonld) { this.appHelperService.openModal( - NewTaskNoteComponent, { 'taskNote': taskNote, 'task': task }, this.afterCommentCreation, task.id + NewTaskNoteComponent, {'taskNote': taskNote, 'task': task}, this.afterCommentCreation, task.id ); } diff --git a/matsen-tool/src/app/_views/tasks/tasks.component.html b/matsen-tool/src/app/_views/tasks/tasks.component.html index 01a8c3b..1fe62cb 100644 --- a/matsen-tool/src/app/_views/tasks/tasks.component.html +++ b/matsen-tool/src/app/_views/tasks/tasks.component.html @@ -1,6 +1,6 @@
-

{{'basic.tasks' | translate}}

+

{{ 'basic.tasks' | translate }}

-
\ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/tasks/tasks.component.ts b/matsen-tool/src/app/_views/tasks/tasks.component.ts index 1db73f3..53685f9 100644 --- a/matsen-tool/src/app/_views/tasks/tasks.component.ts +++ b/matsen-tool/src/app/_views/tasks/tasks.component.ts @@ -10,7 +10,7 @@ import {TaskListComponent} from "@app/_views/tasks/task-list/task-list.component styleUrl: './tasks.component.scss' }) export class TasksComponent implements OnInit, AfterViewInit { - @ViewChild("taskListComponent", { static: false }) taskListComponent!: TaskListComponent; + @ViewChild("taskListComponent", {static: false}) taskListComponent!: TaskListComponent; protected user: User | null; @@ -27,6 +27,4 @@ export class TasksComponent implements OnInit, AfterViewInit { ngAfterViewInit() { } - - } diff --git a/matsen-tool/src/app/_views/user/user-detail/user-detail.component.html b/matsen-tool/src/app/_views/user/user-detail/user-detail.component.html index 0130c87..41c8715 100644 --- a/matsen-tool/src/app/_views/user/user-detail/user-detail.component.html +++ b/matsen-tool/src/app/_views/user/user-detail/user-detail.component.html @@ -4,73 +4,80 @@

{{ user.firstName }} {{ user.lastName }}

-
{{('user.email' | translate)}}
+
{{ ('user.email' | translate) }}
{{ user.email }}
-
{{('user.goals' | translate)}}
+
{{ ('user.goals' | translate) }}
{{ user.goals }}
{{user.firstName}} {{user.lastName}} + alt="{{user.firstName}} {{user.lastName}}" title="{{user.firstName}} {{user.lastName}}"/>
- - + - + - + - + + [user]="user"> - + - + - + - \ No newline at end of file + diff --git a/matsen-tool/src/app/_views/user/user-detail/user-detail.component.ts b/matsen-tool/src/app/_views/user/user-detail/user-detail.component.ts index 3b88da6..c274765 100644 --- a/matsen-tool/src/app/_views/user/user-detail/user-detail.component.ts +++ b/matsen-tool/src/app/_views/user/user-detail/user-detail.component.ts @@ -3,7 +3,6 @@ import {UserJsonld, UserService} from "@app/core/api/v1"; import {Subscription} from "rxjs"; import {AccountService} from "@app/_services"; import {AppHelperService} from "@app/_helpers/app-helper.service"; -import {UsersComponent} from "@app/_views/user/users.component"; import {ToggleComponent} from "@app/_components/toggle/toggle.component"; import {TaskListComponent} from "@app/_views/tasks/task-list/task-list.component"; import {SaleListComponent} from "@app/_views/sales/sale-list/sale-list.component"; @@ -14,29 +13,28 @@ import {SaleSummaryComponent} from "@app/_views/sales/sale-summary/sale-summary. import {ActivatedRoute} from "@angular/router"; @Component({ - selector: 'app-user-detail', - templateUrl: './user-detail.component.html', - styleUrl: './user-detail.component.scss' + selector: 'app-user-detail', + templateUrl: './user-detail.component.html', + styleUrl: './user-detail.component.scss' }) export class UserDetailComponent implements OnInit, AfterViewInit { @Input() public user!: UserJsonld; - @ViewChild("togglePosts", { static: true }) togglePosts!: ToggleComponent; - @ViewChild("postListComponent", { static: false }) postsComponent!: PostListComponent; - @ViewChild("toggleTasks", { static: true }) toggleTasks!: ToggleComponent; - @ViewChild("taskListComponent", { static: false }) taskListComponent!: TaskListComponent; - @ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; - @ViewChild("saleSummaryComponent", { static: false }) saleSummaryComponent!: SaleSummaryComponent; - @ViewChild("saleListComponent", { static: false }) saleListComponent!: SaleListComponent; - @ViewChild("toggleProducts", { static: true }) toggleProducts!: ToggleComponent; - @ViewChild("productListComponent", { static: false }) productListComponent!: ProductListComponent; - @ViewChild("toggleCustomers", { static: true }) toggleCustomers!: ToggleComponent; - @ViewChild("customerListComponent", { static: false }) customerListComponent!: PartnerListComponent; - @ViewChild("toggleSuppliers", { static: true }) toggleSuppliers!: ToggleComponent; - @ViewChild("suppliersListComponent", { static: false }) suppliersListComponent!: PartnerListComponent; - @ViewChild("toggleServices", { static: true }) toggleServices!: ToggleComponent; - @ViewChild("servicesListComponent", { static: false }) servicesListComponent!: PartnerListComponent; + @ViewChild("togglePosts", {static: true}) togglePosts!: ToggleComponent; + @ViewChild("postListComponent", {static: false}) postsComponent!: PostListComponent; + @ViewChild("toggleTasks", {static: true}) toggleTasks!: ToggleComponent; + @ViewChild("taskListComponent", {static: false}) taskListComponent!: TaskListComponent; + @ViewChild("toggleSales", {static: true}) toggleSales!: ToggleComponent; + @ViewChild("saleSummaryComponent", {static: false}) saleSummaryComponent!: SaleSummaryComponent; + @ViewChild("saleListComponent", {static: false}) saleListComponent!: SaleListComponent; + @ViewChild("toggleProducts", {static: true}) toggleProducts!: ToggleComponent; + @ViewChild("productListComponent", {static: false}) productListComponent!: ProductListComponent; + @ViewChild("toggleCustomers", {static: true}) toggleCustomers!: ToggleComponent; + @ViewChild("customerListComponent", {static: false}) customerListComponent!: PartnerListComponent; + @ViewChild("toggleSuppliers", {static: true}) toggleSuppliers!: ToggleComponent; + @ViewChild("suppliersListComponent", {static: false}) suppliersListComponent!: PartnerListComponent; + @ViewChild("toggleServices", {static: true}) toggleServices!: ToggleComponent; + @ViewChild("servicesListComponent", {static: false}) servicesListComponent!: PartnerListComponent; - protected userSub: Subscription; protected isCurrentUser: boolean; constructor( @@ -45,7 +43,6 @@ export class UserDetailComponent implements OnInit, AfterViewInit { protected appHelperService: AppHelperService, private route: ActivatedRoute, ) { - this.userSub = new Subscription(); this.isCurrentUser = false; } @@ -64,7 +61,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit { } getUserData(userId: string) { - this.userSub = this.userService.usersIdGet( + this.userService.usersIdGet( userId ).subscribe( data => { diff --git a/matsen-tool/src/app/_views/user/user-list/user-list.component.html b/matsen-tool/src/app/_views/user/user-list/user-list.component.html index eecdc2c..0fa23c7 100644 --- a/matsen-tool/src/app/_views/user/user-list/user-list.component.html +++ b/matsen-tool/src/app/_views/user/user-list/user-list.component.html @@ -5,4 +5,4 @@ [onSortFunction]="onSortChange" [listColDefinitions]="listColDefinitions" > -
\ No newline at end of file +
diff --git a/matsen-tool/src/app/_views/user/user-list/user-list.component.ts b/matsen-tool/src/app/_views/user/user-list/user-list.component.ts index a734f5f..b52637d 100644 --- a/matsen-tool/src/app/_views/user/user-list/user-list.component.ts +++ b/matsen-tool/src/app/_views/user/user-list/user-list.component.ts @@ -1,25 +1,21 @@ import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; -import {MatSort, Sort} from "@angular/material/sort"; -import {PagingComponent} from "@app/_components/paging/paging.component"; -import {Subscription} from "rxjs"; +import {Sort} from "@angular/material/sort"; import {UserJsonld, UserService} from "@app/core/api/v1"; -import {MatTableDataSource} from "@angular/material/table"; import {OrderFilter} from "@app/_models/orderFilter"; import {Router} from "@angular/router"; import {AppHelperService} from "@app/_helpers/app-helper.service"; import {ListComponent} from "@app/_components/list/list.component"; import {ListColDefinition} from "@app/_components/list/list-col-definition"; -import {ListColTypeAddress} from "@app/_components/list/list-col-type-address"; import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; @Component({ - selector: 'app-user-list', - templateUrl: './user-list.component.html', - styleUrl: './user-list.component.scss' + selector: 'app-user-list', + templateUrl: './user-list.component.html', + styleUrl: './user-list.component.scss' }) export class UserListComponent implements OnInit, AfterViewInit { - @ViewChild("listComponent", { static: false }) listComponent!: ListComponent; + @ViewChild("listComponent", {static: false}) listComponent!: ListComponent; protected listColDefinitions!: ListColDefinition[]; diff --git a/matsen-tool/src/app/_views/user/users.component.ts b/matsen-tool/src/app/_views/user/users.component.ts index 69b8d7f..3d491f3 100644 --- a/matsen-tool/src/app/_views/user/users.component.ts +++ b/matsen-tool/src/app/_views/user/users.component.ts @@ -5,21 +5,19 @@ import {AccountService} from "@app/_services"; import {AppHelperService} from "@app/_helpers/app-helper.service"; @Component({ - selector: 'app-users', - templateUrl: './users.component.html', - styleUrl: './users.component.scss' + selector: 'app-users', + templateUrl: './users.component.html', + styleUrl: './users.component.scss' }) export class UsersComponent implements OnInit, AfterViewInit { @Input() public user!: UserJsonld; - protected userSub: Subscription; constructor( private accountService: AccountService, private userService: UserService, protected appHelperService: AppHelperService ) { - this.userSub = new Subscription(); } ngOnInit() { @@ -33,7 +31,7 @@ export class UsersComponent implements OnInit, AfterViewInit { getData() { const user = this.accountService.userValue; if (user?.id !== null && user?.id !== undefined) { - this.userSub = this.userService.usersIdGet( + this.userService.usersIdGet( this.appHelperService.extractId(user.id) ).subscribe( data => { diff --git a/matsen-tool/src/app/app.component.html b/matsen-tool/src/app/app.component.html index 11cd4e1..3109f46 100644 --- a/matsen-tool/src/app/app.component.html +++ b/matsen-tool/src/app/app.component.html @@ -4,8 +4,8 @@