Commit 0a71a903 authored by Tim Zallmann's avatar Tim Zallmann

Export + Burndown Chart promotions

parent 2d18120a
......@@ -204,6 +204,7 @@ import initGroupAnalytics from './init_group_analytics';
new ProjectSelect();
break;
case 'projects:milestones:show':
new UserCallout();
case 'groups:milestones:show':
case 'dashboard:milestones:show':
new Milestone();
......
.user-callout.promotion-callout {
margin: 20px 0 0;
&.prepend-top-10 { margin-top: 10px; }
.bordered-box {
padding: 20px;
border-color: $border-color;
......@@ -28,3 +30,17 @@
}
}
}
.promotion-modal {
.modal-header {
border-bottom: none;
}
.modal-body {
margin-top: -20px;
}
.modal-footer {
border-top: none;
}
}
- if current_user && @project.feature_available?(:export_issues)
%button.csv_download_link.btn.append-right-10.has-tooltip{ title: 'Export as CSV' }
= icon('download')
%button.csv_download_link.btn.append-right-10.has-tooltip{ title: 'Export as CSV' }
= icon('download')
- return unless current_user && @project.feature_available?(:export_issues)
.issues-export-modal.modal
.modal-dialog
.modal-content
.modal-header
%a.close{ href: '#', 'data-dismiss' => 'modal' } ×
.export-svg-container.pull-right
= render 'projects/issues/export_issues/export_issues_list.svg'
%h3
Export issues
.modal-header
= icon('check', { class: 'export-checkmark' })
%strong
#{pluralize(issuables_count_for_state(:issues, params[:state]), 'issue')} selected
.modal-body
%div
The CSV export will be created in the background. Once finished, it will be sent to
%strong= @current_user.notification_email
in an attachment.
.modal-footer
= link_to 'Export issues', export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn btn-success pull-left', title: 'Export issues'
- if current_user && @project.feature_available?(:export_issues)
.issues-export-modal.modal
.modal-dialog
.modal-content
.modal-header
%a.close{ href: '#', 'data-dismiss' => 'modal' } ×
.export-svg-container.pull-right
= render 'projects/issues/export_issues/export_issues_list.svg'
%h3
Export issues
.modal-header
= icon('check', { class: 'export-checkmark' })
%strong
#{pluralize(issuables_count_for_state(:issues, params[:state]), 'issue')} selected
.modal-body
%div
The CSV export will be created in the background. Once finished, it will be sent to
%strong= @current_user.notification_email
in an attachment.
.modal-footer
= link_to 'Export issues', export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn btn-success pull-left', title: 'Export issues'
- else
= render 'shared/promotions/promote_csv_export'
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="82" viewBox="0 0 78 82"><g fill="none" fill-rule="evenodd"><path fill="#F9F9F9" d="M2.12 42c-.08.99-.12 1.99-.12 3 0 20.435 16.565 37 37 37s37-16.565 37-37c0-1.01-.04-2.01-.12-3C74.353 61.032 58.425 76 39 76 19.575 76 3.647 61.032 2.12 42z"/><path fill="#EEE" fill-rule="nonzero" d="M39 78C17.46 78 0 60.54 0 39S17.46 0 39 0s39 17.46 39 39-17.46 39-39 39zm0-4c19.33 0 35-15.67 35-35S58.33 4 39 4 4 19.67 4 39s15.67 35 35 35z"/><path fill="#E1DBF2" fill-rule="nonzero" d="M45 23c-1.312 0-2.593.23-3.795.673A10.982 10.982 0 0 0 33 20c-5.8 0-10.553 4.49-10.97 10.184A11.003 11.003 0 0 0 16 40c0 6.075 4.925 11 11 11h1.042a2 2 0 1 0 0-4H27a7 7 0 0 1-2.323-13.606 2 2 0 0 0 1.334-1.998 7 7 0 0 1 12.89-4.163 2 2 0 0 0 2.667.664A7.004 7.004 0 0 1 51.7 31.966a2 2 0 0 0 1.334 1.334A7 7 0 0 1 51 47h-.94a2 2 0 1 0 0 4H51c6.075 0 11-4.925 11-11 0-4.524-2.754-8.51-6.822-10.178A11.005 11.005 0 0 0 45 23z"/><path fill="#6B4FBB" d="M41 53V43a2 2 0 1 0-4 0v10h-2.796a1 1 0 0 0-.753 1.659l4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48A1 1 0 0 0 43.796 53H41z"/></g></svg>
\ No newline at end of file
......@@ -34,3 +34,5 @@
this milestone and the chart will appear here, always up-to-date.
= link_to "Add start and due date", edit_project_milestone_path(project, milestone), class: 'btn'
- elsif show_promotions? && show_callout?('promote_burndown_charts_dismissed')
= render 'shared/promotions/promote_burndown_charts'
......@@ -2,6 +2,8 @@
.bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss burndown charts promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
.svg-container
= custom_icon('icon_burndown_charts')
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
......
.issues-export-modal.modal.promotion-modal
.modal-dialog
.modal-content
.modal-header
%a.close{ href: '#', 'data-dismiss' => 'modal' } ×
.modal-body.center
%div
.svg-container
= custom_icon('icon_export_issues')
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
Upgrade your plan to export issues.
- else
Export issues with GitLab Enterprise Edition
%p
Export Issues to CSV enables you and your team to export all the data collected from issues into a comma-separated values (CSV) file, which stores tabular data in plain text.
%a{ href: '/help/user/project/issues/csv_export.html', target: '_blank' } Read more
.modal-footer.center
= render 'shared/promotions/promotion_link_project'
.user-callout.promotion-callout{ id: 'promote_squash_commits', data: { uid: 'promote_squash_commits_dismissed' } }
.user-callout.promotion-callout.prepend-top-10{ id: 'promote_squash_commits', data: { uid: 'promote_squash_commits_dismissed' } }
.bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss merge request promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
......
......@@ -3,9 +3,10 @@ require 'spec_helper'
describe 'Promotions', js: true do
let(:admin) { create(:admin) }
let(:user) { create(:user) }
let(:otherdeveloper) { create(:user, , name: 'TheOtherDeveloper') }
let(:otherdeveloper) { create(:user, name: 'TheOtherDeveloper') }
let(:project) { create(:project, :repository) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
let(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 7.days.from_now) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
describe 'if you have a license' do
before do
......@@ -70,7 +71,6 @@ describe 'Promotions', js: true do
before do
sign_in(user)
project.team << [user, :master]
end
it 'should appear in project edit page' do
......@@ -97,7 +97,6 @@ describe 'Promotions', js: true do
before do
sign_in(user)
project.team << [user, :master]
end
it 'should appear in project edit page' do
......@@ -124,7 +123,6 @@ describe 'Promotions', js: true do
before do
sign_in(user)
project.team << [user, :master]
end
it 'should appear in repository settings page' do
......@@ -152,7 +150,6 @@ describe 'Promotions', js: true do
before do
sign_in(user)
project.team << [user, :master]
end
it 'should appear in new MR page' do
......@@ -173,4 +170,45 @@ describe 'Promotions', js: true do
expect(page).not_to have_selector('#promote_squash_commits')
end
end
describe 'for burndown charts', js: true do
let!(:license) { nil }
before do
sign_in(user)
end
it 'should appear in milestone page' do
visit project_milestone_path(project, milestone)
expect(find('#promote_burndown_charts')).to have_content 'Improve milestone with Burndown Charts.'
expect(find('#promote_burndown_charts')).to have_content 'Burndown Charts are visual representations of the progress of completing a milestone.'
end
it 'does not show when cookie is set' do
visit project_milestone_path(project, milestone)
within('#promote_burndown_charts') do
find('.close').trigger('click')
end
visit project_milestone_path(project, milestone)
expect(page).not_to have_selector('#promote_burndown_charts')
end
end
describe 'for issue export', js: true do
let!(:license) { nil }
before do
sign_in(user)
end
it 'should appear on export modal' do
visit project_issues_path(project)
click_on 'Export as CSV'
expect(find('.issues-export-modal')).to have_content 'Export issues with GitLab Enterprise Edition'
expect(find('.issues-export-modal')).to have_content 'Export Issues to CSV enables you and your team to export all the data collected from issues into a comma-separated values (CSV) file'
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