From eb2d99933666408d352394c06c169b9f7a7e5c5a Mon Sep 17 00:00:00 2001 From: shawon Date: Wed, 22 Oct 2025 18:34:35 +0600 Subject: [PATCH 1/8] added pinned action and action template --- .../backend-configuration-pn.module.ts | 4 + .../properties-table.component.html | 111 ++++++++++-------- .../properties-table.component.ts | 20 +++- 3 files changed, 80 insertions(+), 55 deletions(-) diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/backend-configuration-pn.module.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/backend-configuration-pn.module.ts index 0d1c366b4..3f4bd5525 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/backend-configuration-pn.module.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/backend-configuration-pn.module.ts @@ -60,6 +60,7 @@ import { taskWizardReducer, taskWorkerAssignmentReducer, } from './state'; +import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu"; @NgModule({ @@ -103,6 +104,9 @@ import { taskWizardState: taskWizardReducer, taskWorkerAssignmentState: taskWorkerAssignmentReducer, },), + MatMenu, + MatMenuTrigger, + MatMenuItem, ], declarations: [ BackendConfigurationPnLayoutComponent, diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html index 077ea44a5..324e22091 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html @@ -30,23 +30,23 @@ (sortChange)="sortTable($event)"> -
{{row.id}}
+
{{ row.id }}
-
{{row.name}}
+
{{ row.name }}
-
{{row.cvr}}
+
{{ row.cvr }}
-
{{row.chr}}
+
{{ row.chr }}
-
{{row.address}}
+
{{ row.address }}
@@ -63,51 +63,58 @@ - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + +
diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.ts index 3753fa3c8..457bb3f56 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.ts @@ -31,8 +31,9 @@ export class PropertiesTableComponent implements OnInit { @Input() nameSearchSubject = new Subject(); @Input() propertiesModel: Paged = new Paged(); - @Input() tableHeaders: MtxGridColumn[]; - @Input() adminTableHeaders: MtxGridColumn[]; + @Input() tableHeaders: MtxGridColumn[] = []; + @Input() adminTableHeaders: MtxGridColumn[] = []; + @Output() showEditPropertyModal: EventEmitter = new EventEmitter(); @Output() @@ -68,7 +69,20 @@ export class PropertiesTableComponent implements OnInit { iconRegistry.addSvgIconLiteral('file-word', sanitizer.bypassSecurityTrustHtml(WordIcon)); } - ngOnInit(): void { } + ngOnInit(): void { + this.tableHeaders = [ + { header: 'ID', field: 'id', sortable: true }, + { header: 'Name', field: 'name', sortable: true }, + { header: 'CVR', field: 'cvr', sortable: true }, + { header: 'CHR', field: 'chr', sortable: true }, + { header: 'Address', field: 'address', sortable: true }, + { header: 'Compliance', field: 'compliance' }, + { header: 'Actions', field: 'actions', pinned: 'right'}, + ]; + + this.adminTableHeaders = [...this.tableHeaders]; + + } onShowDeletePropertyModal(propertyModel: PropertyModel) { this.showDeletePropertyModal.emit(propertyModel); From 37e0b4e2930dfb750b3bb431b3716af939183dbd Mon Sep 17 00:00:00 2001 From: shawon Date: Thu, 23 Oct 2025 17:23:19 +0600 Subject: [PATCH 2/8] added action menu design to documents, property worker and task-qizaed page --- .../documents-table.component.html | 33 +++++++++- .../documents-table.component.ts | 28 +-------- .../modules/documents/documents.module.ts | 54 ++++++++-------- .../property-worker-table.component.html | 61 +++++++++++-------- .../task-wizard-table.component.html | 43 ++++++++++++- .../task-wizard-table.component.ts | 38 +----------- .../modules/task-wizard/task-wizard.module.ts | 4 ++ 7 files changed, 143 insertions(+), 118 deletions(-) diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.html index d6067d062..89f8b199d 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.html @@ -3,7 +3,8 @@ [columns]="tableHeaders" [cellTemplate]="{ status: statusTpl, - documentProperties: documentPropertiesTpl + documentProperties: documentPropertiesTpl, + actions: actionsTpl }" [showPaginator]="false" [pageOnFront]="false" @@ -57,3 +58,33 @@
+ + +
+ + + + + + + +
+
diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.ts index 5f9a2b039..ced90f966 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/components/documents-table/documents-table.component.ts @@ -70,33 +70,7 @@ export class DocumentsTableComponent implements OnInit, OnDestroy { // formatter: (document: DocumentModel) => this.translateService.instant(document.status ? 'ON' : 'OFF'), sortable: true, sortProp: {id: 'Status'} }, - { - field: 'actions', - header: this.translateService.stream('Actions'), - type: 'button', - width: '160px', - pinned: 'right', - right: '0px', - buttons: [ - { - type: 'icon', - icon: 'edit', - tooltip: this.translateService.stream('Edit document'), - iif: (document: DocumentModel) => document.isLocked === false, - click: (document: DocumentModel) => this.onShowEditDocumentModal(document), - class: 'editDocumentBtn', - }, - { - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete document'), - iif: (document: DocumentModel) => document.isLocked === false, - click: (document: DocumentModel) => this.onOpenDeleteModal(document), - class: 'deleteDocumentBtn', - }, - ], - }, + { field: 'actions', header: this.translateService.stream('Actions'), pinned: 'right' } ]; @Input() documents: DocumentModel[] = []; @Input() folders: DocumentSimpleFolderModel[] = []; diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/documents.module.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/documents.module.ts index 1edbbb7f7..c9fdc0b69 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/documents.module.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/documents/documents.module.ts @@ -33,6 +33,7 @@ import {MtxCheckboxGroupModule} from '@ng-matero/extensions/checkbox-group'; import {MatDatepickerModule} from '@angular/material/datepicker'; import {StatisticsModule} from '../statistics/statistics.module'; import {MatChip} from "@angular/material/chips"; +import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu"; @NgModule({ declarations: [ @@ -47,31 +48,34 @@ import {MatChip} from "@angular/material/chips"; DocumentsDocumentEditComponent, DocumentsDocumentDeleteComponent ], - imports: [ - CommonModule, - TranslateModule, - RouterModule, - DocumentsRouting, - EformSharedModule, - ReactiveFormsModule, - EformImportedModule, - FormsModule, - MatButtonModule, - MatTooltipModule, - MatIconModule, - MatFormFieldModule, - MtxSelectModule, - MatInputModule, - MtxGridModule, - MatDialogModule, - MatCardModule, - MatSlideToggleModule, - MatCheckboxModule, - MtxCheckboxGroupModule, - MatDatepickerModule, - StatisticsModule, - MatChip, - ], + imports: [ + CommonModule, + TranslateModule, + RouterModule, + DocumentsRouting, + EformSharedModule, + ReactiveFormsModule, + EformImportedModule, + FormsModule, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatFormFieldModule, + MtxSelectModule, + MatInputModule, + MtxGridModule, + MatDialogModule, + MatCardModule, + MatSlideToggleModule, + MatCheckboxModule, + MtxCheckboxGroupModule, + MatDatepickerModule, + StatisticsModule, + MatChip, + MatMenu, + MatMenuItem, + MatMenuTrigger, + ], providers: [], }) diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html index b677da1d2..2b4b4a03e 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html @@ -118,37 +118,44 @@ -
- - - + + + + + +
+ diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html index e1c37649c..eb3850ae4 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html @@ -1,7 +1,7 @@ + + +
+ + + + + + + + +
+
+ + diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.ts index d041f04c3..abf15cb66 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.ts @@ -82,43 +82,7 @@ export class TaskWizardTableComponent implements OnInit, OnDestroy { sortProp: {id: 'AssignedTo'}, formatter: (model: TaskWizardModel) => model.assignedTo.join('
') }, - { - field: 'actions', - header: this.translateService.stream('Actions'), - type: 'button', - width: '180px', - pinned: 'right', - right: '0px', - buttons: [ - { - iif: (model: TaskWizardModel) => model.createdInGuide, - color: 'accent', - type: 'icon', - icon: 'edit', - tooltip: this.translateService.stream('Edit task'), - click: (model: TaskWizardModel) => this.editTask.emit(model), - class: 'editBtn', - }, - { - iif: (model: TaskWizardModel) => model.createdInGuide, - color: 'accent', - type: 'icon', - icon: 'content_copy', - tooltip: this.translateService.stream('Copy task'), - click: (model: TaskWizardModel) => this.copyTask.emit(model), - class: 'copyBtn', - }, - { - iif: (model: TaskWizardModel) => model.createdInGuide, - color: 'warn', - type: 'icon', - icon: 'delete', - tooltip: this.translateService.stream('Delete task'), - click: (model: TaskWizardModel) => this.deleteTask.emit(model), - class: 'deleteBtn', - }, - ], - }, + { field: 'actions', header: this.translateService.stream('Actions'), pinned: 'right' } ]; public selectTaskWizardPaginationSort$ = this.store.select(selectTaskWizardPaginationSort); public selectTaskWizardPaginationIsSortDsc$ = this.store.select(selectTaskWizardPaginationIsSortDsc); diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/task-wizard.module.ts b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/task-wizard.module.ts index 47411d2a2..adefdf3f3 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/task-wizard.module.ts +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/task-wizard.module.ts @@ -28,6 +28,7 @@ import {FormattingTextEditorModule} from 'src/app/common/modules/eform-imported/ import {MatCardModule} from '@angular/material/card'; import {PlanningsModule} from '../../../items-planning-pn/modules/plannings/plannings.module'; import {StatisticsModule} from '../statistics/statistics.module'; +import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu"; @NgModule({ imports: [ @@ -53,6 +54,9 @@ import {StatisticsModule} from '../statistics/statistics.module'; MatCardModule, PlanningsModule, StatisticsModule, + MatMenu, + MatMenuItem, + MatMenuTrigger, ], declarations: [ TaskWizardFiltersComponent, From 51d6ada21523edd9103aecc974a0396d85302714 Mon Sep 17 00:00:00 2001 From: shawon Date: Fri, 24 Oct 2025 16:32:54 +0600 Subject: [PATCH 3/8] added menu trigger --- .../BackendConfigurationProperties.page.ts | 20 +++++++++++++++---- .../properties-table.component.html | 2 +- .../property-worker-table.component.html | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/eform-client/cypress/e2e/plugins/backend-configuration-pn/BackendConfigurationProperties.page.ts b/eform-client/cypress/e2e/plugins/backend-configuration-pn/BackendConfigurationProperties.page.ts index cae7740e9..aaba18e7c 100644 --- a/eform-client/cypress/e2e/plugins/backend-configuration-pn/BackendConfigurationProperties.page.ts +++ b/eform-client/cypress/e2e/plugins/backend-configuration-pn/BackendConfigurationProperties.page.ts @@ -269,12 +269,24 @@ export class PropertyRowObject { editPropertyBtn: () => Cypress.Chainable>; deleteBtn: () => Cypress.Chainable>; + private openMenu(rowNum: number) { + const index = rowNum - 1; + + cy.get(`#property-actions-${index}`) + .find('#actionMenu') + .should('be.visible') + .click({ force: true }); + cy.get('mat-mdc-menu-panel', { timeout: 500 }).should('be.visible'); + } + getRow(rowNum: number) { - const row = () => cy.get('.mat-mdc-row').eq(rowNum - 1); + const index = rowNum - 1; + const row = () => cy.get('.mat-mdc-row').eq(index); this.row = row(); - this.viewAreasBtn = () => row().find('[id^=showPropertyAreasBtn]').should('be.visible').should('be.enabled'); - this.editPropertyBtn = () => row().find('[id^=editPropertyBtn]').should('be.visible').should('be.enabled'); - this.deleteBtn = () => row().find('[id^=deletePropertyBtn]').should('be.visible').should('be.enabled'); + this.openMenu(rowNum); + this.viewAreasBtn = () => row().find(`[id^=showPropertyAreasBtn-${index}]`).should('be.visible').should('be.enabled'); + this.editPropertyBtn = () => row().find(`[id^=editPropertyBtn]-${index}`).should('be.visible').should('be.enabled'); + this.deleteBtn = () => row().find(`[id^=deletePropertyBtn]-${index}`).should('be.visible').should('be.enabled'); return this; } diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html index 324e22091..38e9d775c 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/components/properties/properties-page/properties-table/properties-table.component.html @@ -65,7 +65,7 @@
- diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html index 2b4b4a03e..e2a6a6679 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table/property-worker-table.component.html @@ -119,7 +119,7 @@ @@ -184,7 +187,8 @@ 'status-inactive': TaskWizardStatusesEnum[row.taskManagementEnabled ? 1 : 2] !== 'Active' }" > - {{TaskWizardStatusesEnum[row.taskManagementEnabled ? 1 : 2] | translate}} + {{ TaskWizardStatusesEnum[row.taskManagementEnabled ? 1 : 2] | translate }} @@ -195,6 +199,7 @@ 'status-inactive': TaskWizardStatusesEnum[row.timeRegistrationEnabled ? 1 : 2] !== 'Active' }" > - {{TaskWizardStatusesEnum[row.timeRegistrationEnabled ? 1 : 2] | translate}} + {{ TaskWizardStatusesEnum[row.timeRegistrationEnabled ? 1 : 2] | translate }} diff --git a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html index e8354845d..7aa281601 100644 --- a/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html +++ b/eform-client/src/app/plugins/modules/backend-configuration-pn/modules/task-wizard/components/task-wizard-table/task-wizard-table.component.html @@ -86,7 +86,7 @@
-