diff --git a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.html b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.html index 256ad216..62f09fb5 100644 --- a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.html +++ b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.html @@ -22,9 +22,11 @@ [reportModel]="reportModel" [paginationTemplate]="paginatorTpl" [toolbarTemplate]="toolbarTpl" + [queryParams]="queryParams" (showRemoveCaseModal)="showRemoveCaseModal($event)" (showArchiveCaseModal)="showArchiveCaseModal($event)" (downloadPdf)="onDownloadPdf($event)" + (editCase)="onEditCase($event)" (sortChange)="getReport()" > diff --git a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.ts b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.ts index 372bb430..0c5c32fe 100644 --- a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.ts +++ b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-container/report-container.component.ts @@ -104,30 +104,7 @@ export class ReportContainerComponent implements OnInit, OnDestroy { pinned: 'right', header: this.translateService.stream('Actions'), field: 'actions', - type: 'button', - buttons: [ - { - type: 'icon', - icon: 'edit', - color: 'accent', - tooltip: this.translateService.stream('Edit Case'), - click: (rowData: ReportCaseModel) => this.router.navigate(['/cases/edit/' + rowData.id + '/' + rowData.templateId], {queryParams: this.queryParams}), - }, - { - type: 'icon', - icon: 'picture_as_pdf', - color: 'accent', - tooltip: this.translateService.stream('Download PDF'), - click: (rowData: ReportCaseModel) => this.onDownloadPdf(rowData), - }, - { - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete Case'), - click: (rowData: ReportCaseModel) => this.onShowRemoveCaseModal(rowData), - }, - ] + width: '160px', }, ]; public selectReportFiltersNameFilter$ = this.store.select(selectReportFiltersNameFilter); @@ -254,30 +231,7 @@ export class ReportContainerComponent implements OnInit, OnDestroy { pinned: 'right', header: this.translateService.stream('Actions'), field: 'actions', - type: 'button', - buttons: [ - { - type: 'icon', - icon: 'edit', - color: 'accent', - tooltip: this.translateService.stream('Edit Case'), - click: (rowData: ReportCaseModel) => this.router.navigate(['/cases/edit/' + rowData.id + '/' + rowData.templateId], {queryParams: this.queryParams}), - }, - { - type: 'icon', - icon: 'picture_as_pdf', - color: 'accent', - tooltip: this.translateService.stream('Download PDF'), - click: (rowData: ReportCaseModel) => this.onDownloadPdf(rowData), - }, - { - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete Case'), - click: (rowData: ReportCaseModel) => this.onShowRemoveCaseModal(rowData), - }, - ] + width: '160px', }, ]; } @@ -382,30 +336,7 @@ export class ReportContainerComponent implements OnInit, OnDestroy { pinned: 'right', header: this.translateService.stream('Actions'), field: 'actions', - type: 'button', - buttons: [ - { - type: 'icon', - icon: 'edit', - color: 'accent', - tooltip: this.translateService.stream('Edit Case'), - click: (rowData: ReportCaseModel) => this.router.navigate(['/cases/edit/' + rowData.id + '/' + rowData.templateId], {queryParams: this.queryParams}), - }, - { - type: 'icon', - icon: 'picture_as_pdf', - color: 'accent', - tooltip: this.translateService.stream('Download PDF'), - click: (rowData: ReportCaseModel) => this.onDownloadPdf(rowData), - }, - { - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete Case'), - click: (rowData: ReportCaseModel) => this.onShowRemoveCaseModal(rowData), - }, - ] + width: '160px', }, ]; } @@ -522,30 +453,7 @@ export class ReportContainerComponent implements OnInit, OnDestroy { pinned: 'right', header: this.translateService.stream('Actions'), field: 'actions', - type: 'button', - buttons: [ - { - type: 'icon', - icon: 'edit', - color: 'accent', - tooltip: this.translateService.stream('Edit Case'), - click: (rowData: ReportCaseModel) => this.router.navigate(['/cases/edit/' + rowData.id + '/' + rowData.templateId], {queryParams: this.queryParams}), - }, - { - type: 'icon', - icon: 'picture_as_pdf', - color: 'accent', - tooltip: this.translateService.stream('Download PDF'), - click: (rowData: ReportCaseModel) => this.onDownloadPdf(rowData), - }, - { - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete Case'), - click: (rowData: ReportCaseModel) => this.onShowRemoveCaseModal(rowData), - }, - ] + width: '160px', }, ]; } @@ -763,6 +671,10 @@ export class ReportContainerComponent implements OnInit, OnDestroy { this.showArchiveCaseModal(reportCaseModel); } + onEditCase(model: ReportCaseModel) { + this.router.navigate(['/cases/edit/' + model.id + '/' + model.templateId], {queryParams: this.queryParams}); + } + // onDownloadPdf(model: ReportCaseModel) { // this.downloadPdf.emit(model); // } diff --git a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.html b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.html index 40e69cbf..b68570f4 100644 --- a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.html +++ b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.html @@ -1,6 +1,9 @@ - - - - - - - - - - - - - - - - - - + +
+ + + + + + + +
+
diff --git a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.ts b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.ts index c1bfe435..eaa5fa66 100644 --- a/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.ts +++ b/eform-client/src/app/plugins/modules/greate-belt-pn/components/report/report-page/report-table/report-table.component.ts @@ -32,10 +32,12 @@ export class ReportTableComponent implements OnInit { @Input() tableHeaders: MtxGridColumn[]; @Input() paginationTemplate!: TemplateRef; @Input() toolbarTemplate!: TemplateRef; + @Input() queryParams: any; @Output() showArchiveCaseModal: EventEmitter = new EventEmitter(); @Output() showRemoveCaseModal: EventEmitter = new EventEmitter(); @Output() downloadPdf: EventEmitter = new EventEmitter(); @Output() sortChange: EventEmitter = new EventEmitter(); + @Output() editCase: EventEmitter = new EventEmitter(); get greateBeltPnClaims() { return GreateBeltPnClaims; @@ -59,4 +61,16 @@ export class ReportTableComponent implements OnInit { this.reportStateService.onSortTable(sort.active); this.sortChange.emit(); } + + onEditCase(row: ReportCaseModel) { + this.editCase.emit(row); + } + + onDownloadPdf(row: ReportCaseModel) { + this.downloadPdf.emit(row); + } + + onDeleteCase(row: ReportCaseModel) { + this.showRemoveCaseModal.emit(row); + } }