From 81c3873db1885c47536e3340a648ef66324d3a17 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 6 Nov 2025 14:48:28 +0530 Subject: [PATCH 1/5] feat: add cluster minimum route and API for fetching all cluster list --- src/Common/Constants.ts | 1 + src/Shared/Services/common.service.ts | 16 +++++++++++++++- src/Shared/Services/types.ts | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 9a7e21daa..174617070 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -178,6 +178,7 @@ export const ROUTES = { PATCH: 'patch', ENVIRONMENT_LIST_MIN: 'env/autocomplete', CLUSTER: 'cluster', + CLUSTER_MIN: 'cluster/min', API_RESOURCE: 'k8s/api-resources', GVK: 'gvk', NAMESPACE: 'env/namespace', diff --git a/src/Shared/Services/common.service.ts b/src/Shared/Services/common.service.ts index 4da269fb8..1626a120e 100644 --- a/src/Shared/Services/common.service.ts +++ b/src/Shared/Services/common.service.ts @@ -17,7 +17,13 @@ import { AppConfigProps, GetTemplateAPIRouteType } from '@Pages/index' import { get, getUrlWithSearchParams, post, ROUTES } from '../../Common' -import { ClusterMinDTO, ClusterType, getTemplateAPIRoute, stringComparatorBySortOrder } from '..' +import { + AllClusterListMinItemDTO, + ClusterMinDTO, + ClusterType, + getTemplateAPIRoute, + stringComparatorBySortOrder, +} from '..' import { EnvironmentDataValuesDTO, GetPolicyApiUrlProps, GetResourceApiUrlProps } from './types' export const getResourceApiUrl = ({ baseUrl, kind, version, suffix, queryParams }: GetResourceApiUrlProps) => @@ -57,3 +63,11 @@ export const getClusterOptions = async (): Promise => { })) .sort((a, b) => stringComparatorBySortOrder(a.name, b.name)) } + +export const getAllClusterListMin = async (signal: AbortSignal) => { + const response = await get(`${ROUTES.CLUSTER_MIN}`, { + signal, + }) + + return response +} diff --git a/src/Shared/Services/types.ts b/src/Shared/Services/types.ts index c979411e2..ae70fd6f1 100644 --- a/src/Shared/Services/types.ts +++ b/src/Shared/Services/types.ts @@ -16,7 +16,7 @@ import { MainContext } from '@Shared/Providers' -import { getUrlWithSearchParams } from '../../Common' +import { ClusterDetailDTO, getUrlWithSearchParams } from '../../Common' import { PolicyKindType, ResourceKindType, ResourceVersionType } from '../types' export interface BaseAppMetaData { @@ -69,3 +69,7 @@ export interface ClusterMinDTO { isVirtualCluster: boolean isProd: boolean } + +export type AllClusterListMinItemDTO = Pick & { + costModuleConfig: Pick +} From b2ab10999c26be464692dd9ba9430d19ee355ca3 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 6 Nov 2025 15:01:21 +0530 Subject: [PATCH 2/5] feat: include 'isProd' in AllClusterListMinItemDTO type definition --- src/Shared/Services/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/Services/types.ts b/src/Shared/Services/types.ts index ae70fd6f1..dd0ba0e8e 100644 --- a/src/Shared/Services/types.ts +++ b/src/Shared/Services/types.ts @@ -70,6 +70,6 @@ export interface ClusterMinDTO { isProd: boolean } -export type AllClusterListMinItemDTO = Pick & { +export type AllClusterListMinItemDTO = Pick & { costModuleConfig: Pick } From 051ff00e0fb10a85fe46bea653eda11fed0df2a6 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 6 Nov 2025 16:01:59 +0530 Subject: [PATCH 3/5] fix: bulk selection checkbox --- src/Common/Tooltip/Tooltip.tsx | 4 +++ .../BulkSelection/BulkSelection.tsx | 4 +-- src/Shared/Components/Charts/constants.ts | 26 +++++++++++++++++++ src/Shared/Components/Charts/types.ts | 1 + src/Shared/Helpers.tsx | 6 +++-- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Common/Tooltip/Tooltip.tsx b/src/Common/Tooltip/Tooltip.tsx index 59ad4f6c6..bc5ee228a 100644 --- a/src/Common/Tooltip/Tooltip.tsx +++ b/src/Common/Tooltip/Tooltip.tsx @@ -16,6 +16,8 @@ import { cloneElement } from 'react' import TippyJS from '@tippyjs/react' +// eslint-disable-next-line import/no-extraneous-dependencies +import { followCursor } from 'tippy.js' import { useIsTextTruncated } from '@Common/Hooks' @@ -31,6 +33,7 @@ const Tooltip = ({ showOnTruncate = alwaysShowTippyOnHover === undefined && shortcutKeyCombo === undefined, wordBreak = true, children: child, + plugins = [], ...rest }: TooltipProps) => { const { isTextTruncated, handleMouseEnterEvent } = useIsTextTruncated() @@ -48,6 +51,7 @@ const Tooltip = ({ {...rest} {...(shortcutKeyCombo ? { content: } : {})} className={`${shortcutKeyCombo ? 'shortcut-keys__tippy' : 'default-tt'} ${wordBreak ? 'dc__word-break' : ''} dc__mxw-200 ${rest.className ?? ''}`} + plugins={[...plugins, followCursor]} > {cloneElement(child, { ...child.props, onMouseEnter: handleMouseEnterEvent })} diff --git a/src/Shared/Components/BulkSelection/BulkSelection.tsx b/src/Shared/Components/BulkSelection/BulkSelection.tsx index 128ad5ece..94185a3c1 100644 --- a/src/Shared/Components/BulkSelection/BulkSelection.tsx +++ b/src/Shared/Components/BulkSelection/BulkSelection.tsx @@ -96,11 +96,11 @@ const BulkSelection = forwardRef( diff --git a/src/Shared/Components/Charts/constants.ts b/src/Shared/Components/Charts/constants.ts index 7f7f1a44f..f9ce5d15a 100644 --- a/src/Shared/Components/Charts/constants.ts +++ b/src/Shared/Components/Charts/constants.ts @@ -146,6 +146,19 @@ export const CHART_COLORS: Record> = Gray800: '#202124', Gray900: '#1a1a1a', Gray950: '#0d0d0d', + + // Sunset Orange + SunsetOrange50: '#FFF3ED', + SunsetOrange100: '#FFE7D4', + SunsetOrange200: '#FFCAA8', + SunsetOrange300: '#FFAE80', + SunsetOrange400: '#FF905A', + SunsetOrange500: '#FF7C43', + SunsetOrange600: '#F5572A', + SunsetOrange700: '#D22E10', + SunsetOrange800: '#A81F0D', + SunsetOrange900: '#7E1C10', + SunsetOrange950: '#411311', }, [AppThemeType.dark]: { // Sky Blue - Adjusted for dark theme @@ -290,6 +303,19 @@ export const CHART_COLORS: Record> = Gray800: '#f1f3f4', Gray900: '#f7f8f9', Gray950: '#f9fafb', + + // Sunset Orange - Adjusted for dark theme + SunsetOrange50: '#2F1D1E', + SunsetOrange100: '#53301F', + SunsetOrange200: '#794421', + SunsetOrange300: '#9C5623', + SunsetOrange400: '#C36A25', + SunsetOrange500: '#E87D27', + SunsetOrange600: '#EC9345', + SunsetOrange700: '#F1A862', + SunsetOrange800: '#F4BD7F', + SunsetOrange900: '#F8D29C', + SunsetOrange950: '#FDE9BC', }, } as const diff --git a/src/Shared/Components/Charts/types.ts b/src/Shared/Components/Charts/types.ts index 78fbd2b5a..2c98ebcdd 100644 --- a/src/Shared/Components/Charts/types.ts +++ b/src/Shared/Components/Charts/types.ts @@ -19,6 +19,7 @@ export type ColorTokensType = | 'GoldenYellow' | 'CharcoalGray' | 'Gray' + | 'SunsetOrange' export type VariantsType = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950 export type ChartColorKey = `${ColorTokensType}${VariantsType}` diff --git a/src/Shared/Helpers.tsx b/src/Shared/Helpers.tsx index 65d7bb8b0..2970db166 100644 --- a/src/Shared/Helpers.tsx +++ b/src/Shared/Helpers.tsx @@ -738,15 +738,17 @@ export const YAMLtoJSON = (yamlString: string) => { } } -export const formatNumberToCurrency = (value: number, currency: string): string => { +export const formatNumberToCurrency = (value: number, currency: string, minimumFractionDigits?: number): string => { + const precision = minimumFractionDigits ?? 2 try { const data = new Intl.NumberFormat('en-US', { style: 'currency', currency, + minimumFractionDigits: precision, }).format(value) return data } catch { - return value.toFixed(2) + return value.toFixed(precision) } } From 46e7dc225837b6cc8113d40e1ea06b0fbcf2ef9c Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 6 Nov 2025 16:43:47 +0530 Subject: [PATCH 4/5] chore: remove backticks --- src/Shared/Services/common.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/Services/common.service.ts b/src/Shared/Services/common.service.ts index 1626a120e..2a3b5983d 100644 --- a/src/Shared/Services/common.service.ts +++ b/src/Shared/Services/common.service.ts @@ -65,7 +65,7 @@ export const getClusterOptions = async (): Promise => { } export const getAllClusterListMin = async (signal: AbortSignal) => { - const response = await get(`${ROUTES.CLUSTER_MIN}`, { + const response = await get(ROUTES.CLUSTER_MIN, { signal, }) From e0f6a0981332c89ddb76683e37746807824676f5 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 6 Nov 2025 17:11:00 +0530 Subject: [PATCH 5/5] chore: version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fc372da5..d56b126ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-alpha-35", + "version": "1.20.6-pre-38", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-alpha-35", + "version": "1.20.6-pre-38", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 30de320fb..9fb2d111e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.6-alpha-35", + "version": "1.20.6-pre-38", "description": "Supporting common component library", "type": "module", "main": "dist/index.js",