From ccb6218e8067b7d97d6603ff84ed267562740f4c Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Mon, 2 Sep 2024 14:41:49 +0200 Subject: [PATCH] cleanup --- .../LimitRanges/LimitRangeDetails.tsx | 18 +++++++++--------- .../LimitRanges/LimitRangeSpecification.tsx | 14 ++------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/resources/LimitRanges/LimitRangeDetails.tsx b/src/resources/LimitRanges/LimitRangeDetails.tsx index 7976de8419..07c5f388fc 100644 --- a/src/resources/LimitRanges/LimitRangeDetails.tsx +++ b/src/resources/LimitRanges/LimitRangeDetails.tsx @@ -9,21 +9,21 @@ type LimitResources = { storage?: string; }; +export type LimitProps = { + type: string; + max?: LimitResources; + min?: LimitResources; + default?: LimitResources; + defaultRequest?: LimitResources; +}; + export type LimitRangeProps = { metadata: { name: string; namespace: string; }; spec: { - limits: [ - { - type: string; - max?: LimitResources; - min?: LimitResources; - default?: LimitResources; - defaultRequest?: LimitResources; - }, - ]; + limits: [LimitProps]; }; }; diff --git a/src/resources/LimitRanges/LimitRangeSpecification.tsx b/src/resources/LimitRanges/LimitRangeSpecification.tsx index 44feed240c..706e128c07 100644 --- a/src/resources/LimitRanges/LimitRangeSpecification.tsx +++ b/src/resources/LimitRanges/LimitRangeSpecification.tsx @@ -4,6 +4,7 @@ import { GenericList } from 'shared/components/GenericList/GenericList'; import { EMPTY_TEXT_PLACEHOLDER } from 'shared/constants'; import { UI5Panel } from 'shared/components/UI5Panel/UI5Panel'; import './LimitRangeSpecification.scss'; +import { LimitRangeProps } from './LimitRangeDetails'; type FlatLimitProps = { type?: string; @@ -15,17 +16,6 @@ type FlatLimitProps = { maxLimitRequestRatio: string; }; -const compactEmptyLimit = [ - { - type: EMPTY_TEXT_PLACEHOLDER, - resource: EMPTY_TEXT_PLACEHOLDER, - max: EMPTY_TEXT_PLACEHOLDER, - min: EMPTY_TEXT_PLACEHOLDER, - default: EMPTY_TEXT_PLACEHOLDER, - defaultRequest: EMPTY_TEXT_PLACEHOLDER, - }, -]; - const emptyLimit = [ { type: EMPTY_TEXT_PLACEHOLDER, @@ -45,7 +35,7 @@ export default function LimitRangeSpecification({ resource, isCompact = false, }: { - resource: any; + resource: LimitRangeProps; isCompact?: boolean; }) { const { t } = useTranslation();