Skip to content

Commit

Permalink
display placeholder in case of no time entry activity
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Jun 24, 2024
1 parent 5742b90 commit 9ddceeb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export abstract class WidgetTimeEntriesListComponent extends AbstractWidgetCompo
title: this.i18n.t('js.modals.destroy_time_entry.title'),
},
noResults: this.i18n.t('js.grid.widgets.time_entries_list.no_results'),
placeholder: this.i18n.t('js.placeholders.default'),
};

public entries:TimeEntryResource[] = [];
Expand Down Expand Up @@ -84,7 +85,7 @@ export abstract class WidgetTimeEntriesListComponent extends AbstractWidgetCompo
}

public activityName(entry:TimeEntryResource):string {
return entry.activity.name;
return entry.activity ? entry.activity.name : this.text.placeholder;
}

public projectName(entry:TimeEntryResource):string {
Expand Down

0 comments on commit 9ddceeb

Please sign in to comment.