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
Remember created type so we can continue editing moving to fullscreen
Oliver Günther1920ec0cb1a4
diff --git a/frontend/src/app/features/work-packages/components/wp-new/wp-create.component.ts b/frontend/src/app/features/work-packages/components/wp-new/wp-create.component.tsindex 63f261569ed..2631111f1b8 100644--- a/frontend/src/app/features/work-packages/components/wp-new/wp-create.component.ts+++ b/frontend/src/app/features/work-packages/components/wp-new/wp-create.component.ts@@ -52,10 +52,11 @@ import * as URI from 'urijs';import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';import { splitViewRoute } from 'core-app/features/work-packages/routing/split-view-routes.helper';import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';-import { HalSource } from 'core-app/features/hal/resources/hal-resource';+import { HalResource, HalSource } from 'core-app/features/hal/resources/hal-resource';import { OpTitleService } from 'core-app/core/html/op-title.service';import { WorkPackageCreateService } from './wp-create.service';import { HalError } from 'core-app/features/hal/services/hal-error';+import idFromLink from 'core-app/features/hal/helpers/id-from-link';@Directive()export class WorkPackageCreateComponent extends UntilDestroyedMixin implements OnInit {@@ -83,7 +84,8 @@ export class WorkPackageCreateComponent extends UntilDestroyedMixin implements O/** Explicitly remember destroy state in this abstract base */protected destroyed = false;- constructor(public readonly injector:Injector,+ constructor(+ public readonly injector:Injector,protected readonly $transition:Transition,protected readonly $state:StateService,protected readonly I18n:I18nService,@@ -110,7 +112,8 @@ export class WorkPackageCreateComponent extends UntilDestroyedMixin implements O}public switchToFullscreen() {- this.$state.go('work-packages.new', this.$state.params);+ const type = idFromLink(this.change.value<HalResource>('type')?.href);+ void this.$state.go('work-packages.new', { ...this.$state.params, type });}public onSaved(params:{ savedResource:WorkPackageResource, isInitial:boolean }) {diff --git a/spec/features/work_packages/new/new_work_package_spec.rb b/spec/features/work_packages/new/new_work_package_spec.rbindex e5af2f33094..e386066c6fa 100644--- a/spec/features/work_packages/new/new_work_package_spec.rb+++ b/spec/features/work_packages/new/new_work_package_spec.rb@@ -501,6 +501,22 @@ RSpec.describe 'new work package', js: true, with_cuprite: true doexpect(split_create_page).to have_selector('[data-qa-selector="op-wp-breadcrumb"]', text: "Parent:\n#{parent.subject}")end+ it 'can navigate to the fullscreen page (Regression #49565)' do+ work_packages_page.visit_index++ context_menu.open_for(parent)+ context_menu.choose('Create new child')++ subject_field = split_create_page.edit_field(:subject)+ subject_field.set_value 'My subtask'++ find('.work-packages-show-view-button').click++ expect(split_create_page).not_to have_alert_dialog+ subject_field = wp_page_create.edit_field(:subject)+ subject_field.expect_value 'My subtask'+ end+it 'from the relations tab' dowp_page.visit_tab!('relations')