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
818f2485
Commit
818f2485
authored
May 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
2cdb7824
542b2a7e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
6 deletions
+68
-6
app/helpers/storage_helper.rb
app/helpers/storage_helper.rb
+2
-0
app/views/admin/projects/_projects.html.haml
app/views/admin/projects/_projects.html.haml
+1
-1
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+4
-4
changelogs/unreleased/49915-fix-error-500-admin-projects-nil-storage.yml
...leased/49915-fix-error-500-admin-projects-nil-storage.yml
+5
-0
changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml
changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml
+5
-0
db/migrate/20150509180749_convert_legacy_reference_notes.rb
db/migrate/20150509180749_convert_legacy_reference_notes.rb
+2
-1
spec/features/admin/admin_sees_project_statistics_spec.rb
spec/features/admin/admin_sees_project_statistics_spec.rb
+29
-0
spec/features/admin/admin_sees_projects_statistics_spec.rb
spec/features/admin/admin_sees_projects_statistics_spec.rb
+20
-0
No files found.
app/helpers/storage_helper.rb
View file @
818f2485
...
...
@@ -2,6 +2,8 @@
module
StorageHelper
def
storage_counter
(
size_in_bytes
)
return
s_
(
'StorageSize|Unknown'
)
unless
size_in_bytes
precision
=
size_in_bytes
<
1
.
megabyte
?
0
:
1
number_to_human_size
(
size_in_bytes
,
delimiter:
','
,
precision:
precision
,
significant:
false
)
...
...
app/views/admin/projects/_projects.html.haml
View file @
818f2485
...
...
@@ -13,7 +13,7 @@
.stats
%span
.badge.badge-pill
=
storage_counter
(
project
.
statistics
.
storage_size
)
=
storage_counter
(
project
.
statistics
&
.
storage_size
)
-
if
project
.
archived
%span
.badge.badge-warning
archived
.title
...
...
app/views/admin/projects/show.html.haml
View file @
818f2485
...
...
@@ -74,10 +74,10 @@
%li
%span
.light
=
_
(
'Storage:'
)
%strong
=
storage_counter
(
@project
.
statistics
.
storage_size
)
(
%strong
=
storage_counter
(
@project
.
statistics
&
.
storage_size
)
-
if
@project
.
statistics
=
surround
'('
,
')'
do
=
storage_counters_details
(
@project
.
statistics
)
)
%li
%span
.light
last commit:
...
...
changelogs/unreleased/49915-fix-error-500-admin-projects-nil-storage.yml
0 → 100644
View file @
818f2485
---
title
:
Fix an error in projects admin when statistics are missing
merge_request
:
28355
author
:
type
:
fixed
changelogs/unreleased/fix-db-migrate-is-failed-on-mysql8.yml
0 → 100644
View file @
818f2485
---
title
:
Fix. `db:migrate` is failed on MySQL
8
merge_request
:
28351
author
:
sue445
type
:
fixed
db/migrate/20150509180749_convert_legacy_reference_notes.rb
View file @
818f2485
...
...
@@ -7,7 +7,8 @@
# mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666
class
ConvertLegacyReferenceNotes
<
ActiveRecord
::
Migration
[
4.2
]
def
up
execute
%q{UPDATE notes SET note = trim(both '_' from note) WHERE system = true AND note LIKE '\_%\_'}
quoted_column_name
=
ActiveRecord
::
Base
.
connection
.
quote_column_name
(
'system'
)
execute
%Q{UPDATE notes SET note = trim(both '_' from note) WHERE
#{
quoted_column_name
}
= true AND note LIKE '
\_
%
\_
'}
end
def
down
...
...
spec/features/admin/admin_sees_project_statistics_spec.rb
0 → 100644
View file @
818f2485
# frozen_string_literal: true
require
'spec_helper'
describe
"Admin > Admin sees project statistics"
do
let
(
:current_user
)
{
create
(
:admin
)
}
before
do
sign_in
(
current_user
)
visit
admin_project_path
(
project
)
end
context
'when project has statistics'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
"shows project statistics"
do
expect
(
page
).
to
have_content
(
"Storage: 0 Bytes (0 Bytes repositories, 0 Bytes build artifacts, 0 Bytes LFS)"
)
end
end
context
'when project has no statistics'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
{
|
project
|
project
.
statistics
.
destroy
}
}
it
"shows 'Storage: Unknown'"
do
expect
(
page
).
to
have_content
(
"Storage: Unknown"
)
end
end
end
spec/features/admin/admin_sees_projects_statistics_spec.rb
0 → 100644
View file @
818f2485
# frozen_string_literal: true
require
'spec_helper'
describe
"Admin > Admin sees projects statistics"
do
let
(
:current_user
)
{
create
(
:admin
)
}
before
do
create
(
:project
,
:repository
)
create
(
:project
,
:repository
)
{
|
project
|
project
.
statistics
.
destroy
}
sign_in
(
current_user
)
visit
admin_projects_path
end
it
"shows project statistics for projects that have them"
do
expect
(
page
.
all
(
'.stats'
).
map
(
&
:text
)).
to
contain_exactly
(
"0 Bytes"
,
"Unknown"
)
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