Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b2aba61c
Commit
b2aba61c
authored
Jul 24, 2020
by
Mitchell Nielsen
Committed by
Thong Kuah
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display notices above license breakdown
parent
b4b27440
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
3 deletions
+57
-3
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+3
-3
ee/changelogs/unreleased/display-notices-above-license-breakdown.yml
...gs/unreleased/display-notices-above-license-breakdown.yml
+5
-0
ee/spec/views/admin/dashboard/index.html.haml_spec.rb
ee/spec/views/admin/dashboard/index.html.haml_spec.rb
+40
-0
spec/views/admin/dashboard/index.html.haml_spec.rb
spec/views/admin/dashboard/index.html.haml_spec.rb
+9
-0
No files found.
app/views/admin/dashboard/index.html.haml
View file @
b2aba61c
-
breadcrumb_title
_
(
"Dashboard"
)
-
page_title
_
(
"Dashboard"
)
-
if
show_license_breakdown?
=
render_if_exists
'admin/licenses/breakdown'
,
license:
@license
-
if
@notices
-
@notices
.
each
do
|
notice
|
.js-vue-alert
{
'v-cloak'
:
true
,
data:
{
variant:
notice
[
:type
],
dismissible:
true
.
to_s
}
}
=
notice
[
:message
].
html_safe
-
if
show_license_breakdown?
=
render_if_exists
'admin/licenses/breakdown'
,
license:
@license
.admin-dashboard.gl-mt-3
.row
.col-sm-4
...
...
ee/changelogs/unreleased/display-notices-above-license-breakdown.yml
0 → 100644
View file @
b2aba61c
---
title
:
Display notices above license breakdown
merge_request
:
36881
author
:
type
:
changed
ee/spec/views/admin/dashboard/index.html.haml_spec.rb
0 → 100644
View file @
b2aba61c
# 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
spec/views/admin/dashboard/index.html.haml_spec.rb
View file @
b2aba61c
...
...
@@ -32,4 +32,13 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect
(
rendered
).
to
have_content
"
#{
Gitlab
::
VERSION
}
(
#{
Gitlab
.
revision
}
)"
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment