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", 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 {