From e34eaf548fd48a40d35afb9a5005d257fbc568bc Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 21 May 2025 15:07:43 +0530 Subject: [PATCH 01/77] chore: Added icon for the clusters --- src/Assets/IconV2/ic-environment-isolated.svg | 4 ++++ src/Assets/IconV2/ic-environment.svg | 4 ++++ src/Assets/IconV2/ic-shapes.svg | 3 +++ src/Assets/IconV2/ic-virtual-cluster.svg | 3 +++ src/Shared/Components/Icon/Icon.tsx | 8 ++++++++ 5 files changed, 22 insertions(+) create mode 100644 src/Assets/IconV2/ic-environment-isolated.svg create mode 100644 src/Assets/IconV2/ic-environment.svg create mode 100644 src/Assets/IconV2/ic-shapes.svg create mode 100644 src/Assets/IconV2/ic-virtual-cluster.svg diff --git a/src/Assets/IconV2/ic-environment-isolated.svg b/src/Assets/IconV2/ic-environment-isolated.svg new file mode 100644 index 000000000..3a34316c3 --- /dev/null +++ b/src/Assets/IconV2/ic-environment-isolated.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/Assets/IconV2/ic-environment.svg b/src/Assets/IconV2/ic-environment.svg new file mode 100644 index 000000000..3a34316c3 --- /dev/null +++ b/src/Assets/IconV2/ic-environment.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/Assets/IconV2/ic-shapes.svg b/src/Assets/IconV2/ic-shapes.svg new file mode 100644 index 000000000..520e2c4e3 --- /dev/null +++ b/src/Assets/IconV2/ic-shapes.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-virtual-cluster.svg b/src/Assets/IconV2/ic-virtual-cluster.svg new file mode 100644 index 000000000..14188fbf3 --- /dev/null +++ b/src/Assets/IconV2/ic-virtual-cluster.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index c3953b9fa..749967414 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -59,6 +59,8 @@ import { ReactComponent as ICEdit } from '@IconsV2/ic-edit.svg' import { ReactComponent as ICEnterpriseFeat } from '@IconsV2/ic-enterprise-feat.svg' import { ReactComponent as ICEnterpriseTag } from '@IconsV2/ic-enterprise-tag.svg' import { ReactComponent as ICEnv } from '@IconsV2/ic-env.svg' +import { ReactComponent as ICEnvironment } from '@IconsV2/ic-environment.svg' +import { ReactComponent as ICEnvironmentIsolated } from '@IconsV2/ic-environment-isolated.svg' import { ReactComponent as ICError } from '@IconsV2/ic-error.svg' import { ReactComponent as ICExpandRightSm } from '@IconsV2/ic-expand-right-sm.svg' import { ReactComponent as ICExpandSm } from '@IconsV2/ic-expand-sm.svg' @@ -126,6 +128,7 @@ import { ReactComponent as ICQuay } from '@IconsV2/ic-quay.svg' import { ReactComponent as ICQuote } from '@IconsV2/ic-quote.svg' import { ReactComponent as ICRocketLaunch } from '@IconsV2/ic-rocket-launch.svg' import { ReactComponent as ICSelected } from '@IconsV2/ic-selected.svg' +import { ReactComponent as ICShapes } from '@IconsV2/ic-shapes.svg' import { ReactComponent as ICShieldCheck } from '@IconsV2/ic-shield-check.svg' import { ReactComponent as ICSlidersVertical } from '@IconsV2/ic-sliders-vertical.svg' import { ReactComponent as ICSortAscending } from '@IconsV2/ic-sort-ascending.svg' @@ -149,6 +152,7 @@ import { ReactComponent as ICUnknown } from '@IconsV2/ic-unknown.svg' import { ReactComponent as ICUserCircle } from '@IconsV2/ic-user-circle.svg' import { ReactComponent as ICUserKey } from '@IconsV2/ic-user-key.svg' import { ReactComponent as ICUsers } from '@IconsV2/ic-users.svg' +import { ReactComponent as ICVirtualCluster } from '@IconsV2/ic-virtual-cluster.svg' import { ReactComponent as ICWarning } from '@IconsV2/ic-warning.svg' import { ReactComponent as ICWifiSlash } from '@IconsV2/ic-wifi-slash.svg' @@ -216,6 +220,8 @@ export const iconMap = { 'ic-enterprise-feat': ICEnterpriseFeat, 'ic-enterprise-tag': ICEnterpriseTag, 'ic-env': ICEnv, + 'ic-environment-isolated': ICEnvironmentIsolated, + 'ic-environment': ICEnvironment, 'ic-error': ICError, 'ic-expand-right-sm': ICExpandRightSm, 'ic-expand-sm': ICExpandSm, @@ -283,6 +289,7 @@ export const iconMap = { 'ic-quote': ICQuote, 'ic-rocket-launch': ICRocketLaunch, 'ic-selected': ICSelected, + 'ic-shapes': ICShapes, 'ic-shield-check': ICShieldCheck, 'ic-sliders-vertical': ICSlidersVertical, 'ic-sort-ascending': ICSortAscending, @@ -306,6 +313,7 @@ export const iconMap = { 'ic-user-circle': ICUserCircle, 'ic-user-key': ICUserKey, 'ic-users': ICUsers, + 'ic-virtual-cluster': ICVirtualCluster, 'ic-warning': ICWarning, 'ic-wifi-slash': ICWifiSlash, } From 61bc33cf0249cc8321c28b83b06f12f1258e6e26 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Thu, 22 May 2025 15:27:39 +0530 Subject: [PATCH 02/77] chore: virtual environment added --- src/Assets/IconV2/ic-environment-isolated.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Assets/IconV2/ic-environment-isolated.svg b/src/Assets/IconV2/ic-environment-isolated.svg index 3a34316c3..1c5c59dcb 100644 --- a/src/Assets/IconV2/ic-environment-isolated.svg +++ b/src/Assets/IconV2/ic-environment-isolated.svg @@ -1,4 +1,4 @@ - - + + From 8db2eb76282a3de4363da1df603d90c185612ab3 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 23 May 2025 12:33:31 +0530 Subject: [PATCH 03/77] chore: Added ENVIRONMENT_CATEGORIES constant route --- src/Common/Constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 3243f76c2..7270fac03 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -87,6 +87,8 @@ export const ROUTES = { APP: 'app', APP_ARTIFACT_PROMOTE_MATERIAL: 'app/artifact/promotion-request/material', APP_TEMPLATE_DATA: 'app/template/data', + CLUSTER_CATEGORIES: 'cluster/categories', + ENVIRONMENT_CATEGORIES: 'env/categories', PROJECT_LIST_MIN: 'team/autocomplete', USER_CHECK_ROLE: 'user/check/roles', IMAGE_TAGGING: 'app/image-tagging', From bcd1a3d2c0db6a5990555737c2bc7d00baf826f5 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 23 May 2025 12:53:54 +0530 Subject: [PATCH 04/77] feat: add icon & support for svg className in draggable button --- src/Assets/IconV2/ic-paper-plane.svg | 3 +++ src/Assets/IconV2/ic-sparkle-color.svg | 19 ++++++++++++++++++- .../DraggableWrapper/DraggableButton.tsx | 4 ++-- src/Common/DraggableWrapper/types.ts | 1 + src/Shared/Components/Icon/Icon.tsx | 2 ++ src/index.ts | 1 + 6 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 src/Assets/IconV2/ic-paper-plane.svg diff --git a/src/Assets/IconV2/ic-paper-plane.svg b/src/Assets/IconV2/ic-paper-plane.svg new file mode 100644 index 000000000..f0015526d --- /dev/null +++ b/src/Assets/IconV2/ic-paper-plane.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-sparkle-color.svg b/src/Assets/IconV2/ic-sparkle-color.svg index a2aa5c5d3..5629a5d5a 100644 --- a/src/Assets/IconV2/ic-sparkle-color.svg +++ b/src/Assets/IconV2/ic-sparkle-color.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + diff --git a/src/Common/DraggableWrapper/DraggableButton.tsx b/src/Common/DraggableWrapper/DraggableButton.tsx index 48349887e..cb949d618 100644 --- a/src/Common/DraggableWrapper/DraggableButton.tsx +++ b/src/Common/DraggableWrapper/DraggableButton.tsx @@ -18,13 +18,13 @@ import React from 'react' import { ReactComponent as ICDrag } from '../../Assets/Icon/ic-drag.svg' import { DraggableButtonProps } from './types' -export default function DraggableButton({ dragClassName }: DraggableButtonProps) { +export default function DraggableButton({ dragClassName, svgClassName = 'fcn-6' }: DraggableButtonProps) { return ( ) } diff --git a/src/Common/DraggableWrapper/types.ts b/src/Common/DraggableWrapper/types.ts index 91b9f5f82..ccbf3b320 100644 --- a/src/Common/DraggableWrapper/types.ts +++ b/src/Common/DraggableWrapper/types.ts @@ -49,4 +49,5 @@ export interface DraggableWrapperProps { */ export interface DraggableButtonProps { dragClassName: string + svgClassName?: string } diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index c3953b9fa..f7c49dc55 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -119,6 +119,7 @@ import { ReactComponent as ICOpenBox } from '@IconsV2/ic-open-box.svg' import { ReactComponent as ICOpenInNew } from '@IconsV2/ic-open-in-new.svg' import { ReactComponent as ICOpenshift } from '@IconsV2/ic-openshift.svg' import { ReactComponent as ICOutOfSync } from '@IconsV2/ic-out-of-sync.svg' +import { ReactComponent as ICPaperPlane } from '@IconsV2/ic-paper-plane.svg' import { ReactComponent as ICPaperPlaneColor } from '@IconsV2/ic-paper-plane-color.svg' import { ReactComponent as ICPath } from '@IconsV2/ic-path.svg' import { ReactComponent as ICPencil } from '@IconsV2/ic-pencil.svg' @@ -277,6 +278,7 @@ export const iconMap = { 'ic-openshift': ICOpenshift, 'ic-out-of-sync': ICOutOfSync, 'ic-paper-plane-color': ICPaperPlaneColor, + 'ic-paper-plane': ICPaperPlane, 'ic-path': ICPath, 'ic-pencil': ICPencil, 'ic-quay': ICQuay, diff --git a/src/index.ts b/src/index.ts index 2a0afb927..80769b942 100644 --- a/src/index.ts +++ b/src/index.ts @@ -155,6 +155,7 @@ export interface customEnv { GATEKEEPER_URL?: string FEATURE_AI_INTEGRATION_ENABLE?: boolean LOGIN_PAGE_IMAGE?: string + FEATURE_AI_APP_DETAILS_ENABLE?: boolean } declare global { interface Window { From bfeb4c31c2979fdb3bd5c19977bd97150938f699 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Mon, 26 May 2025 11:10:11 +0530 Subject: [PATCH 05/77] chore: ClusterEnvironmentCategoryType & URL moved to common --- src/Common/Constants.ts | 1 + src/Common/Types.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 7270fac03..77ad7dcfa 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -76,6 +76,7 @@ export const URLS = { COMPARE_CLUSTERS: '/compare-clusters', APP_CONFIG: 'edit', GLOBAL_CONFIG: '/global-config', + GLOBAL_CONFIG_MANAGE_CATEGORIES: '/global-config/cluster-env/manage-categories', GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP, GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP_CREATE: `${GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP}/create`, // NOTE: using appId since we are re-using AppConfig component diff --git a/src/Common/Types.ts b/src/Common/Types.ts index 2a5597eff..e90fe482a 100644 --- a/src/Common/Types.ts +++ b/src/Common/Types.ts @@ -1131,3 +1131,12 @@ export interface EnvAppsMetaDTO { appCount: number apps: AppMeta[] } + + +export interface ClusterEnvironmentCategoryDTO { + id: number + name: string + description?: string +} + +export interface ClusterEnvironmentCategoryType extends ClusterEnvironmentCategoryDTO {} From df80d378989b1df4e9f95457c7a304b21bf28d3e Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Mon, 26 May 2025 15:18:15 +0530 Subject: [PATCH 06/77] feat: add aiAgentContext field to MainContext --- src/Shared/Providers/types.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Shared/Providers/types.ts b/src/Shared/Providers/types.ts index 82f1630cb..fbc251af6 100644 --- a/src/Shared/Providers/types.ts +++ b/src/Shared/Providers/types.ts @@ -78,6 +78,11 @@ export interface MainContext { reloadVersionConfig: ReloadVersionConfigTypes intelligenceConfig: IntelligenceConfig setIntelligenceConfig: Dispatch> + aiAgentContext: { + path: string + context: Record + } + setAIAgentContext: (aiAgentContext: MainContext['aiAgentContext']) => void } export interface MainContextProviderProps { From cfa7b6f51dd0be5f5c965cafc144e9c2cdd61c3e Mon Sep 17 00:00:00 2001 From: shivani170 Date: Tue, 27 May 2025 19:02:13 +0530 Subject: [PATCH 07/77] chore: code feedback fixes --- src/Assets/IconV2/ic-cluster-isolated.svg | 3 +++ src/Assets/IconV2/ic-environment-isolated.svg | 7 +++---- src/Assets/IconV2/ic-virtual-cluster.svg | 3 --- src/Common/Constants.ts | 1 - src/Common/Types.ts | 1 - src/Shared/Components/Icon/Icon.tsx | 4 ++-- 6 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 src/Assets/IconV2/ic-cluster-isolated.svg delete mode 100644 src/Assets/IconV2/ic-virtual-cluster.svg diff --git a/src/Assets/IconV2/ic-cluster-isolated.svg b/src/Assets/IconV2/ic-cluster-isolated.svg new file mode 100644 index 000000000..3e07813b5 --- /dev/null +++ b/src/Assets/IconV2/ic-cluster-isolated.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-environment-isolated.svg b/src/Assets/IconV2/ic-environment-isolated.svg index 1c5c59dcb..74837dab5 100644 --- a/src/Assets/IconV2/ic-environment-isolated.svg +++ b/src/Assets/IconV2/ic-environment-isolated.svg @@ -1,4 +1,3 @@ - - - - + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-virtual-cluster.svg b/src/Assets/IconV2/ic-virtual-cluster.svg deleted file mode 100644 index 14188fbf3..000000000 --- a/src/Assets/IconV2/ic-virtual-cluster.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 77ad7dcfa..908afcccc 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -88,7 +88,6 @@ export const ROUTES = { APP: 'app', APP_ARTIFACT_PROMOTE_MATERIAL: 'app/artifact/promotion-request/material', APP_TEMPLATE_DATA: 'app/template/data', - CLUSTER_CATEGORIES: 'cluster/categories', ENVIRONMENT_CATEGORIES: 'env/categories', PROJECT_LIST_MIN: 'team/autocomplete', USER_CHECK_ROLE: 'user/check/roles', diff --git a/src/Common/Types.ts b/src/Common/Types.ts index e90fe482a..9acb33f5c 100644 --- a/src/Common/Types.ts +++ b/src/Common/Types.ts @@ -1132,7 +1132,6 @@ export interface EnvAppsMetaDTO { apps: AppMeta[] } - export interface ClusterEnvironmentCategoryDTO { id: number name: string diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 1aa2c550f..c07bb0c3a 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -39,6 +39,7 @@ import { ReactComponent as ICCloseLarge } from '@IconsV2/ic-close-large.svg' import { ReactComponent as ICCloseSmall } from '@IconsV2/ic-close-small.svg' import { ReactComponent as ICCloudVms } from '@IconsV2/ic-cloud-vms.svg' import { ReactComponent as ICCluster } from '@IconsV2/ic-cluster.svg' +import { ReactComponent as ICClusterIsolated } from '@IconsV2/ic-cluster-isolated.svg' import { ReactComponent as ICCode } from '@IconsV2/ic-code.svg' import { ReactComponent as ICContainer } from '@IconsV2/ic-container.svg' import { ReactComponent as ICCookr } from '@IconsV2/ic-cookr.svg' @@ -158,7 +159,6 @@ import { ReactComponent as ICUnknown } from '@IconsV2/ic-unknown.svg' import { ReactComponent as ICUserCircle } from '@IconsV2/ic-user-circle.svg' import { ReactComponent as ICUserKey } from '@IconsV2/ic-user-key.svg' import { ReactComponent as ICUsers } from '@IconsV2/ic-users.svg' -import { ReactComponent as ICVirtualCluster } from '@IconsV2/ic-virtual-cluster.svg' import { ReactComponent as ICWarning } from '@IconsV2/ic-warning.svg' import { ReactComponent as ICWifiSlash } from '@IconsV2/ic-wifi-slash.svg' @@ -205,6 +205,7 @@ export const iconMap = { 'ic-close-large': ICCloseLarge, 'ic-close-small': ICCloseSmall, 'ic-cloud-vms': ICCloudVms, + 'ic-cluster-isolated': ICClusterIsolated, 'ic-cluster': ICCluster, 'ic-code': ICCode, 'ic-container': ICContainer, @@ -325,7 +326,6 @@ export const iconMap = { 'ic-user-circle': ICUserCircle, 'ic-user-key': ICUserKey, 'ic-users': ICUsers, - 'ic-virtual-cluster': ICVirtualCluster, 'ic-warning': ICWarning, 'ic-wifi-slash': ICWifiSlash, } From 739e94b6af633d06750cf1c038d7f35f8b888f23 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 28 May 2025 13:25:39 +0530 Subject: [PATCH 08/77] chore: placeholder fix for select picker --- src/Shared/Components/SelectPicker/SelectPicker.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx index 930559493..482dd211a 100644 --- a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx +++ b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx @@ -187,7 +187,7 @@ const SelectPicker = ({ error, icon, helperText, - placeholder = 'Select a option', + placeholder = 'Select an option', label, showSelectedOptionIcon = true, size = ComponentSizeType.medium, From 1d007cf1905f9f5993c1d0135be27dde1f0f0d1d Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 28 May 2025 14:08:02 +0530 Subject: [PATCH 09/77] chore: vector-effect="non-scaling-stroke" applied on icons --- src/Assets/IconV2/ic-cluster-isolated.svg | 2 +- src/Assets/IconV2/ic-cluster.svg | 2 +- src/Assets/IconV2/ic-environment-isolated.svg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Assets/IconV2/ic-cluster-isolated.svg b/src/Assets/IconV2/ic-cluster-isolated.svg index 3e07813b5..24a017f32 100644 --- a/src/Assets/IconV2/ic-cluster-isolated.svg +++ b/src/Assets/IconV2/ic-cluster-isolated.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-cluster.svg b/src/Assets/IconV2/ic-cluster.svg index f6aea37fd..8bc0567ac 100644 --- a/src/Assets/IconV2/ic-cluster.svg +++ b/src/Assets/IconV2/ic-cluster.svg @@ -1,3 +1,3 @@ - + diff --git a/src/Assets/IconV2/ic-environment-isolated.svg b/src/Assets/IconV2/ic-environment-isolated.svg index 74837dab5..17e3d98c6 100644 --- a/src/Assets/IconV2/ic-environment-isolated.svg +++ b/src/Assets/IconV2/ic-environment-isolated.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file From c2874ef4f3aeb3cb7c3e7869f26f09c6515950b8 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Thu, 29 May 2025 10:25:42 +0530 Subject: [PATCH 10/77] 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 898f45fa6..0b11b0656 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.1-pre-5", + "version": "1.14.1-pre-5-beta-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.1-pre-5", + "version": "1.14.1-pre-5-beta-2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 9324c1228..cb1b04265 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.1-pre-5", + "version": "1.14.1-pre-5-beta-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 23608ce2c10dcd2ce116f8edc69dd9f461570787 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Fri, 30 May 2025 11:31:29 +0530 Subject: [PATCH 11/77] feat: add ic-view-variable-toggle icon and refactor Checkbox and Toggle components --- .../ic-view-variable-toggle.svg | 0 src/Common/RJSF/widgets/Checkbox.tsx | 37 ++++++---------- src/Common/Toggle/Toggle.tsx | 3 ++ .../DeploymentHistoryDiffView.tsx | 24 ++++------- .../DeploymentConfigDiffMain.tsx | 2 +- .../FloatingVariablesSuggestions.tsx | 5 ++- .../Suggestions.tsx | 4 +- src/Shared/Components/Icon/Icon.tsx | 2 + .../Components/Switch/Switch.component.tsx | 6 ++- src/Shared/Components/Switch/types.ts | 10 ++--- ...ToggleResolveScopedVariables.component.tsx | 42 +++++++++---------- .../ToggleResolveScopedVariables/types.ts | 2 +- 12 files changed, 59 insertions(+), 78 deletions(-) rename src/Assets/{Icon => IconV2}/ic-view-variable-toggle.svg (100%) diff --git a/src/Assets/Icon/ic-view-variable-toggle.svg b/src/Assets/IconV2/ic-view-variable-toggle.svg similarity index 100% rename from src/Assets/Icon/ic-view-variable-toggle.svg rename to src/Assets/IconV2/ic-view-variable-toggle.svg diff --git a/src/Common/RJSF/widgets/Checkbox.tsx b/src/Common/RJSF/widgets/Checkbox.tsx index 9eac5ccbb..26bb45a23 100644 --- a/src/Common/RJSF/widgets/Checkbox.tsx +++ b/src/Common/RJSF/widgets/Checkbox.tsx @@ -14,48 +14,35 @@ * limitations under the License. */ -import { ChangeEvent } from 'react' import { WidgetProps } from '@rjsf/utils' import { isNullOrUndefined } from '@Shared/Helpers' -import Toggle from '../../Toggle/Toggle' +import { DTSwitch } from '@Shared/Components' export const Checkbox = ({ id, onChange, value, - required, disabled, readonly, autofocus, - onBlur, - onFocus, }: WidgetProps) => { - const handleEvent = (e: ChangeEvent, type: 'blur' | 'focus') => { - const { id, checked } = e.target - if (type === 'blur') { - onBlur(id, checked) - } else if (type === 'focus') { - onFocus(id, checked) - } - } - const isSelected: boolean = isNullOrUndefined(value) ? false : value + const handleChange = () => { + onChange(!isSelected) + } + return ( -
- + handleEvent(e, 'blur')} - onFocus={(e) => handleEvent(e, 'focus')} + isDisabled={disabled || readonly} /> - {isSelected.toString()} + {isSelected.toString()}
) } diff --git a/src/Common/Toggle/Toggle.tsx b/src/Common/Toggle/Toggle.tsx index 8743fc408..5491d3570 100644 --- a/src/Common/Toggle/Toggle.tsx +++ b/src/Common/Toggle/Toggle.tsx @@ -20,6 +20,9 @@ import { throttle, useEffectAfterMount } from '../Helper' import { CHECKBOX_VALUE } from '@Common/Types' import './Toggle.scss' +/** + * @deprecated + */ const Toggle = ({ selected = false, onSelect = null, diff --git a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx index 1116e3324..3f180a9e0 100644 --- a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx +++ b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx @@ -16,13 +16,12 @@ import { useMemo, useState } from 'react' import { useParams } from 'react-router-dom' -import Tippy from '@tippyjs/react' import { CodeEditor } from '@Shared/Components/CodeEditor' +import { ToggleResolveScopedVariables } from '@Shared/Components/ToggleResolveScopedVariables' import { ReactComponent as Info } from '../../../../Assets/Icon/ic-info-filled.svg' -import { ReactComponent as ViewVariablesIcon } from '../../../../Assets/Icon/ic-view-variable-toggle.svg' -import { MODES, Toggle, YAMLStringify } from '../../../../Common' +import { MODES, YAMLStringify } from '../../../../Common' import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '../../../constants' import { DeploymentHistorySingleValue, DeploymentTemplateHistoryType } from '../types' import { DeploymentHistoryParamsType } from './types' @@ -94,8 +93,6 @@ const DeploymentHistoryDiffView = ({ setConvertVariables(!convertVariables) } - const tippyMsg = convertVariables ? 'Hide variables values' : 'Show variables values' - const renderDetailedValue = ( parentClassName: string, singleValue: DeploymentHistorySingleValue, @@ -173,18 +170,11 @@ const DeploymentHistoryDiffView = ({ > {baseTemplateConfiguration?.codeEditorValue?.displayName} {isVariablesAvailable && ( - -
  • -
    - -
    -
  • -
    + )} diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx index 9cf072fb2..54e123aac 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx @@ -162,9 +162,9 @@ export const DeploymentConfigDiffMain = ({ return ( ) } diff --git a/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx b/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx index dadaf8cc0..862e6e94e 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx @@ -19,10 +19,10 @@ import Draggable from 'react-draggable' import Tippy from '@tippyjs/react' import { ReactComponent as ICDrag } from '@Icons/ic-drag.svg' -import { ReactComponent as ICViewVariable } from '@Icons/ic-view-variable-toggle.svg' import { useAsync } from '@Common/Helper' import { useWindowSize } from '@Common/Hooks' +import { Icon } from '../Icon' import { SUGGESTIONS_SIZE } from './constants' import { getScopedVariables } from './service' import Suggestions from './Suggestions' @@ -196,8 +196,9 @@ const FloatingVariablesSuggestions = ({ type="button" onClick={handleActivation} data-testid="activate-suggestions" + aria-label="Activate suggestions" > - + diff --git a/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx b/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx index 0a74234c5..e568b58d3 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx @@ -18,12 +18,12 @@ import { memo, useEffect, useState } from 'react' import { ReactComponent as ICClose } from '@Icons/ic-cross.svg' import { ReactComponent as ICSearch } from '@Icons/ic-search.svg' -import { ReactComponent as ICVariable } from '@Icons/ic-view-variable-toggle.svg' import NoVariables from '@Images/no-artifact.webp' import { DebouncedSearch, GenericEmptyState, Progressing, Reload } from '@Common/index' import { ComponentSizeType } from '@Shared/constants' import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { Icon } from '../Icon' import { NO_DEFINED_DESCRIPTION, NO_DEFINED_VALUE } from './constants' import SuggestionItem from './SuggestionItem' import SuggestionsInfo from './SuggestionsInfo' @@ -79,7 +79,7 @@ const Suggestions = ({

    Scoped variables

    - +

    Use variable to set dynamic value

    diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index a92e2e921..9e74f08f4 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -158,6 +158,7 @@ import { ReactComponent as ICUnknown } from '@IconsV2/ic-unknown.svg' import { ReactComponent as ICUserCircle } from '@IconsV2/ic-user-circle.svg' import { ReactComponent as ICUserKey } from '@IconsV2/ic-user-key.svg' import { ReactComponent as ICUsers } from '@IconsV2/ic-users.svg' +import { ReactComponent as ICViewVariableToggle } from '@IconsV2/ic-view-variable-toggle.svg' import { ReactComponent as ICWarning } from '@IconsV2/ic-warning.svg' import { ReactComponent as ICWifiSlash } from '@IconsV2/ic-wifi-slash.svg' @@ -324,6 +325,7 @@ export const iconMap = { 'ic-user-circle': ICUserCircle, 'ic-user-key': ICUserKey, 'ic-users': ICUsers, + 'ic-view-variable-toggle': ICViewVariableToggle, 'ic-warning': ICWarning, 'ic-wifi-slash': ICWifiSlash, } diff --git a/src/Shared/Components/Switch/Switch.component.tsx b/src/Shared/Components/Switch/Switch.component.tsx index b006d743c..66f06c1a7 100644 --- a/src/Shared/Components/Switch/Switch.component.tsx +++ b/src/Shared/Components/Switch/Switch.component.tsx @@ -22,7 +22,6 @@ import './switch.scss' const Switch = ({ ariaLabel, - dataTestId, isDisabled, isLoading, isChecked, @@ -35,6 +34,7 @@ const Switch = ({ size = ComponentSizeType.medium, name, onChange, + autoFocus = false, }: DTSwitchProps) => { const inputId = useRef(getUniqueId()) @@ -124,10 +124,12 @@ const Switch = ({
    +
    + {radioGroupConfig.map(({ name, title, options, groupValue, onChange }) => ( +
    + {title} + + {options.map(({ label, value, description }) => ( + +
    + {label} + {description} +
    +
    + ))} +
    +
    + ))} +
    + + + ) +} + +export default DeploymentConfigDiffRadioSelect diff --git a/src/Shared/Components/DeploymentConfigDiff/index.ts b/src/Shared/Components/DeploymentConfigDiff/index.ts index fb054bb0e..7b88f8df9 100644 --- a/src/Shared/Components/DeploymentConfigDiff/index.ts +++ b/src/Shared/Components/DeploymentConfigDiff/index.ts @@ -18,3 +18,4 @@ export * from './DeploymentConfigDiff.component' export * from './DeploymentConfigDiff.constants' export * from './DeploymentConfigDiff.types' export * from './DeploymentConfigDiff.utils' +export { default as DeploymentConfigDiffRadioSelect } from './DeploymentConfigDiffRadioSelect' diff --git a/src/Shared/Services/app.types.ts b/src/Shared/Services/app.types.ts index e04c22c39..fa44b9418 100644 --- a/src/Shared/Services/app.types.ts +++ b/src/Shared/Services/app.types.ts @@ -15,7 +15,7 @@ */ import { KeyValueTableData } from '@Shared/Components' -import { TargetPlatformsDTO } from '@Shared/types' +import { DeploymentStrategyType, TargetPlatformsDTO } from '@Shared/types' import { OverrideMergeStrategyType } from '@Pages/Applications' import { ReleaseTag, ResponseType, UserApprovalMetadataType } from '../../Common' @@ -308,10 +308,12 @@ export interface AppEnvDeploymentConfigDTO { isAppAdmin: boolean } -export type AppEnvDeploymentConfigPayloadType = +export type AppEnvDeploymentConfigPayloadType = { + appName: string + envName: string + strategy?: DeploymentStrategyType +} & ( | { - appName: string - envName: string configType: AppEnvDeploymentConfigType wfrId?: number pipelineId?: number @@ -327,6 +329,7 @@ export type AppEnvDeploymentConfigPayloadType = configArea: 'CdRollback' | 'DeploymentHistory' wfrId: number } +) export enum TemplateListType { DefaultVersions = 1, diff --git a/src/Shared/constants.tsx b/src/Shared/constants.tsx index 501c21c70..53d86f680 100644 --- a/src/Shared/constants.tsx +++ b/src/Shared/constants.tsx @@ -17,7 +17,13 @@ import { DeploymentNodeType, OptionType } from '@Common/Types' import { InfoBlockProps } from './Components' -import { CDMaterialSidebarType, ConfigKeysWithLockType, ConfigurationType, IconBaseColorType } from './types' +import { + CDMaterialSidebarType, + ConfigKeysWithLockType, + ConfigurationType, + DeploymentStrategyTypeWithDefault, + IconBaseColorType, +} from './types' export const ARTIFACT_STATUS = { PROGRESSING: 'Progressing', @@ -580,3 +586,13 @@ export const DEPLOYMENT_STAGE_TO_NODE_MAP: Readonly = { + DEFAULT: 'Default Strategy', + 'BLUE-GREEN': 'Blue Green', + CANARY: 'Canary', + RECREATE: 'Recreate', + ROLLING: 'Rolling', + ROLLINGUPDATE: 'Rolling Update', + ONDELETE: 'On Delete', +} diff --git a/src/Shared/types.ts b/src/Shared/types.ts index 17abde1b0..d8b6e2fae 100644 --- a/src/Shared/types.ts +++ b/src/Shared/types.ts @@ -18,7 +18,7 @@ import { ReactNode } from 'react' import { ParsedCountry } from 'react-international-phone' import { Dayjs } from 'dayjs' -import { APIOptions, ApprovalConfigDataType } from '@Common/Types' +import { APIOptions, ApprovalConfigDataType, Strategy } from '@Common/Types' import { ReleaseMode } from '@Pages/index' import { @@ -28,6 +28,7 @@ import { PluginType, RefVariableType, SegmentedControlProps, + ServerError, ServerErrors, SortingParams, TriggerBlockType, @@ -1298,3 +1299,9 @@ export type DeploymentStrategyType = 'CANARY' | 'ROLLING' | 'RECREATE' | 'BLUE-G export type DeploymentStrategyTypeWithDefault = DeploymentStrategyType | 'DEFAULT' export type PipelineIdsVsDeploymentStrategyMap = Record + +export interface PipelineDeploymentStrategy { + pipelineId: number + strategies: Strategy[] + error: ServerError +} From ad4eb3ad32e482ca04e021805d43f9c75b8f8fd7 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Fri, 30 May 2025 16:36:13 +0530 Subject: [PATCH 13/77] chore: add null check for case when not scanned --- .../Components/Security/Vulnerabilities/Vulnerabilities.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx b/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx index e9bb025e4..dec2ffd7a 100644 --- a/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx +++ b/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx @@ -68,7 +68,7 @@ const Vulnerabilities = ({ ) } - if (!isScanEnabled || !scanResultResponse.result?.isImageScanEnabled) { + if (!isScanEnabled || !scanResultResponse?.result?.isImageScanEnabled) { return (

    Scan is Disabled

    From 3c9a2050d84111466fbbeb4af990017c8dc1d249 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Fri, 30 May 2025 17:08:41 +0530 Subject: [PATCH 14/77] chore: update shadow class --- src/Shared/Components/AppStatusModal/AppStatusBody.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/Components/AppStatusModal/AppStatusBody.tsx b/src/Shared/Components/AppStatusModal/AppStatusBody.tsx index b50a568b4..2acd08a47 100644 --- a/src/Shared/Components/AppStatusModal/AppStatusBody.tsx +++ b/src/Shared/Components/AppStatusModal/AppStatusBody.tsx @@ -169,7 +169,7 @@ export const AppStatusBody = ({
    {/* Info card */}
    -
    +
    {infoCardItems.map((item, index) => ( Date: Fri, 30 May 2025 18:40:46 +0530 Subject: [PATCH 15/77] 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 d9ad3c053..9482a5d2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-1", + "version": "1.14.2-pre-1-beta-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-1", + "version": "1.14.2-pre-1-beta-2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index d4d2bb3e7..652732636 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-1", + "version": "1.14.2-pre-1-beta-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From a56afde5b91d236486ac0160872fbd2be7db076d Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Sat, 31 May 2025 13:57:50 +0530 Subject: [PATCH 16/77] fix: ensure focus trapping for additional modals in Backdrop component --- src/Shared/Components/Backdrop/Backdrop.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Shared/Components/Backdrop/Backdrop.tsx b/src/Shared/Components/Backdrop/Backdrop.tsx index d8c460276..7c0fb5e72 100644 --- a/src/Shared/Components/Backdrop/Backdrop.tsx +++ b/src/Shared/Components/Backdrop/Backdrop.tsx @@ -40,10 +40,14 @@ const Backdrop = ({ children, onEscape }: BackdropProps) => { preventBodyScroll(true) // Setting main as inert to that focus is trapped inside the new portal preventOutsideFocus({ identifier: DEVTRON_BASE_MAIN_ID, preventFocus: true }) + preventOutsideFocus({ identifier: 'visible-modal', preventFocus: true }) + preventOutsideFocus({ identifier: 'visible-modal-2', preventFocus: true }) return () => { preventBodyScroll(false) preventOutsideFocus({ identifier: DEVTRON_BASE_MAIN_ID, preventFocus: false }) + preventOutsideFocus({ identifier: 'visible-modal', preventFocus: false }) + preventOutsideFocus({ identifier: 'visible-modal-2', preventFocus: false }) } }, []) From b6918acf8a6f041adcb2f674553af4a3ed805590 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Sun, 1 Jun 2025 21:30:23 +0530 Subject: [PATCH 17/77] feat: add asterisk and world globe SVG icons; update Icon component and Switch component for data-testid support --- src/Assets/IconV2/ic-asterisk.svg | 3 +++ src/Assets/IconV2/ic-world-globe.svg | 3 +++ src/Shared/Components/Icon/Icon.tsx | 4 ++++ src/Shared/Components/Switch/Switch.component.tsx | 4 +++- src/Shared/Components/Switch/types.ts | 9 +++++++-- src/Shared/Components/Switch/utils.ts | 11 ++++++++--- 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 src/Assets/IconV2/ic-asterisk.svg create mode 100644 src/Assets/IconV2/ic-world-globe.svg diff --git a/src/Assets/IconV2/ic-asterisk.svg b/src/Assets/IconV2/ic-asterisk.svg new file mode 100644 index 000000000..f32f6306d --- /dev/null +++ b/src/Assets/IconV2/ic-asterisk.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-world-globe.svg b/src/Assets/IconV2/ic-world-globe.svg new file mode 100644 index 000000000..321dbdffd --- /dev/null +++ b/src/Assets/IconV2/ic-world-globe.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index b55dd3770..939b6b4c3 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -12,6 +12,7 @@ import { ReactComponent as ICArrowRight } from '@IconsV2/ic-arrow-right.svg' import { ReactComponent as ICArrowSquareOut } from '@IconsV2/ic-arrow-square-out.svg' import { ReactComponent as ICArrowsClockwise } from '@IconsV2/ic-arrows-clockwise.svg' import { ReactComponent as ICArrowsLeftRight } from '@IconsV2/ic-arrows-left-right.svg' +import { ReactComponent as ICAsterisk } from '@IconsV2/ic-asterisk.svg' import { ReactComponent as ICAther } from '@IconsV2/ic-ather.svg' import { ReactComponent as ICAzure } from '@IconsV2/ic-azure.svg' import { ReactComponent as ICAzureAks } from '@IconsV2/ic-azure-aks.svg' @@ -181,6 +182,7 @@ import { ReactComponent as ICUsers } from '@IconsV2/ic-users.svg' import { ReactComponent as ICViewVariableToggle } from '@IconsV2/ic-view-variable-toggle.svg' import { ReactComponent as ICWarning } from '@IconsV2/ic-warning.svg' import { ReactComponent as ICWifiSlash } from '@IconsV2/ic-wifi-slash.svg' +import { ReactComponent as ICWorldGlobe } from '@IconsV2/ic-world-globe.svg' // eslint-disable-next-line no-restricted-imports import { IconBase } from './IconBase' @@ -199,6 +201,7 @@ export const iconMap = { 'ic-arrow-square-out': ICArrowSquareOut, 'ic-arrows-clockwise': ICArrowsClockwise, 'ic-arrows-left-right': ICArrowsLeftRight, + 'ic-asterisk': ICAsterisk, 'ic-ather': ICAther, 'ic-azure-aks': ICAzureAks, 'ic-azure': ICAzure, @@ -368,6 +371,7 @@ export const iconMap = { 'ic-view-variable-toggle': ICViewVariableToggle, 'ic-warning': ICWarning, 'ic-wifi-slash': ICWifiSlash, + 'ic-world-globe': ICWorldGlobe, } export type IconName = keyof typeof iconMap diff --git a/src/Shared/Components/Switch/Switch.component.tsx b/src/Shared/Components/Switch/Switch.component.tsx index 66f06c1a7..4e1673c3b 100644 --- a/src/Shared/Components/Switch/Switch.component.tsx +++ b/src/Shared/Components/Switch/Switch.component.tsx @@ -33,6 +33,7 @@ const Switch = ({ indeterminate = false, size = ComponentSizeType.medium, name, + dataTestId = name, onChange, autoFocus = false, }: DTSwitchProps) => { @@ -129,7 +130,7 @@ const Switch = ({ aria-checked={ariaCheckedValue} aria-labelledby={inputId.current} aria-label={isLoading ? 'Loading...' : ariaLabel} - data-testid={name} + data-testid={dataTestId} disabled={isDisabled || isLoading} aria-disabled={isDisabled} className={`p-0-imp h-100 flex flex-grow-1 dc__no-border dt-switch__track ${shape === 'rounded' ? 'br-12' : 'br-4'} ${getSwitchTrackColor({ shape, variant, isChecked, isLoading })} ${isDisabled ? 'dc__disabled' : ''} dc__fill-available-space`} @@ -140,6 +141,7 @@ const Switch = ({ shape, variant, isChecked, + isLoading, }), }} > diff --git a/src/Shared/Components/Switch/types.ts b/src/Shared/Components/Switch/types.ts index 61ab8c4e6..29caf1958 100644 --- a/src/Shared/Components/Switch/types.ts +++ b/src/Shared/Components/Switch/types.ts @@ -1,4 +1,4 @@ -import { ButtonHTMLAttributes } from 'react' +import { ButtonHTMLAttributes, ReactNode } from 'react' import { ComponentSizeType } from '@Shared/constants' import { IconBaseColorType } from '@Shared/types' @@ -76,6 +76,11 @@ export type DTSwitchProps = { */ name: string + /** + * Provide if name generated through `getUniqueId`. + */ + dataTestId?: string + /** * The visual variant of the switch. * @@ -115,7 +120,7 @@ export type DTSwitchProps = { * * @default undefined */ - tooltipContent?: string + tooltipContent?: ReactNode /** * Indicates whether the switch should be focused automatically when rendered. * @default false diff --git a/src/Shared/Components/Switch/utils.ts b/src/Shared/Components/Switch/utils.ts index 514697ff6..e3b3307f8 100644 --- a/src/Shared/Components/Switch/utils.ts +++ b/src/Shared/Components/Switch/utils.ts @@ -38,9 +38,14 @@ export const getSwitchTrackHoverColor = ({ shape, variant, isChecked, -}: Required< - Pick ->): (typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP)[DTSwitchProps['variant']] => { + isLoading, +}: Required>): + | (typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP)[DTSwitchProps['variant']] + | 'transparent' => { + if (isLoading) { + return 'transparent' + } + if (!isChecked) { return 'var(--N300)' } From b39c2ebb9e6434302d3058f55e6434a8db913256 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Mon, 2 Jun 2025 08:28:05 +0530 Subject: [PATCH 18/77] 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 9602fbeae..3797ba769 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-2-beta-1", + "version": "1.14.2-pre-2-beta-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-2-beta-1", + "version": "1.14.2-pre-2-beta-2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 7254c94df..92b21ae13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-2-beta-1", + "version": "1.14.2-pre-2-beta-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From a479f41bf966baaa1bbcfe835fb777bdb7936c2d Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 2 Jun 2025 13:09:07 +0530 Subject: [PATCH 19/77] feat: Enhance DocLink component to support isLicenseDashboard flag and update documentation URL logic --- src/Shared/Components/DocLink/DocLink.tsx | 11 +++- src/Shared/Components/DocLink/types.ts | 1 + src/Shared/Components/DocLink/utils.tsx | 5 +- src/Shared/Providers/types.ts | 74 +++++++++++++++-------- 4 files changed, 64 insertions(+), 27 deletions(-) diff --git a/src/Shared/Components/DocLink/DocLink.tsx b/src/Shared/Components/DocLink/DocLink.tsx index bbb698abd..c3467c036 100644 --- a/src/Shared/Components/DocLink/DocLink.tsx +++ b/src/Shared/Components/DocLink/DocLink.tsx @@ -23,18 +23,25 @@ export const DocLink = ({ fullWidth = false, }: DocLinkProps) => { // HOOKS - const { isEnterprise, setSidePanelConfig } = useMainContext() + const { isEnterprise, setSidePanelConfig, isLicenseDashboard } = useMainContext() // CONSTANTS const documentationLink = getDocumentationUrl({ docLinkKey, isEnterprise, isExternalLink, + isLicenseDashboard, }) // HANDLERS const handleClick = (e: MouseEvent) => { - if (!isExternalLink && !openInNewTab && !e.metaKey && documentationLink.startsWith(DOCUMENTATION_HOME_PAGE)) { + if ( + !isExternalLink && + !openInNewTab && + !e.metaKey && + !isLicenseDashboard && + documentationLink.startsWith(DOCUMENTATION_HOME_PAGE) + ) { e.preventDefault() setSidePanelConfig((prev) => ({ ...prev, open: true, docLink: documentationLink, reinitialize: true })) } diff --git a/src/Shared/Components/DocLink/types.ts b/src/Shared/Components/DocLink/types.ts index 4dfec7b99..5ced59b00 100644 --- a/src/Shared/Components/DocLink/types.ts +++ b/src/Shared/Components/DocLink/types.ts @@ -7,6 +7,7 @@ import { DOCUMENTATION } from './constants' export type BaseDocLink = { isExternalLink?: T isEnterprise?: boolean + isLicenseDashboard?: boolean docLinkKey: T extends true ? string : keyof typeof DOCUMENTATION } diff --git a/src/Shared/Components/DocLink/utils.tsx b/src/Shared/Components/DocLink/utils.tsx index c98bd5b35..84a1c48a9 100644 --- a/src/Shared/Components/DocLink/utils.tsx +++ b/src/Shared/Components/DocLink/utils.tsx @@ -7,6 +7,7 @@ export const getDocumentationUrl = ({ docLinkKey, isEnterprise = false, isExternalLink, + isLicenseDashboard = false, }: BaseDocLink) => { if (isExternalLink) { return docLinkKey @@ -18,5 +19,7 @@ export const getDocumentationUrl = ({ return docPath } - return `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/${docPath || ''}?utm-source=product_${isEnterprise ? 'ent' : 'oss'}` + const utmPath = !isLicenseDashboard ? `?utm-source=product_${isEnterprise ? 'ent' : 'oss'}` : '' + + return `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/${docPath || ''}${utmPath}` } diff --git a/src/Shared/Providers/types.ts b/src/Shared/Providers/types.ts index 4911a42b9..a21a45e9e 100644 --- a/src/Shared/Providers/types.ts +++ b/src/Shared/Providers/types.ts @@ -39,12 +39,10 @@ export interface SidePanelConfig { docLink: string | null } -export interface MainContext { - serverMode: SERVER_MODE +type CommonMainContextProps = { setServerMode: (serverMode: SERVER_MODE) => void isHelpGettingStartedClicked: boolean showCloseButtonAfterGettingStartedClicked: () => void - loginCount: number setLoginCount: (loginCount: number) => void showGettingStartedCard: boolean setShowGettingStartedCard: (showGettingStartedCard: boolean) => void @@ -52,9 +50,8 @@ export interface MainContext { setGettingStartedClicked: (isGettingStartedClicked: boolean) => void moduleInInstallingState: string setModuleInInstallingState: (moduleInInstallingState: string) => void - installedModuleMap: MutableRefObject> currentServerInfo: { - serverInfo: ServerInfo + serverInfo: ServerInfo | null fetchingServerInfo: boolean } isAirgapped: boolean @@ -79,31 +76,60 @@ export interface MainContext { handleOpenLicenseInfoDialog: ( initialDialogType?: LicenseInfoDialogType.ABOUT | LicenseInfoDialogType.LICENSE, ) => void - /** - * Data is set only if showLicenseData is received as true - */ - licenseData: DevtronLicenseInfo setLicenseData: Dispatch> canFetchHelmAppStatus: boolean - reloadVersionConfig: ReloadVersionConfigTypes - intelligenceConfig: IntelligenceConfig setIntelligenceConfig: Dispatch> - - sidePanelConfig: SidePanelConfig setSidePanelConfig: Dispatch> - - /** - * Indicates whether the current Devtron instance is running as an Enterprise edition. \ - * This flag is determined based on server-side configuration. - */ - isEnterprise: boolean - /** - * Indicates whether the fe-lib modules are available in the current instance. \ - * Used to conditionally render or enable features that depend on fe-lib - */ - isFELibAvailable: boolean } +export type MainContext = CommonMainContextProps & + ( + | { + isLicenseDashboard?: never + serverMode: SERVER_MODE + loginCount: number | null + installedModuleMap: MutableRefObject> + /** + * Data is set only if showLicenseData is received as true + */ + licenseData: DevtronLicenseInfo + + reloadVersionConfig: ReloadVersionConfigTypes + intelligenceConfig: IntelligenceConfig + + sidePanelConfig: SidePanelConfig + + /** + * Indicates whether the current Devtron instance is running as an Enterprise edition. \ + * This flag is determined based on server-side configuration. + */ + isEnterprise: boolean + /** + * Indicates whether the fe-lib modules are available in the current instance. \ + * Used to conditionally render or enable features that depend on fe-lib + */ + isFELibAvailable: boolean + } + | { + isLicenseDashboard: true + serverMode: null + loginCount: null + installedModuleMap: null + /** + * Data is set only if showLicenseData is received as true + */ + licenseData: null + + reloadVersionConfig: null + intelligenceConfig: null + + sidePanelConfig: null + + isEnterprise: false + isFELibAvailable: false + } + ) + export interface MainContextProviderProps { children: ReactNode value: MainContext From 5b931fe5b4acf0cf0102cd434dceaa28f2fcee5f Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 2 Jun 2025 16:04:02 +0530 Subject: [PATCH 20/77] fix: animation logic --- .../Components/Switch/Switch.component.tsx | 67 ++++++++----------- src/Shared/Components/Switch/utils.ts | 30 +++++++-- 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/src/Shared/Components/Switch/Switch.component.tsx b/src/Shared/Components/Switch/Switch.component.tsx index 4e1673c3b..779993778 100644 --- a/src/Shared/Components/Switch/Switch.component.tsx +++ b/src/Shared/Components/Switch/Switch.component.tsx @@ -1,12 +1,12 @@ import { AriaAttributes, useRef } from 'react' -import { AnimatePresence, motion } from 'framer-motion' +import { motion } from 'framer-motion' import { Tooltip } from '@Common/Tooltip' import { ComponentSizeType } from '@Shared/constants' import { getUniqueId } from '@Shared/Helpers' import { Icon } from '../Icon' -import { INDETERMINATE_ICON_WIDTH_MAP, LOADING_COLOR_MAP } from './constants' +import { LOADING_COLOR_MAP } from './constants' import { DTSwitchProps } from './types' import { getSwitchContainerClass, @@ -51,59 +51,46 @@ const Switch = ({ const showIndeterminateIcon = ariaCheckedValue === 'mixed' + const thumbPosition = getThumbPosition({ isChecked, shape, size, indeterminate, isLoading }) + const renderContent = () => ( - {isLoading ? ( ) : ( - - {showIndeterminateIcon ? ( - + - ) : ( - iconName && ( - - - - ) - )} - + + )} )} - + ) return ( diff --git a/src/Shared/Components/Switch/utils.ts b/src/Shared/Components/Switch/utils.ts index e3b3307f8..37206de79 100644 --- a/src/Shared/Components/Switch/utils.ts +++ b/src/Shared/Components/Switch/utils.ts @@ -1,6 +1,8 @@ +import { ComponentSizeType } from '@Shared/constants' import { IconBaseColorType } from '@Shared/types' import { + INDETERMINATE_ICON_WIDTH_MAP, ROUNDED_SWITCH_SIZE_MAP, ROUNDED_SWITCH_THUMB_SIZE_MAP, ROUNDED_SWITCH_TRACK_COLOR_MAP, @@ -61,7 +63,7 @@ export const getSwitchThumbClass = ({ showIndeterminateIcon, }: Pick & { showIndeterminateIcon: boolean }) => { if (showIndeterminateIcon) { - return 'w-100 h-100 flex' + return `${INDETERMINATE_ICON_WIDTH_MAP[size]} h-2 br-4 dc__no-shrink bg__white` } return `flex ${SWITCH_THUMB_PADDING_MAP[size]} ${shape === 'rounded' ? `dc__border-radius-50-per ${ROUNDED_SWITCH_THUMB_SIZE_MAP[size]}` : 'br-3'} bg__white` @@ -80,14 +82,32 @@ export const getSwitchIconColor = ({ } export const getThumbPosition = ({ - isLoading, isChecked, -}: Pick): 'left' | 'right' | 'center' => { + size, + shape, + indeterminate, + isLoading, +}: Required>): + | 0 + | 12 + | 8 + | 5 + | 6 + | 4 => { if (isLoading) { - return 'center' + return size === ComponentSizeType.medium && shape === 'rounded' ? 6 : 4 + } + + if (!isChecked) { + return 0 + } + + if (indeterminate) { + // This only has rounded shape + return size === ComponentSizeType.medium ? 8 : 5 } - return isChecked ? 'right' : 'left' + return size === ComponentSizeType.medium && shape === 'rounded' ? 12 : 8 } export const getThumbPadding = ({ shape, isLoading }: Pick): string => { From 45cf15b964f06af41c033837e6fee39d8f6ae725 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 2 Jun 2025 18:06:21 +0530 Subject: [PATCH 21/77] refactor: remove Toggle component and associated styles from the codebase --- .eslintignore | 1 - src/Common/Toggle/Toggle.scss | 144 ---------------------------------- src/Common/Toggle/Toggle.tsx | 121 ---------------------------- src/Common/index.ts | 1 - 4 files changed, 267 deletions(-) delete mode 100644 src/Common/Toggle/Toggle.scss delete mode 100644 src/Common/Toggle/Toggle.tsx diff --git a/.eslintignore b/.eslintignore index 9ff40a0db..a74f285b7 100755 --- a/.eslintignore +++ b/.eslintignore @@ -56,5 +56,4 @@ src/Common/Select/Select.tsx src/Common/ServerError.ts src/Common/TippyCustomized.tsx src/Common/ToastBody.tsx -src/Common/Toggle/Toggle.tsx src/Common/Types.ts diff --git a/src/Common/Toggle/Toggle.scss b/src/Common/Toggle/Toggle.scss deleted file mode 100644 index a431bb437..000000000 --- a/src/Common/Toggle/Toggle.scss +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.toggle__switch { - position: relative; - display: inline-block; - width: 100%; - height: 100%; - - &.disabled { - cursor: not-allowed; - .toggle__slider { - cursor: not-allowed; - } - } -} - -/* Hide default HTML checkbox */ - -.toggle__switch input { - opacity: 0; - width: 0; - height: 0; -} - -/* The slider */ - -.toggle__slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: var(--N200); - transition: all 0.4s ease; - &.round { - border-radius: 34px; - &:before { - border-radius: 50%; - } - } - &:before { - position: absolute; - content: ''; - height: calc(100% - 8px); - width: calc(50% - 4px); - left: 4px; - bottom: 4px; - background-color: var(--white); - transition: all 0.4s ease; - } - - &.intermediate::before { - width: 0px; - height: 0px; - } - - &.with-icon { - background-color: var(--bg-primary) !important; - svg { - position: absolute; - content: ''; - top: -1px; - left: -1px; - background-color: var(--N300); - transition: all 0.4s ease; - } - } -} - -input:checked + .toggle__slider { - background-color: var(--color); - &:before { - transform: translateX(calc(100%)); - } - &.with-icon { - svg { - transform: translateX(calc(100%)); - background-color: var(--color); - } - } -} - -input:focus + .toggle__slider { - box-shadow: 0 0 1px var(--color); -} - -.dc__toggle-square-toggle { - .toggle__slider { - border-color: var(--color); - background-color: var(--color) !important; - - &:before { - background-color: transparent; - } - - &.with-icon svg { - height: 16px; - width: 16px; - margin-top: 1px; - background-color: var(--bg-primary); - left: 0; - padding: 0; - border-radius: 3px; - } - } - - input:checked + .toggle__slider { - &.with-icon svg { - left: -6px; - background-color: var(--bg-primary); - } - } - - &--h20 { - .toggle__slider { - &.with-icon svg { - height: 18px; - width: 18px; - padding: 2px; - } - } - - input:checked + .toggle__slider { - &.with-icon svg { - left: -10px; - } - } - } -} diff --git a/src/Common/Toggle/Toggle.tsx b/src/Common/Toggle/Toggle.tsx deleted file mode 100644 index 5491d3570..000000000 --- a/src/Common/Toggle/Toggle.tsx +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React, { SyntheticEvent, useCallback } from 'react' -import { Icon as IconComponent } from '@Shared/Components' -import { throttle, useEffectAfterMount } from '../Helper' -import { CHECKBOX_VALUE } from '@Common/Types' -import './Toggle.scss' - -/** - * @deprecated - */ -const Toggle = ({ - selected = false, - onSelect = null, - color = 'var(--G500)', - rootClassName = '', - disabled = false, - dataTestId = 'handle-toggle-button', - Icon = null, - iconClass = '', - throttleOnChange = false, - shouldToggleValueOnLabelClick = false, - isLoading = false, - value = CHECKBOX_VALUE.CHECKED, - isControlled = false, - ...props -}) => { - const [active, setActive] = React.useState(selected) - - useEffectAfterMount(() => { - if (typeof onSelect === 'function' && !isControlled) { - if (active !== selected) { - onSelect(active) - } - } - }, [active]) - - useEffectAfterMount(() => { - setActive(selected) - }, [selected]) - - function handleClick() { - if (!disabled) { - if (isControlled) { - onSelect(!active) - } else { - setActive((active) => !active) - } - } - } - - const throttledHandleClick = useCallback(throttle(handleClick, 500), [disabled]) - - const handleChange = () => { - if (throttleOnChange) { - throttledHandleClick() - return - } - handleClick() - } - - const handleLabelClick = (e: SyntheticEvent) => { - if (shouldToggleValueOnLabelClick) { - e.preventDefault() - handleChange() - } - } - - const isIntermediateView = selected && value === CHECKBOX_VALUE.INTERMEDIATE - - const renderIcon = () => { - if (isIntermediateView) { - return ( -
    -
    -
    - ) - } - - if (Icon) { - return - } - - return null - } - - return isLoading ? ( - - ) : ( - - ) -} - -export default Toggle diff --git a/src/Common/index.ts b/src/Common/index.ts index dc619f806..461f1aadd 100644 --- a/src/Common/index.ts +++ b/src/Common/index.ts @@ -63,6 +63,5 @@ export { default as Select } from './Select/Select' export * from './ServerError' export * from './SortableTableHeaderCell' export * from './TippyCustomized' -export { default as Toggle } from './Toggle/Toggle' export * from './Tooltip' export * from './Types' From b550970feae5956baff5f33070d25164b065771d Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 2 Jun 2025 19:02:25 +0530 Subject: [PATCH 22/77] feat: update asterisk SVG icon to a larger size and new design --- src/Assets/IconV2/ic-asterisk.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Assets/IconV2/ic-asterisk.svg b/src/Assets/IconV2/ic-asterisk.svg index f32f6306d..1d2205af4 100644 --- a/src/Assets/IconV2/ic-asterisk.svg +++ b/src/Assets/IconV2/ic-asterisk.svg @@ -1,3 +1,3 @@ - - - + + + \ No newline at end of file From d0b6086df94cf4bfa498a007161ce681556f1f71 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Tue, 3 Jun 2025 15:10:26 +0530 Subject: [PATCH 23/77] feat: add support for info in config diff details view --- .../DeploymentHistoryDiffView.tsx | 16 +---- .../DeploymentHistoryConfigDiff/utils.tsx | 28 +++++++- src/Shared/Components/CICDHistory/service.tsx | 65 ++++++------------- src/Shared/Components/CICDHistory/types.tsx | 22 +------ .../DeploymentConfigDiffMain.tsx | 2 +- .../DeploymentConfigDiffRadioSelect.tsx | 7 +- src/Shared/Components/LoadingCard.tsx | 2 +- src/Shared/Components/Popover/types.ts | 4 ++ .../Components/Popover/usePopover.hook.ts | 3 +- src/Shared/Services/app.types.ts | 3 + 10 files changed, 66 insertions(+), 86 deletions(-) diff --git a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx index cc9448003..5603118aa 100644 --- a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx +++ b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx @@ -26,8 +26,9 @@ import { ReactComponent as Info } from '../../../../Assets/Icon/ic-info-filled.s import { ReactComponent as ViewVariablesIcon } from '../../../../Assets/Icon/ic-view-variable-toggle.svg' import { MODES, Toggle, YAMLStringify } from '../../../../Common' import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '../../../constants' -import { DeploymentHistorySingleValue, DeploymentTemplateHistoryType } from '../types' +import { DeploymentTemplateHistoryType } from '../types' import { DeploymentHistoryParamsType } from './types' +import { renderDetailedValue } from './utils' const DeploymentHistoryDiffView = ({ currentConfiguration, @@ -94,19 +95,6 @@ const DeploymentHistoryDiffView = ({ const tippyMsg = convertVariables ? 'Hide variables values' : 'Show variables values' - const renderDetailedValue = ( - parentClassName: string, - singleValue: DeploymentHistorySingleValue, - dataTestId: string, - ) => ( -
    -
    - {singleValue.displayName} -
    -
    {singleValue.value}
    -
    - ) - return (
    {!previousConfigAvailable && ( diff --git a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.tsx b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.tsx index 69ceea14c..63338f875 100644 --- a/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.tsx +++ b/src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.tsx @@ -17,11 +17,12 @@ import moment from 'moment' import { DATE_TIME_FORMATS, ERROR_STATUS_CODE } from '@Common/Constants' +import { Icon } from '@Shared/Components/Icon' import { SelectPickerOptionType } from '@Shared/Components/SelectPicker' import { DeploymentStatus } from '@Shared/Components/StatusComponent' import { DeploymentStageType } from '@Shared/constants' -import { History } from '../types' +import { DeploymentHistorySingleValue, History } from '../types' import { renderPipelineDeploymentOptionDescription } from './helpers' import { DeploymentHistoryConfigDiffProps } from './types' @@ -88,3 +89,28 @@ export const isDeploymentHistoryConfigDiffNotFoundError = (re export const getDeploymentHistoryConfigDiffError = (res: PromiseSettledResult) => res.status === 'rejected' && res.reason?.code !== ERROR_STATUS_CODE.NOT_FOUND ? res.reason : null + +export const renderDetailedValue = ( + parentClassName: string, + singleValue: DeploymentHistorySingleValue, + dataTestId: string, +) => ( +
    +
    +
    + {singleValue.displayName} +
    +
    {singleValue.value}
    +
    + {singleValue.tooltipContent && ( + + )} +
    +) diff --git a/src/Shared/Components/CICDHistory/service.tsx b/src/Shared/Components/CICDHistory/service.tsx index 582d524ee..6a130c68c 100644 --- a/src/Shared/Components/CICDHistory/service.tsx +++ b/src/Shared/Components/CICDHistory/service.tsx @@ -15,19 +15,18 @@ */ /* eslint-disable dot-notation */ +import moment from 'moment' + import { get, getUrlWithSearchParams, ResponseType, ROUTES, sanitizeUserApprovalMetadata, trash } from '../../../Common' -import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP, EXTERNAL_TYPES } from '../../constants' -import { decode } from '../../Helpers' +import { DATE_TIME_FORMAT_STRING, DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP, EXTERNAL_TYPES } from '../../constants' +import { decode, isNullOrUndefined } from '../../Helpers' import { ResourceKindType, ResourceVersionType } from '../../types' import { - DeploymentConfigurationsRes, DeploymentHistoryDetail, - DeploymentHistoryDetailRes, DeploymentHistoryResult, DeploymentHistorySingleValue, DeploymentStatusDetailsResponse, FetchIdDataStatus, - HistoryDiffSelectorRes, ModuleConfigResponse, TriggerDetailsResponseType, TriggerHistoryParamsType, @@ -107,26 +106,7 @@ export function getManualSync(params: { appId: string; envId: string }): Promise return get(`${ROUTES.MANUAL_SYNC}/${params.appId}/${params.envId}`) } -export const getDeploymentHistoryList = ( - appId: string, - pipelineId: string, - triggerId: string, -): Promise => get(`app/history/deployed-configuration/${appId}/${pipelineId}/${triggerId}`) - -export const getDeploymentHistoryDetail = ( - appId: string, - pipelineId: string, - id: string, - historyComponent: string, - historyComponentName: string, -): Promise => - get( - `app/history/deployed-component/detail/${appId}/${pipelineId}/${id}?historyComponent=${historyComponent - .replace('-', '_') - .toUpperCase()}${historyComponentName ? `&historyComponentName=${historyComponentName}` : ''}`, - ) - -export const prepareDeploymentTemplateData = (rawData): Record => { +const prepareDeploymentTemplateData = (rawData): Record => { const deploymentTemplateData = {} if (rawData.templateVersion) { deploymentTemplateData['templateVersion'] = { displayName: 'Chart Version', value: rawData.templateVersion } @@ -140,7 +120,7 @@ export const prepareDeploymentTemplateData = (rawData): Record => { +const preparePipelineConfigData = (rawData): Record => { const pipelineConfigData = {} if (rawData.pipelineTriggerType) { pipelineConfigData['pipelineTriggerType'] = { @@ -149,15 +129,28 @@ export const preparePipelineConfigData = (rawData): Record + + {selectedAtRuntime ? 'Selected at runtime' : 'Default Strategy'} + + {`${selectedAtRuntime ? '' : 'Last updated '}by ${updatedBy} at ${moment(updatedOn).format(DATE_TIME_FORMAT_STRING)}`} +
    + ), + } + : {}), } } return pipelineConfigData } -export const prepareConfigMapAndSecretData = ( +const prepareConfigMapAndSecretData = ( rawData, type: string, historyData: DeploymentHistoryDetail, @@ -277,24 +270,6 @@ export const prepareHistoryData = ( return historyData } -export const getDeploymentDiffSelector = ( - pipelineId: string, - historyComponent, - baseConfigurationId, - historyComponentName, -): Promise => { - const url = getUrlWithSearchParams( - `${ROUTES.RESOURCE_HISTORY_DEPLOYMENT}/${ROUTES.CONFIG_CD_PIPELINE}/${ResourceVersionType.v1}`, - { - baseConfigurationId, - historyComponent: historyComponent.replace('-', '_').toUpperCase(), - filterCriteria: `cd-pipeline|id|${pipelineId}`, - historyComponentName, - }, - ) - return get(url) -} - export const getTriggerHistory = async ({ appId, envId, diff --git a/src/Shared/Components/CICDHistory/types.tsx b/src/Shared/Components/CICDHistory/types.tsx index 280b5124e..6d1022550 100644 --- a/src/Shared/Components/CICDHistory/types.tsx +++ b/src/Shared/Components/CICDHistory/types.tsx @@ -27,6 +27,7 @@ import { PromotionApprovalMetadataType, ReleaseTag, ResponseType, + TooltipProps, UserApprovalMetadataType, useScrollable, } from '../../../Common' @@ -529,15 +530,12 @@ export interface DeploymentStatusDetailRowType extends Pick {(sortingConfig || scopeVariablesConfig) && ( -
    +
    {renderSortButton()} {renderScopeVariablesButton()}
    diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx index daee85390..322e96956 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx @@ -20,6 +20,7 @@ const DeploymentConfigDiffRadioSelect = ({ id: 'deployment-config', width: 300, position, + variant: 'overlay', }) const { triggerElementTitle, radioGroupConfig } = radioSelectConfig @@ -40,7 +41,7 @@ const DeploymentConfigDiffRadioSelect = ({ overlayProps={overlayProps} triggerProps={triggerProps} > -
    +
    Deployment with Configuration
    @@ -68,7 +69,7 @@ const DeploymentConfigDiffRadioSelect = ({
    {label} - {description} + {description}
    ))} diff --git a/src/Shared/Components/LoadingCard.tsx b/src/Shared/Components/LoadingCard.tsx index bd0b61480..701253722 100644 --- a/src/Shared/Components/LoadingCard.tsx +++ b/src/Shared/Components/LoadingCard.tsx @@ -5,7 +5,7 @@ interface LoadingCardType { const LoadingCard = ({ wider }: LoadingCardType) => (
    diff --git a/src/Shared/Components/Popover/types.ts b/src/Shared/Components/Popover/types.ts index 5b1fdaac8..71b8ad19b 100644 --- a/src/Shared/Components/Popover/types.ts +++ b/src/Shared/Components/Popover/types.ts @@ -52,6 +52,10 @@ export interface UsePopoverProps { * @param closePopover - A function to close the popover. */ onPopoverKeyDown?: (e: KeyboardEvent, openState: boolean, closePopover: () => void) => void + /** + * Variant of the popover (bg, shadow and styles changes based on variant) + */ + variant?: 'menu' | 'overlay' } /** diff --git a/src/Shared/Components/Popover/usePopover.hook.ts b/src/Shared/Components/Popover/usePopover.hook.ts index d95ff93b2..e02189cb5 100644 --- a/src/Shared/Components/Popover/usePopover.hook.ts +++ b/src/Shared/Components/Popover/usePopover.hook.ts @@ -13,6 +13,7 @@ export const usePopover = ({ position = 'bottom', alignment = 'start', width = 'auto', + variant = 'menu', onOpen, onPopoverKeyDown, onTriggerKeyDown, @@ -110,7 +111,7 @@ export const usePopover = ({ id, ref: popover, role: 'listbox', - className: `popover-content dc__position-abs bg__menu--primary shadow__menu border__primary br-6 dc__overflow-hidden ${isAutoWidth ? 'dc_width-max-content dc__mxw-250' : ''}`, + className: `popover-content dc__position-abs ${variant === 'menu' ? 'bg__menu--primary shadow__menu' : 'bg__overlay--primary shadow__overlay'} border__primary br-6 dc__overflow-hidden ${isAutoWidth ? 'dc_width-max-content dc__mxw-250' : ''}`, onKeyDown: handlePopoverKeyDown, style: { width: !isAutoWidth ? `${width}px` : undefined, diff --git a/src/Shared/Services/app.types.ts b/src/Shared/Services/app.types.ts index fa44b9418..a1dfb2e90 100644 --- a/src/Shared/Services/app.types.ts +++ b/src/Shared/Services/app.types.ts @@ -298,6 +298,9 @@ export interface PipelineConfigDataDTO { data: Record pipelineTriggerType: string Strategy: string + updatedBy: string + updatedOn: string + selectedAtRuntime: boolean } export interface AppEnvDeploymentConfigDTO { From c055c060cc08a47d89248bbedac7ee52b6ed56bb Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Tue, 3 Jun 2025 16:17:03 +0530 Subject: [PATCH 24/77] feat: remove tooltip content so that its diff is not calculated --- .../DeploymentConfigDiff.utils.tsx | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx index b57c4cbf4..525876b80 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx @@ -669,6 +669,23 @@ const getConfigDataWithResolvedDeploymentTemplate = ( } } +const removeTooltipContent = ( + valuesObj: Record, +): Record => { + if (!valuesObj) return valuesObj + return Object.fromEntries( + Object.entries(valuesObj).map(([key, val]) => { + if (val && typeof val === 'object' && 'tooltipContent' in val) { + // Remove tooltipContent so that diff is not checked in this property + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { tooltipContent, ...rest } = val + return [key, rest] + } + return [key, val] + }), + ) +} + /** * Generates a list of deployment configurations for application environments and identifies changes between the current and compare lists. * @@ -740,6 +757,17 @@ export const getAppEnvDeploymentConfigList = Date: Tue, 3 Jun 2025 16:54:20 +0530 Subject: [PATCH 25/77] feat: add typewriter in shared/components --- src/Assets/IconV2/ic-brain.svg | 3 +++ .../Components/Button/Button.component.tsx | 21 ++++++++++++++++--- src/Shared/Components/Button/types.ts | 3 ++- src/Shared/Components/Icon/Icon.tsx | 2 ++ .../Textarea/Textarea.component.tsx | 2 +- .../Components/Typewriter/BlinkingCursor.tsx | 15 +++++++++++++ .../Typewriter/Typewriter.component.tsx | 20 ++++++++++++++++++ src/Shared/Components/Typewriter/index.ts | 3 +++ .../Components/Typewriter/useTypewriter.ts | 20 ++++++++++++++++++ src/Shared/Components/index.ts | 1 + 10 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 src/Assets/IconV2/ic-brain.svg create mode 100644 src/Shared/Components/Typewriter/BlinkingCursor.tsx create mode 100644 src/Shared/Components/Typewriter/Typewriter.component.tsx create mode 100644 src/Shared/Components/Typewriter/index.ts create mode 100644 src/Shared/Components/Typewriter/useTypewriter.ts diff --git a/src/Assets/IconV2/ic-brain.svg b/src/Assets/IconV2/ic-brain.svg new file mode 100644 index 000000000..a5ff6cc35 --- /dev/null +++ b/src/Assets/IconV2/ic-brain.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Shared/Components/Button/Button.component.tsx b/src/Shared/Components/Button/Button.component.tsx index 525f96440..571ac5a50 100644 --- a/src/Shared/Components/Button/Button.component.tsx +++ b/src/Shared/Components/Button/Button.component.tsx @@ -34,6 +34,7 @@ const ButtonElement = ({ buttonProps, onClick, elementRef, + buttonRef, ...props }: PropsWithChildren< Omit< @@ -60,6 +61,20 @@ const ButtonElement = ({ // Added the specific class to ensure that the link override is applied const linkOrAnchorClassName = `${props.className} button__link ${props.disabled ? 'dc__disable-click' : ''}` + const refCallback = (el: HTMLButtonElement | HTMLAnchorElement) => { + if (!el) { + return + } + + // eslint-disable-next-line no-param-reassign + elementRef.current = el + + if (buttonRef && typeof buttonRef === 'object' && Object.hasOwn(buttonRef, 'current')) { + // eslint-disable-next-line no-param-reassign + buttonRef.current = el + } + } + if (component === ButtonComponentType.link) { return ( ['onClick']} - ref={elementRef as MutableRefObject} + ref={refCallback} /> ) } @@ -81,7 +96,7 @@ const ButtonElement = ({ {...props} className={linkOrAnchorClassName} onClick={onClick as ButtonProps['onClick']} - ref={elementRef as MutableRefObject} + ref={refCallback} > {props.children} @@ -95,7 +110,7 @@ const ButtonElement = ({ // eslint-disable-next-line react/button-has-type type={buttonProps?.type || 'button'} onClick={onClick as ButtonProps['onClick']} - ref={elementRef as MutableRefObject} + ref={refCallback} /> ) } diff --git a/src/Shared/Components/Button/types.ts b/src/Shared/Components/Button/types.ts index 5ed004be5..e4d532434 100644 --- a/src/Shared/Components/Button/types.ts +++ b/src/Shared/Components/Button/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactElement } from 'react' +import { AnchorHTMLAttributes, ButtonHTMLAttributes, MutableRefObject, ReactElement } from 'react' import { LinkProps } from 'react-router-dom' import { TooltipProps } from '@Common/Tooltip/types' @@ -141,6 +141,7 @@ export type ButtonProps } & ( | { /** diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index b581d561b..4c15f4fd0 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -18,6 +18,7 @@ import { ReactComponent as ICBgCluster } from '@IconsV2/ic-bg-cluster.svg' import { ReactComponent as ICBharatpe } from '@IconsV2/ic-bharatpe.svg' import { ReactComponent as ICBitbucket } from '@IconsV2/ic-bitbucket.svg' import { ReactComponent as ICBookOpen } from '@IconsV2/ic-book-open.svg' +import { ReactComponent as ICBrain } from '@IconsV2/ic-brain.svg' import { ReactComponent as ICBrowser } from '@IconsV2/ic-browser.svg' import { ReactComponent as ICBuildColor } from '@IconsV2/ic-build-color.svg' import { ReactComponent as ICCalendar } from '@IconsV2/ic-calendar.svg' @@ -183,6 +184,7 @@ export const iconMap = { 'ic-bharatpe': ICBharatpe, 'ic-bitbucket': ICBitbucket, 'ic-book-open': ICBookOpen, + 'ic-brain': ICBrain, 'ic-browser': ICBrowser, 'ic-build-color': ICBuildColor, 'ic-calendar': ICCalendar, diff --git a/src/Shared/Components/Textarea/Textarea.component.tsx b/src/Shared/Components/Textarea/Textarea.component.tsx index fb9f3271e..703b9b062 100644 --- a/src/Shared/Components/Textarea/Textarea.component.tsx +++ b/src/Shared/Components/Textarea/Textarea.component.tsx @@ -116,7 +116,7 @@ const Textarea = ({ const handleKeyDown: TextareaHTMLAttributes['onKeyDown'] = ( event: React.KeyboardEvent, ) => { - if (event.key === 'Enter' || event.key === 'Escape') { + if ((event.key === 'Enter' && !event.metaKey && !event.ctrlKey) || event.key === 'Escape') { event.stopPropagation() if (event.key === 'Escape') { diff --git a/src/Shared/Components/Typewriter/BlinkingCursor.tsx b/src/Shared/Components/Typewriter/BlinkingCursor.tsx new file mode 100644 index 000000000..fa49c4a11 --- /dev/null +++ b/src/Shared/Components/Typewriter/BlinkingCursor.tsx @@ -0,0 +1,15 @@ +import { motion } from 'framer-motion' + +export const BlinkingCursor = () => ( + +) diff --git a/src/Shared/Components/Typewriter/Typewriter.component.tsx b/src/Shared/Components/Typewriter/Typewriter.component.tsx new file mode 100644 index 000000000..95c8513d1 --- /dev/null +++ b/src/Shared/Components/Typewriter/Typewriter.component.tsx @@ -0,0 +1,20 @@ +import { motion } from 'framer-motion' + +import { BlinkingCursor } from './BlinkingCursor' +import { useTypewriter } from './useTypewriter' + +interface TypewriterProps { + text: string +} + +export const Typewriter = ({ text }: TypewriterProps) => { + const visibleText = useTypewriter(text) + + return ( + + {visibleText} + + + + ) +} diff --git a/src/Shared/Components/Typewriter/index.ts b/src/Shared/Components/Typewriter/index.ts new file mode 100644 index 000000000..74c5f637e --- /dev/null +++ b/src/Shared/Components/Typewriter/index.ts @@ -0,0 +1,3 @@ +export { BlinkingCursor } from './BlinkingCursor' +export { Typewriter } from './Typewriter.component' +export { useTypewriter } from './useTypewriter' diff --git a/src/Shared/Components/Typewriter/useTypewriter.ts b/src/Shared/Components/Typewriter/useTypewriter.ts new file mode 100644 index 000000000..82ece9afd --- /dev/null +++ b/src/Shared/Components/Typewriter/useTypewriter.ts @@ -0,0 +1,20 @@ +import { useEffect } from 'react' +import { animate, useMotionValue, useTransform } from 'framer-motion' + +export const useTypewriter = (text: string) => { + const progress = useMotionValue(0) + + const visibleText = useTransform(progress, (latest) => text.slice(0, Math.floor(latest))) + + useEffect(() => { + const controls = animate(progress, text.length, { + type: 'tween', + duration: 4, + ease: 'linear', + }) + + return controls.stop + }, [text]) + + return visibleText +} diff --git a/src/Shared/Components/index.ts b/src/Shared/Components/index.ts index 261d398c5..79ddd2439 100644 --- a/src/Shared/Components/index.ts +++ b/src/Shared/Components/index.ts @@ -95,6 +95,7 @@ export * from './TargetPlatforms' export * from './Textarea' export * from './ThemeSwitcher' export * from './ToggleResolveScopedVariables' +export * from './Typewriter' export * from './UnsavedChanges' export * from './UnsavedChangesDialog' export * from './UserIdentifier' From b79fafe127a1d3c14dbee9a891b264bf80b79add Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Tue, 3 Jun 2025 17:36:38 +0530 Subject: [PATCH 26/77] chore: use scrollable ref from hook --- .../DeploymentConfigDiff/DeploymentConfigDiffMain.tsx | 7 ++++--- .../DeploymentConfigDiffRadioSelect.tsx | 5 +++-- src/Shared/Components/Popover/types.ts | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx index 6a70521d6..99adad290 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx @@ -111,9 +111,10 @@ export const DeploymentConfigDiffMain = ({ if (configItem.type === 'radio-group') { return ( - - - + ) } diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx index 322e96956..6bf170e05 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.tsx @@ -16,7 +16,7 @@ const DeploymentConfigDiffRadioSelect = ({ radioSelectConfig: DeploymentConfigDiffRadioSelectConfig position?: UsePopoverProps['position'] }) => { - const { open, closePopover, overlayProps, popoverProps, triggerProps } = usePopover({ + const { open, closePopover, overlayProps, popoverProps, triggerProps, scrollableRef } = usePopover({ id: 'deployment-config', width: 300, position, @@ -41,7 +41,8 @@ const DeploymentConfigDiffRadioSelect = ({ overlayProps={overlayProps} triggerProps={triggerProps} > -
    + {/* TODO: Remove any after syncing with develop */} +
    Deployment with Configuration
    + ) } diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index 858b9933d..2c48cc646 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -21,12 +21,15 @@ import Tippy from '@tippyjs/react' import { ReactComponent as ICCaretDownSmall } from '@Icons/ic-caret-down-small.svg' import { ReactComponent as Close } from '@Icons/ic-close.svg' import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg' +import { ComponentSizeType } from '@Shared/constants' import { InstallationType } from '@Shared/types' import { getAlphabetIcon, TippyCustomized, TippyTheme } from '../../../Common' import { MAX_LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from '../../../Common/Constants' -import { useMainContext, useTheme, useUserEmail } from '../../Providers' +import { SidePanelTab, useMainContext, useTheme, useUserEmail } from '../../Providers' +import { Button, ButtonStyleType, ButtonVariantType } from '../Button' import GettingStartedCard from '../GettingStartedCard/GettingStarted' +import { Icon } from '../Icon' import { InfoIconTippy } from '../InfoIconTippy' import LogoutCard from '../LogoutCard' import { HelpButton } from './HelpButton' @@ -50,8 +53,14 @@ const PageHeader = ({ markAsBeta, tippyProps, }: PageHeaderType) => { - const { loginCount, setLoginCount, showGettingStartedCard, setShowGettingStartedCard, licenseData } = - useMainContext() + const { + loginCount, + setLoginCount, + showGettingStartedCard, + setShowGettingStartedCard, + licenseData, + setSidePanelConfig, + } = useMainContext() const { showSwitchThemeLocationTippy, handleShowSwitchThemeLocationTippyChange } = useTheme() const { isTippyCustomized, tippyRedirectLink, TippyIcon, tippyMessage, onClickTippyButton, additionalContent } = @@ -133,8 +142,21 @@ const PageHeader = ({
    ) + const onAskButtonClick = () => { + setSidePanelConfig(() => ({ state: SidePanelTab.ASK_DEVTRON })) + } + const renderLogoutHelpSection = () => ( <> +
    {hasPreviousDeploymentConfigNotFoundError && ( - )}
    diff --git a/src/Shared/Components/CMCS/helpers.tsx b/src/Shared/Components/CMCS/helpers.tsx index 5ae49ac39..1341e5a70 100644 --- a/src/Shared/Components/CMCS/helpers.tsx +++ b/src/Shared/Components/CMCS/helpers.tsx @@ -14,13 +14,11 @@ * limitations under the License. */ -import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg' -import { InfoColourBar } from '@Common/index' +import { InfoBlock } from '../InfoBlock' export const renderHashiOrAwsDeprecatedInfo = () => ( - Kubernetes External Secret (KES) has been deprecated and will be removed in the next Devtron @@ -37,7 +35,6 @@ export const renderHashiOrAwsDeprecatedInfo = () => (

    } - Icon={ICWarningY5} - iconSize={20} + variant="warning" /> ) From 05293654ffd40ad4bff4a0c7d7d95b2c6ff6b578 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Wed, 4 Jun 2025 11:47:16 +0530 Subject: [PATCH 29/77] feat: add SwitchThemeDialog --- .../SwitchThemeDialog.component.tsx | 226 ++++++++++++++++++ .../SwitchThemeDialog/SwitchThemeDialog.scss | 44 ++++ .../Components/SwitchThemeDialog/index.ts | 18 ++ .../Components/SwitchThemeDialog/types.ts | 58 +++++ src/Shared/Components/index.ts | 1 + 5 files changed, 347 insertions(+) create mode 100644 src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.component.tsx create mode 100644 src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.scss create mode 100644 src/Shared/Components/SwitchThemeDialog/index.ts create mode 100644 src/Shared/Components/SwitchThemeDialog/types.ts diff --git a/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.component.tsx b/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.component.tsx new file mode 100644 index 000000000..827486a71 --- /dev/null +++ b/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.component.tsx @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { useEffect, useState } from 'react' + +import { updateUserPreferences } from '@Shared/Hooks' +import { + AppThemeType, + getComponentSpecificThemeClass, + getThemePreferenceText, + THEME_PREFERENCE_STORAGE_KEY, + useTheme, +} from '@Shared/Providers' + +import { ConfirmationModal, ConfirmationModalVariantType } from '../ConfirmationModal' +import { Icon } from '../Icon' +import { + BaseLabelFigureProps, + SwitchThemeDialogProps, + ThemePreferenceLabelFigureProps, + ThemePreferenceOptionProps, +} from './types' + +import './SwitchThemeDialog.scss' + +const THEME_PREFERENCE_OPTION_MAP: Record = { + [AppThemeType.light]: null, + [AppThemeType.dark]: null, + auto: null, +} + +const THEME_PREFERENCE_OPTION_LIST: ThemePreferenceOptionProps['value'][] = Object.keys( + THEME_PREFERENCE_OPTION_MAP, +) as ThemePreferenceOptionProps['value'][] + +const BaseLabelFigure = ({ isSelected, value, noLeftRadius = false }: BaseLabelFigureProps) => ( +
    +
    + Aa +
    +
    +) + +const ThemePreferenceLabelFigure = ({ value, isSelected }: ThemePreferenceLabelFigureProps) => { + switch (value) { + case AppThemeType.light: + case AppThemeType.dark: + return + case 'auto': + return ( +
    +
    + +
    + +
    + +
    +
    + ) + default: + return null + } +} + +const ThemePreferenceOption = ({ + selectedThemePreference, + value, + handleChangedThemePreference, +}: ThemePreferenceOptionProps) => { + const handleChange = () => { + handleChangedThemePreference(value) + } + + const inputId = `theme-preference-option__input-${value}` + const isSelected = value === selectedThemePreference + + return ( +
    + + + +
    + ) +} + +const SwitchThemeDialog = ({ + initialThemePreference, + handleClose, + handleUpdateUserThemePreference, + disableAPICalls = false, +}: SwitchThemeDialogProps) => { + const { handleShowSwitchThemeLocationTippyChange, handleThemePreferenceChange, appTheme } = useTheme() + const [themePreference, setThemePreference] = useState( + !initialThemePreference ? 'auto' : initialThemePreference, + ) + const [isSaving, setIsSaving] = useState(false) + + const handleSuccess = (updatedThemePreference: typeof themePreference = themePreference) => { + handleShowSwitchThemeLocationTippyChange(!initialThemePreference) + handleUpdateUserThemePreference(updatedThemePreference) + handleThemePreferenceChange(updatedThemePreference) + handleClose() + } + + useEffect(() => { + // Watching every 10s local storage for theme preference, if present in localStorage and no initial theme preference is provided would close the modal + let interval: ReturnType | null = null + + if (!initialThemePreference) { + interval = setInterval(() => { + const currentThemePreference = localStorage.getItem( + THEME_PREFERENCE_STORAGE_KEY, + ) as typeof themePreference + + if (currentThemePreference) { + handleSuccess(currentThemePreference) + } + }, 10000) + } + + return () => { + clearInterval(interval) + } + }, []) + + const handleSaveThemePreference = async () => { + setIsSaving(true) + + if (!disableAPICalls) { + const isSuccessful = await updateUserPreferences({ + path: 'themePreference', + value: { themePreference, appTheme }, + }) + + if (isSuccessful) { + handleSuccess() + } + } else { + handleSuccess() + } + setIsSaving(false) + } + + const handleChangedThemePreference: ThemePreferenceOptionProps['handleChangedThemePreference'] = (value) => { + handleThemePreferenceChange(value, true) + setThemePreference(value) + } + + const handleCloseModal = () => { + handleThemePreferenceChange(initialThemePreference, true) + handleClose() + } + + return ( + } + buttonConfig={{ + primaryButtonConfig: { + isLoading: isSaving, + text: 'Save Preference', + onClick: handleSaveThemePreference, + disabled: !themePreference, + }, + }} + isLandscapeView + > +
    + {THEME_PREFERENCE_OPTION_LIST.map((value) => ( + + ))} +
    +
    + ) +} + +export default SwitchThemeDialog diff --git a/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.scss b/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.scss new file mode 100644 index 000000000..447882092 --- /dev/null +++ b/src/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.scss @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.theme-preference-option { + &__label-container { + transition: padding 0.2s; + } + + &__label-container--hover:hover { + padding: 2px; + } + + &__container { + grid-template-columns: 1fr 1fr 1fr; + } + + &__auto-figure { + grid-template-columns: repeat(12, 1fr); + grid-template-rows: 1fr; + + &--light { + grid-column: 1 / -1; + grid-row: 1 / -1; + } + + &--dark { + grid-column: 7 / -1; + grid-row: 1 / -1; + } + } +} \ No newline at end of file diff --git a/src/Shared/Components/SwitchThemeDialog/index.ts b/src/Shared/Components/SwitchThemeDialog/index.ts new file mode 100644 index 000000000..4e16ae885 --- /dev/null +++ b/src/Shared/Components/SwitchThemeDialog/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { default as SwitchThemeDialog } from './SwitchThemeDialog.component' +export * from './types' diff --git a/src/Shared/Components/SwitchThemeDialog/types.ts b/src/Shared/Components/SwitchThemeDialog/types.ts new file mode 100644 index 000000000..6e7881c2f --- /dev/null +++ b/src/Shared/Components/SwitchThemeDialog/types.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppThemeType, useTheme } from '@Shared/Providers' + +type ThemePreferenceType = ReturnType['themePreference'] + +export type SwitchThemeDialogProps = { + /** + * @description The initial theme preference of the user fetched from api, in case of error would be null + */ + initialThemePreference: ThemePreferenceType + handleUpdateUserThemePreference: (themePreference: ThemePreferenceType) => void + handleClose: () => void +} & ( + | { + /** + * @default false + * @description Required for storybook + */ + disableAPICalls?: false + } + | { + currentUserPreferences?: never + disableAPICalls: true + } +) + +export interface ThemePreferenceOptionProps { + selectedThemePreference: SwitchThemeDialogProps['initialThemePreference'] + value: SwitchThemeDialogProps['initialThemePreference'] + handleChangedThemePreference: (themePreference: SwitchThemeDialogProps['initialThemePreference']) => void +} + +export interface ThemePreferenceLabelFigureProps extends Pick { + isSelected: boolean +} + +export interface BaseLabelFigureProps extends Pick { + value: AppThemeType + /** + * @default false + */ + noLeftRadius?: boolean +} diff --git a/src/Shared/Components/index.ts b/src/Shared/Components/index.ts index a6252dbd6..fceeef3bd 100644 --- a/src/Shared/Components/index.ts +++ b/src/Shared/Components/index.ts @@ -89,6 +89,7 @@ export * from './ShowMoreText' export * from './SSOProviderIcon' export * from './StatusComponent' export * from './Switch' +export * from './SwitchThemeDialog' export * from './TabGroup' export * from './Table' export * from './TagsKeyValueTable' From 076bf4101b859441c851f50ad1685c499f834f24 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Wed, 4 Jun 2025 11:48:40 +0530 Subject: [PATCH 30/77] chore: update vite to version 5.4.19 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28f328095..e5c49a53e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -79,7 +79,7 @@ "sharp": "^0.33.5", "svgo": "^3.3.2", "typescript": "5.5.4", - "vite": "5.4.17", + "vite": "5.4.19", "vite-plugin-dts": "4.0.3", "vite-plugin-image-optimizer": "^1.1.8", "vite-plugin-lib-inject-css": "2.1.1", @@ -12025,9 +12025,9 @@ } }, "node_modules/vite": { - "version": "5.4.17", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.17.tgz", - "integrity": "sha512-5+VqZryDj4wgCs55o9Lp+p8GE78TLVg0lasCH5xFZ4jacZjtqZa6JUw9/p0WeAojaOfncSM6v77InkFPGnvPvg==", + "version": "5.4.19", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", + "integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==", "dev": true, "dependencies": { "esbuild": "^0.21.3", diff --git a/package.json b/package.json index c43aa93d8..e6a4a5551 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "sharp": "^0.33.5", "svgo": "^3.3.2", "typescript": "5.5.4", - "vite": "5.4.17", + "vite": "5.4.19", "vite-plugin-dts": "4.0.3", "vite-plugin-image-optimizer": "^1.1.8", "vite-plugin-lib-inject-css": "2.1.1", From eb845b64da2ac0bb2a8248a9058973d08e43b439 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Wed, 4 Jun 2025 11:54:59 +0530 Subject: [PATCH 31/77] chore: update version to 1.14.2-beta-1 and vite to 5.4.19 --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5c49a53e..566e087e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-3", + "version": "1.14.2-beta-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-3", + "version": "1.14.2-beta-1", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index e6a4a5551..47a644f5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2-pre-3", + "version": "1.14.2-beta-1", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", @@ -135,7 +135,7 @@ "react-dom": "^17.0.2" }, "vite-plugin-svgr": { - "vite": "5.4.17" + "vite": "5.4.19" }, "react-virtualized-sticky-tree": { "react": "^17.0.2", From 4e72dcf3b0b578c653752e87802fd51cc4405f60 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 4 Jun 2025 12:17:07 +0530 Subject: [PATCH 32/77] chore: info block removed from common --- src/Common/InfoColorBar/InfoColourbar.tsx | 138 --------------------- src/Common/InfoColorBar/infoColourBar.scss | 44 ------- src/Common/Types.ts | 51 -------- src/Common/index.ts | 1 - 4 files changed, 234 deletions(-) delete mode 100644 src/Common/InfoColorBar/InfoColourbar.tsx delete mode 100644 src/Common/InfoColorBar/infoColourBar.scss diff --git a/src/Common/InfoColorBar/InfoColourbar.tsx b/src/Common/InfoColorBar/InfoColourbar.tsx deleted file mode 100644 index 286e43793..000000000 --- a/src/Common/InfoColorBar/InfoColourbar.tsx +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Link } from 'react-router-dom' -import { InfoColourBarType } from '../Types' -import { Tooltip } from '@Common/Tooltip' -import { Button } from '@Shared/Components' -import './infoColourBar.scss' - -/** - * @deprecated Use InfoBlock instead - */ -const InfoColourBar = ({ - message, - classname, - Icon, - iconClass, - iconSize, - renderActionButton, - linkText, - redirectLink, - linkOnClick, - linkClass, - internalLink, - styles, - hideIcon = false, - textConfig, -}: InfoColourBarType) => { - const renderLink = () => { - if (!linkText) { - return null - } - if (redirectLink) { - if (internalLink) { - return ( - - {linkText} - - ) - } - - return ( - - {linkText} - - ) - } - - return ( - linkOnClick && ( -
    - {linkText} -
    - ) - ) - } - - const renderMessageWrapper = () => { - if (textConfig) { - const { heading, description, actionButtonConfig } = textConfig - - return ( -
    -
    - {heading &&
    {heading}
    } - - -

    {description}

    -
    -
    - - {actionButtonConfig && ( -
    - ) - } - - return ( -
    - {message} - {renderLink()} -
    - ) - } - - return ( -
    -
    -
    - {!hideIcon && ( -
    - -
    - )} - {renderMessageWrapper()} -
    - {typeof renderActionButton === 'function' && renderActionButton()} -
    -
    - ) -} - -export default InfoColourBar diff --git a/src/Common/InfoColorBar/infoColourBar.scss b/src/Common/InfoColorBar/infoColourBar.scss deleted file mode 100644 index 9065364cf..000000000 --- a/src/Common/InfoColorBar/infoColourBar.scss +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.info-bar-container { - .info_text .success { - background-color: var(--G100); - } - .warn { - background: var(--Y100); - border: solid var(--Y200); - - .warning-icon path:nth-child(2) { - fill: var(--Y700); - } - } - - .info_bar { - background-color: var(--B100); - border: 1px solid var(--B200); - } - - .error_bar { - background-color: var(--R100); - border: 1px solid var(--R200); - } - - .question-bar { - background-color: var(--V100); - border: 1px solid var(--V200); - } -} diff --git a/src/Common/Types.ts b/src/Common/Types.ts index 94c5a2ba2..0383a3686 100644 --- a/src/Common/Types.ts +++ b/src/Common/Types.ts @@ -25,7 +25,6 @@ import { Severity, PolicyBlockInfo, TargetPlatformItemDTO, - ButtonProps, ComponentLayoutType, StatusType, DocLinkProps, @@ -230,56 +229,6 @@ export enum ImageType { Medium = 'medium', SMALL = 'small', } - -interface InfoColourBarTextConfigType { - /** - * If given would be shown above the description, in bold - */ - heading?: string - /** - * If given would be shown below the heading (if given) - */ - description: string - actionButtonConfig?: ButtonProps -} - -type InfoColourBarMessageProp = - | { - message: ReactNode - linkText?: ReactNode - redirectLink?: string - linkOnClick?: () => void - linkClass?: string - internalLink?: boolean - - textConfig?: never - } - | { - textConfig: InfoColourBarTextConfigType - - message?: never - linkText?: never - redirectLink?: never - linkOnClick?: () => never - linkClass?: never - internalLink?: never - } - -export type InfoColourBarType = InfoColourBarMessageProp & { - classname: string - Icon - iconClass?: string - iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`). - renderActionButton?: () => JSX.Element - styles?: CSSProperties - /** - * If true, the icon is not shown - * - * @default false - */ - hideIcon?: boolean -} - export interface ReloadType { reload?: (event?: any) => void className?: string diff --git a/src/Common/index.ts b/src/Common/index.ts index dc619f806..fd132a3e6 100644 --- a/src/Common/index.ts +++ b/src/Common/index.ts @@ -41,7 +41,6 @@ export * from './Helper' export * from './Hooks' export * from './ImageTags' export * from './ImageTags.Types' -export { default as InfoColourBar } from './InfoColorBar/InfoColourbar' export * from './Markdown' export * from './Modals/Modal' export * from './Modals/VisibleModal' From 26e0c68ba2de1ce9ce6b0e00c933c7f8ca0c0728 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Wed, 4 Jun 2025 13:09:22 +0530 Subject: [PATCH 33/77] 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 d2db8046b..c7713aae4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2", + "version": "1.14.2-beta-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2", + "version": "1.14.2-beta-3", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 130def67b..22a62de3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.2", + "version": "1.14.2-beta-3", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 2f483bb7d6f8c175b981cf6774bbe96a6ee2bbc4 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Wed, 4 Jun 2025 17:50:54 +0530 Subject: [PATCH 34/77] fix: update version to 1.15.0-pre-0 in package.json and package-lock.json; refactor getThumbPosition return type to number --- package-lock.json | 4 ++-- package.json | 2 +- src/Shared/Components/Switch/utils.ts | 8 +------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e097b652..d3a490947 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0", + "version": "1.15.0-pre-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0", + "version": "1.15.0-pre-0", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 50b1a46a8..f7a27eea2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0", + "version": "1.15.0-pre-0", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Shared/Components/Switch/utils.ts b/src/Shared/Components/Switch/utils.ts index 37206de79..101532a83 100644 --- a/src/Shared/Components/Switch/utils.ts +++ b/src/Shared/Components/Switch/utils.ts @@ -87,13 +87,7 @@ export const getThumbPosition = ({ shape, indeterminate, isLoading, -}: Required>): - | 0 - | 12 - | 8 - | 5 - | 6 - | 4 => { +}: Required>): number => { if (isLoading) { return size === ComponentSizeType.medium && shape === 'rounded' ? 6 : 4 } From 6082644d594263984d376c57682639a9bf031c5e Mon Sep 17 00:00:00 2001 From: shivani170 Date: Wed, 4 Jun 2025 18:23:57 +0530 Subject: [PATCH 35/77] 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 d3a490947..a8270fab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-0", + "version": "1.15.0-pre-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-0", + "version": "1.15.0-pre-1", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index f7a27eea2..50e3e4d78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-0", + "version": "1.15.0-pre-1", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 6db0d5539a02f3e78ff6bdc679436a5ba1dd104c Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Wed, 4 Jun 2025 18:28:44 +0530 Subject: [PATCH 36/77] feat: uat changes --- src/Assets/IconV2/ic-stop-circle.svg | 4 +++ .../Components/Button/Button.component.tsx | 8 +++-- src/Shared/Components/Header/PageHeader.tsx | 2 +- src/Shared/Components/Icon/Icon.tsx | 2 ++ .../Textarea/Textarea.component.tsx | 33 +++++++++++++++---- src/Shared/Components/Textarea/types.ts | 18 +++++++++- src/Shared/Components/Textarea/utils.ts | 15 +++++++++ src/Shared/Providers/types.ts | 13 +++----- 8 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 src/Assets/IconV2/ic-stop-circle.svg create mode 100644 src/Shared/Components/Textarea/utils.ts diff --git a/src/Assets/IconV2/ic-stop-circle.svg b/src/Assets/IconV2/ic-stop-circle.svg new file mode 100644 index 000000000..32d741a85 --- /dev/null +++ b/src/Assets/IconV2/ic-stop-circle.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Shared/Components/Button/Button.component.tsx b/src/Shared/Components/Button/Button.component.tsx index 571ac5a50..8c0d4a6f8 100644 --- a/src/Shared/Components/Button/Button.component.tsx +++ b/src/Shared/Components/Button/Button.component.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { MutableRefObject, PropsWithChildren, useEffect, useRef, useState } from 'react' +import { MutableRefObject, PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react' import { Link } from 'react-router-dom' import { Progressing } from '@Common/Progressing' @@ -61,7 +61,9 @@ const ButtonElement = ({ // Added the specific class to ensure that the link override is applied const linkOrAnchorClassName = `${props.className} button__link ${props.disabled ? 'dc__disable-click' : ''}` - const refCallback = (el: HTMLButtonElement | HTMLAnchorElement) => { + // NOTE: If the ref callback is re-created every render (i.e., not wrapped in useCallback), + // it will be invoked on every render: first with null, then with the new node. + const refCallback = useCallback((el: HTMLButtonElement | HTMLAnchorElement) => { if (!el) { return } @@ -73,7 +75,7 @@ const ButtonElement = ({ // eslint-disable-next-line no-param-reassign buttonRef.current = el } - } + }, []) if (component === ButtonComponentType.link) { return ( diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index 2c48cc646..bc4277bd7 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -143,7 +143,7 @@ const PageHeader = ({ ) const onAskButtonClick = () => { - setSidePanelConfig(() => ({ state: SidePanelTab.ASK_DEVTRON })) + setSidePanelConfig((prev) => ({ ...prev, state: SidePanelTab.ASK_DEVTRON })) } const renderLogoutHelpSection = () => ( diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 4c15f4fd0..9ce327cbe 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -142,6 +142,7 @@ import { ReactComponent as ICSpinny } from '@IconsV2/ic-spinny.svg' import { ReactComponent as ICSprayCan } from '@IconsV2/ic-spray-can.svg' import { ReactComponent as ICStack } from '@IconsV2/ic-stack.svg' import { ReactComponent as ICStamp } from '@IconsV2/ic-stamp.svg' +import { ReactComponent as ICStopCircle } from '@IconsV2/ic-stop-circle.svg' import { ReactComponent as ICSuccess } from '@IconsV2/ic-success.svg' import { ReactComponent as ICSuspended } from '@IconsV2/ic-suspended.svg' import { ReactComponent as ICTata1mg } from '@IconsV2/ic-tata1mg.svg' @@ -308,6 +309,7 @@ export const iconMap = { 'ic-spray-can': ICSprayCan, 'ic-stack': ICStack, 'ic-stamp': ICStamp, + 'ic-stop-circle': ICStopCircle, 'ic-success': ICSuccess, 'ic-suspended': ICSuspended, 'ic-tata1mg': ICTata1mg, diff --git a/src/Shared/Components/Textarea/Textarea.component.tsx b/src/Shared/Components/Textarea/Textarea.component.tsx index 703b9b062..a50374557 100644 --- a/src/Shared/Components/Textarea/Textarea.component.tsx +++ b/src/Shared/Components/Textarea/Textarea.component.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { TextareaHTMLAttributes, useEffect, useRef, useState } from 'react' +import { TextareaHTMLAttributes, useCallback, useEffect, useRef, useState } from 'react' import { useThrottledEffect } from '@Common/Helper' import { @@ -25,16 +25,15 @@ import { import { deriveBorderRadiusAndBorderClassFromConfig } from '@Shared/Helpers' import { FormFieldWrapper, getFormFieldAriaAttributes } from '../FormFieldWrapper' -import { TEXTAREA_CONSTRAINTS } from './constants' import { TextareaProps } from './types' +import { getTextAreaConstraintsForSize } from './utils' import './textarea.scss' -const { MIN_HEIGHT, AUTO_EXPANSION_MAX_HEIGHT } = TEXTAREA_CONSTRAINTS - const Textarea = ({ name, label, + textareaRef: textareaRefProp, fullWidth, error, helperText, @@ -51,6 +50,8 @@ const Textarea = ({ hideFormFieldInfo, value, borderConfig, + disableResize, + newlineOnShiftEnter = false, ...props }: TextareaProps) => { const textareaRef = useRef(null) @@ -58,6 +59,8 @@ const Textarea = ({ // else, it behaves as controlled const [text, setText] = useState('') + const { MIN_HEIGHT, AUTO_EXPANSION_MAX_HEIGHT } = getTextAreaConstraintsForSize(size) + const updateRefsHeight = (height: number) => { const refElement = textareaRef.current if (refElement) { @@ -65,6 +68,19 @@ const Textarea = ({ } } + const refCallback = useCallback((node: HTMLTextAreaElement) => { + if (textareaRefProp) { + if (typeof textareaRefProp === 'function') { + textareaRefProp(node) + } else { + // eslint-disable-next-line no-param-reassign + textareaRefProp.current = node + } + } + + textareaRef.current = node + }, []) + const reInitHeight = () => { const currentHeight = parseInt(textareaRef.current.style.height, 10) let nextHeight = textareaRef.current.scrollHeight || 0 @@ -116,9 +132,13 @@ const Textarea = ({ const handleKeyDown: TextareaHTMLAttributes['onKeyDown'] = ( event: React.KeyboardEvent, ) => { - if ((event.key === 'Enter' && !event.metaKey && !event.ctrlKey) || event.key === 'Escape') { + if (event.key === 'Enter' || event.key === 'Escape') { event.stopPropagation() + if (newlineOnShiftEnter && event.key === 'Enter' && !event.shiftKey) { + event.preventDefault() + } + if (event.key === 'Escape') { textareaRef.current.blur() } @@ -163,11 +183,12 @@ const Textarea = ({ onBlur={handleBlur} onKeyDown={handleKeyDown} className={`${COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP[size]} ${COMPONENT_SIZE_TYPE_TO_INLINE_PADDING_MAP[size]} ${deriveBorderRadiusAndBorderClassFromConfig({ borderConfig, borderRadiusConfig })} w-100 dc__overflow-auto textarea`} - ref={textareaRef} + ref={refCallback} style={{ // No max height when user is expanding maxHeight: 'none', minHeight: MIN_HEIGHT, + resize: disableResize ? 'none' : 'vertical', }} /> diff --git a/src/Shared/Components/Textarea/types.ts b/src/Shared/Components/Textarea/types.ts index 4584dfdd6..2fb12cd87 100644 --- a/src/Shared/Components/Textarea/types.ts +++ b/src/Shared/Components/Textarea/types.ts @@ -35,9 +35,25 @@ export interface TextareaProps * * @default ComponentSizeType.large */ - size?: Extract + size?: Extract /** * Value of the textarea */ value: string + /** + * If true, the textarea resize is disabled + * + * @default false + */ + disableResize?: true + /** + * Allows inserting a newline with Shift + Enter instead of Enter alone. + * + * When enabled, pressing Enter submits the form, while Shift + Enter inserts a newline. + * Useful for forms where Enter should trigger submission, but multiline input is still needed. + * + * @default false + */ + newlineOnShiftEnter?: boolean + textareaRef?: React.MutableRefObject | React.RefCallback } diff --git a/src/Shared/Components/Textarea/utils.ts b/src/Shared/Components/Textarea/utils.ts new file mode 100644 index 000000000..a9cfe4699 --- /dev/null +++ b/src/Shared/Components/Textarea/utils.ts @@ -0,0 +1,15 @@ +import { ComponentSizeType } from '@Shared/constants' + +import { TEXTAREA_CONSTRAINTS } from './constants' +import { TextareaProps } from './types' + +export const getTextAreaConstraintsForSize = (size: TextareaProps['size']) => { + if (size === ComponentSizeType.small) { + return { + MIN_HEIGHT: 56, + AUTO_EXPANSION_MAX_HEIGHT: 150, + } + } + + return TEXTAREA_CONSTRAINTS +} diff --git a/src/Shared/Providers/types.ts b/src/Shared/Providers/types.ts index b6c7da906..ce9437cb7 100644 --- a/src/Shared/Providers/types.ts +++ b/src/Shared/Providers/types.ts @@ -35,15 +35,10 @@ export enum SidePanelTab { ASK_DEVTRON = 'ask-devtron', } -export type SidePanelConfig = - | { - state: SidePanelTab.DOCUMENTATION - docLink?: string | null - } - | { - state: SidePanelTab.ASK_DEVTRON | 'closed' - docLink?: never - } +export interface SidePanelConfig { + state: SidePanelTab | 'closed' + docLink?: string | null +} export interface MainContext { serverMode: SERVER_MODE From a35fdec549422d81704c97fd3f255b2dbccfe584 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 5 Jun 2025 12:48:54 +0530 Subject: [PATCH 37/77] chore: bump version to 1.15.0-pre-2 in package.json and package-lock.json --- 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 a8270fab0..f4a55f0f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-1", + "version": "1.15.0-pre-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-1", + "version": "1.15.0-pre-2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 50e3e4d78..c79b6c562 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-1", + "version": "1.15.0-pre-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 909b728960b7bf5fc4f7f8886d1d41e3090fef8c Mon Sep 17 00:00:00 2001 From: shivani170 Date: Thu, 5 Jun 2025 13:43:50 +0530 Subject: [PATCH 38/77] chore: add icon update --- src/Assets/IconV2/ic-add.svg | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Assets/IconV2/ic-add.svg b/src/Assets/IconV2/ic-add.svg index e64db2edf..a3571c580 100644 --- a/src/Assets/IconV2/ic-add.svg +++ b/src/Assets/IconV2/ic-add.svg @@ -1,19 +1,3 @@ - - - - + + From 748034e4134fc08f1a03c2231e543cc8cade02ad Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 5 Jun 2025 13:45:31 +0530 Subject: [PATCH 39/77] chore: bump version to 1.15.0-pre-3 in package.json and package-lock.json --- 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 ff7498685..298bc9861 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-2", + "version": "1.15.0-pre-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-2", + "version": "1.15.0-pre-3", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 152f1243e..9f243789b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-2", + "version": "1.15.0-pre-3", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 5804b70524de985dea93c6addc17161b9b1ae49e Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 5 Jun 2025 14:14:56 +0530 Subject: [PATCH 40/77] feat: delete confirmation dialog --- .eslintignore | 1 - src/Common/Dialogs/ConfirmationDialog.tsx | 54 ----------------------- src/Common/Dialogs/Types.ts | 18 +------- src/Common/Dialogs/index.ts | 1 - 4 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 src/Common/Dialogs/ConfirmationDialog.tsx diff --git a/.eslintignore b/.eslintignore index a74f285b7..0adc76113 100755 --- a/.eslintignore +++ b/.eslintignore @@ -21,7 +21,6 @@ src/Common/DebouncedSearch/DebouncedSearch.tsx src/Common/DebouncedSearch/Utils.ts src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx src/Common/DevtronProgressing/DevtronProgressing.tsx -src/Common/Dialogs/ConfirmationDialog.tsx src/Common/Dialogs/DialogForm.tsx src/Common/DraggableWrapper/DraggableButton.tsx src/Common/DraggableWrapper/DraggableWrapper.tsx diff --git a/src/Common/Dialogs/ConfirmationDialog.tsx b/src/Common/Dialogs/ConfirmationDialog.tsx deleted file mode 100644 index 9099e11b9..000000000 --- a/src/Common/Dialogs/ConfirmationDialog.tsx +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { stopPropagation } from '@Common/Helper' -import { VisibleModal2 } from '../Modals/VisibleModal2' -import { - ConfirmationDialogBodyType, - ConfirmationDialogButtonGroupType, - ConfirmationDialogIconType, - ConfirmationDialogType, -} from './Types' - -/** - * @deprecated use confirmation modal instead - */ -const ConfirmationDialog = ({ className = '', children, close }: ConfirmationDialogType) => ( - -
    {children}
    - -) - -const Icon = ({ src, className = '' }: ConfirmationDialogIconType) => ( - -) - -const Body = ({ title, subtitle = null, children = null }: ConfirmationDialogBodyType) => ( -
    -

    {title}

    - {subtitle &&
    {subtitle}
    } - {children} -
    -) - -const ButtonGroup = ({ children }: ConfirmationDialogButtonGroupType) => ( -
    {children}
    -) - -ConfirmationDialog.Icon = Icon -ConfirmationDialog.Body = Body -ConfirmationDialog.ButtonGroup = ButtonGroup -export default ConfirmationDialog diff --git a/src/Common/Dialogs/Types.ts b/src/Common/Dialogs/Types.ts index 088f0fc53..14270f4d5 100644 --- a/src/Common/Dialogs/Types.ts +++ b/src/Common/Dialogs/Types.ts @@ -53,23 +53,7 @@ export interface ForceDeleteDialogType { forceDeleteDialogTitle: string forceDeleteDialogMessage: string } -export interface ConfirmationDialogType { - className?: string - children: any - close?: (e) => void -} -export interface ConfirmationDialogIconType { - src: string - className?: string -} -export interface ConfirmationDialogBodyType { - title: string - subtitle?: ReactNode - children?: any -} -export interface ConfirmationDialogButtonGroupType { - children: any -} + export interface DialogFormProps { className: string title: string diff --git a/src/Common/Dialogs/index.ts b/src/Common/Dialogs/index.ts index 0bd30979d..dbd6587a0 100644 --- a/src/Common/Dialogs/index.ts +++ b/src/Common/Dialogs/index.ts @@ -14,5 +14,4 @@ * limitations under the License. */ -export { default as ConfirmationDialog } from './ConfirmationDialog' export * from './DialogForm' From 7b9840528990878b126413225d9a0c4e7e3b4502 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 5 Jun 2025 17:40:04 +0530 Subject: [PATCH 41/77] chore: add null check --- src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx b/src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx index 583de9898..3b0e52ba4 100644 --- a/src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx +++ b/src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx @@ -58,8 +58,7 @@ const ConfirmationModalBody = ({ const hideIcon = variant === ConfirmationModalVariantType.custom && !ButtonIcon const disablePrimaryButton: boolean = - ('disabled' in primaryButtonConfig && primaryButtonConfig.disabled) || - (confirmationKeyword && confirmationText.trim() !== confirmationKeyword) + !!primaryButtonConfig?.disabled || (confirmationKeyword && confirmationText.trim() !== confirmationKeyword) const handleTriggerPrimaryActionButton = () => { if (primaryButtonConfig && !disablePrimaryButton) { From b4032fcc57a39becd1c7804380d18f44ee1e135a Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Thu, 5 Jun 2025 18:55:09 +0530 Subject: [PATCH 42/77] 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 298bc9861..22064747a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-beta-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-beta-1", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 9f243789b..1be89736b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-beta-1", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From c8c91c16f00932a3eccdb39a3cda81adcfff1312 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 6 Jun 2025 10:41:39 +0530 Subject: [PATCH 43/77] feat: add devtron-ai icon --- src/Assets/IconV2/ic-devtron-ai.svg | 45 +++++++++++++++++++++++++++++ src/Shared/Components/Icon/Icon.tsx | 2 ++ 2 files changed, 47 insertions(+) create mode 100644 src/Assets/IconV2/ic-devtron-ai.svg diff --git a/src/Assets/IconV2/ic-devtron-ai.svg b/src/Assets/IconV2/ic-devtron-ai.svg new file mode 100644 index 000000000..fdb4e92d5 --- /dev/null +++ b/src/Assets/IconV2/ic-devtron-ai.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 9ce327cbe..f2f57dbd8 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -52,6 +52,7 @@ import { ReactComponent as ICDeleteDots } from '@IconsV2/ic-delete-dots.svg' import { ReactComponent as ICDeleteLightning } from '@IconsV2/ic-delete-lightning.svg' import { ReactComponent as ICDelhivery } from '@IconsV2/ic-delhivery.svg' import { ReactComponent as ICDevtron } from '@IconsV2/ic-devtron.svg' +import { ReactComponent as ICDevtronAi } from '@IconsV2/ic-devtron-ai.svg' import { ReactComponent as ICDevtronApp } from '@IconsV2/ic-devtron-app.svg' import { ReactComponent as ICDevtronHeaderLogo } from '@IconsV2/ic-devtron-header-logo.svg' import { ReactComponent as ICDevtronJob } from '@IconsV2/ic-devtron-job.svg' @@ -218,6 +219,7 @@ export const iconMap = { 'ic-delete-lightning': ICDeleteLightning, 'ic-delete': ICDelete, 'ic-delhivery': ICDelhivery, + 'ic-devtron-ai': ICDevtronAi, 'ic-devtron-app': ICDevtronApp, 'ic-devtron-header-logo': ICDevtronHeaderLogo, 'ic-devtron-job': ICDevtronJob, From acfab788b2ee9c5047eccc59d308020cc58eccf7 Mon Sep 17 00:00:00 2001 From: Arun Jain Date: Fri, 6 Jun 2025 11:19:56 +0530 Subject: [PATCH 44/77] 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 298bc9861..8a340c433 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-pre-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-pre-4", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 9f243789b..a573ffe5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-3", + "version": "1.15.0-pre-4", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 9eebbd5fd6374f42e49a2faee9099a2d6255428c Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 6 Jun 2025 13:04:23 +0530 Subject: [PATCH 45/77] chore: folder & minus icon added --- src/Assets/IconV2/ic-folder-color.svg | 6 ++++++ src/Assets/IconV2/ic-minus.svg | 5 +++++ src/Shared/Components/Icon/Icon.tsx | 4 ++++ src/Shared/Components/TabGroup/TabGroup.helpers.tsx | 7 ++----- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 src/Assets/IconV2/ic-folder-color.svg create mode 100644 src/Assets/IconV2/ic-minus.svg diff --git a/src/Assets/IconV2/ic-folder-color.svg b/src/Assets/IconV2/ic-folder-color.svg new file mode 100644 index 000000000..198f8b239 --- /dev/null +++ b/src/Assets/IconV2/ic-folder-color.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Assets/IconV2/ic-minus.svg b/src/Assets/IconV2/ic-minus.svg new file mode 100644 index 000000000..966a324ce --- /dev/null +++ b/src/Assets/IconV2/ic-minus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 939b6b4c3..c579dc910 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -77,6 +77,7 @@ import { ReactComponent as ICFiles } from '@IconsV2/ic-files.svg' import { ReactComponent as ICFilter } from '@IconsV2/ic-filter.svg' import { ReactComponent as ICFilterApplied } from '@IconsV2/ic-filter-applied.svg' import { ReactComponent as ICFlask } from '@IconsV2/ic-flask.svg' +import { ReactComponent as ICFolderColor } from '@IconsV2/ic-folder-color.svg' import { ReactComponent as ICFolderUser } from '@IconsV2/ic-folder-user.svg' import { ReactComponent as ICGear } from '@IconsV2/ic-gear.svg' import { ReactComponent as ICGift } from '@IconsV2/ic-gift.svg' @@ -123,6 +124,7 @@ import { ReactComponent as ICMegaphoneRight } from '@IconsV2/ic-megaphone-right. import { ReactComponent as ICMemory } from '@IconsV2/ic-memory.svg' import { ReactComponent as ICMicrosoft } from '@IconsV2/ic-microsoft.svg' import { ReactComponent as ICMinikube } from '@IconsV2/ic-minikube.svg' +import { ReactComponent as ICMinus } from '@IconsV2/ic-minus.svg' import { ReactComponent as ICMissing } from '@IconsV2/ic-missing.svg' import { ReactComponent as ICMobile } from '@IconsV2/ic-mobile.svg' import { ReactComponent as ICMonitoring } from '@IconsV2/ic-monitoring.svg' @@ -266,6 +268,7 @@ export const iconMap = { 'ic-filter-applied': ICFilterApplied, 'ic-filter': ICFilter, 'ic-flask': ICFlask, + 'ic-folder-color': ICFolderColor, 'ic-folder-user': ICFolderUser, 'ic-gear': ICGear, 'ic-gift-gradient': ICGiftGradient, @@ -312,6 +315,7 @@ export const iconMap = { 'ic-memory': ICMemory, 'ic-microsoft': ICMicrosoft, 'ic-minikube': ICMinikube, + 'ic-minus': ICMinus, 'ic-missing': ICMissing, 'ic-mobile': ICMobile, 'ic-monitoring': ICMonitoring, diff --git a/src/Shared/Components/TabGroup/TabGroup.helpers.tsx b/src/Shared/Components/TabGroup/TabGroup.helpers.tsx index 6be862718..390b8dd3d 100644 --- a/src/Shared/Components/TabGroup/TabGroup.helpers.tsx +++ b/src/Shared/Components/TabGroup/TabGroup.helpers.tsx @@ -14,9 +14,6 @@ * limitations under the License. */ -import { ReactComponent as ICErrorExclamation } from '@Icons/ic-error-exclamation.svg' -import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg' - import { Icon } from '../Icon' import { TabGroupProps, TabProps } from './TabGroup.types' import { TAB_ICON_SIZE_MAP } from './TabGroup.utils' @@ -32,10 +29,10 @@ export const getTabIcon = ({ }: Pick & Pick & { className: string }) => { if (showError) { - return + return } if (showWarning) { - return + return } if (typeof icon === 'string') { return From 151ce8b7a05827a7a202c0c4304fc19fa5677e45 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 6 Jun 2025 17:19:33 +0530 Subject: [PATCH 46/77] chore: hide ask devtorn intelligence if flag not present --- src/Shared/Components/Header/PageHeader.tsx | 20 +++++++++++--------- src/index.ts | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index bc4277bd7..a19bc9921 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -148,15 +148,17 @@ const PageHeader = ({ const renderLogoutHelpSection = () => ( <> - )} Date: Tue, 10 Jun 2025 11:14:48 +0530 Subject: [PATCH 51/77] fix: add lazy load for LoginBanner --- src/Shared/Components/LoginBanner/LoginBanner.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Shared/Components/LoginBanner/LoginBanner.tsx b/src/Shared/Components/LoginBanner/LoginBanner.tsx index c2981b6af..f0d9c0ab4 100644 --- a/src/Shared/Components/LoginBanner/LoginBanner.tsx +++ b/src/Shared/Components/LoginBanner/LoginBanner.tsx @@ -146,6 +146,7 @@ const LoginBanner = () => { style={{ maxHeight: '90%', }} + loading="lazy" />
    From 1db39a608dd21d52936d7469d1f5b17b43020b04 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 10 Jun 2025 11:16:01 +0530 Subject: [PATCH 52/77] chore: update package to 1.15.0-beta-6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a573ffe5f..4dbb51ee9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-4", + "version": "1.15.0-beta-6", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 67dc7c9aaedffe8d1b1b1f8ec33e08e03b68dfa0 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Tue, 10 Jun 2025 12:59:31 +0530 Subject: [PATCH 53/77] chore: version bump --- package-lock.json | 4 ++-- package.json | 2 +- src/Assets/IconV2/ic-add.svg | 6 +++--- src/Assets/IconV2/ic-minus.svg | 8 +++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 966c9cbf6..5d91cbffb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-4-beta-1", + "version": "1.15.0-beta-6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-4-beta-1", + "version": "1.15.0-beta-6", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 46aa0c4e6..4dbb51ee9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-pre-4-beta-1", + "version": "1.15.0-beta-6", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Assets/IconV2/ic-add.svg b/src/Assets/IconV2/ic-add.svg index a3571c580..52bbbdea8 100644 --- a/src/Assets/IconV2/ic-add.svg +++ b/src/Assets/IconV2/ic-add.svg @@ -1,3 +1,3 @@ - - - + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-minus.svg b/src/Assets/IconV2/ic-minus.svg index 966a324ce..c3e3d3831 100644 --- a/src/Assets/IconV2/ic-minus.svg +++ b/src/Assets/IconV2/ic-minus.svg @@ -1,5 +1,3 @@ - - - - - + + + \ No newline at end of file From d84f1c195f0d93d2ea6615e406b410eb753719f6 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Tue, 10 Jun 2025 13:01:43 +0530 Subject: [PATCH 54/77] 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 5d91cbffb..0a558508a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-beta-6", + "version": "1.15.0-beta-7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-beta-6", + "version": "1.15.0-beta-7", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 4dbb51ee9..ef94cc16e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.0-beta-6", + "version": "1.15.0-beta-7", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 51a828bec32af617dd100e2d8c721ec12674cae2 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Tue, 10 Jun 2025 13:51:45 +0530 Subject: [PATCH 55/77] fix: review comments --- .../DraggableWrapper/DraggableButton.tsx | 4 ++-- src/Common/DraggableWrapper/types.ts | 1 - .../Typewriter/Typewriter.component.tsx | 20 ------------------- src/Shared/Components/Typewriter/index.ts | 1 - 4 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 src/Shared/Components/Typewriter/Typewriter.component.tsx diff --git a/src/Common/DraggableWrapper/DraggableButton.tsx b/src/Common/DraggableWrapper/DraggableButton.tsx index cb949d618..48349887e 100644 --- a/src/Common/DraggableWrapper/DraggableButton.tsx +++ b/src/Common/DraggableWrapper/DraggableButton.tsx @@ -18,13 +18,13 @@ import React from 'react' import { ReactComponent as ICDrag } from '../../Assets/Icon/ic-drag.svg' import { DraggableButtonProps } from './types' -export default function DraggableButton({ dragClassName, svgClassName = 'fcn-6' }: DraggableButtonProps) { +export default function DraggableButton({ dragClassName }: DraggableButtonProps) { return ( ) } diff --git a/src/Common/DraggableWrapper/types.ts b/src/Common/DraggableWrapper/types.ts index ccbf3b320..91b9f5f82 100644 --- a/src/Common/DraggableWrapper/types.ts +++ b/src/Common/DraggableWrapper/types.ts @@ -49,5 +49,4 @@ export interface DraggableWrapperProps { */ export interface DraggableButtonProps { dragClassName: string - svgClassName?: string } diff --git a/src/Shared/Components/Typewriter/Typewriter.component.tsx b/src/Shared/Components/Typewriter/Typewriter.component.tsx deleted file mode 100644 index 95c8513d1..000000000 --- a/src/Shared/Components/Typewriter/Typewriter.component.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { motion } from 'framer-motion' - -import { BlinkingCursor } from './BlinkingCursor' -import { useTypewriter } from './useTypewriter' - -interface TypewriterProps { - text: string -} - -export const Typewriter = ({ text }: TypewriterProps) => { - const visibleText = useTypewriter(text) - - return ( - - {visibleText} - - - - ) -} diff --git a/src/Shared/Components/Typewriter/index.ts b/src/Shared/Components/Typewriter/index.ts index 74c5f637e..441759395 100644 --- a/src/Shared/Components/Typewriter/index.ts +++ b/src/Shared/Components/Typewriter/index.ts @@ -1,3 +1,2 @@ export { BlinkingCursor } from './BlinkingCursor' -export { Typewriter } from './Typewriter.component' export { useTypewriter } from './useTypewriter' From 9fbfea95d4d13f7e49f201b3fa170ddc014d1aa5 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Tue, 10 Jun 2025 14:08:24 +0530 Subject: [PATCH 56/77] fix: use forwardRef instead in Button Component --- .../Components/Button/Button.component.tsx | 359 +++++++++--------- src/Shared/Components/Button/types.ts | 3 +- 2 files changed, 184 insertions(+), 178 deletions(-) diff --git a/src/Shared/Components/Button/Button.component.tsx b/src/Shared/Components/Button/Button.component.tsx index 2ce4d1d59..23e7d9e33 100644 --- a/src/Shared/Components/Button/Button.component.tsx +++ b/src/Shared/Components/Button/Button.component.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { MutableRefObject, PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react' +import { forwardRef, MutableRefObject, PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react' import { Link } from 'react-router-dom' import { Progressing } from '@Common/Progressing' @@ -26,95 +26,96 @@ import { getButtonDerivedClass, getButtonIconClassName, getButtonLoaderSize } fr import './button.scss' -const ButtonElement = ({ - component = ButtonComponentType.button, - anchorProps, - linkProps, - buttonProps, - onClick, - elementRef, - buttonRef, - ...props -}: PropsWithChildren< - Omit< - ButtonProps, - | 'text' - | 'variant' - | 'size' - | 'style' - | 'startIcon' - | 'endIcon' - | 'showTooltip' - | 'tooltipProps' - | 'dataTestId' - | 'isLoading' - | 'ariaLabel' - | 'showAriaLabelInTippy' - > & { - className: string - 'data-testid': ButtonProps['dataTestId'] - 'aria-label': ButtonProps['ariaLabel'] - elementRef: MutableRefObject - } ->) => { - // Added the specific class to ensure that the link override is applied - const linkOrAnchorClassName = `${props.className} button__link ${props.disabled ? 'dc__disable-click' : ''}` - - // NOTE: If the ref callback is re-created every render (i.e., not wrapped in useCallback), - // it will be invoked on every render: first with null, then with the new node. - const refCallback = useCallback((el: HTMLButtonElement | HTMLAnchorElement) => { - if (!el) { - return +const ButtonElement = forwardRef< + HTMLButtonElement | HTMLAnchorElement, + PropsWithChildren< + Omit< + ButtonProps, + | 'text' + | 'variant' + | 'size' + | 'style' + | 'startIcon' + | 'endIcon' + | 'showTooltip' + | 'tooltipProps' + | 'dataTestId' + | 'isLoading' + | 'ariaLabel' + | 'showAriaLabelInTippy' + > & { + className: string + 'data-testid': ButtonProps['dataTestId'] + 'aria-label': ButtonProps['ariaLabel'] + elementRef: MutableRefObject } + > +>( + ( + { component = ButtonComponentType.button, anchorProps, linkProps, buttonProps, onClick, elementRef, ...props }, + forwardedRef, + ) => { + // Added the specific class to ensure that the link override is applied + const linkOrAnchorClassName = `${props.className} button__link ${props.disabled ? 'dc__disable-click' : ''}` - // eslint-disable-next-line no-param-reassign - elementRef.current = el + // NOTE: If the ref callback is re-created every render (i.e., not wrapped in useCallback), + // it will be invoked on every render: first with null, then with the new node. + const refCallback = useCallback((el: HTMLButtonElement | HTMLAnchorElement) => { + if (!el) { + return + } - if (buttonRef && typeof buttonRef === 'object' && Object.hasOwn(buttonRef, 'current')) { // eslint-disable-next-line no-param-reassign - buttonRef.current = el + elementRef.current = el + + if (forwardedRef && typeof forwardedRef === 'object' && Object.hasOwn(forwardedRef, 'current')) { + // eslint-disable-next-line no-param-reassign + forwardedRef.current = el + } else if (typeof forwardedRef === 'function') { + forwardedRef(el) + } + }, []) + + if (component === ButtonComponentType.link) { + return ( + ['onClick']} + ref={refCallback} + /> + ) } - }, []) - if (component === ButtonComponentType.link) { - return ( - ['onClick']} - ref={refCallback} - /> - ) - } + if (component === ButtonComponentType.anchor) { + return ( + ['onClick']} + ref={refCallback} + > + {props.children} + + ) + } - if (component === ButtonComponentType.anchor) { return ( - ['onClick']} ref={refCallback} - > - {props.children} - + /> ) - } - - return ( -
      -
    • - -
    • + - +
    {!isPageSizeFix && ( diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 3ce2f6ae2..fec40a217 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -28,7 +28,9 @@ import { ReactComponent as ICCancelled } from '@IconsV2/ic-cancelled.svg' import { ReactComponent as ICCardStack } from '@IconsV2/ic-card-stack.svg' import { ReactComponent as ICCaretDownSmall } from '@IconsV2/ic-caret-down-small.svg' import { ReactComponent as ICCaretLeft } from '@IconsV2/ic-caret-left.svg' +import { ReactComponent as ICCaretLeftSmall } from '@IconsV2/ic-caret-left-small.svg' import { ReactComponent as ICCaretRight } from '@IconsV2/ic-caret-right.svg' +import { ReactComponent as ICCaretRightSmall } from '@IconsV2/ic-caret-right-small.svg' import { ReactComponent as ICCd } from '@IconsV2/ic-cd.svg' import { ReactComponent as ICChatCircleDots } from '@IconsV2/ic-chat-circle-dots.svg' import { ReactComponent as ICChatCircleOnline } from '@IconsV2/ic-chat-circle-online.svg' @@ -227,7 +229,9 @@ export const iconMap = { 'ic-cancelled': ICCancelled, 'ic-card-stack': ICCardStack, 'ic-caret-down-small': ICCaretDownSmall, + 'ic-caret-left-small': ICCaretLeftSmall, 'ic-caret-left': ICCaretLeft, + 'ic-caret-right-small': ICCaretRightSmall, 'ic-caret-right': ICCaretRight, 'ic-cd': ICCd, 'ic-chat-circle-dots': ICChatCircleDots, From 9261c122dfa23e31ba5219185664b60a7b690dc1 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Thu, 12 Jun 2025 17:21:19 +0530 Subject: [PATCH 66/77] fix: add openai custom model for devtron --- src/Assets/IconV2/ic-openai.svg | 10 ++++++++++ src/Assets/IconV2/ic-sparkle-ai-color.svg | 13 ++++--------- src/Common/Constants.ts | 1 + src/Shared/Components/Header/HelpButton.tsx | 4 ++-- src/Shared/Components/Header/PageHeader.tsx | 20 +++++++++++--------- src/Shared/Components/Header/constants.ts | 10 +++++++++- src/Shared/Components/Header/types.ts | 1 + src/Shared/Components/Icon/Icon.tsx | 2 ++ 8 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 src/Assets/IconV2/ic-openai.svg diff --git a/src/Assets/IconV2/ic-openai.svg b/src/Assets/IconV2/ic-openai.svg new file mode 100644 index 000000000..685e4a394 --- /dev/null +++ b/src/Assets/IconV2/ic-openai.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-sparkle-ai-color.svg b/src/Assets/IconV2/ic-sparkle-ai-color.svg index be65b9a69..316cc9cbb 100644 --- a/src/Assets/IconV2/ic-sparkle-ai-color.svg +++ b/src/Assets/IconV2/ic-sparkle-ai-color.svg @@ -1,16 +1,11 @@ - - - - - + + + - + - - - \ No newline at end of file diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index e0de61a42..f130743e6 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -23,6 +23,7 @@ export const DOCUMENTATION_VERSION = '/devtron/v0.7' export const DISCORD_LINK = 'https://discord.devtron.ai/' export const DEFAULT_JSON_SCHEMA_URI = 'https://json-schema.org/draft/2020-12/schema' export const LICENSE_DASHBOARD_HOME_PAGE = 'https://license.devtron.ai/dashboard' +export const DEVTRON_GPT_LINK = 'https://chatgpt.com/g/g-6826efa4362c8191b23e7bfa0ac036db-devtron-expert' export const PATTERNS = { STRING: /^[a-zA-Z0-9_]+$/, diff --git a/src/Shared/Components/Header/HelpButton.tsx b/src/Shared/Components/Header/HelpButton.tsx index 2815642b6..aec6362f1 100644 --- a/src/Shared/Components/Header/HelpButton.tsx +++ b/src/Shared/Components/Header/HelpButton.tsx @@ -4,7 +4,7 @@ import { SliderButton } from '@typeform/embed-react' import { DOCUMENTATION_HOME_PAGE, URLS } from '@Common/Constants' import { ComponentSizeType } from '@Shared/constants' -import { useMainContext } from '@Shared/Providers' +import { SidePanelTab, useMainContext } from '@Shared/Providers' import { InstallationType } from '@Shared/types' import { ActionMenu } from '../ActionMenu' @@ -81,7 +81,7 @@ export const HelpButton = ({ serverInfo, fetchingServerInfo, onClick }: HelpButt e.preventDefault() setSidePanelConfig((prev) => ({ ...prev, - open: true, + state: SidePanelTab.DOCUMENTATION, docLink: DOCUMENTATION_HOME_PAGE, reinitialize: true, })) diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index 17bd34f69..d64da0930 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -22,7 +22,7 @@ import { ReactComponent as Close } from '@Icons/ic-close.svg' import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg' import { InstallationType } from '@Shared/types' -import { TippyCustomized, TippyTheme } from '../../../Common' +import { TippyCustomized, TippyTheme, Tooltip } from '../../../Common' import { MAX_LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from '../../../Common/Constants' import { SidePanelTab, useMainContext, useTheme, useUserEmail } from '../../Providers' import GettingStartedCard from '../GettingStartedCard/GettingStarted' @@ -139,14 +139,16 @@ const PageHeader = ({ const renderLogoutHelpSection = () => ( <> {window._env_?.FEATURE_ASK_DEVTRON_EXPERT && sidePanelConfig.state === 'closed' && ( - + + + )} diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 97968af7e..f009544b5 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -136,6 +136,7 @@ import { ReactComponent as ICNodeScript } from '@IconsV2/ic-node-script.svg' import { ReactComponent as ICOidc } from '@IconsV2/ic-oidc.svg' import { ReactComponent as ICOpenBox } from '@IconsV2/ic-open-box.svg' import { ReactComponent as ICOpenInNew } from '@IconsV2/ic-open-in-new.svg' +import { ReactComponent as ICOpenai } from '@IconsV2/ic-openai.svg' import { ReactComponent as ICOpenshift } from '@IconsV2/ic-openshift.svg' import { ReactComponent as ICOutOfSync } from '@IconsV2/ic-out-of-sync.svg' import { ReactComponent as ICPaperPlane } from '@IconsV2/ic-paper-plane.svg' @@ -332,6 +333,7 @@ export const iconMap = { 'ic-oidc': ICOidc, 'ic-open-box': ICOpenBox, 'ic-open-in-new': ICOpenInNew, + 'ic-openai': ICOpenai, 'ic-openshift': ICOpenshift, 'ic-out-of-sync': ICOutOfSync, 'ic-paper-plane-color': ICPaperPlaneColor, From 4a32871a387252a5a4c2e6c83095f95a41f56379 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 13 Jun 2025 09:11:44 +0530 Subject: [PATCH 67/77] chore: pagination fixes --- src/Common/Pagination/Pagination.tsx | 9 ++++++--- src/Shared/Components/DocLink/constants.ts | 3 +++ .../GenericInfoCard/GenericInfoCard.component.tsx | 4 ++-- .../HeaderWithCreateButton/HeaderWithCreateButon.tsx | 8 ++++++-- .../Components/Header/HeaderWithCreateButton/types.ts | 3 +++ 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Common/Pagination/Pagination.tsx b/src/Common/Pagination/Pagination.tsx index e0d299341..e57ea6bb7 100644 --- a/src/Common/Pagination/Pagination.tsx +++ b/src/Common/Pagination/Pagination.tsx @@ -17,6 +17,7 @@ import { useEffect, useState } from 'react' import { Button, ButtonVariantType, Icon } from '@Shared/Components' +import { ComponentSizeType } from '@Shared/constants' import PageSizeSelector from './PageSizeSelector' import { Page, PageValueItemProps, PaginationProps } from './types' @@ -90,15 +91,16 @@ const Pagination = ({ {offset + 1} - {lastPageNo} of {size}
    -
      +
      diff --git a/src/Shared/Components/DocLink/constants.ts b/src/Shared/Components/DocLink/constants.ts index f1a32de92..f868c2606 100644 --- a/src/Shared/Components/DocLink/constants.ts +++ b/src/Shared/Components/DocLink/constants.ts @@ -13,6 +13,7 @@ export const DOCUMENTATION = { APP_CREATE_WORKFLOW: 'usage/applications/creating-application/workflow', APP_DEPLOYMENT_TEMPLATE: 'usage/applications/creating-application/deployment-template', APP_EPHEMERAL_CONTAINER: 'usage/applications/app-details/ephemeral-containers', + APP_GROUP: 'usage/application-groups', APP_METRICS: 'usage/applications/app-details/app-metrics', APP_OVERVIEW_TAGS: 'usage/applications/overview#manage-tags', APP_ROLLOUT_DEPLOYMENT_TEMPLATE: 'usage/applications/creating-application/deployment-template/rollout-deployment', @@ -22,6 +23,7 @@ export const DOCUMENTATION = { BULK_UPDATE: 'usage/bulk-update', CHART_GROUP: 'usage/deploy-chart/chart-group', CHART_LIST: 'usage/deploy-chart/overview-of-charts', + CHART_STORE: 'usage/deploy-chart', CHART_STORE_METRICS_SERVER: 'dashboard//chart-store/discover?appStoreName=metrics-server', CUSTOM_VALUES: 'usage/deploy-chart/overview-of-charts#custom-values', DEPLOYMENT: 'usage/applications/creating-application/deployment-template/deployment', @@ -38,6 +40,7 @@ export const DOCUMENTATION = { KUBE_CONFIG: 'usage/resource-browser#running-kubectl-commands-locally', JOBS: 'usage/jobs', TAINT: 'usage/resource-browser#taint-a-node', + RESOURCE_BROWSER: 'usage/resource-browser', // Global Configurations GLOBAL_CONFIG_API_TOKEN: 'getting-started/global-configurations/authorization/api-tokens', diff --git a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx index ea373c5c1..44d78eaf5 100644 --- a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx +++ b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx @@ -17,9 +17,9 @@ import { cloneElement } from 'react' import { Link } from 'react-router-dom' -import { ReactComponent as ICCaretSmall } from '@Icons/ic-caret-left-small.svg' import { Tooltip } from '@Common/Tooltip' +import { Icon as InconComponent } from '../Icon' import { GenericInfoCardProps } from './types' import { getClassNameForBorderVariant } from './utils' @@ -76,7 +76,7 @@ const GenericInfoCard = ({
      - +
    diff --git a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx index 0b503f3d2..fa7470ac3 100644 --- a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx +++ b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx @@ -29,7 +29,7 @@ import PageHeader from '../PageHeader' import { HeaderWithCreateButtonProps } from './types' import { getCreateActionMenuOptions } from './utils' -export const HeaderWithCreateButton = ({ headerName }: HeaderWithCreateButtonProps) => { +export const HeaderWithCreateButton = ({ headerName, renderAdditionalHeaderInfo }: HeaderWithCreateButtonProps) => { // HOOKS const { serverMode } = useMainContext() const params = useParams<{ appType: string }>() @@ -64,7 +64,11 @@ export const HeaderWithCreateButton = ({ headerName }: HeaderWithCreateButtonPro return (
    - +
    ) } diff --git a/src/Shared/Components/Header/HeaderWithCreateButton/types.ts b/src/Shared/Components/Header/HeaderWithCreateButton/types.ts index 60a67ae7e..0f89bdd09 100644 --- a/src/Shared/Components/Header/HeaderWithCreateButton/types.ts +++ b/src/Shared/Components/Header/HeaderWithCreateButton/types.ts @@ -1,7 +1,10 @@ import { ActionMenuProps } from '@Shared/Components/ActionMenu' +import { PageHeaderType } from '../types' + export interface HeaderWithCreateButtonProps { headerName: string + renderAdditionalHeaderInfo: PageHeaderType['additionalHeaderInfo'] } export enum CreateActionMenuItems { From ee754cb8382b851392de268c98990f4f453e5c70 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 13 Jun 2025 13:44:10 +0530 Subject: [PATCH 68/77] feat: add progress bar --- .../ProgressBar/ProgressBar.component.tsx | 44 +++++++++++++++++++ src/Shared/Components/ProgressBar/index.tsx | 1 + src/Shared/Components/ProgressBar/types.ts | 9 ++++ src/Shared/Components/index.ts | 1 + 4 files changed, 55 insertions(+) create mode 100644 src/Shared/Components/ProgressBar/ProgressBar.component.tsx create mode 100644 src/Shared/Components/ProgressBar/index.tsx create mode 100644 src/Shared/Components/ProgressBar/types.ts diff --git a/src/Shared/Components/ProgressBar/ProgressBar.component.tsx b/src/Shared/Components/ProgressBar/ProgressBar.component.tsx new file mode 100644 index 000000000..7289bd466 --- /dev/null +++ b/src/Shared/Components/ProgressBar/ProgressBar.component.tsx @@ -0,0 +1,44 @@ +import { useEffect } from 'react' +import { AnimatePresence, motion, useMotionValue, useSpring, useTransform } from 'framer-motion' + +import { ProgressBarProps } from './types' + +export const ProgressBar = ({ isLoading, intervalTime = 50 }: ProgressBarProps) => { + const progress = useMotionValue(0) + const smoothProgress = useSpring(progress, { stiffness: 50, damping: 20 }) + + const width = useTransform(smoothProgress, (v) => `${v}%`) + + useEffect(() => { + let interval = null + + if (isLoading) { + interval = setInterval(() => { + const next = progress.get() + Math.random() * 5 + progress.set(next < 95 ? next : 95) + }, intervalTime) + } + + return () => clearInterval(interval) + }, [isLoading]) + + return ( + + {isLoading && ( + + + + )} + + ) +} diff --git a/src/Shared/Components/ProgressBar/index.tsx b/src/Shared/Components/ProgressBar/index.tsx new file mode 100644 index 000000000..6bd39f8f1 --- /dev/null +++ b/src/Shared/Components/ProgressBar/index.tsx @@ -0,0 +1 @@ +export * from './ProgressBar.component' diff --git a/src/Shared/Components/ProgressBar/types.ts b/src/Shared/Components/ProgressBar/types.ts new file mode 100644 index 000000000..aaa225413 --- /dev/null +++ b/src/Shared/Components/ProgressBar/types.ts @@ -0,0 +1,9 @@ +export interface ProgressBarProps { + isLoading: boolean + /** + * Interval in milliseconds for the progress bar simulation. + * + * @default 50 + */ + intervalTime?: number +} diff --git a/src/Shared/Components/index.ts b/src/Shared/Components/index.ts index fa263a080..5900c486b 100644 --- a/src/Shared/Components/index.ts +++ b/src/Shared/Components/index.ts @@ -79,6 +79,7 @@ export * from './ModalSidebarPanel' export * from './NumbersCount' export * from './PhoneInput' export * from './Plugin' +export * from './ProgressBar' export { default as QRCode } from './QRCode' export * from './ReactSelect' export * from './RegistryIcon' From 777390ec200bf31d1ffa7308a200abce934bf565 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 13 Jun 2025 14:12:21 +0530 Subject: [PATCH 69/77] feat: add ga for ask devtron button --- src/Shared/Components/Header/HelpButton.tsx | 1 + src/Shared/Components/Header/PageHeader.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Shared/Components/Header/HelpButton.tsx b/src/Shared/Components/Header/HelpButton.tsx index aec6362f1..24b5113bd 100644 --- a/src/Shared/Components/Header/HelpButton.tsx +++ b/src/Shared/Components/Header/HelpButton.tsx @@ -104,6 +104,7 @@ export const HelpButton = ({ serverInfo, fetchingServerInfo, onClick }: HelpButt case HelpMenuItems.VIEW_ALL_TICKETS: case HelpMenuItems.CHAT_WITH_SUPPORT: case HelpMenuItems.RAISE_ISSUE_REQUEST: + case HelpMenuItems.DEVTRON_GPT: handleAnalytics(item, e) break case HelpMenuItems.VIEW_DOCUMENTATION: diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index d64da0930..4b53f751f 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -133,6 +133,10 @@ const PageHeader = ({ ) const onAskButtonClick = () => { + ReactGA.event({ + category: 'AI', + action: `HELP_ASK_DEVTRON_AI`, + }) setSidePanelConfig((prev) => ({ ...prev, state: SidePanelTab.ASK_DEVTRON })) } From c33b68f1ca61918c1d847df6980f6ef805ae5ebf Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Fri, 13 Jun 2025 14:13:29 +0530 Subject: [PATCH 70/77] chore: bump version --- 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 767429662..fd0a7cf14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.1-pre-4", + "version": "1.15.1-pre-5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.1-pre-4", + "version": "1.15.1-pre-5", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index df494fe90..0dab9da36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.1-pre-4", + "version": "1.15.1-pre-5", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From eba65f743ac3b60c0328349dedcade710724c5f7 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 13 Jun 2025 16:02:30 +0530 Subject: [PATCH 71/77] Merge branch main from 'feat/fe-misc-clone' --- .../Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx | 4 ++-- src/Shared/Components/Header/HeaderWithCreateButton/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx index fa7470ac3..cdb738421 100644 --- a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx +++ b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx @@ -29,7 +29,7 @@ import PageHeader from '../PageHeader' import { HeaderWithCreateButtonProps } from './types' import { getCreateActionMenuOptions } from './utils' -export const HeaderWithCreateButton = ({ headerName, renderAdditionalHeaderInfo }: HeaderWithCreateButtonProps) => { +export const HeaderWithCreateButton = ({ headerName, additionalHeaderInfo }: HeaderWithCreateButtonProps) => { // HOOKS const { serverMode } = useMainContext() const params = useParams<{ appType: string }>() @@ -67,7 +67,7 @@ export const HeaderWithCreateButton = ({ headerName, renderAdditionalHeaderInfo
    ) diff --git a/src/Shared/Components/Header/HeaderWithCreateButton/types.ts b/src/Shared/Components/Header/HeaderWithCreateButton/types.ts index 0f89bdd09..5eb48a423 100644 --- a/src/Shared/Components/Header/HeaderWithCreateButton/types.ts +++ b/src/Shared/Components/Header/HeaderWithCreateButton/types.ts @@ -4,7 +4,7 @@ import { PageHeaderType } from '../types' export interface HeaderWithCreateButtonProps { headerName: string - renderAdditionalHeaderInfo: PageHeaderType['additionalHeaderInfo'] + additionalHeaderInfo: PageHeaderType['additionalHeaderInfo'] } export enum CreateActionMenuItems { From 373f5b2d4fae0dc49a10eb84dcfc5af733745e23 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 13 Jun 2025 17:17:06 +0530 Subject: [PATCH 72/77] chore: version bump --- package-lock.json | 4 ++-- package.json | 2 +- .../Components/GenericInfoCard/GenericInfoCard.component.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2aba488b..2e43bd67e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.2", + "version": "1.15.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.2", + "version": "1.15.3", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index fb5db48a5..63c114be4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.2", + "version": "1.15.3", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx index 44d78eaf5..aa8ec7302 100644 --- a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx +++ b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx @@ -19,7 +19,7 @@ import { Link } from 'react-router-dom' import { Tooltip } from '@Common/Tooltip' -import { Icon as InconComponent } from '../Icon' +import { Icon as IconComponent } from '../Icon' import { GenericInfoCardProps } from './types' import { getClassNameForBorderVariant } from './utils' @@ -76,7 +76,7 @@ const GenericInfoCard = ({
    - +
    From cfd8ccdb2e707f7d179b001e53e394c5561bff32 Mon Sep 17 00:00:00 2001 From: shivani170 Date: Fri, 13 Jun 2025 17:39:41 +0530 Subject: [PATCH 73/77] chore: icon left caret removed --- src/Assets/IconV2/ic-caret-left-small.svg | 3 --- src/Common/Pagination/Pagination.tsx | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 src/Assets/IconV2/ic-caret-left-small.svg diff --git a/src/Assets/IconV2/ic-caret-left-small.svg b/src/Assets/IconV2/ic-caret-left-small.svg deleted file mode 100644 index 0cb731540..000000000 --- a/src/Assets/IconV2/ic-caret-left-small.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Common/Pagination/Pagination.tsx b/src/Common/Pagination/Pagination.tsx index e57ea6bb7..0a5a9ae68 100644 --- a/src/Common/Pagination/Pagination.tsx +++ b/src/Common/Pagination/Pagination.tsx @@ -97,7 +97,7 @@ const Pagination = ({ onClick={selectPreviousPage} ariaLabel="Previous page" variant={ButtonVariantType.borderLess} - icon={} + icon={} dataTestId="pagination-prev-button-clicked" showAriaLabelInTippy={false} size={ComponentSizeType.xs} From f220845e33721c696e62ba8290419c956ef684ce Mon Sep 17 00:00:00 2001 From: shivani170 Date: Mon, 16 Jun 2025 11:46:57 +0530 Subject: [PATCH 74/77] chore: version bump --- src/Assets/IconV2/ic-caret-right-small.svg | 3 --- src/Common/Pagination/Pagination.tsx | 4 ++-- .../Components/GenericInfoCard/GenericInfoCard.component.tsx | 2 +- src/Shared/Components/Icon/Icon.tsx | 2 -- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 src/Assets/IconV2/ic-caret-right-small.svg diff --git a/src/Assets/IconV2/ic-caret-right-small.svg b/src/Assets/IconV2/ic-caret-right-small.svg deleted file mode 100644 index cd400b7eb..000000000 --- a/src/Assets/IconV2/ic-caret-right-small.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Common/Pagination/Pagination.tsx b/src/Common/Pagination/Pagination.tsx index 0a5a9ae68..6304f4eb3 100644 --- a/src/Common/Pagination/Pagination.tsx +++ b/src/Common/Pagination/Pagination.tsx @@ -97,7 +97,7 @@ const Pagination = ({ onClick={selectPreviousPage} ariaLabel="Previous page" variant={ButtonVariantType.borderLess} - icon={} + icon={} dataTestId="pagination-prev-button-clicked" showAriaLabelInTippy={false} size={ComponentSizeType.xs} @@ -117,7 +117,7 @@ const Pagination = ({ onClick={selectNextPage} ariaLabel="Next page" variant={ButtonVariantType.borderLess} - icon={} + icon={} dataTestId="pagination-prev-button-clicked" showAriaLabelInTippy={false} size={ComponentSizeType.xs} diff --git a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx index aa8ec7302..9ab61923a 100644 --- a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx +++ b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx @@ -76,7 +76,7 @@ const GenericInfoCard = ({
    - +
    diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 92fe6125d..56cd6901e 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -29,7 +29,6 @@ import { ReactComponent as ICCardStack } from '@IconsV2/ic-card-stack.svg' import { ReactComponent as ICCaretDownSmall } from '@IconsV2/ic-caret-down-small.svg' import { ReactComponent as ICCaretLeft } from '@IconsV2/ic-caret-left.svg' import { ReactComponent as ICCaretRight } from '@IconsV2/ic-caret-right.svg' -import { ReactComponent as ICCaretRightSmall } from '@IconsV2/ic-caret-right-small.svg' import { ReactComponent as ICCd } from '@IconsV2/ic-cd.svg' import { ReactComponent as ICChatCircleDots } from '@IconsV2/ic-chat-circle-dots.svg' import { ReactComponent as ICChatCircleOnline } from '@IconsV2/ic-chat-circle-online.svg' @@ -230,7 +229,6 @@ export const iconMap = { 'ic-card-stack': ICCardStack, 'ic-caret-down-small': ICCaretDownSmall, 'ic-caret-left': ICCaretLeft, - 'ic-caret-right-small': ICCaretRightSmall, 'ic-caret-right': ICCaretRight, 'ic-cd': ICCd, 'ic-chat-circle-dots': ICChatCircleDots, From b627614f8213a9a5734547f0de0bcea99adf5188 Mon Sep 17 00:00:00 2001 From: Amrit Kashyap Borah Date: Tue, 17 Jun 2025 17:32:13 +0530 Subject: [PATCH 75/77] feat: export useAnimationControls --- src/Shared/Components/FramerComponents/index.ts | 11 +++++++++-- .../Components/ProgressBar/ProgressBar.component.tsx | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Shared/Components/FramerComponents/index.ts b/src/Shared/Components/FramerComponents/index.ts index fe454ac71..611b99a4f 100644 --- a/src/Shared/Components/FramerComponents/index.ts +++ b/src/Shared/Components/FramerComponents/index.ts @@ -1,3 +1,10 @@ -import { animate, AnimatePresence, motion, useMotionTemplate, useMotionValue } from 'framer-motion' +import { + animate, + AnimatePresence, + motion, + useAnimationControls, + useMotionTemplate, + useMotionValue, +} from 'framer-motion' -export { animate, AnimatePresence, motion, useMotionTemplate, useMotionValue } +export { animate, AnimatePresence, motion, useAnimationControls, useMotionTemplate, useMotionValue } diff --git a/src/Shared/Components/ProgressBar/ProgressBar.component.tsx b/src/Shared/Components/ProgressBar/ProgressBar.component.tsx index 7289bd466..f6f6b4ee3 100644 --- a/src/Shared/Components/ProgressBar/ProgressBar.component.tsx +++ b/src/Shared/Components/ProgressBar/ProgressBar.component.tsx @@ -28,7 +28,7 @@ export const ProgressBar = ({ isLoading, intervalTime = 50 }: ProgressBarProps) Date: Tue, 17 Jun 2025 17:38:20 +0530 Subject: [PATCH 76/77] chore: bump version --- 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 2e43bd67e..dae5586cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3", + "version": "1.15.3-pre-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3", + "version": "1.15.3-pre-2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 63c114be4..99ce1cd50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3", + "version": "1.15.3-pre-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", From 37756ecab94aa3f7a1a09f3920001e43485a7b33 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Thu, 19 Jun 2025 15:40:48 +0530 Subject: [PATCH 77/77] chore(version): bump to 1.16.0 --- 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 dae5586cb..06ebf6472 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3-pre-2", + "version": "1.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3-pre-2", + "version": "1.16.0", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 99ce1cd50..ffa5ad287 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.15.3-pre-2", + "version": "1.16.0", "description": "Supporting common component library", "type": "module", "main": "dist/index.js",