Commit 08f2f399 authored by Tim Zallmann's avatar Tim Zallmann

Fixing Linter + Tests

parent 075fa370
/* global Chart */ /* global Chart */
export default () => { export default () => {
const dataEl = document.getElementById('js-analytics-data'); const dataEl = document.getElementById('js-analytics-data');
if (dataEl) {
const data = JSON.parse(dataEl.innerHTML); const data = JSON.parse(dataEl.innerHTML);
const labels = data.labels; const labels = data.labels;
const outputElIds = ['push', 'issues_closed', 'merge_requests_created']; const outputElIds = ['push', 'issues_closed', 'merge_requests_created'];
...@@ -10,8 +11,7 @@ export default () => { ...@@ -10,8 +11,7 @@ export default () => {
const ctx = el.getContext('2d'); const ctx = el.getContext('2d');
const chart = new Chart(ctx); const chart = new Chart(ctx);
chart.Bar( chart.Bar({
{
labels, labels,
datasets: [{ datasets: [{
fillColor: 'rgba(220,220,220,0.5)', fillColor: 'rgba(220,220,220,0.5)',
...@@ -31,4 +31,5 @@ export default () => { ...@@ -31,4 +31,5 @@ export default () => {
}); });
$('#event-stats').tablesorter(); $('#event-stats').tablesorter();
}
}; };
.user-callout.promotion-callout { .user-callout.promotion-callout {
margin: 20px 0 0; margin: 20px 0 0;
&.prepend-top-10 { &.prepend-top-10 {
margin-top: 10px; margin-top: 10px;
} }
.bordered-box { .bordered-box {
padding: 20px; padding: 20px;
border-color: $border-color; border-color: $border-color;
background-color: $white-light; background-color: $white-light;
align-items: flex-start; align-items: flex-start;
.user-callout-copy { .user-callout-copy {
max-width: inherit; max-width: inherit;
} }
.close { .close {
.dismiss-icon { .dismiss-icon {
color: $gray-darkest; color: $gray-darkest;
} }
&:hover { &:hover {
.dismiss-icon { .dismiss-icon {
color: $text-color; color: $text-color;
} }
} }
} }
.svg-container { .svg-container {
margin-right: 15px; margin-right: 15px;
} }
} }
} }
.promotion-modal { .promotion-modal {
.modal-header { .modal-header {
border-bottom: none; border-bottom: none;
} }
.modal-body { .modal-body {
margin-top: -20px; margin-top: -20px;
} }
.modal-footer { .modal-footer {
border-top: none; border-top: none;
} }
} }
.promotion-backdrop { .promotion-backdrop {
......
...@@ -10,4 +10,3 @@ ...@@ -10,4 +10,3 @@
- if @project.feature_available?(:audit_events) - if @project.feature_available?(:audit_events)
= render 'shared/audit_events/event_table', events: @events = render 'shared/audit_events/event_table', events: @events
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- else - else
- owner = @project.namespace.owner - owner = @project.namespace.owner
%p Contact owner #{ link_to(simple_sanitize(owner.name), user_path(owner)) } to upgrade the license. %p Contact owner #{ link_to(simple_sanitize(owner.name), user_path(owner)) } to upgrade the license.
- elsif current_user.admin? - elsif current_user && current_user.admin?
- if License.current&.expired? - if License.current&.expired?
= link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary' = link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary'
- else - else
......
...@@ -4,6 +4,7 @@ describe 'Promotions', js: true do ...@@ -4,6 +4,7 @@ describe 'Promotions', js: true do
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:otherdeveloper) { create(:user, name: 'TheOtherDeveloper') } let(:otherdeveloper) { create(:user, name: 'TheOtherDeveloper') }
let(:group) { create(:group) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 7.days.from_now) } let(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 7.days.from_now) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) } let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
...@@ -70,6 +71,7 @@ describe 'Promotions', js: true do ...@@ -70,6 +71,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -96,6 +98,7 @@ describe 'Promotions', js: true do ...@@ -96,6 +98,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -122,6 +125,7 @@ describe 'Promotions', js: true do ...@@ -122,6 +125,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -149,6 +153,7 @@ describe 'Promotions', js: true do ...@@ -149,6 +153,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -175,6 +180,7 @@ describe 'Promotions', js: true do ...@@ -175,6 +180,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -201,6 +207,7 @@ describe 'Promotions', js: true do ...@@ -201,6 +207,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -216,6 +223,7 @@ describe 'Promotions', js: true do ...@@ -216,6 +223,7 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
project.team << [user, :master]
sign_in(user) sign_in(user)
end end
...@@ -230,16 +238,14 @@ describe 'Promotions', js: true do ...@@ -230,16 +238,14 @@ describe 'Promotions', js: true do
let!(:license) { nil } let!(:license) { nil }
before do before do
group.add_owner(user)
sign_in(user) sign_in(user)
end end
it 'should appear on the page' do it 'should appear on the page' do
visit group_analytics_path(project) visit group_analytics_path(group)
expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution analytics and GitLab Enterprise Edition.' expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution analytics and GitLab Enterprise Edition.'
expect(find('.user-callout-copy')).to have_content 'Audit Events is a tool for GitLab Enterprise Edition administrators to be able to track important events such as user access level, target user, and user addition or removal.' expect(find('.user-callout-copy')).to have_content 'Audit Events is a tool for GitLab Enterprise Edition administrators to be able to track important events such as user access level, target user, and user addition or removal.'
end end
end 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