summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-04-19 17:02:21 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-04-19 17:02:21 +0000
commit6d713065622953c81dbf39c7d9f393f08f968179 (patch)
treea0055a1f84aa5214d615e7753eba3c6cf8fa0863
parentab4dbcecac691690bed34b74020ec4f21c207ce8 (diff)
parentc2b311e034eeec6d9a3ddab1a86a56e2c13a11d4 (diff)
downloadgitlab-ce-6d713065622953c81dbf39c7d9f393f08f968179.tar.gz
Merge branch 'group-milestone-date-fields-fix' into 'master'
Fixed group milestones date pickers not working Closes #31095 See merge request !10779
-rw-r--r--app/assets/javascripts/dispatcher.js6
-rw-r--r--app/assets/javascripts/dropzone_input.js3
-rw-r--r--changelogs/unreleased/group-milestone-date-fields-fix.yml4
-rw-r--r--spec/features/groups/milestone_spec.rb36
4 files changed, 46 insertions, 3 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 0faf757eaab..02a7df9b2a0 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -150,13 +150,13 @@ const ShortcutsBlob = require('./shortcuts_blob');
case 'projects:milestones:new':
case 'projects:milestones:edit':
case 'projects:milestones:update':
+ case 'groups:milestones:new':
+ case 'groups:milestones:edit':
+ case 'groups:milestones:update':
new ZenMode();
new gl.DueDateSelectors();
new gl.GLForm($('.milestone-form'));
break;
- case 'groups:milestones:new':
- new ZenMode();
- break;
case 'projects:compare:show':
new gl.Diff();
break;
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js
index c5fbbdaf465..b70d242269d 100644
--- a/app/assets/javascripts/dropzone_input.js
+++ b/app/assets/javascripts/dropzone_input.js
@@ -38,6 +38,9 @@ window.DropzoneInput = (function() {
"opacity": 0,
"display": "none"
});
+
+ if (!project_uploads_path) return;
+
dropzone = form_dropzone.dropzone({
url: project_uploads_path,
dictDefaultMessage: "",
diff --git a/changelogs/unreleased/group-milestone-date-fields-fix.yml b/changelogs/unreleased/group-milestone-date-fields-fix.yml
new file mode 100644
index 00000000000..3cf3d3fa5ed
--- /dev/null
+++ b/changelogs/unreleased/group-milestone-date-fields-fix.yml
@@ -0,0 +1,4 @@
+---
+title: Fixed group milestone date dropdowns not opening
+merge_request:
+author:
diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb
new file mode 100644
index 00000000000..daa2c6afd63
--- /dev/null
+++ b/spec/features/groups/milestone_spec.rb
@@ -0,0 +1,36 @@
+require 'rails_helper'
+
+feature 'Group milestones', :feature, :js do
+ let(:group) { create(:group) }
+ let!(:project) { create(:project_empty_repo, group: group) }
+ let(:user) { create(:group_member, :master, user: create(:user), group: group ).user }
+
+ before do
+ Timecop.freeze
+
+ login_as(user)
+ end
+
+ after do
+ Timecop.return
+ end
+
+ context 'create a milestone' do
+ before do
+ visit new_group_milestone_path(group)
+ end
+
+ it 'creates milestone with start date' do
+ fill_in 'Title', with: 'testing'
+ find('#milestone_start_date').click
+
+ page.within(find('.pika-single')) do
+ click_button '1'
+ end
+
+ click_button 'Create milestone'
+
+ expect(find('.start_date')).to have_content(Date.today.at_beginning_of_month.strftime('%b %-d, %Y'))
+ end
+ end
+end