From 1f36f36d89505e51a0211f35c514bcdbbcd918ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 06:13:54 +0000 Subject: [PATCH 1/4] Initial plan From a89055f58445e9d11c55005f55a4bfc8e31e1791 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 06:21:22 +0000 Subject: [PATCH 2/4] Refactor Actions column to use mat-menu following reference pattern Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com> --- .../report-container.component.html | 2 + .../report-container.component.ts | 104 ++---------------- .../report-table/report-table.component.html | 55 ++++++--- .../report-table/report-table.component.ts | 14 +++ 4 files changed, 61 insertions(+), 114 deletions(-) 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..940ecd6c 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); + } } From a038cac88d405ad208d06edffec51649ca9ac7ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 06:24:21 +0000 Subject: [PATCH 3/4] Fix code review issues: unique IDs and warn color placement Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com> --- .../report-page/report-table/report-table.component.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 940ecd6c..3e8ffadf 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 @@ -18,7 +18,7 @@
- @@ -41,10 +41,11 @@ From 8c3cd20f8a8a757c53622bcb84c9548e751480b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 06:25:37 +0000 Subject: [PATCH 4/4] Add color="warn" to mat-icon to match reference pattern exactly Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com> --- .../report/report-page/report-table/report-table.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3e8ffadf..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 @@ -45,7 +45,7 @@ id="deleteCaseBtn-{{i}}" (click)="onDeleteCase(row)" > - delete + delete {{ 'Delete Case' | translate }}