Updated storage views to include snippets_size

parent 1b0feb52
......@@ -14,9 +14,10 @@ module StorageHelper
counter_repositories: storage_counter(statistics.repository_size),
counter_wikis: storage_counter(statistics.wiki_size),
counter_build_artifacts: storage_counter(statistics.build_artifacts_size),
counter_lfs_objects: storage_counter(statistics.lfs_objects_size)
counter_lfs_objects: storage_counter(statistics.lfs_objects_size),
counter_snippets: storage_counter(statistics.snippets_size)
}
_("Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects}") % counters
_("Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects} / Snippets: %{counter_snippets}") % counters
end
end
......@@ -78,6 +78,7 @@ export default {
buildArtifactsSize: s__('UsageQuota|Artifacts'),
packagesSize: s__('UsageQuota|Packages'),
wikiSize: s__('UsageQuota|Wiki'),
snippetsSize: s__('UsageQuota|Snippets'),
},
};
</script>
......
......@@ -27,6 +27,7 @@ query getStorageCounter($fullPath: ID!) {
buildArtifactsSize
packagesSize
wikiSize
snippetsSize
}
}
}
......
---
title: Update storage views to show snippets size
merge_request: 35419
author:
type: changed
......@@ -19,6 +19,8 @@ const data = {
lfsObjectsSize: 0,
buildArtifactsSize: 1272375,
packagesSize: 0,
wikiSize: 2048,
snippetsSize: 1024,
},
};
......
......@@ -19222,7 +19222,7 @@ msgstr ""
msgid "Repository sync capacity"
msgstr ""
msgid "Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects}"
msgid "Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects} / Snippets: %{counter_snippets}"
msgstr ""
msgid "RepositorySettingsAccessLevel|Select"
......@@ -24725,6 +24725,9 @@ msgstr ""
msgid "UsageQuota|Repository"
msgstr ""
msgid "UsageQuota|Snippets"
msgstr ""
msgid "UsageQuota|Storage"
msgstr ""
......
......@@ -15,7 +15,7 @@ RSpec.describe "Admin > Admin sees project statistics" do
let(:project) { create(:project, :repository) }
it "shows project statistics" do
expect(page).to have_content("Storage: 0 Bytes (Repository: 0 Bytes / Wikis: 0 Bytes / Build Artifacts: 0 Bytes / LFS: 0 Bytes)")
expect(page).to have_content("Storage: 0 Bytes (Repository: 0 Bytes / Wikis: 0 Bytes / Build Artifacts: 0 Bytes / LFS: 0 Bytes / Snippets: 0 Bytes)")
end
end
......
......@@ -30,10 +30,11 @@ RSpec.describe StorageHelper do
repository_size: 10.kilobytes,
wiki_size: 10.bytes,
lfs_objects_size: 20.gigabytes,
build_artifacts_size: 30.megabytes))
build_artifacts_size: 30.megabytes,
snippets_size: 40.megabytes))
end
let(:message) { 'Repository: 10 KB / Wikis: 10 Bytes / Build Artifacts: 30 MB / LFS: 20 GB' }
let(:message) { 'Repository: 10 KB / Wikis: 10 Bytes / Build Artifacts: 30 MB / LFS: 20 GB / Snippets: 40 MB' }
it 'works on ProjectStatistics' do
expect(helper.storage_counters_details(project.statistics)).to eq(message)
......
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