Skip to content

Commit 8d4e301

Browse files
committed
fixes
1 parent a8fe13c commit 8d4e301

File tree

7 files changed

+54
-28
lines changed

7 files changed

+54
-28
lines changed

src/components/ControlPlane/FluxList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function FluxList() {
5959
{
6060
Header: t('FluxList.tableStatusHeader'),
6161
accessor: 'status',
62-
width: 85,
62+
width: 125,
6363
hAlign: 'Center',
6464
Filter: ({ column }) => <StatusFilter column={column} />,
6565
Cell: (cellData: CellData<FluxRow>) =>
@@ -78,7 +78,7 @@ export default function FluxList() {
7878
{
7979
Header: t('yaml.YAML'),
8080
hAlign: 'Center',
81-
width: 85,
81+
width: 75,
8282
accessor: 'yaml',
8383
disableFilters: true,
8484
Cell: (cellData: CellData<KustomizationsResponse['items']>) => (
@@ -103,7 +103,7 @@ export default function FluxList() {
103103
{
104104
Header: t('FluxList.tableStatusHeader'),
105105
accessor: 'status',
106-
width: 85,
106+
width: 125,
107107
hAlign: 'Center',
108108
Filter: ({ column }) => <StatusFilter column={column} />,
109109
Cell: (cellData: CellData<FluxRow['isReady']>) =>
@@ -125,7 +125,7 @@ export default function FluxList() {
125125
{
126126
Header: t('yaml.YAML'),
127127
hAlign: 'Center',
128-
width: 85,
128+
width: 75,
129129
accessor: 'yaml',
130130
disableFilters: true,
131131
Cell: (cellData: CellData<FluxRow>) => <YamlViewButton resourceObject={cellData.cell.row.original?.item} />,

src/components/ControlPlane/MCPHealthPopoverButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const MCPHealthPopoverButton = ({ mcpStatus, projectName, workspaceName, mcpName
133133
{
134134
Header: t('MCPHealthPopoverButton.transitionHeader'),
135135
accessor: 'lastTransitionTime',
136-
width: 110,
136+
width: 125,
137137
Cell: (instance: CellData<ControlPlaneStatusCondition>) => {
138138
const rawDate = instance.cell.value;
139139
const date = new Date(rawDate as string);

src/components/ControlPlane/ManagedResources.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import IllustratedError from '../Shared/IllustratedError';
1212
import '@ui5/webcomponents-icons/dist/sys-enter-2';
1313
import '@ui5/webcomponents-icons/dist/sys-cancel-2';
1414
import { resourcesInterval } from '../../lib/shared/constants';
15-
import { ResourceStatusCell } from '../Shared/ResourceStatusCell';
15+
1616
import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
1717
import { useMemo } from 'react';
1818
import StatusFilter from '../Shared/StatusFilter/StatusFilter.tsx';
@@ -69,7 +69,7 @@ export function ManagedResources() {
6969
Header: t('ManagedResources.tableHeaderSynced'),
7070
accessor: 'synced',
7171
hAlign: 'Center',
72-
width: 85,
72+
width: 125,
7373
Filter: ({ column }) => <StatusFilter column={column} />,
7474
Cell: (cellData: CellData<ResourceRow['synced']>) =>
7575
cellData.cell.row.original?.synced != null ? (
@@ -86,7 +86,7 @@ export function ManagedResources() {
8686
Header: t('ManagedResources.tableHeaderReady'),
8787
accessor: 'ready',
8888
hAlign: 'Center',
89-
width: 85,
89+
width: 125,
9090
Filter: ({ column }) => <StatusFilter column={column} />,
9191
Cell: (cellData: CellData<ResourceRow['ready']>) =>
9292
cellData.cell.row.original?.ready != null ? (
@@ -102,7 +102,7 @@ export function ManagedResources() {
102102
{
103103
Header: t('yaml.YAML'),
104104
hAlign: 'Center',
105-
width: 85,
105+
width: 75,
106106
accessor: 'yaml',
107107
disableFilters: true,
108108
Cell: (cellData: CellData<ResourceRow>) =>

src/components/ControlPlane/Providers.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
1818
import '@ui5/webcomponents-icons/dist/sys-enter-2';
1919
import '@ui5/webcomponents-icons/dist/sys-cancel-2';
2020
import StatusFilter from '../Shared/StatusFilter/StatusFilter.tsx';
21+
import { ResourceStatusCellWithButton } from '../Shared/ResourceStatusCellWithButton.tsx';
2122

2223
interface CellData<T> {
2324
cell: {
@@ -33,8 +34,10 @@ type ProvidersRow = {
3334
version: string;
3435
healthy: string;
3536
healthyTransitionTime: string;
37+
healthyMessage: string;
3638
installed: string;
3739
installedTransitionTime: string;
40+
installedMessage: string;
3841
created: string;
3942
item: unknown;
4043
};
@@ -68,39 +71,44 @@ export function Providers() {
6871
Header: t('Providers.tableHeaderInstalled'),
6972
accessor: 'installed',
7073
hAlign: 'Center',
71-
width: 85,
74+
width: 125,
7275
Filter: ({ column }) => <StatusFilter column={column} />,
7376
filter: 'equals',
7477
Cell: (cellData: CellData<ProvidersRow['installed']>) =>
7578
cellData.cell.row.original?.installed != null ? (
76-
<ResourceStatusCell
79+
<ResourceStatusCellWithButton
7780
value={cellData.cell.row.original?.installed === 'true'}
7881
transitionTime={cellData.cell.row.original?.installedTransitionTime}
82+
positiveText={'Installed'}
83+
negativeText={'Install error'}
84+
message={cellData.cell.row.original?.installedMessage}
7985
/>
8086
) : null,
8187
},
8288
{
8389
Header: t('Providers.tableHeaderHealthy'),
8490
accessor: 'healthy',
8591
hAlign: 'Center',
86-
width: 85,
92+
width: 125,
8793
Filter: ({ column }) => <StatusFilter column={column} />,
8894
filter: 'equals',
8995
Cell: (cellData: CellData<ProvidersRow['healthy']>) =>
9096
cellData.cell.row.original?.installed != null ? (
9197
<div>
92-
<ResourceStatusCell
98+
<ResourceStatusCellWithButton
9399
value={cellData.cell.row.original?.healthy === 'true'}
94100
transitionTime={cellData.cell.row.original?.healthyTransitionTime}
101+
positiveText={'Healthy'}
102+
negativeText={'Not healthy'}
103+
message={cellData.cell.row.original?.healthyMessage}
95104
/>
96-
here2
97105
</div>
98106
) : null,
99107
},
100108
{
101109
Header: t('yaml.YAML'),
102110
hAlign: 'Center',
103-
width: 85,
111+
width: 75,
104112
accessor: 'yaml',
105113
disableFilters: true,
106114
Cell: (cellData: CellData<ProvidersRow>) => (
@@ -124,6 +132,8 @@ export function Providers() {
124132
healthyTransitionTime: healthy?.lastTransitionTime ?? '',
125133
version: item.spec.package.match(/\d+(\.\d+)+/g)?.toString() ?? '',
126134
item: item,
135+
healthyMessage: healthy?.message ?? healthy?.reason ?? '',
136+
installedMessage: installed?.message ?? installed?.reason ?? '',
127137
};
128138
}) ?? [];
129139

src/components/ControlPlane/ProvidersConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function ProvidersConfig() {
7474
{
7575
Header: t('yaml.YAML'),
7676
hAlign: 'Center',
77-
width: 85,
77+
width: 75,
7878
accessor: 'yaml',
7979
disableFilters: true,
8080
Cell: (cellData: CellData<Rows>) =>

src/components/Projects/ProjectsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function ProjectsList() {
7575
{
7676
Header: t('yaml.YAML'),
7777
accessor: 'yaml',
78-
width: 85,
78+
width: 75,
7979
disableFilters: true,
8080
hAlign: 'Center',
8181
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -84,7 +84,7 @@ export default function ProjectsList() {
8484
style={{
8585
width: '100%',
8686
display: 'flex',
87-
justifyContent: 'end',
87+
justifyContent: 'center',
8888
alignItems: 'center',
8989
}}
9090
>

src/components/Shared/ResourceStatusCellWithButton.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Icon, Popover, PopoverDomRef, Text } from '@ui5/webcomponents-react';
1+
import { FlexBox, Icon, PopoverDomRef, ResponsivePopover, Text } from '@ui5/webcomponents-react';
22
import { timeAgo } from '../../utils/i18n/timeAgo';
33
import { MouseEvent, useRef, useState } from 'react';
44
import { AnimatedHoverTextButton } from '../Helper/AnimatedHoverTextButton.tsx';
55
import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js';
6+
67
export interface StatusCellProps {
78
value: boolean;
89
transitionTime: string;
@@ -26,10 +27,7 @@ export const ResourceStatusCellWithButton = ({
2627
setOpen((prev) => !prev);
2728
}
2829
};
29-
// if (!value) {
30-
// console.log(errorMessage);
31-
// }
32-
// alert(errorMessage);
30+
3331
return (
3432
<span>
3533
<AnimatedHoverTextButton
@@ -44,12 +42,30 @@ export const ResourceStatusCellWithButton = ({
4442
text={value ? positiveText : negativeText}
4543
onClick={handleOpenerClick}
4644
/>
47-
<Popover ref={popoverRef} open={open} placement={PopoverPlacement.Bottom}>
48-
<Text style={{ maxWidth: '60ch', textAlign: 'left', lineHeight: '1.5em' }}>{message}</Text>
49-
<Text style={{ maxWidth: '60ch', textAlign: 'left', lineHeight: '1.5em', fontWeight: 'bold' }}>
50-
{timeAgo.format(new Date(transitionTime))}
45+
<ResponsivePopover ref={popoverRef} open={open} placement={PopoverPlacement.Bottom}>
46+
<Text
47+
style={{
48+
maxWidth: '60ch',
49+
textAlign: 'left',
50+
lineHeight: '1.5em',
51+
color: value ? 'var(--sapPositiveTextColor)' : 'var(--sapNegativeTextColor)',
52+
}}
53+
>
54+
{message}
5155
</Text>
52-
</Popover>
56+
57+
<FlexBox
58+
style={{ borderTop: '1px solid gray', paddingTop: '1rem', marginTop: '1rem' }}
59+
justifyContent={'Start'}
60+
alignItems={'Center'}
61+
gap={16}
62+
>
63+
<Icon name={'date-time'} />
64+
<Text style={{ maxWidth: '60ch', textAlign: 'left', lineHeight: '1.5em', fontWeight: 'bold' }}>
65+
{timeAgo.format(new Date(transitionTime))}
66+
</Text>
67+
</FlexBox>
68+
</ResponsivePopover>
5369
</span>
5470
);
5571
};

0 commit comments

Comments
 (0)