Commit b2aba61c authored by Mitchell Nielsen's avatar Mitchell Nielsen Committed by Thong Kuah

Display notices above license breakdown

parent b4b27440
- breadcrumb_title _("Dashboard") - breadcrumb_title _("Dashboard")
- page_title _("Dashboard") - page_title _("Dashboard")
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
- if @notices - if @notices
- @notices.each do |notice| - @notices.each do |notice|
.js-vue-alert{ 'v-cloak': true, data: { variant: notice[:type], .js-vue-alert{ 'v-cloak': true, data: { variant: notice[:type],
dismissible: true.to_s } } dismissible: true.to_s } }
= notice[:message].html_safe = notice[:message].html_safe
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
.admin-dashboard.gl-mt-3 .admin-dashboard.gl-mt-3
.row .row
.col-sm-4 .col-sm-4
......
---
title: Display notices above license breakdown
merge_request: 36881
author:
type: changed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'admin/dashboard/index.html.haml' do
include Devise::Test::ControllerHelpers
before do
counts = Admin::DashboardController::COUNTED_ITEMS.each_with_object({}) do |item, hash|
hash[item] = 100
end
assign(:counts, counts)
assign(:projects, create_list(:project, 1))
assign(:users, create_list(:user, 1))
assign(:groups, create_list(:group, 1))
assign(:license, create(:license))
allow(view).to receive(:admin?).and_return(true)
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
allow(view).to receive(:show_license_breakdown?).and_return(true)
end
it 'includes notices above license breakdown' do
assign(:notices, [{ type: :alert, message: 'An alert' }])
render
expect(rendered).to have_content /An alert.*Users in License/
end
it 'includes license breakdown' do
render
expect(rendered).to have_content "Users in License"
expect(rendered).to have_content "Active Users"
expect(rendered).to have_content "Maximum Users"
expect(rendered).to have_content "Users over License"
end
end
...@@ -32,4 +32,13 @@ RSpec.describe 'admin/dashboard/index.html.haml' do ...@@ -32,4 +32,13 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})" expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})"
end end
it 'does not include license breakdown' do
render
expect(rendered).not_to have_content "Users in License"
expect(rendered).not_to have_content "Active Users"
expect(rendered).not_to have_content "Maximum Users"
expect(rendered).not_to have_content "Users over License"
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