Skip to content

Commit 37e957d

Browse files
authored
Merge pull request #2858 from devtron-labs/chore/modal-outside-click
feat: show namespace count for virtual clusters
2 parents 60c8a84 + 5bece67 commit 37e957d

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
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.18.1-pre-2",
7+
"@devtron-labs/devtron-fe-common-lib": "1.18.1-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/GlobalConfigurations/ClustersAndEnvironments/EnvironmentList.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
EnvListSortableKeys,
3535
EnvNamespaceRowType,
3636
} from './cluster.type'
37-
import { environmentNameComparator, getSelectParsedCategory } from './cluster.util'
37+
import { environmentNameComparator, getNamespaceCount, getSelectParsedCategory } from './cluster.util'
3838
import { ClusterEnvironmentDrawer } from './ClusterEnvironmentDrawer'
3939
import { ClusterActions, ClusterEnvLoader, ClusterIconWithStatus } from './ClusterList.components'
4040
import { ADD_ENVIRONMENT_FORM_LOCAL_STORAGE_KEY } from './constants'
@@ -290,7 +290,18 @@ const ClustersEnvironmentsList = ({
290290
<span className="dc__ellipsis-right">({environments.length} Environments)</span>
291291
</div>
292292
</Tooltip>
293-
{showUnmappedEnvs ? <span>{(namespaceListResult?.result ?? []).length} Namespaces</span> : <span />}
293+
{showUnmappedEnvs ? (
294+
<span>
295+
{getNamespaceCount({
296+
isVirtualCluster,
297+
envList: environments,
298+
namespaceList: namespaceListResult?.result,
299+
})}
300+
&nbsp;Namespaces
301+
</span>
302+
) : (
303+
<span />
304+
)}
294305
<span>{isProd ? 'Production' : 'Non Production'}</span>
295306
{category?.label ? <span>{category.label}</span> : <span />}
296307
<div className="flex right">

src/Pages/GlobalConfigurations/ClustersAndEnvironments/cluster.util.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
ClusterEnvFilterKeys,
3434
ClusterTerminalParamsType,
3535
emptyClusterTerminalParamsData,
36+
Environment,
3637
} from './cluster.type'
3738
import { ADD_CLUSTER_FORM_LOCAL_STORAGE_KEY, ADD_ENVIRONMENT_FORM_LOCAL_STORAGE_KEY } from './constants'
3839

@@ -169,3 +170,13 @@ export const getBulletColorAccToStatus = (status: ClusterStatusType) => {
169170
return 'bcr-5'
170171
}
171172
}
173+
174+
export const getNamespaceCount = ({
175+
isVirtualCluster,
176+
envList,
177+
namespaceList,
178+
}: {
179+
isVirtualCluster: boolean
180+
envList: Environment[]
181+
namespaceList: string[]
182+
}) => (isVirtualCluster ? (envList ?? []).filter(({ namespace }) => !!namespace).length : (namespaceList ?? []).length)

src/components/ApplicationGroup/Details/TriggerView/BulkCITrigger.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ const BulkCITrigger = ({
807807

808808
return (
809809
<Drawer position="right" width="75%" minWidth="1024px" maxWidth="1200px" onClose={closeBulkCIModal} >
810-
<div className="bg__primary bulk-ci-trigger-container">
810+
<div className="bg__primary bulk-ci-trigger-container" onClick={stopPropagation}>
811811
<div className="flexbox-col flex-grow-1 dc__overflow-hidden">
812812
{renderHeaderSection()}
813813
{responseListLength ? (

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.18.1-pre-2":
1726-
version: 1.18.1-pre-2
1727-
resolution: "@devtron-labs/devtron-fe-common-lib@npm:1.18.1-pre-2"
1725+
"@devtron-labs/devtron-fe-common-lib@npm:1.18.1-pre-3":
1726+
version: 1.18.1-pre-3
1727+
resolution: "@devtron-labs/devtron-fe-common-lib@npm:1.18.1-pre-3"
17281728
dependencies:
17291729
"@codemirror/autocomplete": "npm:6.18.6"
17301730
"@codemirror/lang-json": "npm:6.0.1"
@@ -1774,7 +1774,7 @@ __metadata:
17741774
react-select: 5.8.0
17751775
rxjs: ^7.8.1
17761776
yaml: ^2.4.1
1777-
checksum: 10c0/8ca5cd044c4554b6eb320979b8736baccbdc87f4e55a26d45a3c7bffb61cedfa4cdc78fa7434c909d885a389fd9f0598abdf7f6411ac0d53a421a304fa5c2c6c
1777+
checksum: 10c0/4840d247eb16864917a42aaf8bae5388faf41136c2fa2cc0a303cb19980e5a7f7ced5312716d824c88281f25e2bac446cea1715305b62782986ccf13510f7491
17781778
languageName: node
17791779
linkType: hard
17801780

@@ -5721,7 +5721,7 @@ __metadata:
57215721
version: 0.0.0-use.local
57225722
resolution: "dashboard@workspace:."
57235723
dependencies:
5724-
"@devtron-labs/devtron-fe-common-lib": "npm:1.18.1-pre-2"
5724+
"@devtron-labs/devtron-fe-common-lib": "npm:1.18.1-pre-3"
57255725
"@esbuild-plugins/node-globals-polyfill": "npm:0.2.3"
57265726
"@playwright/test": "npm:^1.32.1"
57275727
"@rjsf/core": "npm:^5.13.3"

0 commit comments

Comments
 (0)