fix: [AH-492]: show size coming from BE in layers table (#2893)

* fix: [AH-492]: show size coming from BE in layers table
This commit is contained in:
Shivanand Sonnad 2024-10-29 16:53:43 +00:00 committed by Harness
parent 9227b297bb
commit 34bee25c56
2 changed files with 5 additions and 1 deletions

View File

@ -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 []

View File

@ -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)