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

Fixing Linter + Tests

parent 075fa370
/* global Chart */
export default () => {
const dataEl = document.getElementById('js-analytics-data');
const data = JSON.parse(dataEl.innerHTML);
const labels = data.labels;
const outputElIds = ['push', 'issues_closed', 'merge_requests_created'];
if (dataEl) {
const data = JSON.parse(dataEl.innerHTML);
const labels = data.labels;
const outputElIds = ['push', 'issues_closed', 'merge_requests_created'];
outputElIds.forEach((id) => {
const el = document.getElementById(id);
const ctx = el.getContext('2d');
const chart = new Chart(ctx);
outputElIds.forEach((id) => {
const el = document.getElementById(id);
const ctx = el.getContext('2d');
const chart = new Chart(ctx);
chart.Bar(
{
chart.Bar({
labels,
datasets: [{
fillColor: 'rgba(220,220,220,0.5)',
......@@ -22,13 +22,14 @@ export default () => {
data: data[id].data,
}],
},
{
scaleOverlay: true,
responsive: true,
maintainAspectRatio: false,
},
);
});
{
scaleOverlay: true,
responsive: true,
maintainAspectRatio: false,
},
);
});
$('#event-stats').tablesorter();
$('#event-stats').tablesorter();
}
};
.user-callout.promotion-callout {
margin: 20px 0 0;
&.prepend-top-10 {
margin-top: 10px;
}
.bordered-box {
padding: 20px;
border-color: $border-color;
background-color: $white-light;
align-items: flex-start;
.user-callout-copy {
max-width: inherit;
}
.close {
.dismiss-icon {
color: $gray-darkest;
}
&:hover {
.dismiss-icon {
color: $text-color;
}
}
}
.svg-container {
margin-right: 15px;
}
}
}
.promotion-modal {
.modal-header {
border-bottom: none;
}
.modal-body {
margin-top: -20px;
}
.modal-footer {
border-top: none;
}
}
.promotion-backdrop {
......
......@@ -10,4 +10,3 @@
- if @project.feature_available?(:audit_events)
= render 'shared/audit_events/event_table', events: @events
......@@ -6,7 +6,7 @@
- else
- owner = @project.namespace.owner
%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?
= link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary'
- else
......
......@@ -4,6 +4,7 @@ describe 'Promotions', js: true do
let(:admin) { create(:admin) }
let(:user) { create(:user) }
let(:otherdeveloper) { create(:user, name: 'TheOtherDeveloper') }
let(:group) { create(:group) }
let(:project) { create(:project, :repository) }
let(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 7.days.from_now) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
......@@ -70,6 +71,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -96,6 +98,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -122,6 +125,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -149,6 +153,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -175,6 +180,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -201,6 +207,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -216,6 +223,7 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
project.team << [user, :master]
sign_in(user)
end
......@@ -230,16 +238,14 @@ describe 'Promotions', js: true do
let!(:license) { nil }
before do
group.add_owner(user)
sign_in(user)
end
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 '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
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