Commit a50bd89d authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-cleanup-project-milestone-resource' into 'master'

Clean up project milestone resources and specs

See merge request gitlab-org/gitlab!33537
parents ad13dd28 7dbeed30
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.burndown-chart.mb-2{ data: { start_date: burndown.start_date.strftime("%Y-%m-%d"), .burndown-chart.mb-2{ data: { start_date: burndown.start_date.strftime("%Y-%m-%d"),
due_date: burndown.due_date.strftime("%Y-%m-%d"), due_date: burndown.due_date.strftime("%Y-%m-%d"),
milestone_id: milestone.id, milestone_id: milestone.id,
burndown_events_path: expose_url(burndown_endpoint), burnup_events_path: expose_url(burnup_endpoint), qa_selector: 'burndown_chart' } } burndown_events_path: expose_url(burndown_endpoint), burnup_events_path: expose_url(burnup_endpoint) } }
- elsif show_burndown_placeholder?(milestone, warning) - elsif show_burndown_placeholder?(milestone, warning)
.burndown-hint.content-block.container-fluid .burndown-hint.content-block.container-fluid
......
...@@ -187,7 +187,6 @@ module QA ...@@ -187,7 +187,6 @@ module QA
module Resource module Resource
autoload :License, 'qa/ee/resource/license' autoload :License, 'qa/ee/resource/license'
autoload :Epic, 'qa/ee/resource/epic' autoload :Epic, 'qa/ee/resource/epic'
autoload :ProjectMilestone, 'qa/ee/resource/project_milestone'
autoload :GroupLabel, 'qa/ee/resource/group_label.rb' autoload :GroupLabel, 'qa/ee/resource/group_label.rb'
module Board module Board
......
...@@ -6,10 +6,6 @@ module QA ...@@ -6,10 +6,6 @@ module QA
module Project module Project
module Milestone module Milestone
class Show < ::QA::Page::Base class Show < ::QA::Page::Base
view 'ee/app/views/shared/milestones/_burndown.html.haml' do
element :burndown_chart
end
view 'ee/app/views/shared/milestones/_weight.html.haml' do view 'ee/app/views/shared/milestones/_weight.html.haml' do
element :total_issue_weight_value element :total_issue_weight_value
end end
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
module Project module Project
class MilestoneBoardList < BaseBoardList class MilestoneBoardList < BaseBoardList
attribute :project_milestone do attribute :project_milestone do
QA::EE::Resource::ProjectMilestone.fabricate_via_api! do |project_milestone| QA::Resource::ProjectMilestone.fabricate_via_api! do |project_milestone|
project_milestone.project = board.project project_milestone.project = board.project
project_milestone.title = '1.0' project_milestone.title = '1.0'
end end
......
# frozen_string_literal: true
module QA
module EE
module Resource
class ProjectMilestone < QA::Resource::ProjectMilestone
attr_writer :start_date, :due_date
def api_post_body
{
title: title
}.tap do |hash|
hash[:start_date] = @start_date if @start_date
hash[:due_date] = @due_date if @due_date
end
end
end
end
end
end
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module QA module QA
module Resource module Resource
class ProjectMilestone < Base class ProjectMilestone < Base
attr_writer :start_date, :due_date
attribute :id attribute :id
attribute :title attribute :title
...@@ -27,7 +29,10 @@ module QA ...@@ -27,7 +29,10 @@ module QA
def api_post_body def api_post_body
{ {
title: title title: title
} }.tap do |hash|
hash[:start_date] = @start_date if @start_date
hash[:due_date] = @due_date if @due_date
end
end end
end end
end end
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
include ::QA::Support::Dates include ::QA::Support::Dates
let(:milestone) do let(:milestone) do
QA::EE::Resource::ProjectMilestone.fabricate_via_api! do |m| Resource::ProjectMilestone.fabricate_via_api! do |m|
m.start_date = current_date_yyyy_mm_dd m.start_date = current_date_yyyy_mm_dd
m.due_date = next_month_yyyy_mm_dd m.due_date = next_month_yyyy_mm_dd
end end
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
end end
let(:milestone) do let(:milestone) do
QA::EE::Resource::ProjectMilestone.fabricate_via_api! Resource::ProjectMilestone.fabricate_via_api!
end end
let(:weight) { 1000 } let(:weight) { 1000 }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment