Commit 6bf91ae9 authored by Simon Knox's avatar Simon Knox

Merge branch '340794-sort-usage-column-by-actual-value' into 'master'

Fix sorting by usage column in project's storage

See merge request gitlab-org/gitlab!70269
parents 9d3a0311 dc8d3c22
<script> <script>
import { GlLink, GlIcon, GlTable, GlSprintf } from '@gitlab/ui'; import { GlLink, GlIcon, GlTable, GlSprintf } from '@gitlab/ui';
import { numberToHumanSize } from '~/lib/utils/number_utils';
import { thWidthClass } from '~/lib/utils/table_utility'; import { thWidthClass } from '~/lib/utils/table_utility';
import { sprintf } from '~/locale'; import { sprintf } from '~/locale';
import { PROJECT_TABLE_LABELS, HELP_LINK_ARIA_LABEL } from '../constants'; import { PROJECT_TABLE_LABELS, HELP_LINK_ARIA_LABEL } from '../constants';
...@@ -37,6 +38,9 @@ export default { ...@@ -37,6 +38,9 @@ export default {
label: PROJECT_TABLE_LABELS.VALUE, label: PROJECT_TABLE_LABELS.VALUE,
thClass: thWidthClass(10), thClass: thWidthClass(10),
sortable: true, sortable: true,
formatter: (value) => {
return numberToHumanSize(value, 1);
},
}, },
], ],
}; };
......
...@@ -26,7 +26,7 @@ export const parseGetProjectStorageResults = (data, helpLinks) => { ...@@ -26,7 +26,7 @@ export const parseGetProjectStorageResults = (data, helpLinks) => {
...currentType, ...currentType,
helpPath, helpPath,
}, },
value: numberToHumanSize(storageStatistics[currentType.id], 1), value: storageStatistics[currentType.id],
}); });
}, []); }, []);
......
...@@ -48,7 +48,7 @@ export const projectData = { ...@@ -48,7 +48,7 @@ export const projectData = {
'There is a known issue with Artifact storage where the total could be incorrect for some projects. More details and progress are available in %{warningLinkStart}the epic%{warningLinkEnd}.', 'There is a known issue with Artifact storage where the total could be incorrect for some projects. More details and progress are available in %{warningLinkStart}the epic%{warningLinkEnd}.',
helpPath: '/build-artifacts', helpPath: '/build-artifacts',
}, },
value: '390.6 KiB', value: 400000,
}, },
{ {
storageType: { storageType: {
...@@ -57,7 +57,7 @@ export const projectData = { ...@@ -57,7 +57,7 @@ export const projectData = {
description: 'Audio samples, videos, datasets, and graphics.', description: 'Audio samples, videos, datasets, and graphics.',
helpPath: '/lsf-objects', helpPath: '/lsf-objects',
}, },
value: '4.6 MiB', value: 4800000,
}, },
{ {
storageType: { storageType: {
...@@ -66,7 +66,7 @@ export const projectData = { ...@@ -66,7 +66,7 @@ export const projectData = {
description: 'Code packages and container images.', description: 'Code packages and container images.',
helpPath: '/packages', helpPath: '/packages',
}, },
value: '3.6 MiB', value: 3800000,
}, },
{ {
storageType: { storageType: {
...@@ -75,7 +75,7 @@ export const projectData = { ...@@ -75,7 +75,7 @@ export const projectData = {
description: 'Git repository, managed by the Gitaly service.', description: 'Git repository, managed by the Gitaly service.',
helpPath: '/repository', helpPath: '/repository',
}, },
value: '3.7 MiB', value: 3900000,
}, },
{ {
storageType: { storageType: {
...@@ -84,7 +84,7 @@ export const projectData = { ...@@ -84,7 +84,7 @@ export const projectData = {
description: 'Shared bits of code and text.', description: 'Shared bits of code and text.',
helpPath: '/snippets', helpPath: '/snippets',
}, },
value: '1.1 MiB', value: 1200000,
}, },
{ {
storageType: { storageType: {
...@@ -93,7 +93,7 @@ export const projectData = { ...@@ -93,7 +93,7 @@ export const projectData = {
description: 'File attachments and smaller design graphics.', description: 'File attachments and smaller design graphics.',
helpPath: '/uploads', helpPath: '/uploads',
}, },
value: '878.9 KiB', value: 900000,
}, },
{ {
storageType: { storageType: {
...@@ -102,7 +102,7 @@ export const projectData = { ...@@ -102,7 +102,7 @@ export const projectData = {
description: 'Wiki content.', description: 'Wiki content.',
helpPath: '/wiki', helpPath: '/wiki',
}, },
value: '293.0 KiB', value: 300000,
}, },
], ],
}, },
......
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