diff options
Diffstat (limited to 'app/assets/javascripts/projects/storage_counter/utils.js')
-rw-r--r-- | app/assets/javascripts/projects/storage_counter/utils.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/app/assets/javascripts/projects/storage_counter/utils.js b/app/assets/javascripts/projects/storage_counter/utils.js deleted file mode 100644 index 9fca9d88f46..00000000000 --- a/app/assets/javascripts/projects/storage_counter/utils.js +++ /dev/null @@ -1,36 +0,0 @@ -import { numberToHumanSize } from '~/lib/utils/number_utils'; -import { PROJECT_STORAGE_TYPES } from './constants'; - -/** - * This method parses the results from `getProjectStorageCount` call. - * - * @param {Object} data graphql result - * @returns {Object} - */ -export const parseGetProjectStorageResults = (data, helpLinks) => { - const projectStatistics = data?.project?.statistics; - if (!projectStatistics) { - return {}; - } - const { storageSize, ...storageStatistics } = projectStatistics; - const storageTypes = PROJECT_STORAGE_TYPES.reduce((types, currentType) => { - const helpPathKey = currentType.id.replace(`Size`, `HelpPagePath`); - const helpPath = helpLinks[helpPathKey]; - - return types.concat({ - storageType: { - ...currentType, - helpPath, - }, - value: storageStatistics[currentType.id], - }); - }, []); - - return { - storage: { - totalUsage: numberToHumanSize(storageSize, 1), - storageTypes, - }, - statistics: projectStatistics, - }; -}; |