From 6e2615a02dbf57f31f93f369403a279a2c6bd5c8 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 3 Feb 2020 13:18:16 +0100 Subject: [PATCH] time entry widget headers non editable & rephrased --- frontend/src/app/modules/grids/openproject-grids.module.ts | 4 ++-- .../current-user/time-entries-current-user.component.html | 2 +- .../current-user/time-entries-current-user.component.ts | 4 ++++ .../time-entries/list/time-entries-list.component.html | 2 +- .../widgets/time-entries/list/time-entries-list.component.ts | 4 ++++ modules/grids/config/locales/js-en.yml | 4 +++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/grids/openproject-grids.module.ts b/frontend/src/app/modules/grids/openproject-grids.module.ts index 5bbef3ae5e..7abb50a383 100644 --- a/frontend/src/app/modules/grids/openproject-grids.module.ts +++ b/frontend/src/app/modules/grids/openproject-grids.module.ts @@ -257,9 +257,9 @@ export function registerWidgets(injector:Injector) { { identifier: 'time_entries_current_user', component: WidgetTimeEntriesCurrentUserComponent, - title: i18n.t(`js.grid.widgets.time_entries_list.title`), + title: i18n.t(`js.grid.widgets.time_entries_current_user.title`), properties: { - name: i18n.t('js.grid.widgets.time_entries_list.title'), + name: i18n.t('js.grid.widgets.time_entries_current_user.title'), } }, { diff --git a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.html b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.html index 92e9bf66ef..f9b17c6114 100644 --- a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.html +++ b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.html @@ -1,6 +1,6 @@ + [editable]="isEditable"> diff --git a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.ts b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.ts index e2dc33bb5f..bb0e7c5fed 100644 --- a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.ts +++ b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user.component.ts @@ -39,6 +39,10 @@ export class WidgetTimeEntriesCurrentUserComponent extends AbstractWidgetCompone } } + public get isEditable() { + return false; + } + protected formatNumber(value:number):string { return this.i18n.toNumber(value, { precision: 2 }); } diff --git a/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.html b/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.html index 9f4d3b2fc9..7547c73e02 100644 --- a/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.html +++ b/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.html @@ -1,6 +1,6 @@ + [editable]="isEditable"> diff --git a/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.ts b/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.ts index 5b7bc26edc..f0d3a78ebd 100644 --- a/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.ts +++ b/frontend/src/app/modules/grids/widgets/time-entries/list/time-entries-list.component.ts @@ -94,6 +94,10 @@ export abstract class WidgetTimeEntriesListComponent extends AbstractWidgetCompo return this.pathHelper.workPackagePath(entry.workPackage.idFromLink); } + public get isEditable() { + return false; + } + public deleteIfConfirmed(event:Event, entry:TimeEntryResource) { event.preventDefault(); diff --git a/modules/grids/config/locales/js-en.yml b/modules/grids/config/locales/js-en.yml index 34e9e64cef..18d0ce09b8 100644 --- a/modules/grids/config/locales/js-en.yml +++ b/modules/grids/config/locales/js-en.yml @@ -37,8 +37,10 @@ en: subprojects: title: 'Subprojects' no_results: 'No subprojects.' + time_entries_current_user: + title: 'My spent time' time_entries_list: - title: 'Spent time' + title: 'Spent time (last 7 days)' no_results: 'No time entries for the last 7 days.' work_packages_accountable: title: "Work packages I am accountable for"