Skip to content

Commit 7d77271

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/dashboard into refactor/remove-monaco
2 parents 1d87895 + 17cc22c commit 7d77271

File tree

91 files changed

+1709
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1709
-1239
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ src/components/ApplicationGroup/SearchBar.tsx
3636
src/components/CIPipelineN/AdvancedConfigOptions.tsx
3737
src/components/CIPipelineN/Build.tsx
3838
src/components/CIPipelineN/CIPipeline.tsx
39-
src/components/CIPipelineN/ConditionContainer.tsx
4039
src/components/CIPipelineN/CustomImageTags.tsx
4140
src/components/CIPipelineN/CustomInputOutputVariables.tsx
4241
src/components/CIPipelineN/CustomInputVariableSelect.tsx

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.12.0-pre-0",
7+
"@devtron-labs/devtron-fe-common-lib": "1.12.0-pre-3",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useEffect, useState } from 'react'
17+
import { useEffect, useRef, useState } from 'react'
1818
import { useParams } from 'react-router-dom'
1919

2020
import {
21+
abortPreviousRequests,
2122
AppType,
2223
DeploymentAppTypes,
2324
ERROR_STATUS_CODE,
2425
ErrorScreenManager,
26+
getIsRequestAborted,
2527
IndexStore,
2628
noop,
2729
ResponseType,
@@ -46,6 +48,15 @@ const ExternalFluxAppDetails = () => {
4648
const [isReloadResourceTreeInProgress, setIsReloadResourceTreeInProgress] = useState(true)
4749
const [appDetailsError, setAppDetailsError] = useState(null)
4850

51+
const abortControllerRef = useRef<AbortController>(new AbortController())
52+
53+
useEffect(
54+
() => () => {
55+
abortControllerRef.current.abort()
56+
},
57+
[],
58+
)
59+
4960
const handleUpdateIndexStoreWithDetails = (response: ResponseType<any>) => {
5061
const genericAppDetail: AppDetails = {
5162
...response.result,
@@ -63,13 +74,19 @@ const ExternalFluxAppDetails = () => {
6374
new Promise<void>((resolve) => {
6475
setIsReloadResourceTreeInProgress(true)
6576

66-
getExternalFluxCDAppDetails(clusterId, namespace, appName, isKustomization)
77+
abortPreviousRequests(
78+
() =>
79+
getExternalFluxCDAppDetails({ clusterId, namespace, appName, isKustomization, abortControllerRef }),
80+
abortControllerRef,
81+
)
6782
.then(handleUpdateIndexStoreWithDetails)
6883
.catch((error) => {
69-
if (!initialLoading) {
70-
showError(error)
71-
} else {
72-
setAppDetailsError(error)
84+
if (!getIsRequestAborted(error)) {
85+
if (!initialLoading) {
86+
showError(error)
87+
} else {
88+
setAppDetailsError(error)
89+
}
7390
}
7491
})
7592
.finally(() => {

src/Pages/App/Details/ExternalFlux/service.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@
1717
import { get, getUrlWithSearchParams } from '@devtron-labs/devtron-fe-common-lib'
1818

1919
import { Routes } from '../../../../config'
20+
import { GetExternalFluxCDAppDetailsParamsType } from './types'
2021

21-
export const getExternalFluxCDAppDetails = (clusterId, namespace, appName, isKustomization) => {
22+
export const getExternalFluxCDAppDetails = async ({
23+
clusterId,
24+
namespace,
25+
appName,
26+
isKustomization,
27+
abortControllerRef,
28+
}: GetExternalFluxCDAppDetailsParamsType) => {
2229
const appId = `${clusterId}|${namespace}|${appName}|${isKustomization}`
2330
const baseurl = `${Routes.FLUX_APPS}/${Routes.APP}`
2431
const params = {
2532
appId,
2633
}
34+
2735
const url = getUrlWithSearchParams(baseurl, params)
28-
return get(url)
36+
return get(url, { abortControllerRef })
2937
}

src/Pages/App/Details/ExternalFlux/types.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { APIOptions } from '@devtron-labs/devtron-fe-common-lib'
18+
1719
export interface ExternalFluxAppDetailParams {
1820
clusterId: string
1921
appName: string
@@ -25,3 +27,9 @@ export enum EXTERNAL_FLUX_APP_STATUS {
2527
READY = 'Ready',
2628
NOT_READY = 'Not Ready',
2729
}
30+
31+
export interface GetExternalFluxCDAppDetailsParamsType
32+
extends Pick<ExternalFluxAppDetailParams, 'clusterId' | 'namespace' | 'appName'>,
33+
Pick<APIOptions, 'abortControllerRef'> {
34+
isKustomization: boolean
35+
}

src/Pages/GlobalConfigurations/Authorization/APITokens/APITokenList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const APITokenList = ({ tokenList, renderSearchToken, reload }: APITokenListType
6969

7070
return (
7171
<div className="bg__primary">
72-
<div data-testid="api-token-page-header" className="flex dc__content-space pl-20 pr-20 pb-16">
72+
<div data-testid="api-token-page-header" className="flex dc__content-space pl-20 pr-20 py-16">
7373
<FeatureTitleWithInfo
7474
title={HEADER_TEXT.API_TOKEN.title}
7575
renderDescriptionContent={() => HEADER_TEXT.API_TOKEN.description}

src/Pages/GlobalConfigurations/Authorization/Authorization.component.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { lazy } from 'react'
17+
import { lazy, useRef } from 'react'
1818
import { Redirect, Route, Switch, useRouteMatch } from 'react-router-dom'
1919

2020
import { Routes } from '../../../config'
@@ -26,15 +26,21 @@ const SSOLogin = lazy(() => import('./SSOLoginServices'))
2626

2727
const Authorization = () => {
2828
const { path } = useRouteMatch()
29+
const authorizationContainerRef = useRef<HTMLDivElement>(null)
2930

3031
return (
3132
<Switch>
3233
<Route path={`${path}/${Routes.SSO_LOGIN_SERVICES}`} component={SSOLogin} />
3334
<Route
3435
path={path}
3536
render={() => (
36-
<div className="authorization-container flexbox-col flex-grow-1 min-h-100 bg__primary flex-align-center dc__content-center pt-16">
37-
<UserAndGroupPermissions />
37+
<div
38+
ref={authorizationContainerRef}
39+
className="authorization-container flexbox-col flex-grow-1 h-100 bg__primary dc__overflow-hidden"
40+
>
41+
<div className="flex-grow-1 flexbox-col dc__overflow-auto">
42+
<UserAndGroupPermissions authorizationContainerRef={authorizationContainerRef} />
43+
</div>
3844
</div>
3945
)}
4046
/>

src/Pages/GlobalConfigurations/Authorization/AuthorizationProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const AuthorizationContext = createContext<AuthorizationContextProps>({
2626
possibleRolesMetaForCluster: {},
2727
},
2828
isAutoAssignFlowEnabled: false,
29+
authorizationContainerRef: { current: null },
2930
})
3031

3132
export const AuthorizationProvider = ({ children, value }: AuthorizationProviderProps) => (

src/Pages/GlobalConfigurations/Authorization/PermissionGroups/List/PermissionGroupListHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const PermissionGroupListHeader = ({
4141
const { isSuperAdmin } = useMainContext()
4242

4343
return (
44-
<div className="flex dc__content-space pl-20 pr-20">
44+
<div className="flex dc__content-space pl-20 pr-20 pt-16">
4545
<div className="flex dc__gap-8">
4646
<h2 className="fs-16 lh-32 cn-9 fw-6 m-0">Permission Groups</h2>
4747
<InfoIconTippy

src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/AppPermissions.component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ const AppPermissions = () => {
996996
}
997997
: [],
998998
)}
999-
alignActiveBorderWithContainer
1000999
/>
10011000
</div>
10021001
<div>

0 commit comments

Comments
 (0)