Skip to content

Commit f208ab0

Browse files
authored
Merge pull request #1033 from devtron-labs/feat/audit-logs-ui
chore: File log search icon added
2 parents 56c9a26 + 3a2632a commit f208ab0

8 files changed

Lines changed: 43 additions & 18 deletions

File tree

package-lock.json

Lines changed: 8 additions & 8 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": "4.0.7",
3+
"version": "4.0.8",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
Lines changed: 3 additions & 0 deletions
Loading

src/Pages-Devtron-2.0/Navigation/types.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export type NavigationRootItemID =
7878
| 'automation-and-enablement'
7979
| 'data-protection-management'
8080
| 'global-configuration'
81+
| 'audit-logs'
8182

8283
export type CommonNavigationItemType = {
8384
title: string
@@ -107,11 +108,19 @@ export type NavigationItemType = Pick<
107108
})
108109
)
109110

110-
export interface NavigationGroupType extends Pick<
111+
export type NavigationGroupType = Pick<
111112
CommonNavigationItemType,
112113
'title' | 'icon' | 'hideNav' | 'forceHideEnvKey' | 'isAvailableInEA'
113-
> {
114+
> & {
114115
id: NavigationRootItemID
115-
items: NavigationItemType[]
116116
disabled?: boolean
117-
}
117+
} & (
118+
| {
119+
items: NavigationItemType[]
120+
href?: never
121+
}
122+
| {
123+
items?: never
124+
href: string
125+
}
126+
)

src/Pages-Devtron-2.0/Shared/Routes/routes.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { generatePath } from 'react-router-dom'
22

33
import { InfrastructureManagementAppListType } from '@Common/Types'
4-
import { CostBreakdownItemViewParamsType, CostBreakdownViewType } from '@PagesDevtron2.0/index'
4+
import { CostBreakdownItemViewParamsType, CostBreakdownViewType } from '@PagesDevtron2.0/CostVisibility/Shared/types'
55

66
const OVERVIEW = 'overview'
77

@@ -279,6 +279,9 @@ export const BASE_ROUTES = {
279279
DETAIL: ':locationId',
280280
},
281281
},
282+
AUDIT_LOGS: {
283+
ROOT: 'audit-logs',
284+
},
282285
GLOBAL_CONFIG: {
283286
ROOT: 'global-configuration',
284287
HOST_URL: 'host-url',
@@ -415,6 +418,7 @@ const JOBS_ROOT =
415418
const JOB_DETAIL_ROOT = `${JOBS_ROOT}/${BASE_ROUTES.AUTOMATION_AND_ENABLEMENT.JOBS.DETAIL.ROOT}` as const
416419

417420
const DATA_PROTECTION_MANAGEMENT_ROOT = `/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.ROOT}` as const
421+
const AUDIT_LOGS_ROOT = `/${BASE_ROUTES.AUDIT_LOGS.ROOT}` as const
418422
const GLOBAL_CONFIG_ROOT = `/${BASE_ROUTES.GLOBAL_CONFIG.ROOT}` as const
419423
const GLOBAL_CONFIG_AUTH_ROOT = `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.AUTH.ROOT}` as const
420424
const NETWORK_STATUS_INTERFACE_ROOT = `/${BASE_ROUTES.NETWORK_STATUS_INTERFACE.ROOT}` as const
@@ -675,7 +679,9 @@ export const ROUTER_URLS = {
675679
DATA_PROTECTION_MANAGEMENT_BACKUP_LOCATIONS: `${DATA_PROTECTION_MANAGEMENT_ROOT}/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.BACKUP_LOCATIONS.ROOT}`,
676680
DATA_PROTECTION_MANAGEMENT_BACKUP_LOCATIONS_DETAIL: `${DATA_PROTECTION_MANAGEMENT_ROOT}/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.BACKUP_LOCATIONS.ROOT}/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.BACKUP_LOCATIONS.DETAIL}`,
677681

678-
// Global Config
682+
// Audit Logs
683+
AUDIT_LOGS: AUDIT_LOGS_ROOT,
684+
679685
GLOBAL_CONFIG_HOST_URL: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.HOST_URL}`,
680686
GLOBAL_CONFIG_EXTERNAL_LINKS: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.EXTERNAL_LINKS}`,
681687
GLOBAL_CONFIG_CHART_REPOSITORIES: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.CHART_REPOSITORIES}`,

src/Shared/Components/DatePicker/DateTimePicker.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ const DateTimePicker = ({
104104
onChange(updateTime(dateObject, option.value).value)
105105
}
106106

107-
const handleDateRangeChange = (range: DateRange) => {
107+
const handleDateRangeChange = (range: DateRange | undefined) => {
108+
if (!range) {
109+
return
110+
}
108111
if (isDateUpdateRange(isRangePicker, onChange)) {
109112
const fromDate = range.from ? range.from : new Date()
110113
const toDate = range.to ? range.to : undefined

src/Shared/Components/Icon/Icon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ import ICFileCode from '@IconsV2/ic-file-code.svg?react'
149149
import ICFileDownload from '@IconsV2/ic-file-download.svg?react'
150150
import ICFileEdit from '@IconsV2/ic-file-edit.svg?react'
151151
import ICFileKey from '@IconsV2/ic-file-key.svg?react'
152+
import ICFileLogSearch from '@IconsV2/ic-file-log-search.svg?react'
152153
import ICFiles from '@IconsV2/ic-files.svg?react'
153154
import ICFilesChanged from '@IconsV2/ic-files-changed.svg?react'
154155
import ICFilter from '@IconsV2/ic-filter.svg?react'
@@ -492,6 +493,7 @@ export const iconMap = {
492493
'ic-file-download': ICFileDownload,
493494
'ic-file-edit': ICFileEdit,
494495
'ic-file-key': ICFileKey,
496+
'ic-file-log-search': ICFileLogSearch,
495497
'ic-file': ICFile,
496498
'ic-files-changed': ICFilesChanged,
497499
'ic-files': ICFiles,

src/Shared/Hooks/useUserPreferences/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import { USER_PREFERENCES_ATTRIBUTE_KEY } from '@Shared/Hooks/useUserPreferences/constants'
1818
import { AppThemeType, ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types'
1919
import { ResourceKindType } from '@Shared/types'
20-
import { NavigationItemID, NavigationSubMenuItemID } from '@PagesDevtron2.0/Navigation'
20+
import { NavigationItemID, NavigationRootItemID, NavigationSubMenuItemID } from '@PagesDevtron2.0/Navigation'
2121

2222
export interface GetUserPreferencesQueryParamsType {
2323
key: typeof USER_PREFERENCES_ATTRIBUTE_KEY
@@ -78,7 +78,9 @@ export interface GetUserPreferencesParsedDTO {
7878
*/
7979
resources?: UserPreferenceResourceType
8080
commandBar: {
81-
recentNavigationActions: { id: NavigationItemID | NavigationSubMenuItemID | CommandBarAdditionalItemsId }[]
81+
recentNavigationActions: {
82+
id: NavigationItemID | NavigationRootItemID | NavigationSubMenuItemID | CommandBarAdditionalItemsId
83+
}[]
8284
}
8385
}
8486
export interface UserPreferencesPayloadValueType extends GetUserPreferencesParsedDTO {}

0 commit comments

Comments
 (0)