Skip to content

Commit d4ce250

Browse files
committed
Update ManagedResources.tsx
1 parent c0d35f1 commit d4ce250

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/components/ControlPlane/ManagedResources.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import '@ui5/webcomponents-icons/dist/sys-enter-2';
1313
import '@ui5/webcomponents-icons/dist/sys-cancel-2';
1414
import { resourcesInterval } from '../../lib/shared/constants';
1515
import { ResourceStatusCell } from '../Shared/ResourceStatusCell';
16+
import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
1617

1718
interface CellData<T> {
1819
cell: {
@@ -31,6 +32,7 @@ type ResourceRow = {
3132
syncedTransitionTime: string;
3233
ready: boolean;
3334
readyTransitionTime: string;
35+
item: unknown;
3436
};
3537

3638
export function ManagedResources() {
@@ -60,6 +62,8 @@ export function ManagedResources() {
6062
{
6163
Header: t('ManagedResources.tableHeaderSynced'),
6264
accessor: 'synced',
65+
hAlign: 'Center',
66+
width: 85,
6367
Cell: (cellData: CellData<ResourceRow['synced']>) =>
6468
cellData.cell.row.original?.synced != null ? (
6569
<ResourceStatusCell
@@ -71,6 +75,8 @@ export function ManagedResources() {
7175
{
7276
Header: t('ManagedResources.tableHeaderReady'),
7377
accessor: 'ready',
78+
hAlign: 'Center',
79+
width: 85,
7480
Cell: (cellData: CellData<ResourceRow['ready']>) =>
7581
cellData.cell.row.original?.ready != null ? (
7682
<ResourceStatusCell
@@ -79,6 +85,16 @@ export function ManagedResources() {
7985
/>
8086
) : null,
8187
},
88+
{
89+
Header: t('yaml.YAML'),
90+
hAlign: 'Center',
91+
width: 85,
92+
accessor: 'yaml',
93+
Cell: (cellData: CellData<ResourceRow>) =>
94+
!!cellData.cell.row.original?.item ? (
95+
<YamlViewButton resourceObject={cellData.cell.row.original?.item} />
96+
) : undefined,
97+
},
8298
];
8399

84100
const rows: ResourceRow[] =
@@ -101,6 +117,7 @@ export function ManagedResources() {
101117
syncedTransitionTime: conditionSynced?.lastTransitionTime ?? '',
102118
ready: conditionReady?.status === 'True',
103119
readyTransitionTime: conditionReady?.lastTransitionTime ?? '',
120+
item: item,
104121
};
105122
}),
106123
) ?? [];

0 commit comments

Comments
 (0)