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
fix running timer specs
Klaus Zanders7399522501c8
diff --git a/frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts b/frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.tsindex 0e7bb3a426e..d91c0c7efd5 100644--- a/frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts+++ b/frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts@@ -120,7 +120,7 @@ export class WorkPackageTimerButtonComponent extends UntilDestroyedMixin impleme}activeForWorkPackage(entry:TimeEntryResource | null):boolean {- return !!entry && entry.workPackage.href === this.workPackage.href;+ return !!entry && entry.entity.href === this.workPackage.href;}clear():void {diff --git a/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html b/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.htmlindex 88336a031e9..3b035aecfa7 100644--- a/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html+++ b/frontend/src/app/shared/components/time_entries/timer/stop-existing-timer-modal.component.html@@ -18,7 +18,7 @@<br/><auiSref="work-packages.show"- [uiParams]="{ workPackageId: active.workPackage.id }"+ [uiParams]="{ workPackageId: active.entity.id }"(click)="closeMe()">#{{ active.workPackage.id }}: {{ active.workPackage.name }}diff --git a/frontend/src/app/shared/components/time_entries/timer/timer-account-menu.component.html b/frontend/src/app/shared/components/time_entries/timer/timer-account-menu.component.htmlindex b9f6e7f0e05..85bcdb97e18 100644--- a/frontend/src/app/shared/components/time_entries/timer/timer-account-menu.component.html+++ b/frontend/src/app/shared/components/time_entries/timer/timer-account-menu.component.html@@ -12,9 +12,9 @@<aclass="op-timer-account-menu--wp-details"uiSref="work-packages.show"- [uiParams]="{ workPackageId: timer.workPackage.id }"+ [uiParams]="{ workPackageId: timer.entity.id }">- #{{ timer.workPackage.id }}: {{ timer.workPackage.name }}+ #{{ timer.entity.id }}: {{ timer.entity.name }}</a><div class="spot-divider"></div></ng-container>diff --git a/modules/costs/spec/features/timer_spec.rb b/modules/costs/spec/features/timer_spec.rbindex 5dbfd03edc1..ba757fc6408 100644--- a/modules/costs/spec/features/timer_spec.rb+++ b/modules/costs/spec/features/timer_spec.rb@@ -55,7 +55,7 @@ RSpec.describe "Work Package timer", :js, :selenium doactive_time_entries = TimeEntry.where(ongoing: true, user:)expect(active_time_entries.count).to eq 1timer_entry = active_time_entries.first- expect(timer_entry.work_package).to eq work_package_a+ expect(timer_entry.entity).to eq work_package_aexpect(timer_entry.hours).to be_nilpage.find(".op-top-menu-user").click@@ -97,7 +97,7 @@ RSpec.describe "Work Package timer", :js, :selenium doactive_time_entries = TimeEntry.where(ongoing: true, user:)expect(active_time_entries.count).to eq 1timer_entry = active_time_entries.first- expect(timer_entry.work_package).to eq work_package_a+ expect(timer_entry.entity).to eq work_package_aexpect(timer_entry.hours).to be_nilpage.within(".spot-modal") { click_on "Stop current timer" }@@ -122,7 +122,7 @@ RSpec.describe "Work Package timer", :js, :selenium doactive_time_entries = TimeEntry.where(ongoing: true, user:)expect(active_time_entries.count).to eq 1timer_entry = active_time_entries.first- expect(timer_entry.work_package).to eq work_package_b+ expect(timer_entry.entity).to eq work_package_bexpect(timer_entry.hours).to be_nilendenddiff --git a/spec/features/support/components/time_logging_modal.rb b/spec/features/support/components/time_logging_modal.rbindex ed031a45efa..943bb43e5db 100644--- a/spec/features/support/components/time_logging_modal.rb+++ b/spec/features/support/components/time_logging_modal.rb@@ -76,9 +76,11 @@ module Componentsendend+ # TODO: Make this aware of more entitiesdef expect_work_package(work_package)title = "#{work_package.type.name} ##{work_package.id} #{work_package.subject}"within modal_container do+ expect(page).to have_field("time_entry_entity_type", with: "WorkPackage", type: :hidden)expect(page).to have_css("opce-time-entries-work-package-autocompleter .ng-value", text: title, wait: 10)endend