Skip to content

Commit 6867356

Browse files
Copilotrenemadsen
andcommitted
Change Actions column to use menu-based pattern
Co-authored-by: renemadsen <[email protected]>
1 parent 7f5f7be commit 6867356

File tree

2 files changed

+44
-35
lines changed

2 files changed

+44
-35
lines changed

eform-client/src/app/plugins/modules/workflow-pn/components/workflow-cases/workflow-cases-page/workflow-cases-page.component.html

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,47 @@
4444
[noResultText]="'No workflow cases found' | translate">
4545
</mtx-grid>
4646

47-
<ng-template #actionsTpl let-row>
48-
<div class="d-flex">
49-
<button
50-
mat-icon-button
51-
id="editWorkflowCaseBtn"
52-
matTooltip="{{ 'Edit Workflow Case' | translate }}"
53-
[routerLink]="['/plugins/workflow-pn/edit-workflow-case/', row.id]"
54-
>
55-
<mat-icon>edit</mat-icon>
56-
</button>
57-
<button
58-
mat-icon-button
59-
matTooltip="{{ 'Download PDF' | translate }}"
60-
(click)="downloadFile(row.id, 'pdf')"
61-
color="accent"
62-
>
63-
<mat-icon svgIcon="file-pdf"></mat-icon>
64-
</button>
65-
<button
66-
mat-icon-button
67-
color="primary"
68-
(click)="downloadFile(row.id, 'docx')"
69-
matTooltip="{{ 'Download Docx' | translate }}"
70-
>
71-
<mat-icon svgIcon="file-word"></mat-icon>
72-
</button>
73-
<button
74-
mat-icon-button
75-
color="warn"
76-
id="deleteBtn"
77-
(click)="showDeleteWorkflowCaseModal(row)"
78-
matTooltip="{{ 'Delete' | translate }}"
79-
>
80-
<mat-icon>delete</mat-icon>
47+
<ng-template #actionsTpl let-row let-i="index">
48+
<div class="workflow-case-actions" id="action-items-{{i}}">
49+
<button id="actionMenu" mat-icon-button [matMenuTriggerFor]="menu" matTooltip="{{ 'Actions' | translate }}">
50+
<mat-icon>more_vert</mat-icon>
8151
</button>
52+
53+
<mat-menu #menu="matMenu">
54+
<button
55+
mat-menu-item
56+
id="editWorkflowCaseBtn-{{i}}"
57+
[routerLink]="['/plugins/workflow-pn/edit-workflow-case/', row.id]"
58+
>
59+
<mat-icon>edit</mat-icon>
60+
<span>{{ 'Edit Workflow Case' | translate }}</span>
61+
</button>
62+
<button
63+
mat-menu-item
64+
id="downloadPdfBtn-{{i}}"
65+
(click)="downloadFile(row.id, 'pdf')"
66+
>
67+
<mat-icon svgIcon="file-pdf"></mat-icon>
68+
<span>{{ 'Download PDF' | translate }}</span>
69+
</button>
70+
<button
71+
mat-menu-item
72+
id="downloadDocxBtn-{{i}}"
73+
(click)="downloadFile(row.id, 'docx')"
74+
>
75+
<mat-icon svgIcon="file-word"></mat-icon>
76+
<span>{{ 'Download Docx' | translate }}</span>
77+
</button>
78+
<button
79+
mat-menu-item
80+
color="warn"
81+
id="deleteBtn-{{i}}"
82+
(click)="showDeleteWorkflowCaseModal(row)"
83+
>
84+
<mat-icon color="warn">delete</mat-icon>
85+
<span>{{ 'Delete' | translate }}</span>
86+
</button>
87+
</mat-menu>
8288
</div>
8389
</ng-template>
8490

eform-client/src/app/plugins/modules/workflow-pn/components/workflow-cases/workflow-cases-page/workflow-cases-page.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ export class WorkflowCasesPageComponent implements OnInit, OnDestroy {
8282
},
8383
{
8484
pinned: 'right',
85-
header: this.translateService.stream('Actions'), field: 'actions'},
85+
header: this.translateService.stream('Actions'),
86+
field: 'actions',
87+
width: '160px',
88+
},
8689
];
8790
workflowCaseDeletedSub$: Subscription;
8891
deleteWorkflowCase$: Subscription;

0 commit comments

Comments
 (0)