diff --git a/web/src/ar/pages/version-details/DockerVersion/components/LayersTable/LayersTable.tsx b/web/src/ar/pages/version-details/DockerVersion/components/LayersTable/LayersTable.tsx index d7d079e76..608224cb1 100644 --- a/web/src/ar/pages/version-details/DockerVersion/components/LayersTable/LayersTable.tsx +++ b/web/src/ar/pages/version-details/DockerVersion/components/LayersTable/LayersTable.tsx @@ -16,10 +16,12 @@ import React, { useMemo } from 'react' import classNames from 'classnames' +import { defaultTo } from 'lodash-es' import type { Column } from 'react-table' import { TableV2 } from '@harnessio/uicore' import type { DockerLayerEntry } from '@harnessio/react-har-service-client' +import { DEFAULT_LAYER_SIZE } from '@ar/pages/version-details/utils' import { LayerActionCell, LayerCodeCell, LayerIndexCell, LayerSizeCell } from './LayersTableCells' import css from './LayersTable.module.scss' @@ -56,7 +58,7 @@ export default function LayersTable(props: LayersTableProps): JSX.Element { return data.map((each, index) => ({ id: index + 1, code: each.command, - size: '0 B' + size: defaultTo(each.size, DEFAULT_LAYER_SIZE) })) } return [] diff --git a/web/src/ar/pages/version-details/utils.ts b/web/src/ar/pages/version-details/utils.ts index 14aae32be..b657e8502 100644 --- a/web/src/ar/pages/version-details/utils.ts +++ b/web/src/ar/pages/version-details/utils.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +export const DEFAULT_LAYER_SIZE = '0 B' + export function prettifyManifestJSON(manifest: string): string { try { return JSON.stringify(JSON.parse(manifest), null, 2)