Skip to content

Commit b2c7aa9

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/catalog-schema
2 parents d46368f + 454bf98 commit b2c7aa9

File tree

9 files changed

+49
-11
lines changed

9 files changed

+49
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.20.2-pre-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.20.3-pre-1",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
BreadcrumbStore,
2424
DevtronProgressing,
2525
ErrorScreenManager,
26+
setGlobalAPITimeout,
2627
showError,
2728
URLS as CommonURLS,
2829
useUserEmail,
@@ -147,6 +148,8 @@ const App = () => {
147148
setValidating(false)
148149
defaultRedirection()
149150
}
151+
152+
setGlobalAPITimeout(window._env_.GLOBAL_API_TIMEOUT)
150153
}, [])
151154

152155
const renderRoutesWithErrorBoundary = () =>

src/components/common/ClusterNotReachableDialog/ClusterNotReachableDialog.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import { ForceDeleteConfirmationModal } from '@devtron-labs/devtron-fe-common-li
1919
import { NON_CASCADE_DELETE_DIALOG_INTERNAL_MESSAGE } from '../../../config/constantMessaging'
2020
import { ClusterNotReachableDialogType } from './ClusterNotReachableDialog.type'
2121

22-
const ClusterNotReachableDialog = ({ clusterName, onClickCancel, onClickDelete }: ClusterNotReachableDialogType) => {
22+
const ClusterNotReachableDialog = ({
23+
clusterName,
24+
onClickCancel,
25+
onClickDelete,
26+
isDeleting,
27+
}: ClusterNotReachableDialogType) => {
2328
if (!clusterName) {
2429
return null
2530
}
@@ -34,6 +39,7 @@ const ClusterNotReachableDialog = ({ clusterName, onClickCancel, onClickDelete }
3439
</p>
3540
}
3641
onDelete={onClickDelete}
42+
isDeleting={isDeleting}
3743
closeConfirmationModal={onClickCancel}
3844
/>
3945
)

src/components/common/ClusterNotReachableDialog/ClusterNotReachableDialog.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export interface ClusterNotReachableDialogType {
1818
clusterName: string
1919
onClickCancel: () => void
2020
onClickDelete: () => void
21+
isDeleting?: boolean
2122
}

src/components/externalArgoApps/ExternalArgoAppDetail.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
DeploymentAppTypes,
2525
getIsRequestAborted,
2626
abortPreviousRequests,
27+
API_STATUS_CODES,
2728
} from '@devtron-labs/devtron-fe-common-lib'
2829
import { getArgoAppDetail } from '../external-apps/ExternalAppService'
2930
import { checkIfToRefetchData, deleteRefetchDataFromUrl } from '../util/URLUtil'
@@ -41,6 +42,8 @@ const ExternalArgoAppDetail = ({ appName, clusterId, isExternalApp, namespace }:
4142
const [isReloadResourceTreeInProgress, setIsReloadResourceTreeInProgress] = useState(false)
4243
const [errorResponseCode, setErrorResponseCode] = useState(undefined)
4344

45+
const handledFirstCall = useRef(false)
46+
4447
let isAPICallInProgress = false
4548

4649
const abortControllerRef = useRef<AbortController>(new AbortController())
@@ -114,7 +117,11 @@ const ExternalArgoAppDetail = ({ appName, clusterId, isExternalApp, namespace }:
114117
.catch((errors: ServerErrors) => {
115118
if (!getIsRequestAborted(errors)) {
116119
showError(errors)
117-
setErrorResponseCode(errors.code)
120+
121+
if (!handledFirstCall.current || errors.code === API_STATUS_CODES.NOT_FOUND) {
122+
setErrorResponseCode(errors.code)
123+
}
124+
118125
isAPICallInProgress = false
119126
handleInitiatePolling()
120127
}
@@ -123,6 +130,7 @@ const ExternalArgoAppDetail = ({ appName, clusterId, isExternalApp, namespace }:
123130
setIsLoading(false)
124131
isAPICallInProgress = false
125132
setIsReloadResourceTreeInProgress(false)
133+
handledFirstCall.current = true
126134
})
127135
}
128136

src/components/v2/appDetails/ea/EAAppDetail.component.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
DeploymentAppTypes,
2525
getIsRequestAborted,
2626
abortPreviousRequests,
27+
API_STATUS_CODES,
2728
} from '@devtron-labs/devtron-fe-common-lib'
2829
import moment from 'moment'
2930
import { sortOptionsByValue } from '../../../common'
@@ -54,6 +55,7 @@ const ExternalAppDetail = ({ appId, appName, isExternalApp }) => {
5455
const [isReloadResourceTreeInProgress, setIsReloadResourceTreeInProgress] = useState(false)
5556

5657
const abortControllerRef = useRef<AbortController>(new AbortController())
58+
const handledFirstCall = useRef(false)
5759

5860
let isAPICallInProgress = false
5961

@@ -189,12 +191,15 @@ const ExternalAppDetail = ({ appId, appName, isExternalApp }) => {
189191

190192
if (!getIsRequestAborted(errors)) {
191193
showError(errors)
192-
setErrorResponseCode(errors.code)
194+
if (!handledFirstCall.current || errors.code === API_STATUS_CODES.NOT_FOUND) {
195+
setErrorResponseCode(errors.code)
196+
}
193197
handleInitiatePolling()
194198
}
195199
})
196200
.finally(() => {
197201
setIsReloadResourceTreeInProgress(false)
202+
handledFirstCall.current = true
198203
})
199204
}
200205

