Merge pull request #7312 from opf/fix/30216/cancel-editing-correctly

[30231] Correctly reset form when cancelling editing

[ci skip]
pull/7270/head
Oliver Günther 6 years ago committed by GitHub
commit fe51e74253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      frontend/src/app/components/wp-edit/wp-edit-field/wp-edit-field-group.directive.ts
  2. 1
      frontend/src/app/components/wp-new/wp-create.service.ts
  3. 17
      spec/features/work_packages/new/new_work_package_spec.rb

@ -176,6 +176,10 @@ export class WorkPackageEditFieldGroupComponent implements OnInit, OnDestroy {
this.form.editMode = false;
this.wpEditing.stopEditing(this.workPackage.id!);
this.form.destroy();
if (this.workPackage.isNew) {
this.wpCreate.cancelCreation();
}
}
public saveWorkPackage() {

@ -125,6 +125,7 @@ export class WorkPackageCreateService implements IWorkPackageCreateService {
public cancelCreation() {
this.wpEditing.stopEditing('new');
this.wpCacheService.clearSome('new');
this.form = undefined;
}
public changesetUpdates$() {

@ -278,6 +278,23 @@ describe 'new work package', js: true do
it_behaves_like 'work package creation workflow' do
let(:create_method) { method(:create_work_package_globally) }
end
it 'can stop and re-create with correct selection (Regression #30216)' do
create_work_package_globally(type_bug, project.name)
click_on 'Cancel'
wp_page.click_add_wp_button
expect(page).to have_no_selector('.ng-value', text: project.name)
project_field.openSelectField
project_field.set_value project.name
type_field.openSelectField
type_field.set_value type_bug
click_on 'Cancel'
end
end
context 'as a user with no permissions' do

Loading…
Cancel
Save