Skip to content

Commit b903857

Browse files
committed
fix undefined for resource and urlPath
1 parent b8969fc commit b903857

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/Extensibility/ExtensibilityList.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export const ExtensibilityListCore = ({
5252
});
5353

5454
const listProps = usePrepareListProps({
55-
resourceCustomType: getExtensibilityPath(resMetaData?.general),
55+
resourceCustomType: getExtensibilityPath(
56+
resMetaData?.general || { resource: { kind: '' } },
57+
),
5658
resourceI18Key: 'name',
5759
apiGroup: resource?.group,
5860
apiVersion: resource?.version,
@@ -187,7 +189,9 @@ const ExtensibilityList = ({ overrideResMetadata, ...props }) => {
187189
return (
188190
<TranslationBundleContext.Provider
189191
value={{
190-
translationBundle: getExtensibilityPath(resMetaData?.general),
192+
translationBundle: getExtensibilityPath(
193+
resMetaData?.general?.kind || { resource: { kind: '' } },
194+
),
191195
defaultResourcePlaceholder: defaultPlaceholder,
192196
}}
193197
>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import pluralize from 'pluralize';
22

33
export const getExtensibilityPath = ({
4-
urlPath,
54
resource: { kind },
65
}: {
7-
urlPath?: string;
86
resource: { kind: string };
9-
}) => urlPath ?? pluralize((kind ?? '').toLowerCase());
7+
}) => pluralize((kind ?? '').toLowerCase());

0 commit comments

Comments
 (0)