| @@ -63,7 +63,7 @@ | |||||
| <th mat-header-cell class="text-end" *matHeaderCellDef> | <th mat-header-cell class="text-end" *matHeaderCellDef> | ||||
| {{ 'overview.details' | translate }} | {{ 'overview.details' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell class="text-end" *matCellDef="let element"> | |||||
| <td mat-cell class="spt-button-td" *matCellDef="let element"> | |||||
| <span class="btn btn-primary spt-icon-details" | <span class="btn btn-primary spt-icon-details" | ||||
| data-type="user-tool" data-action="edit" (click)="navigateToPartnerDetails(element)"></span> | data-type="user-tool" data-action="edit" (click)="navigateToPartnerDetails(element)"></span> | ||||
| </td> | </td> | ||||
| @@ -52,7 +52,7 @@ export class PartnerListComponent implements OnInit, AfterViewInit { | |||||
| private translateService: TranslateService, | private translateService: TranslateService, | ||||
| protected appHelperService: AppHelperService, | protected appHelperService: AppHelperService, | ||||
| ) { | ) { | ||||
| this.displayedColumns = ['pos', 'image', 'name', 'address', 'website', 'details']; | |||||
| this.displayedColumns = ['details', 'pos', 'image', 'name', 'address', 'website']; | |||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.partnersSub = new Subscription(); | this.partnersSub = new Subscription(); | ||||
| this.partners = []; | this.partners = []; | ||||
| @@ -61,7 +61,7 @@ | |||||
| <th mat-header-cell class="text-end" *matHeaderCellDef> | <th mat-header-cell class="text-end" *matHeaderCellDef> | ||||
| {{ 'overview.details' | translate }} | {{ 'overview.details' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell class="text-end" *matCellDef="let element"> | |||||
| <td mat-cell class="spt-button-td" *matCellDef="let element"> | |||||
| <span class="btn btn-primary spt-icon-details" | <span class="btn btn-primary spt-icon-details" | ||||
| data-type="user-tool" data-action="edit" (click)="navigateToProductDetails(element)"></span> | data-type="user-tool" data-action="edit" (click)="navigateToProductDetails(element)"></span> | ||||
| </td> | </td> | ||||
| @@ -47,7 +47,7 @@ export class ProductListComponent implements OnInit, AfterViewInit { | |||||
| protected appHelperService: AppHelperService, | protected appHelperService: AppHelperService, | ||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.displayedColumns = ['pos', 'image', 'name', 'storage', 'number', 'details']; | |||||
| this.displayedColumns = ['details', 'pos', 'image', 'name', 'storage', 'number']; | |||||
| this.productsSub = new Subscription(); | this.productsSub = new Subscription(); | ||||
| this.products = []; | this.products = []; | ||||
| @@ -83,7 +83,7 @@ | |||||
| <th mat-header-cell class="text-end" *matHeaderCellDef> | <th mat-header-cell class="text-end" *matHeaderCellDef> | ||||
| {{ 'overview.details' | translate }} | {{ 'overview.details' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell class="text-end" *matCellDef="let element"> | |||||
| <td mat-cell class="spt-button-td" *matCellDef="let element"> | |||||
| <span class="btn btn-primary spt-icon-details" | <span class="btn btn-primary spt-icon-details" | ||||
| data-type="user-tool" data-action="edit" (click)="navigateToSaleDetails(element)"></span> | data-type="user-tool" data-action="edit" (click)="navigateToSaleDetails(element)"></span> | ||||
| </td> | </td> | ||||
| @@ -37,7 +37,7 @@ export class SaleListComponent implements OnInit, AfterViewInit { | |||||
| protected accountService: AccountService, | protected accountService: AccountService, | ||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.displayedColumns = ['pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date', 'details']; | |||||
| this.displayedColumns = ['details', 'pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date']; | |||||
| this.salesSub = new Subscription(); | this.salesSub = new Subscription(); | ||||
| this.sales = []; | this.sales = []; | ||||
| this.salesSummarySub = new Subscription(); | this.salesSummarySub = new Subscription(); | ||||
| @@ -36,9 +36,8 @@ export class SaleSummaryComponent implements OnInit, AfterViewInit { | |||||
| getData() { | getData() { | ||||
| if (this.user !== undefined) { | if (this.user !== undefined) { | ||||
| console.log(this.user); | |||||
| this.salesSummarySub = this.saleSummaryService.saleSummariesUserIdGet( | this.salesSummarySub = this.saleSummaryService.saleSummariesUserIdGet( | ||||
| String(this.user?.id) | |||||
| this.appHelperService.extractId(String(this.user?.id)) | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.saleSummaries = [data]; | this.saleSummaries = [data]; | ||||
| @@ -39,7 +39,6 @@ export class UserDetailComponent implements OnInit, AfterViewInit { | |||||
| protected userSub: Subscription; | protected userSub: Subscription; | ||||
| protected isCurrentUser: boolean; | protected isCurrentUser: boolean; | ||||
| protected userId!: string; | |||||
| constructor( | constructor( | ||||
| private accountService: AccountService, | private accountService: AccountService, | ||||
| @@ -48,34 +47,44 @@ export class UserDetailComponent implements OnInit, AfterViewInit { | |||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| ) { | ) { | ||||
| this.userSub = new Subscription(); | this.userSub = new Subscription(); | ||||
| this.isCurrentUser = false; | this.isCurrentUser = false; | ||||
| } | } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| this.route.params.subscribe(params => { | |||||
| this.userId = params['id']; | |||||
| }); | |||||
| console.log(this.userId); | |||||
| if (this.user === undefined) { | |||||
| this.route.params.subscribe(params => { | |||||
| this.getUserData(params['id']); | |||||
| }); | |||||
| } else { | |||||
| this.setIsCurrentUser(); | |||||
| } | |||||
| } | } | ||||
| ngAfterViewInit(): void { | ngAfterViewInit(): void { | ||||
| if (this.accountService.userValue?.userResource) { | |||||
| let user = this.accountService.userValue?.userResource; | |||||
| this.isCurrentUser = this.userId == user?.id; | |||||
| } | |||||
| this.getData(); | |||||
| // if (this.accountService.userValue?.userResource) { | |||||
| // let user = this.accountService.userValue?.userResource; | |||||
| // if (this.user.id === user.id) { | |||||
| // this.isCurrentUser = true; | |||||
| // } | |||||
| // this.isCurrentUser = this.userId == user?.id; | |||||
| // } | |||||
| } | } | ||||
| getData() { | |||||
| getUserData(userId: string) { | |||||
| this.userSub = this.userService.usersIdGet( | this.userSub = this.userService.usersIdGet( | ||||
| this.userId | |||||
| userId | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.user = data; | this.user = data; | ||||
| this.setIsCurrentUser(); | |||||
| } | } | ||||
| ); | ); | ||||
| } | } | ||||
| setIsCurrentUser() { | |||||
| if (this.accountService.userValue?.userResource) { | |||||
| let user = this.accountService.userValue?.userResource; | |||||
| this.isCurrentUser = this.user.id == user?.id; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -56,7 +56,7 @@ | |||||
| <th mat-header-cell class="text-end" *matHeaderCellDef> | <th mat-header-cell class="text-end" *matHeaderCellDef> | ||||
| {{ 'overview.details' | translate }} | {{ 'overview.details' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell class="text-end" *matCellDef="let element"> | |||||
| <td mat-cell class="spt-button-td" *matCellDef="let element"> | |||||
| <span class="btn btn-primary spt-icon-details" | <span class="btn btn-primary spt-icon-details" | ||||
| data-type="user-tool" data-action="edit" (click)="navigateToUserDetails(element)"></span> | data-type="user-tool" data-action="edit" (click)="navigateToUserDetails(element)"></span> | ||||
| </td> | </td> | ||||
| @@ -30,7 +30,7 @@ export class UserListComponent implements OnInit, AfterViewInit { | |||||
| private router: Router, | private router: Router, | ||||
| protected appHelperService: AppHelperService, | protected appHelperService: AppHelperService, | ||||
| ) { | ) { | ||||
| this.displayedColumns = ['pos', 'image', 'firstName', 'lastName', 'email', 'details']; | |||||
| this.displayedColumns = ['details', 'pos', 'image', 'firstName', 'lastName', 'email']; | |||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| @@ -90,6 +90,7 @@ body { | |||||
| } | } | ||||
| .spt-icon-details { | .spt-icon-details { | ||||
| display: block; | |||||
| width: 48px; | width: 48px; | ||||
| height: 48px; | height: 48px; | ||||
| background: #2e3a43 url("/assets/images/icons/details.svg") no-repeat center center; | background: #2e3a43 url("/assets/images/icons/details.svg") no-repeat center center; | ||||
| @@ -22,12 +22,13 @@ th.mat-sort-header-sorted { | |||||
| .mdc-data-table__header-cell { | .mdc-data-table__header-cell { | ||||
| padding-top: 8px; | padding-top: 8px; | ||||
| padding-bottom: 8px; | padding-bottom: 8px; | ||||
| @include transition(); | |||||
| } | } | ||||
| .mat-mdc-row { | .mat-mdc-row { | ||||
| &:hover { | &:hover { | ||||
| .mdc-data-table__cell { | .mdc-data-table__cell { | ||||
| background: #fbfbfb; | |||||
| background: #f6f6f6; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -88,3 +89,7 @@ th.mat-sort-header-sorted { | |||||
| app-paging > .mat-mdc-paginator:first-child { | app-paging > .mat-mdc-paginator:first-child { | ||||
| border-width: 4px; | border-width: 4px; | ||||
| } | } | ||||
| .spt-button-td { | |||||
| width: 85px; | |||||
| } | |||||