Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
},
{header: this.translateService.stream('Done by'), field: 'doneBy'},
{header: this.translateService.stream('Name'), field: 'itemName'},
{
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
},
];
adminTableHeaders: MtxGridColumn[] = [
{header: this.translateService.stream('Id'), field: 'microtingSdkCaseId'},
Expand All @@ -72,12 +66,6 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
{header: this.translateService.stream('Server time'), field: 'serverTime', type: 'date', typeParameter: {format: 'dd.MM.y HH:mm'}},
{header: this.translateService.stream('Done by'), field: 'doneBy'},
{header: this.translateService.stream('Area'), field: 'itemName'},
{
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
},
];
mergedTableHeaders: MtxGridColumn[] = [];

Expand Down Expand Up @@ -126,10 +114,16 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
},
};
});
const actionsColumn: MtxGridColumn = {
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
};
if (this.isAdmin) {
this.mergedTableHeaders = [...this.adminTableHeaders, ...itemHeaders];
this.mergedTableHeaders = [...this.adminTableHeaders, ...itemHeaders, actionsColumn];
} else {
this.mergedTableHeaders = [...this.tableHeaders, ...itemHeaders];
this.mergedTableHeaders = [...this.tableHeaders, ...itemHeaders, actionsColumn];
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
{header: this.translateService.stream('Submitted date'), field: 'microtingSdkCaseDoneAt', type: 'date', typeParameter: {format: 'dd.MM.y', timezone: 'utc'}},
{header: this.translateService.stream('Done by'), field: 'doneBy'},
{header: this.translateService.stream('Name'), field: 'itemName'},
{
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
},
{header: this.translateService.stream('Employee no'), field: 'employeeNo'},
];
adminTableHeaders: MtxGridColumn[] = [
Expand All @@ -63,12 +57,6 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
{header: this.translateService.stream('Server time'), field: 'serverTime', type: 'date', typeParameter: {format: 'dd.MM.y HH:mm', timezone: 'utc'}},
{header: this.translateService.stream('Done by'), field: 'doneBy'},
{header: this.translateService.stream('Area'), field: 'itemName'},
{
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
},
{header: this.translateService.stream('Employee no'), field: 'employeeNo'},
];
mergedTableHeaders: MtxGridColumn[] = [];
Expand Down Expand Up @@ -119,10 +107,17 @@ export class ReportTableComponent implements OnInit, OnChanges, OnDestroy {
let isAdmin = false;
this.selectAuthIsAdmin$.subscribe((selectAuthIsAdmin$) => isAdmin = selectAuthIsAdmin$);
const tableHeaders = [...(isAdmin ? [...this.adminTableHeaders] : [...this.tableHeaders])];
const actionsColumn: MtxGridColumn = {
header: this.translateService.stream('Actions'),
field: 'actions',
width: '160px',
pinned: 'right',
};

this.mergedTableHeaders = [
...tableHeaders,
...itemHeaders
...itemHeaders,
actionsColumn
];
}
}
Expand Down
Loading