Skip to content

Commit d166788

Browse files
committed
Merge branch 'fix/trigger-view' of https://github.com/devtron-labs/dashboard into fix/cd-trigger
2 parents 32d520b + f1b0411 commit d166788

File tree

22 files changed

+330
-314
lines changed

22 files changed

+330
-314
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ FEATURE_INFRA_PROVISION_INFO_BLOCK_HIDE=false
7676
FEATURE_GROUPED_APP_LIST_FILTERS_ENABLE=false
7777
FEATURE_FLUX_DEPLOYMENTS_ENABLE=false
7878
FEATURE_LINK_EXTERNAL_FLUX_ENABLE=false
79+
FEATURE_CANARY_ROLLOUT_PROGRESS_ENABLE=true

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const AppOrJobSelector = ({
7070
_permission.entityName.filter((option) => option.value !== SELECT_ALL_VALUE).map((app) => app.label) ??
7171
[]
7272
const { appIdWorkflowNamesMapping } = await getUserAccessAllWorkflows({
73-
appIds: jobNames,
73+
appNames: jobNames,
7474
options: { abortControllerRef },
7575
})
7676
const workflowOptions = getWorkflowOptions(appIdWorkflowNamesMapping)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ const AppPermissions = () => {
345345
async function setAllWorkflows(jobOptions) {
346346
const jobNames = jobOptions.filter((job) => job.value !== SELECT_ALL_VALUE).map((job) => job.label)
347347
try {
348-
const result = await getUserAccessAllWorkflows(jobNames)
348+
const result = await getUserAccessAllWorkflows({ appNames: jobNames })
349349

350350
const workflowOptions = getWorkflowOptions(result?.appIdWorkflowNamesMapping)
351351
return [

src/Pages/GlobalConfigurations/Authorization/authorization.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ export const getUserAccessClusterList = () =>
312312
payload: { entity: EntityTypes.CLUSTER },
313313
})
314314

315-
export const getUserAccessAllWorkflows = ({ appIds, options }: GetUserAccessAllWorkflowsParams) =>
315+
export const getUserAccessAllWorkflows = ({ appNames, options }: GetUserAccessAllWorkflowsParams) =>
316316
getUserResourceOptions<AppIdWorkflowNamesMapping>({
317-
kind: UserAccessResourceKind.JOBS,
318-
payload: { entity: EntityTypes.JOB, appIds },
317+
kind: UserAccessResourceKind.WORKFLOW,
318+
payload: { entity: EntityTypes.JOB, appNames },
319319
options,
320320
})
321321

src/Pages/GlobalConfigurations/Authorization/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ export interface GetUserPermissionResourcesPayload
347347
accessType?: ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.HELM_APPS
348348
teamIds?: number[]
349349
appIds?: string[]
350+
appNames?: string[]
350351
}
351352

352353
export interface GetUserResourceOptionsProps {
@@ -356,5 +357,5 @@ export interface GetUserResourceOptionsProps {
356357
}
357358

358359
export interface GetUserAccessAllWorkflowsParams
359-
extends Pick<GetUserPermissionResourcesPayload, 'appIds'>,
360+
extends Pick<GetUserPermissionResourcesPayload, 'appNames'>,
360361
Pick<GetUserResourceOptionsProps, 'options'> {}

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,6 @@ export const ConfigMapSecretContainer = ({
328328
}
329329
}, [configMapSecretResLoading, configMapSecretRes])
330330

331-
// CONFIGMAP/SECRET DELETED
332-
const configHasBeenDeleted = useMemo(
333-
() =>
334-
!configMapSecretResLoading && configMapSecretRes
335-
? !configMapSecretData && !inheritedConfigMapSecretData && !draftData
336-
: null,
337-
[configMapSecretResLoading, configMapSecretRes],
338-
)
339-
340331
// CONFIGMAP/SECRET ERROR
341332
const configMapSecretResErr = useMemo(
342333
() =>
@@ -348,6 +339,18 @@ export const ConfigMapSecretContainer = ({
348339
[configMapSecretResLoading, configMapSecretRes],
349340
)
350341

342+
// CONFIGMAP/SECRET DELETED
343+
const configHasBeenDeleted = useMemo(
344+
() =>
345+
!configMapSecretResLoading &&
346+
configMapSecretRes &&
347+
!configMapSecretResErr &&
348+
!configMapSecretData &&
349+
!inheritedConfigMapSecretData &&
350+
!draftData,
351+
[configMapSecretResLoading, configMapSecretRes, configMapSecretResErr],
352+
)
353+
351354
// ASYNC CALL - CONFIGMAP/SECRET RESOLVED DATA
352355
const [resolvedScopeVariablesResLoading, resolvedScopeVariablesRes, reloadResolvedScopeVariablesResErr] = useAsync(
353356
() =>

src/components/ResourceBrowser/Constants.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -325,29 +325,13 @@ export const NODE_LIST_HEADERS_TO_KEY_MAP: Record<(typeof NODE_LIST_HEADERS)[num
325325
unschedulable: 'unschedulable',
326326
} as const
327327

328-
export const NODE_SEARCH_KEY_OPTIONS = [
329-
{ value: NODE_SEARCH_KEYS.NAME, label: 'Name' },
330-
{ value: NODE_SEARCH_KEYS.LABEL, label: 'Label' },
331-
{ value: NODE_SEARCH_KEYS.NODE_GROUP, label: 'Node group' },
332-
] as const
333-
334-
export const DEFAULT_NODE_K8S_VERSION = {
335-
label: 'K8s version: Any',
336-
value: 'K8s version: Any',
337-
}
338-
339-
export const NODE_SEARCH_KEY_PLACEHOLDER: Record<NODE_SEARCH_KEYS, string> = {
340-
[NODE_SEARCH_KEYS.NAME]: 'Search by node name Eg. ip-172-31-2-152.us-east-2.compute.internal',
341-
[NODE_SEARCH_KEYS.LABEL]: 'Search by key=value Eg. environment=production, tier=frontend',
342-
[NODE_SEARCH_KEYS.NODE_GROUP]: 'Search by node group name Eg. mainnode',
343-
}
328+
export const NODE_LIST_HEADER_KEYS_TO_SEARCH = Object.values(NODE_LIST_HEADERS_TO_KEY_MAP)
344329

345330
export const NODE_SEARCH_KEYS_TO_OBJECT_KEYS: Record<
346331
NODE_SEARCH_KEYS,
347332
(typeof NODE_LIST_HEADERS_TO_KEY_MAP)[keyof typeof NODE_LIST_HEADERS_TO_KEY_MAP]
348333
> = {
349334
[NODE_SEARCH_KEYS.LABEL]: 'labels',
350-
[NODE_SEARCH_KEYS.NAME]: 'name',
351335
[NODE_SEARCH_KEYS.NODE_GROUP]: 'nodeGroup',
352336
}
353337

src/components/ResourceBrowser/ResourceBrowser.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@
6666
.resource-list-container {
6767
.node-listing-search-container {
6868
display: grid;
69-
grid-template-columns: auto 160px 1px 180px;
69+
grid-template-columns: 1fr auto 1px 180px;
7070
column-gap: 8px;
7171

72-
&__shortcut-key {
73-
right: 10px;
74-
top: 6px;
72+
.grouped-filter-select-picker {
73+
width: 350px;
74+
> .dc__mxw-250 {
75+
max-width: 350px;
76+
}
7577
}
7678
}
7779

@@ -92,6 +94,7 @@
9294
.cluster-terminal-hidden {
9395
visibility: hidden;
9496
height: 0;
97+
9598
.terminal-action-strip {
9699
display: none;
97100
}

src/components/ResourceBrowser/ResourceList/K8SResourceList.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
updateManifestResourceHelmApps,
4545
} from '@Components/v2/appDetails/k8Resource/nodeDetail/nodeDetail.api'
4646

47-
import { NODE_LIST_HEADERS_TO_KEY_MAP } from '../Constants'
47+
import { NODE_LIST_HEADER_KEYS_TO_SEARCH, NODE_LIST_HEADERS_TO_KEY_MAP } from '../Constants'
4848
import { getResourceData } from '../ResourceBrowser.service'
4949
import { K8SResourceListType } from '../Types'
5050
import K8sResourceListTableCellComponent from './K8sResourceListTableCellComponent'
@@ -88,6 +88,7 @@ const K8SResourceListViewWrapper = ({
8888
updateSearchParams,
8989
eventType = 'warning',
9090
filteredRows,
91+
rows,
9192
...restProps
9293
}: K8SResourceListViewWrapperProps) => (
9394
<div className="flexbox-col flex-grow-1 resource-list-container dc__overflow-hidden border__primary--left">
@@ -97,6 +98,9 @@ const K8SResourceListViewWrapper = ({
9798
setVisibleColumns={setVisibleColumns}
9899
allColumns={allColumns}
99100
searchParams={restProps}
101+
rows={rows}
102+
searchKey={searchKey}
103+
handleSearch={handleSearch}
100104
/>
101105
) : (
102106
<ResourceFilterOptions
@@ -218,15 +222,18 @@ export const K8SResourceList = ({
218222
)
219223

220224
const tableFilter: K8sResourceListTableProps['filter'] = (row, filterData) => {
225+
let nodeFilters = true
226+
221227
if (isNodeListing) {
222-
return isItemASearchMatchForNodeListing(row.data, filterData)
228+
nodeFilters = isItemASearchMatchForNodeListing(row.data, filterData)
223229
}
224230

225231
const isSearchMatch =
226232
!filterData.searchKey ||
227233
Object.entries(row.data).some(
228234
([key, value]) =>
229235
key !== 'id' &&
236+
(!isNodeListing || NODE_LIST_HEADER_KEYS_TO_SEARCH.includes(key)) &&
230237
value !== null &&
231238
value !== undefined &&
232239
String(value).toLowerCase().includes(filterData.searchKey.toLowerCase()),
@@ -239,7 +246,7 @@ export const K8SResourceList = ({
239246
)
240247
}
241248

242-
return isSearchMatch
249+
return isSearchMatch && nodeFilters
243250
}
244251

245252
const getDefaultSortKey = () => {

0 commit comments

Comments
 (0)