@skyhook-io/k8s-ui 1.14.1 → 1.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/issues/IssuesView.tsx +1 -1
- package/src/components/issues/types.ts +2 -0
- package/src/components/resources/ResourcesView.tsx +261 -188
- package/src/components/resources/column-settings-merge.test.ts +104 -0
- package/src/components/resources/istio-gateway-filter.test.ts +5 -3
- package/src/components/resources/istio-policy-accessors.test.ts +193 -0
- package/src/components/resources/renderers/IstioAuthorizationPolicyRenderer.tsx +11 -24
- package/src/components/resources/renderers/capi-cells.tsx +3 -0
- package/src/components/resources/renderers/certmanager-cells.tsx +2 -2
- package/src/components/resources/renderers/eso-cells.tsx +0 -5
- package/src/components/resources/renderers/istio-cells.tsx +36 -26
- package/src/components/resources/renderers/knative-cells.tsx +13 -0
- package/src/components/resources/renderers/kueue-cells.tsx +0 -9
- package/src/components/resources/renderers/kyverno-cells.tsx +8 -1
- package/src/components/resources/renderers/kyverno-modern-cells.tsx +6 -0
- package/src/components/resources/renderers/prometheus-cells.tsx +3 -3
- package/src/components/resources/renderers/ray-cells.tsx +12 -4
- package/src/components/resources/renderers/trivy-cells.tsx +7 -0
- package/src/components/resources/renderers/velero-cells.tsx +3 -0
- package/src/components/resources/renderers/volcano-cells.tsx +0 -9
- package/src/components/resources/resource-utils-calico.test.ts +6 -0
- package/src/components/resources/resource-utils-calico.ts +6 -2
- package/src/components/resources/resource-utils-cnpg.ts +5 -0
- package/src/components/resources/resource-utils-eso.test.ts +56 -0
- package/src/components/resources/resource-utils-eso.ts +37 -5
- package/src/components/resources/resource-utils-istio.ts +152 -44
- package/src/components/resources/resource-utils-kyverno.ts +3 -6
- package/src/components/resources/resource-utils-prometheus.ts +51 -23
- package/src/components/resources/resource-utils-ray.test.ts +36 -0
- package/src/components/resources/resource-utils-ray.ts +6 -0
- package/src/components/resources/resource-utils-trivy.ts +3 -0
- package/src/components/resources/resource-utils.ts +183 -19
- package/src/components/resources/resources-column-filter.test.ts +20 -0
- package/src/components/resources/status-accessors.test.ts +363 -0
- package/src/components/resources/status-overclaim.test.ts +158 -0
- package/src/components/timeline/DiffViewer.test.tsx +26 -0
- package/src/components/timeline/DiffViewer.tsx +16 -12
- package/src/components/topology/TopologyGraph.tsx +7 -2
- package/src/components/ui/Collapse.tsx +9 -2
- package/src/components/ui/ConfirmDialog.test.tsx +37 -0
- package/src/components/ui/ConfirmDialog.tsx +3 -1
- package/src/components/ui/drawer-components.tsx +1 -1
- package/src/components/workload/WorkloadView.tsx +2 -1
|
@@ -37,7 +37,10 @@ export function Collapse({
|
|
|
37
37
|
const render = !mountLazily || hasOpened
|
|
38
38
|
return (
|
|
39
39
|
<div
|
|
40
|
-
className={clsx(
|
|
40
|
+
className={clsx(
|
|
41
|
+
'grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
41
44
|
style={{ gridTemplateRows: open ? '1fr' : '0fr' }}
|
|
42
45
|
>
|
|
43
46
|
{/* `relative` is load-bearing. Collapsed content is still laid out at full
|
|
@@ -61,7 +64,11 @@ export function CollapseChevron({ open, className }: { open: boolean; className?
|
|
|
61
64
|
return (
|
|
62
65
|
<ChevronRight
|
|
63
66
|
aria-hidden="true"
|
|
64
|
-
className={clsx(
|
|
67
|
+
className={clsx(
|
|
68
|
+
'shrink-0 text-theme-text-tertiary transition-transform duration-200 motion-reduce:transition-none',
|
|
69
|
+
open && 'rotate-90',
|
|
70
|
+
className,
|
|
71
|
+
)}
|
|
65
72
|
/>
|
|
66
73
|
)
|
|
67
74
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react'
|
|
2
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
4
|
+
import { ConfirmDialog } from './ConfirmDialog'
|
|
5
|
+
|
|
6
|
+
vi.mock('./DialogPortal', () => ({
|
|
7
|
+
DialogPortal: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
8
|
+
}))
|
|
9
|
+
|
|
10
|
+
const props = {
|
|
11
|
+
open: true,
|
|
12
|
+
onClose: () => {},
|
|
13
|
+
onConfirm: () => {},
|
|
14
|
+
title: 'Share this investigation?',
|
|
15
|
+
message: 'Organization members can read and continue this investigation.',
|
|
16
|
+
confirmLabel: 'Share with organization',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('ConfirmDialog warning disclosure', () => {
|
|
20
|
+
it('can omit redundant boilerplate without removing the actual disclosure or actions', () => {
|
|
21
|
+
const html = renderToStaticMarkup(<ConfirmDialog {...props} variant="warning" showWarning={false} />)
|
|
22
|
+
expect(html).toContain(props.message)
|
|
23
|
+
expect(html).toContain(props.confirmLabel)
|
|
24
|
+
expect(html).toContain('Cancel')
|
|
25
|
+
expect(html).not.toContain('Please confirm you want to proceed')
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('preserves warning boilerplate by default for existing callers', () => {
|
|
29
|
+
expect(renderToStaticMarkup(<ConfirmDialog {...props} variant="warning" />))
|
|
30
|
+
.toContain('Please confirm you want to proceed with this action.')
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('preserves the irreversible-action warning for destructive callers', () => {
|
|
34
|
+
expect(renderToStaticMarkup(<ConfirmDialog {...props} />))
|
|
35
|
+
.toContain('This action cannot be undone.')
|
|
36
|
+
})
|
|
37
|
+
})
|
|
@@ -18,6 +18,7 @@ interface ConfirmDialogProps {
|
|
|
18
18
|
isLoading?: boolean
|
|
19
19
|
isClosable?: boolean // Allow closing even when isLoading (e.g., for long-running ops the user can dismiss)
|
|
20
20
|
confirmDisabled?: boolean // Block the confirm action while custom content is invalid (e.g., bad YAML)
|
|
21
|
+
showWarning?: boolean
|
|
21
22
|
className?: string
|
|
22
23
|
children?: ReactNode // Optional custom content (e.g., checkboxes)
|
|
23
24
|
}
|
|
@@ -35,6 +36,7 @@ export function ConfirmDialog({
|
|
|
35
36
|
isLoading = false,
|
|
36
37
|
isClosable = false,
|
|
37
38
|
confirmDisabled = false,
|
|
39
|
+
showWarning = true,
|
|
38
40
|
className,
|
|
39
41
|
children,
|
|
40
42
|
}: ConfirmDialogProps) {
|
|
@@ -84,7 +86,7 @@ export function ConfirmDialog({
|
|
|
84
86
|
)}
|
|
85
87
|
|
|
86
88
|
{/* Warning message — hidden once the action is in progress */}
|
|
87
|
-
{!isLoading && !children && (
|
|
89
|
+
{showWarning && !isLoading && !children && (
|
|
88
90
|
<div className="p-4">
|
|
89
91
|
<div
|
|
90
92
|
className={clsx(
|
|
@@ -291,7 +291,7 @@ function isConditionHealthy(cond: { type?: string; status?: string }): boolean {
|
|
|
291
291
|
|
|
292
292
|
export type ConditionTone = 'ok' | 'warning' | 'fail' | 'unknown'
|
|
293
293
|
|
|
294
|
-
function defaultConditionTone(cond: { type?: string; status?: string }): ConditionTone {
|
|
294
|
+
export function defaultConditionTone(cond: { type?: string; status?: string }): ConditionTone {
|
|
295
295
|
if (cond.status !== 'True' && cond.status !== 'False') return 'unknown'
|
|
296
296
|
return isConditionHealthy(cond) ? 'ok' : 'fail'
|
|
297
297
|
}
|
|
@@ -728,10 +728,11 @@ export function WorkloadView({
|
|
|
728
728
|
// prominent "Diagnose" on a problem, a quiet icon when fine. Rendered via the host
|
|
729
729
|
// slot (DiagnoseCustomization); standalone Radar injects it, Hub overrides it.
|
|
730
730
|
const renderDiagnose = actionsBarProps?.renderDiagnose as
|
|
731
|
-
| ((ctx: { kind: string; namespace: string; name: string; health?: DiagnoseHealthHint }) => ReactNode)
|
|
731
|
+
| ((ctx: { kind: string; group?: string; namespace: string; name: string; health?: DiagnoseHealthHint }) => ReactNode)
|
|
732
732
|
| undefined
|
|
733
733
|
const diagnoseAction = renderDiagnose?.({
|
|
734
734
|
kind: apiKind,
|
|
735
|
+
group,
|
|
735
736
|
namespace,
|
|
736
737
|
name,
|
|
737
738
|
health: diagnoseHealthHint(apiKind, resource),
|