From 505e9b012caea40014bb798f12626b43f71edbba Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Thu, 18 Sep 2025 17:14:29 +0530 Subject: [PATCH 1/2] feat: add global API timeout setting and enhance force delete confirmation modal --- src/Common/API/CoreAPI.ts | 4 ++++ src/Common/API/index.ts | 2 +- .../ConfirmationModal/ForceDeleteConfirmationModal.tsx | 2 ++ src/Shared/Components/ConfirmationModal/types.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Common/API/CoreAPI.ts b/src/Common/API/CoreAPI.ts index a7163f452..2e71cdb35 100644 --- a/src/Common/API/CoreAPI.ts +++ b/src/Common/API/CoreAPI.ts @@ -278,6 +278,10 @@ class CoreAPI { trash = (url: string, data?: K, options?: APIOptions): Promise> => this.fetchInTime({ url, type: 'DELETE', data, options }) + + setGlobalAPITimeout = (timeout: number) => { + this.timeout = timeout || FALLBACK_REQUEST_TIMEOUT + } } export default CoreAPI diff --git a/src/Common/API/index.ts b/src/Common/API/index.ts index 64da8b73f..ac7465169 100644 --- a/src/Common/API/index.ts +++ b/src/Common/API/index.ts @@ -23,7 +23,7 @@ const dashboardAPI = new CoreAPI({ handleRedirectToLicenseActivation, }) -export const { post, put, patch, get, trash } = dashboardAPI +export const { post, put, patch, get, trash, setGlobalAPITimeout } = dashboardAPI export { default as CoreAPI } from './CoreAPI' export { QueryClientProvider } from './QueryClientProvider' export * from './reactQueryHooks' diff --git a/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx b/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx index 439672137..9dbeed849 100644 --- a/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx +++ b/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx @@ -23,6 +23,7 @@ export const ForceDeleteConfirmationModal = ({ subtitle, onDelete, closeConfirmationModal, + isDeleting, }: ForceDeleteConfirmationProps) => { const renderSubtitle = () => ( <> @@ -43,6 +44,7 @@ export const ForceDeleteConfirmationModal = ({ primaryButtonConfig: { text: 'Force Delete', onClick: onDelete, + isLoading: isDeleting, }, }} handleClose={closeConfirmationModal} diff --git a/src/Shared/Components/ConfirmationModal/types.ts b/src/Shared/Components/ConfirmationModal/types.ts index 091543f3a..805868b64 100644 --- a/src/Shared/Components/ConfirmationModal/types.ts +++ b/src/Shared/Components/ConfirmationModal/types.ts @@ -187,7 +187,7 @@ export interface CannotDeleteModalProps * and `ConfirmationModalProps` to configure the force delete confirmation modal. */ export interface ForceDeleteConfirmationProps - extends Partial>, + extends Partial>, Partial> {} export interface ConfirmationModalContextType { From fc1e014fcb5e52306287f116b3ad32ea3090e8b1 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Fri, 19 Sep 2025 18:03:03 +0530 Subject: [PATCH 2/2] chore: bump version to 1.20.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 7e78a47b7..14337481b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.2", + "version": "1.20.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.2", + "version": "1.20.3", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 9c82b80b3..376b0077b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.20.2", + "version": "1.20.3", "description": "Supporting common component library", "type": "module", "main": "dist/index.js",