Merge pull request #7110 from opf/fix/29664/calendar-history

[29664] Fix calendar history navigation

[ci skip]
pull/7111/head
Oliver Günther 6 years ago committed by GitHub
commit a7cea1a9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      frontend/src/app/modules/calendar/wp-calendar/wp-calendar.component.ts
  2. 7
      spec/features/calendars/calendars_spec.rb

@ -16,6 +16,7 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
import {DomSanitizer} from "@angular/platform-browser";
import {WorkPackagesListChecksumService} from "core-components/wp-list/wp-list-checksum.service";
import {OpTitleService} from "core-components/html/op-title.service";
@Component({
templateUrl: './wp-calendar.template.html',
@ -34,6 +35,7 @@ export class WorkPackagesCalendarController implements OnInit, OnDestroy {
readonly wpListService:WorkPackagesListService,
readonly wpListChecksumService:WorkPackagesListChecksumService,
readonly tableState:TableState,
readonly titleService:OpTitleService,
readonly urlParamsHelper:UrlParamsHelperService,
private element:ElementRef,
readonly i18n:I18nService,
@ -104,6 +106,9 @@ export class WorkPackagesCalendarController implements OnInit, OnDestroy {
// Ensure checksum is removed to allow queries to load
this.wpListChecksumService.clear();
// Ensure current calendar URL is pushed to history
window.history.pushState({}, this.titleService.current, window.location.href);
this.$state.go(
'work-packages.show',
{ workPackageId: workPackage.id },

@ -172,5 +172,12 @@ describe 'Work package calendars', type: :feature, js: true do
expect(page)
.to have_selector('.subject-header', text: current_work_package.subject)
# Going back in browser history will lead us back to the calendar
# Regression #29664
page.go_back
# click goes to work package show page
expect(page).to have_selector('.fc-event-container', text: current_work_package.subject, wait: 20)
end
end

Loading…
Cancel
Save