Skip to content

Commit e2ce781

Browse files
Merge pull request #902 from devtron-labs/fix/helm-app-delete
feat: add global API timeout setting and enhance force delete confirmation modal
2 parents 0ab9850 + fc1e014 commit e2ce781

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.20.2",
3+
"version": "1.20.3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/API/CoreAPI.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ class CoreAPI {
278278

279279
trash = <T = any, K = object>(url: string, data?: K, options?: APIOptions): Promise<ResponseType<T>> =>
280280
this.fetchInTime<K>({ url, type: 'DELETE', data, options })
281+
282+
setGlobalAPITimeout = (timeout: number) => {
283+
this.timeout = timeout || FALLBACK_REQUEST_TIMEOUT
284+
}
281285
}
282286

283287
export default CoreAPI

src/Common/API/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const dashboardAPI = new CoreAPI({
2323
handleRedirectToLicenseActivation,
2424
})
2525

26-
export const { post, put, patch, get, trash } = dashboardAPI
26+
export const { post, put, patch, get, trash, setGlobalAPITimeout } = dashboardAPI
2727
export { default as CoreAPI } from './CoreAPI'
2828
export { QueryClientProvider } from './QueryClientProvider'
2929
export * from './reactQueryHooks'

src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const ForceDeleteConfirmationModal = ({
2323
subtitle,
2424
onDelete,
2525
closeConfirmationModal,
26+
isDeleting,
2627
}: ForceDeleteConfirmationProps) => {
2728
const renderSubtitle = () => (
2829
<>
@@ -43,6 +44,7 @@ export const ForceDeleteConfirmationModal = ({
4344
primaryButtonConfig: {
4445
text: 'Force Delete',
4546
onClick: onDelete,
47+
isLoading: isDeleting,
4648
},
4749
}}
4850
handleClose={closeConfirmationModal}

src/Shared/Components/ConfirmationModal/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export interface CannotDeleteModalProps
187187
* and `ConfirmationModalProps` to configure the force delete confirmation modal.
188188
*/
189189
export interface ForceDeleteConfirmationProps
190-
extends Partial<Pick<DeleteConfirmationModalProps, 'onDelete' | 'closeConfirmationModal'>>,
190+
extends Partial<Pick<DeleteConfirmationModalProps, 'onDelete' | 'closeConfirmationModal' | 'isDeleting'>>,
191191
Partial<Pick<ConfirmationModalProps, 'title' | 'subtitle'>> {}
192192

193193
export interface ConfirmationModalContextType {

0 commit comments

Comments
 (0)