Commit d2cd261f authored by Tim Zallmann's avatar Tim Zallmann

Promote Audit Events

parent 0a71a903
......@@ -17,6 +17,7 @@ $darken-border-factor: 5%;
$white-light: #fff;
$white-normal: #f0f0f0;
$white-dark: #eaeaea;
$white-transparent: rgba(255, 255, 255, 0.8);
$gray-lightest: #fdfdfd;
$gray-light: #fafafa;
......
.user-callout.promotion-callout {
margin: 20px 0 0;
&.prepend-top-10 { margin-top: 10px; }
&.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;
}
......@@ -35,12 +31,16 @@
.modal-header {
border-bottom: none;
}
.modal-body {
margin-top: -20px;
}
.modal-footer {
border-top: none;
}
}
.promotion-backdrop {
background-color: $white-transparent;
position: absolute;
padding-top: 20px;
}
class Projects::AuditEventsController < Projects::ApplicationController
before_action :authorize_admin_project!
before_action :check_audit_events_available!
layout 'project_settings'
......
......@@ -149,7 +149,8 @@
= nav_link(controller: :environments) do
= link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do
%span
Environments
Pages
= render 'projects/settings/ee/nav'
- if @project.feature_available?(:builds, current_user) && !@project.empty_repo?
= nav_link(path: 'pipelines#charts') do
......
......@@ -2,7 +2,12 @@
= render "projects/settings/head"
- if !@project.feature_available?(:audit_events)
= render 'shared/promotions/promote_audit_events'
%h3.page-title Project Audit Events
%p.light Events in #{@project.full_path}
= render 'shared/audit_events/event_table', events: @events
- if @project.feature_available?(:audit_events)
= render 'shared/audit_events/event_table', events: @events
<svg xmlns="http://www.w3.org/2000/svg" width="74" height="78" viewBox="0 0 74 78"><g fill="none" fill-rule="evenodd"><path fill="#F9F9F9" d="M.053 39A37.599 37.599 0 0 0 0 41c0 20.435 16.565 37 37 37s37-16.565 37-37c0-.671-.018-1.338-.053-2C72.907 58.505 56.764 74 37 74 17.236 74 1.092 58.505.053 39z"/><path fill="#EEE" fill-rule="nonzero" d="M37 70c18.225 0 33-14.775 33-33S55.225 4 37 4 4 18.775 4 37s14.775 33 33 33zm0 4C16.565 74 0 57.435 0 37S16.565 0 37 0s37 16.565 37 37-16.565 37-37 37z"/><g fill-rule="nonzero"><path fill="#E1DBF2" d="M37 49c-6.406 0-12.228-2.843-17.38-8.412a4 4 0 0 1-.267-5.113C24.53 28.559 30.434 25 37 25c6.566 0 12.47 3.56 17.647 10.475a4 4 0 0 1-.266 5.113C49.228 46.158 43.406 49 37 49zm0-4c5.225 0 10.012-2.337 14.445-7.128C46.966 31.89 42.173 29 37 29s-9.966 2.89-14.445 8.872C26.988 42.662 31.775 45 37 45z"/><path fill="#6B4FBB" d="M37 45a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm0-4a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/></g></g></svg>
\ No newline at end of file
.center.promotion-backdrop
.svg-container
= custom_icon('icon_audit_events_purple')
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
Upgrade your plan to activate Service Desk.
- else
Track your project with Audit Events
%p
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.
%a{ href: '/help/administration/audit_events.html', target: '_blank' } Read more
= render 'shared/promotions/promotion_link_project'
- if @project.feature_available?(:audit_events)
= nav_link(controller: :audit_events) do
= link_to project_audit_events_path(@project), title: "Audit Events" do
%span
Audit Events
= nav_link(controller: :audit_events) do
= link_to project_audit_events_path(@project), title: "Audit Events" do
%span
Audit Events
......@@ -10,24 +10,6 @@ feature 'Projects > Audit Events', :js do
sign_in(user)
end
context 'unlicensed' do
before do
stub_licensed_features(audit_events: false)
end
it 'returns 404' do
visit project_audit_events_path(project)
expect(page.status_code).to eq(404)
end
it 'does not have Audit Events button in head nav bar' do
visit edit_project_path(project)
expect(page).not_to have_link('Audit Events')
end
end
it 'has Audit Events button in head nav bar' do
visit edit_project_path(project)
......
......@@ -211,4 +211,18 @@ describe 'Promotions', js: true do
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
describe 'for audit events', js: true do
let!(:license) { nil }
before do
sign_in(user)
end
it 'should appear on the page' do
visit project_audit_events_path(project)
expect(find('.issues-export-modal')).to have_content 'Track your project with Audit Events'
expect(find('.issues-export-modal')).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