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 d01318a..004c16a 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 @@ -68,13 +68,13 @@ - - - {{ 'overview.details' | translate }} + + + {{ 'overview.unassign' | translate }} - - + + 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 00205e0..8d6278e 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 @@ -49,7 +49,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { protected appHelperService: AppHelperService, ) { this.sort = new MatSort(); - this.displayedColumns = ['details', 'pos', 'image', 'name', 'storage', 'number', 'unassign']; + this.displayedColumns = ['details', 'pos', 'image', 'name', 'storage', 'number']; this.productsSub = new Subscription(); this.products = []; @@ -58,6 +58,9 @@ export class ProductListComponent implements OnInit, AfterViewInit { } ngOnInit(){ + if (this.partner || this.contact) { + this.displayedColumns.push('unassign'); + } this.bShowNewProductButton = this.user === undefined && this.partner === undefined && this.contact === undefined; } @@ -225,6 +228,13 @@ export class ProductListComponent implements OnInit, AfterViewInit { const userConfirmed = window.confirm(confirmMessage); if (userConfirmed) { console.log(element); + console.log(this.partner); + console.log(this.contact); + if (this.partner) { + //this.contactPartnerProductService.contactPartnerProductsIdDelete(element.id) + } else if (this.contact) { + //this.partnerProductService.partnerProductsIdDelete(element.id) + } } } } diff --git a/matsen-tool/src/assets/i18n/de.json b/matsen-tool/src/assets/i18n/de.json index 262c2bf..58d510a 100644 --- a/matsen-tool/src/assets/i18n/de.json +++ b/matsen-tool/src/assets/i18n/de.json @@ -88,7 +88,8 @@ "createdAt": "erstellt am", "firstName": "Vorname", "lastName": "Vorname", - "email": "Email" + "email": "Email", + "unassign": "Zuweisung aufheben" }, "form": { diff --git a/matsen-tool/src/assets/scss/_button.scss b/matsen-tool/src/assets/scss/_button.scss index 68bb6a2..385e19a 100644 --- a/matsen-tool/src/assets/scss/_button.scss +++ b/matsen-tool/src/assets/scss/_button.scss @@ -100,3 +100,10 @@ body { border-color: #6d757c !important; } } + +.spt-icon-unassign { + display: inline-block; + width: 20px; + height: 30px; + @include delete-image(); +} \ No newline at end of file diff --git a/matsen-tool/src/assets/scss/_mixins.scss b/matsen-tool/src/assets/scss/_mixins.scss index e2ef09d..b7e1700 100644 --- a/matsen-tool/src/assets/scss/_mixins.scss +++ b/matsen-tool/src/assets/scss/_mixins.scss @@ -1,3 +1,25 @@ @mixin transition { transition: all 0.3s ease-out; +} + +@mixin delete-image { + position: relative; + cursor: pointer; + &:before, &:after { + content: ""; + position: absolute; + left: 50%; + top: 50%; + width: 10px; + height: 2px; + background: #000; + } + + &:before { + transform: translate(-50%, -50%) rotate(45deg); + } + + &:after { + transform: translate(-50%, -50%) rotate(-45deg); + } } \ No newline at end of file diff --git a/matsen-tool/src/assets/scss/_table.scss b/matsen-tool/src/assets/scss/_table.scss index c02bbca..697d665 100644 --- a/matsen-tool/src/assets/scss/_table.scss +++ b/matsen-tool/src/assets/scss/_table.scss @@ -58,32 +58,14 @@ th.mat-sort-header-sorted { } .spt-clear { + @include delete-image(); position: absolute; right: 10px; top: 50%; background: #fff; width: 20px; height: 30px; - cursor: pointer; transform: translate(0, -50%); - - &:before, &:after { - content: ""; - position: absolute; - left: 50%; - top: 50%; - width: 10px; - height: 2px; - background: #000; - } - - &:before { - transform: translate(-50%, -50%) rotate(45deg); - } - - &:after { - transform: translate(-50%, -50%) rotate(-45deg); - } } .spt-no-entries {