src/components/v2/appDetails/sourceInfo/EnvironmentSelector.component.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ const EnvironmentSelectorComponent = ({
7676
const [forceDeleteDialogMessage, setForceDeleteDialogMessage] = useState<string>('')
7777
const [nonCascadeDeleteDialog, showNonCascadeDeleteDialog] = useState<boolean>(false)
7878
const [clusterName, setClusterName] = useState<string>('')
79+
const [isDeleteLoading, setIsDeleteLoading] = useState<boolean>(false)
80+
7981
const isGitops = appDetails?.deploymentAppType === DeploymentAppTypes.ARGO
8082
const isExternalArgo = appDetails.appType === AppType.EXTERNAL_ARGO_APP
8183
const isExternalFlux = appDetails.appType === AppType.EXTERNAL_FLUX_APP
@@ -150,6 +152,7 @@ const EnvironmentSelectorComponent = ({
150152

151153
async function deleteResourceAction(deleteAction: DELETE_ACTION) {
152154
try {
155+
setIsDeleteLoading(true)
153156
const response = await getDeleteApplicationApi(deleteAction)
154157
if (response.result.deleteResponse?.deleteInitiated || (isExternalApp && response.result?.success)) {
155158
setShowDeleteConfirmation(false)
@@ -179,6 +182,8 @@ const EnvironmentSelectorComponent = ({
179182
showForceDeleteDialog(true)
180183
}
181184
showError(error)
185+
} finally {
186+
setIsDeleteLoading(false)
182187
}
183188
}
184189

@@ -376,6 +381,7 @@ const EnvironmentSelectorComponent = ({
376381
handleDelete={handleDelete}
377382
toggleConfirmation={setShowDeleteConfirmation}
378383
isCreateValueView={false}
384+
disableButton={isDeleteLoading}
379385
/>
380386
)}
381387
</div>
@@ -387,6 +393,7 @@ const EnvironmentSelectorComponent = ({
387393
subtitle={forceDeleteDialogMessage}
388394
onDelete={handleForceDelete}
389395
closeConfirmationModal={closeForceConfirmationModal}
396+
isDeleting={isDeleteLoading}
390397
/>
391398
)}
392399

@@ -395,6 +402,7 @@ const EnvironmentSelectorComponent = ({
395402
clusterName={clusterName}
396403
onClickCancel={onClickHideNonCascadeDeletePopup}
397404
onClickDelete={onClickNonCascadeDelete}
405+
isDeleting={isDeleteLoading}
398406
/>
399407
)}
400408
</div>

src/components/v2/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Redirect, Route, Switch, useHistory, useLocation, useParams, useRouteMa
1919

2020
import {
2121
abortPreviousRequests,
22+
API_STATUS_CODES,
2223
DetailsProgressing,
2324
ErrorScreenManager,
2425
getIsRequestAborted,
@@ -64,6 +65,7 @@ const RouterComponent = () => {
6465
const [isReloadResourceTreeInProgress, setIsReloadResourceTreeInProgress] = useState(false)
6566
const appDetailsRef = useRef({} as AppDetails)
6667
const isVirtualRef = useRef(false)
68+
const handledFirstCall = useRef(false)
6769

6870
useEffect(() => {
6971
IndexStore.setEnvDetails(EnvType.CHART, +params.appId, +params.envId)
@@ -126,8 +128,11 @@ const RouterComponent = () => {
126128
return
127129
}
128130

129-
setErrorResponseCode(e.code)
130-
if (e.code === 404 && initTimer) {
131+
if (!handledFirstCall.current || e.code === API_STATUS_CODES.NOT_FOUND) {
132+
setErrorResponseCode(e.code)
133+
}
134+
135+
if (e.code === API_STATUS_CODES.NOT_FOUND && initTimer) {
131136
clearTimeout(initTimer)
132137
}
133138
}
@@ -204,6 +209,8 @@ const RouterComponent = () => {
204209
if (!isAborted) {
205210
handleInitiatePolling()
206211
}
212+
}).finally(() => {
213+
handledFirstCall.current = true
207214
})
208215
}
209216

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,9 +1722,9 @@ __metadata:
17221722
languageName: node
17231723
linkType: hard
17241724

1725-
"@devtron-labs/devtron-fe-common-lib@npm:1.20.2-pre-1":
1726-
version: 1.20.2-pre-1
1727-
resolution: "@devtron-labs/devtron-fe-common-lib@npm:1.20.2-pre-1"
1725+
"@devtron-labs/devtron-fe-common-lib@npm:1.20.3-pre-1":
1726+
version: 1.20.3-pre-1
1727+
resolution: "@devtron-labs/devtron-fe-common-lib@npm:1.20.3-pre-1"
17281728
dependencies:
17291729
"@codemirror/autocomplete": "npm:6.18.6"
17301730
"@codemirror/lang-json": "npm:6.0.1"
@@ -1775,7 +1775,7 @@ __metadata:
17751775
react-select: 5.8.0
17761776
rxjs: ^7.8.1
17771777
yaml: ^2.4.1
1778-
checksum: 10c0/92f267d988304ee901da89edf9f589667ca40f0bdeda44df78c97079aaf017ca5c6bcf9f9d3c7cb4dd26c9805e94519e94db30e560bf3f86ea32b5d465170ba3
1778+
checksum: 10c0/9a27418453f61b8df4786feb9456104481594156e3d3cde56910e8068abe30613b523378722df8977352e70a935af658c404f48572f4ad011f981b8e987c9142
17791779
languageName: node
17801780
linkType: hard
17811781

@@ -5738,7 +5738,7 @@ __metadata:
57385738
version: 0.0.0-use.local
57395739
resolution: "dashboard@workspace:."
57405740
dependencies:
5741-
"@devtron-labs/devtron-fe-common-lib": "npm:1.20.2-pre-1"
5741+
"@devtron-labs/devtron-fe-common-lib": "npm:1.20.3-pre-1"
57425742
"@esbuild-plugins/node-globals-polyfill": "npm:0.2.3"
57435743
"@playwright/test": "npm:^1.32.1"
57445744
"@rjsf/core": "npm:^5.13.3"

0 commit comments

Comments
 (0)