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
[31859] Save date with confirm button when empty
Oliver Güntherafeb1a42af38
diff --git a/frontend/src/app/modules/common/op-date-picker/datepicker.ts b/frontend/src/app/modules/common/op-date-picker/datepicker.tsindex 2310096d143..c16d316b4f3 100644--- a/frontend/src/app/modules/common/op-date-picker/datepicker.ts+++ b/frontend/src/app/modules/common/op-date-picker/datepicker.ts@@ -52,6 +52,7 @@ export class DatePicker {showWeeks: true,changeMonth: true,changeYear: true,+ closeText: I18n.t('js.button_confirm'),dateFormat: this.datepickerFormat,defaultDate: this.timezoneService.formattedISODate(this.date),showButtonPanel: truediff --git a/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.tsindex 4d27b1b38f9..2d7ccf2ef70 100644--- a/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts@@ -36,6 +36,7 @@ import {EditFieldComponent} from "core-app/modules/fields/edit/edit-field.compon<op-date-pickertabindex="-1"(onChange)="onValueSelected($event)"+ (onClose)="handler.handleUserSubmit()"[initialDate]="defaultDate"><input [ngModel]="formatter(value)"@@ -57,7 +58,6 @@ export class DateEditFieldComponent extends EditFieldComponent {public onValueSelected(data:string) {this.value = this.parser(data);- this.handler.handleUserSubmit();}public parser(data:any) {diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rbindex 2ff1dfc0a8d..742ce538d7a 100644--- a/spec/features/work_packages/details/date_editor_spec.rb+++ b/spec/features/work_packages/details/date_editor_spec.rb@@ -42,6 +42,7 @@ describe 'date inplace editor',let(:work_packages_page) { Pages::FullWorkPackage.new(work_package,project) }let(:due_date) { work_packages_page.edit_field(:dueDate) }+ let(:start_date) { work_packages_page.edit_field(:startDate) }before dologin_as(user)@@ -63,4 +64,26 @@ describe 'date inplace editor',due_date.expect_inactive!due_date.expect_state_text '2016-01-25'end++ it 'saves the date when clearing and then confirming' do+ start_date.activate!++ sleep 1++ start_date.input_element.click+ start_date.clear with_backspace: true+ start_date.input_element.send_keys :backspace++ within('.ui-datepicker') do+ find('button', text: 'Confirm').click+ end++ work_packages_page.expect_and_dismiss_notification message: 'Successful update.'++ start_date.expect_inactive!+ start_date.expect_state_text 'no start date'++ work_package.reload+ expect(work_package.start_date).to be_nil+ endenddiff --git a/spec/features/work_packages/details/inplace_editor/shared_examples.rb b/spec/features/work_packages/details/inplace_editor/shared_examples.rbindex 9776f12754c..5b152ca4e10 100644--- a/spec/features/work_packages/details/inplace_editor/shared_examples.rb+++ b/spec/features/work_packages/details/inplace_editor/shared_examples.rb@@ -144,7 +144,7 @@ shared_examples 'a principal autocomplete field' doit 'autocompletes links to user profiles' dofield.activate!- field.input_element.set(' ', fill_options: { clear: :backspace })+ field.clear with_backspace: truefield.input_element.set(" @lau")expect(page).to have_selector('.mention-list-item', text: mentioned_user.name)expect(page).to have_selector('.mention-list-item', text: mentioned_group.name)@@ -155,7 +155,7 @@ shared_examples 'a principal autocomplete field' do# Clear the fieldsleep(0.01)- field.input_element.set(' ', fill_options: { clear: :backspace })+ field.clear with_backspace: truesleep(0.01)field.input_element.set(" @Laura Fo")diff --git a/spec/features/work_packages/table/milestones_spec.rb b/spec/features/work_packages/table/milestones_spec.rbindex e1cf07ac507..c3a027ed5c9 100644--- a/spec/features/work_packages/table/milestones_spec.rb+++ b/spec/features/work_packages/table/milestones_spec.rb@@ -39,13 +39,12 @@ describe 'Inline editing milestones', js: true dostart_date.expect_active!due_date.expect_inactive!- # Open both dates+ # Open second date, closese firstdue_date.activate!- start_date.expect_active!+ start_date.expect_inactive!due_date.expect_active!- # Close both with escape- start_date.cancel_by_escape+ # Close with escapedue_date.cancel_by_escapestart_date.expect_inactive!diff --git a/spec/features/wysiwyg/user_autocomplete_spec.rb b/spec/features/wysiwyg/user_autocomplete_spec.rbindex d30ddd08c38..e3b9b4ceb8b 100644--- a/spec/features/wysiwyg/user_autocomplete_spec.rb+++ b/spec/features/wysiwyg/user_autocomplete_spec.rb@@ -62,7 +62,7 @@ describe 'Wysiwyg work package user mentions',it 'can autocomplete users and groups' docomment_field.activate!- comment_field.input_element.set('', fill_options: { clear: :backspace })+ comment_field.clear with_backspace: truecomment_field.input_element.send_keys("@Foo")expect(page).to have_selector('.mention-list-item', text: user2.name)expect(page).to have_selector('.mention-list-item', text: group.name)@@ -76,7 +76,7 @@ describe 'Wysiwyg work package user mentions',endcomment_field.activate!- comment_field.input_element.set('', fill_options: { clear: :backspace })+ comment_field.clear with_backspace: truecomment_field.input_element.send_keys(" @Foo")expect(page).to have_selector('.mention-list-item', text: user2.name)expect(page).to have_selector('.mention-list-item', text: group.name)diff --git a/spec/support/edit_fields/edit_field.rb b/spec/support/edit_fields/edit_field.rbindex 7a6c15d0cc1..31e8e9e14bd 100644--- a/spec/support/edit_fields/edit_field.rb+++ b/spec/support/edit_fields/edit_field.rb@@ -34,8 +34,12 @@ class EditFieldcontext.find "#{@selector} #{input_selector}"end- def clear- input_element.native.clear+ def clear(with_backspace: false)+ if with_backspace+ input_element.set(' ', fill_options: { clear: :backspace })+ else+ input_element.native.clear+ endenddef expect_read_onlydiff --git a/spec/support/edit_fields/text_editor_field.rb b/spec/support/edit_fields/text_editor_field.rbindex 773c4e1d8a1..e5e72508de0 100644--- a/spec/support/edit_fields/text_editor_field.rb+++ b/spec/support/edit_fields/text_editor_field.rb@@ -29,7 +29,7 @@ class TextEditorField < EditFieldckeditor.set_markdown textend- def clear+ def clear(*)ckeditor.clearend