Commit 1c0aef44 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'change_message_for_newly_created_milestone' into 'master'

Use a better message when milestone is newly created

closes #14982

See merge request !3925
parents 6d716fbd ded3b02f
......@@ -7,6 +7,7 @@ v 8.8.0 (unreleased)
- Fix error when visiting commit builds page before build was updated
- Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
- Updated search UI
- Display informative message when new milestone is created
- Replace Devise Async with Devise ActiveJob integration. !3902 (Connor Shea)
- Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea)
- Added button to toggle whitespaces changes on diff view
......
......@@ -8,7 +8,7 @@ module Milestoneish
end
def complete?(user = nil)
total_items_count(user) == closed_items_count(user)
total_items_count(user) > 0 && total_items_count(user) == closed_items_count(user)
end
def percent_complete(user = nil)
......
......@@ -42,9 +42,12 @@
= preserve do
= markdown @milestone.description
- if @milestone.complete?(current_user) && @milestone.active?
- if @milestone.total_items_count(current_user).zero?
.alert.alert-success.prepend-top-default
%span All issues for this milestone are closed. You may close milestone now.
%span Assign some issues to this milestone.
- elsif @milestone.complete?(current_user) && @milestone.active?
.alert.alert-success.prepend-top-default
%span All issues for this milestone are closed. You may close this milestone now.
= render 'shared/milestones/summary', milestone: @milestone, project: @project
= render 'shared/milestones/tabs', milestone: @milestone
require 'rails_helper'
feature 'Milestone', feature: true do
include WaitForAjax
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
let(:milestone) { create(:milestone, project: project, title: 8.7) }
before do
project.team << [user, :master]
login_as(user)
end
feature 'Create a milestone' do
scenario 'should show an informative message for a new issue' do
visit new_namespace_project_milestone_path(project.namespace, project)
page.within '.milestone-form' do
fill_in "milestone_title", with: '8.7'
end
find('input[name="commit"]').click
expect(find('.alert-success')).to have_content('Assign some issues to this milestone.')
end
end
feature 'Open a milestone with closed issues' do
scenario 'should show an informative message' do
create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed")
visit namespace_project_milestone_path(project.namespace, project, milestone)
expect(find('.alert-success')).to have_content('All issues for this milestone are closed. You may close this milestone now.')
end
end
end
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