OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[41015] Fix recent time entries with no work package assigned
Oliver Günthere2bc05346fa8
diff --git a/frontend/src/app/shared/components/fields/edit/field-types/te-work-package-edit-field.component.ts b/frontend/src/app/shared/components/fields/edit/field-types/te-work-package-edit-field.component.tsindex a2b4fa06b31..11c9763f8c5 100644--- a/frontend/src/app/shared/components/fields/edit/field-types/te-work-package-edit-field.component.ts+++ b/frontend/src/app/shared/components/fields/edit/field-types/te-work-package-edit-field.component.ts@@ -93,6 +93,7 @@ export class TimeEntryWorkPackageEditFieldComponent extends WorkPackageEditField.then((collection) => {this.recentWorkPackageIds = collection.elements+ .filter((timeEntry) => timeEntry.workPackage?.href).map((timeEntry) => idFromLink(timeEntry.workPackage.href)).filter((v, i, a) => a.indexOf(v) === i);diff --git a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb b/modules/my_page/spec/features/my/time_entries_current_user_spec.rbindex 1b16c36624b..5e5e3e8df04 100644--- a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb+++ b/modules/my_page/spec/features/my/time_entries_current_user_spec.rb@@ -57,6 +57,16 @@ describe 'My page time entries current user widget spec', type: :feature, js: trhours: 3,comments: 'My comment'end+ let!(:visible_time_entry_on_project) do+ FactoryBot.create :time_entry,+ work_package: nil,+ project: project,+ activity: activity,+ user: user,+ spent_on: Date.today.beginning_of_week(:sunday) + 1.day,+ hours: 1,+ comments: 'My comment'+ endlet!(:other_visible_time_entry) doFactoryBot.create :time_entry,work_package: work_package,@@ -119,7 +129,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: trentries_area.expect_to_span(1, 1, 2, 2)expect(page)- .to have_content "Total: 5.00"+ .to have_content "Total: 6.00"expect(page).to have_content visible_time_entry.spent_on.strftime('%-m/%-d')@@ -150,7 +160,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: trendexpect(page)- .to have_content "Total: 5.00"+ .to have_content "Total: 6.00"within entries_area.area dofind(".te-calendar--time-entry", match: :first).hover@@ -199,15 +209,15 @@ describe 'My page time entries current user widget spec', type: :feature, js: trendexpect(page)- .to have_content "Total: 9.00"+ .to have_content "Total: 10.00"expect(TimeEntry.count)- .to eql 5+ .to eql 6## Editing an entrywithin entries_area.area do- find("td.fc-timegrid-col:nth-of-type(3) .te-calendar--time-entry").click+ all("td.fc-timegrid-col:nth-of-type(3) .te-calendar--time-entry").first.clickendtime_logging_modal.is_visible true@@ -231,7 +241,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: trmy_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_update)within entries_area.area do- find("td.fc-timegrid-col:nth-of-type(3) .te-calendar--time-entry").hover+ all("td.fc-timegrid-col:nth-of-type(3) .te-calendar--time-entry").first.hoverendexpect(page)@@ -247,7 +257,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: tr.to have_selector('.ui-tooltip', text: "Comment: Some comment")expect(page)- .to have_content "Total: 12.00"+ .to have_content "Total: 13.00"## Hiding weekdaysentries_area.click_menu_item I18n.t('js.grid.configure')@@ -279,7 +289,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: trwithin entries_area.area doexpect(page)- .not_to have_selector("td.fc-timegrid-col:nth-of-type(5) .te-calendar--time-entry")+ .not_to have_selector("td.fc-timegrid-col:nth-of-type(5) .te-calendar--time-entry")endexpect(TimeEntry.where(id: other_visible_time_entry.id))