Avoid submitting the edit form when in edit mode

pull/6263/head
Oliver Günther 7 years ago
parent 56564c88ea
commit f6773333f2
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 8
      frontend/app/components/wp-edit-form/work-package-edit-field-handler.ts
  2. 1
      spec/features/work_packages/new/new_work_package_spec.rb

@ -95,12 +95,12 @@ export class WorkPackageEditFieldHandler {
* Handle a user submitting the field (e.g, ng-change)
*/
public async handleUserSubmit():Promise<any> {
if (!(this.form.editMode && this.field.inFlight)) {
this.field.onSubmit();
return this.form.submit();
if (this.field.inFlight || this.form.editMode) {
return Promise.resolve();
}
return Promise.resolve();
this.field.onSubmit();
return this.form.submit();
}
/**

@ -71,6 +71,7 @@ describe 'new work package', js: true do
shared_examples 'work package creation workflow' do
before do
create_method.call('Task', project.name)
expect(page).to have_selector(safeguard_selector, wait: 10)
end

Loading…
Cancel
Save