Skip to content

Commit 5fa99b7

Browse files
PR corrections
1 parent d81a605 commit 5fa99b7

File tree

6 files changed

+25
-30
lines changed

6 files changed

+25
-30
lines changed

src/components/Extensibility/components-form/SimpleList.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export function SimpleList({
7777
return (
7878
<ResourceForm.CollapsibleSection
7979
defaultOpen={defaultOpen}
80-
/*@ts-expect-error Some type mismatch or probably no longer used*/
81-
container
8280
title={tFromStoreKeys(storeKeys, schema)}
8381
required={required}
8482
nestingLevel={nestingLevel}

src/components/Extensibility/contexts/Trigger.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { StoreKeys } from '@ui-schema/ui-schema';
22
import { fromJS } from 'immutable';
3-
import { createContext, useState, useRef } from 'react';
3+
import { createContext, useState, useRef, ReactNode } from 'react';
44

55
export function scopePaths(storeKeys: StoreKeys) {
66
const indexes = fromJS(storeKeys)
@@ -50,11 +50,7 @@ export const TriggerContext = createContext({
5050
subs: [] as any,
5151
});
5252

53-
export function TriggerContextProvider({
54-
children,
55-
}: {
56-
children: React.ReactNode;
57-
}) {
53+
export function TriggerContextProvider({ children }: { children: ReactNode }) {
5854
const subs = useRef<Record<string, any>[]>([]);
5955
const [enabled, setEnabled] = useState(true);
6056

src/components/Extensibility/contexts/VarStore.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createContext, SetStateAction, useState } from 'react';
1+
import { createContext, ReactNode, SetStateAction, useState } from 'react';
22
import jp from 'jsonpath';
33

44
export const VarStoreContext = createContext({
@@ -7,11 +7,7 @@ export const VarStoreContext = createContext({
77
setVars: (() => {}) as (value: SetStateAction<Record<string, any>>) => void,
88
});
99

10-
export function VarStoreContextProvider({
11-
children,
12-
}: {
13-
children: React.ReactNode;
14-
}) {
10+
export function VarStoreContextProvider({ children }: { children: ReactNode }) {
1511
const [vars, setVars] = useState({});
1612

1713
const setVar = (path: string, value: any) => {

src/shared/components/ResourceDetails/ResourceActions.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { lazy, Suspense } from 'react';
1+
import { lazy, ReactNode, Suspense } from 'react';
22
import { Spinner } from '../Spinner/Spinner';
33
import { ToolbarButton } from '@ui5/webcomponents-react';
44
import { createPortal } from 'react-dom';
@@ -13,10 +13,10 @@ const Injections = lazy(
1313
);
1414

1515
type ResourceActionsProps = {
16-
headerActions?: React.ReactNode;
16+
headerActions?: ReactNode;
1717
readOnly?: boolean;
1818
resource: K8sResource & Resource;
19-
resourceHeaderActions: Array<(resource: any) => React.ReactNode>;
19+
resourceHeaderActions: Array<(resource: any) => ReactNode>;
2020
resourceType: string;
2121
resourceUrl?: string;
2222
disableDelete?: boolean;
@@ -33,7 +33,7 @@ type ResourceActionsProps = {
3333
showDeleteDialog: boolean;
3434
performDelete: (
3535
resource: any,
36-
resourceUrl: any,
36+
resourceUrl: string,
3737
deleteFn: any,
3838
) => Promise<void>;
3939
performCancel: (cancelFn: any) => void;

src/shared/components/ResourceDetails/ResourceComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { Resource } from 'components/Extensibility/contexts/DataSources';
2525
import { ResourceActions } from './ResourceActions';
2626
import { ResourceDetailsCardContent } from './ResourceDetailsCardContent';
2727
import { ResourceStatusCardContent } from './ResourceStatusCardContent';
28+
import './ResourceDetailsCard.scss';
2829

2930
// This component is loaded after the page mounts.
3031
// Don't try to load it on scroll. It was tested.

src/shared/components/ResourceDetails/ResourceDetails.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { createContext, useEffect, useState } from 'react';
1+
import {
2+
ComponentType,
3+
createContext,
4+
ReactNode,
5+
useEffect,
6+
useState,
7+
} from 'react';
28
import { ResourceNotFound } from 'shared/components/ResourceNotFound/ResourceNotFound';
39
import { useGet } from 'shared/hooks/BackendAPI/useGet';
410
import { getErrorMessage, prettifyNameSingular } from 'shared/utils/helpers';
@@ -14,18 +20,16 @@ export const ResourceDetailContext = createContext(false);
1420

1521
export type ResourceDetailsProps = {
1622
customColumns?: CustomColumnsType;
17-
children?: React.ReactNode;
18-
customComponents?: Array<
19-
(resource: any, resourceUrl: string) => React.ReactNode
20-
>;
23+
children?: ReactNode;
24+
customComponents?: Array<(resource: any, resourceUrl: string) => ReactNode>;
2125
description?: string;
2226
resourceUrl?: string;
2327
resourceType: string;
2428
resourceName?: string;
2529
resourceTitle?: string;
2630
namespace?: string;
27-
headerActions?: React.ReactNode;
28-
resourceHeaderActions?: Array<(resource: any) => React.ReactNode>;
31+
headerActions?: ReactNode;
32+
resourceHeaderActions?: Array<(resource: any) => ReactNode>;
2933
readOnly?: boolean;
3034
editActionLabel?: string;
3135
windowTitle?: string;
@@ -36,7 +40,7 @@ export type ResourceDetailsProps = {
3640
showYamlTab?: boolean;
3741
layoutCloseCreateUrl?: string;
3842
layoutNumber?: string;
39-
customHealthCards?: Array<(resource: any, index: number) => React.ReactNode>;
43+
customHealthCards?: Array<(resource: any, index: number) => ReactNode>;
4044
showHealthCardsTitle?: boolean;
4145
isModule?: boolean;
4246
isEntireListProtected?: boolean;
@@ -45,7 +49,7 @@ export type ResourceDetailsProps = {
4549
hideLabels?: boolean;
4650
hideAnnotations?: boolean;
4751
hideLastUpdate?: boolean;
48-
createResourceForm: React.ComponentType<{
52+
createResourceForm: ComponentType<{
4953
resource: any;
5054
resourceType: string;
5155
resourceUrl: string;
@@ -57,16 +61,16 @@ export type ResourceDetailsProps = {
5761
}>;
5862
customConditionsComponents?: CustomColumnsType;
5963
title?: string;
60-
statusBadge?: (resource: any) => React.ReactNode;
64+
statusBadge?: (resource: any) => ReactNode;
6165
customStatusColumns?: CustomColumnsType;
62-
customStatus?: React.ReactNode;
66+
customStatus?: ReactNode;
6367
statusConditions?: (resource: any) => Array<{
6468
type: string;
6569
status: string;
6670
reason?: string;
6771
message?: string;
6872
}>;
69-
headerContent?: React.ReactNode;
73+
headerContent?: ReactNode;
7074
className?: string;
7175
headerDescription?: string;
7276
};

0 commit comments

Comments
 (0)