Skip to content

Commit

Permalink
Merge pull request #15943 from opf/bug/53200-removing-logged-activity…
Browse files Browse the repository at this point in the history
…-via-spent-time-widget-freezes-the-site-and-destroys-spent-time-widget

Display placeholder in case of no time entry activity
  • Loading branch information
aaron-contreras authored Jun 24, 2024
2 parents 32d4a2c + 9ddceeb commit da0a801
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 da0a801

Please sign in to comment.