diff --git a/package-lock.json b/package-lock.json index 77731c8fb..e3c76813f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "4.0.4-pre-0", + "version": "4.0.4-pre-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "4.0.4-pre-0", + "version": "4.0.4-pre-2", "hasInstallScript": true, "license": "ISC", "dependencies": { @@ -5719,9 +5719,9 @@ "license": "ISC" }, "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "dev": true, "license": "MIT", "dependencies": { @@ -6759,9 +6759,9 @@ } }, "node_modules/dompurify": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.3.tgz", - "integrity": "sha512-Oj6pzI2+RqBfFG+qOaOLbFXLQ90ARpcGG6UePL82bJLtdsa6CYJD7nmiU8MW9nQNOtCHV3lZ/Bzq1X0QYbBZCA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.2.tgz", + "integrity": "sha512-lHeS9SA/IKeIFFyYciHBr2n0v1VMPlSj843HdLOwjb2OxNwdq9Xykxqhk+FE42MzAdHvInbAolSE4mhahPpjXA==", "license": "(MPL-2.0 OR Apache-2.0)", "peer": true, "optionalDependencies": { diff --git a/package.json b/package.json index 258a5b087..8cdf188af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "4.0.4-pre-0", + "version": "4.0.4-pre-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Assets/IconV2/ic-file-log-search.svg b/src/Assets/IconV2/ic-file-log-search.svg new file mode 100644 index 000000000..bc833810f --- /dev/null +++ b/src/Assets/IconV2/ic-file-log-search.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Pages-Devtron-2.0/Navigation/types.ts b/src/Pages-Devtron-2.0/Navigation/types.ts index d07a81318..6793eb3fc 100644 --- a/src/Pages-Devtron-2.0/Navigation/types.ts +++ b/src/Pages-Devtron-2.0/Navigation/types.ts @@ -78,6 +78,7 @@ export type NavigationRootItemID = | 'automation-and-enablement' | 'data-protection-management' | 'global-configuration' + | 'audit-logs' export type CommonNavigationItemType = { title: string @@ -107,11 +108,19 @@ export type NavigationItemType = Pick< }) ) -export interface NavigationGroupType extends Pick< +export type NavigationGroupType = Pick< CommonNavigationItemType, 'title' | 'icon' | 'hideNav' | 'forceHideEnvKey' | 'isAvailableInEA' -> { +> & { id: NavigationRootItemID - items: NavigationItemType[] disabled?: boolean -} +} & ( + | { + items: NavigationItemType[] + href?: never + } + | { + items?: never + href: string + } + ) diff --git a/src/Pages-Devtron-2.0/Shared/Routes/routes.ts b/src/Pages-Devtron-2.0/Shared/Routes/routes.ts index 68735bbd7..8aad122a9 100644 --- a/src/Pages-Devtron-2.0/Shared/Routes/routes.ts +++ b/src/Pages-Devtron-2.0/Shared/Routes/routes.ts @@ -1,7 +1,7 @@ import { generatePath } from 'react-router-dom' import { InfrastructureManagementAppListType } from '@Common/Types' -import { CostBreakdownItemViewParamsType, CostBreakdownViewType } from '@PagesDevtron2.0/index' +import { CostBreakdownItemViewParamsType, CostBreakdownViewType } from '@PagesDevtron2.0/CostVisibility/Shared/types' const OVERVIEW = 'overview' @@ -279,6 +279,9 @@ export const BASE_ROUTES = { DETAIL: ':locationId', }, }, + AUDIT_LOGS: { + ROOT: 'audit-logs', + }, GLOBAL_CONFIG: { ROOT: 'global-configuration', HOST_URL: 'host-url', @@ -410,6 +413,7 @@ const JOBS_ROOT = const JOB_DETAIL_ROOT = `${JOBS_ROOT}/${BASE_ROUTES.AUTOMATION_AND_ENABLEMENT.JOBS.DETAIL.ROOT}` as const const DATA_PROTECTION_MANAGEMENT_ROOT = `/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.ROOT}` as const +const AUDIT_LOGS_ROOT = `/${BASE_ROUTES.AUDIT_LOGS.ROOT}` as const const GLOBAL_CONFIG_ROOT = `/${BASE_ROUTES.GLOBAL_CONFIG.ROOT}` as const const GLOBAL_CONFIG_AUTH_ROOT = `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.AUTH.ROOT}` as const const NETWORK_STATUS_INTERFACE_ROOT = `/${BASE_ROUTES.NETWORK_STATUS_INTERFACE.ROOT}` as const @@ -670,7 +674,9 @@ export const ROUTER_URLS = { DATA_PROTECTION_MANAGEMENT_BACKUP_LOCATIONS: `${DATA_PROTECTION_MANAGEMENT_ROOT}/${BASE_ROUTES.DATA_PROTECTION_MANAGEMENT.BACKUP_LOCATIONS.ROOT}`, 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}`, - // Global Config + // Audit Logs + AUDIT_LOGS: AUDIT_LOGS_ROOT, + GLOBAL_CONFIG_HOST_URL: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.HOST_URL}`, GLOBAL_CONFIG_EXTERNAL_LINKS: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.EXTERNAL_LINKS}`, GLOBAL_CONFIG_CHART_REPOSITORIES: `${GLOBAL_CONFIG_ROOT}/${BASE_ROUTES.GLOBAL_CONFIG.CHART_REPOSITORIES}`, diff --git a/src/Shared/Components/DatePicker/DateTimePicker.tsx b/src/Shared/Components/DatePicker/DateTimePicker.tsx index bc81caf1b..c88a4f0e0 100644 --- a/src/Shared/Components/DatePicker/DateTimePicker.tsx +++ b/src/Shared/Components/DatePicker/DateTimePicker.tsx @@ -104,7 +104,10 @@ const DateTimePicker = ({ onChange(updateTime(dateObject, option.value).value) } - const handleDateRangeChange = (range: DateRange) => { + const handleDateRangeChange = (range: DateRange | undefined) => { + if (!range) { + return + } if (isDateUpdateRange(isRangePicker, onChange)) { const fromDate = range.from ? range.from : new Date() const toDate = range.to ? range.to : undefined diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index 8ddb97356..99d13dc57 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -149,6 +149,7 @@ import ICFileCode from '@IconsV2/ic-file-code.svg?react' import ICFileDownload from '@IconsV2/ic-file-download.svg?react' import ICFileEdit from '@IconsV2/ic-file-edit.svg?react' import ICFileKey from '@IconsV2/ic-file-key.svg?react' +import ICFileLogSearch from '@IconsV2/ic-file-log-search.svg?react' import ICFiles from '@IconsV2/ic-files.svg?react' import ICFilesChanged from '@IconsV2/ic-files-changed.svg?react' import ICFilter from '@IconsV2/ic-filter.svg?react' @@ -492,6 +493,7 @@ export const iconMap = { 'ic-file-download': ICFileDownload, 'ic-file-edit': ICFileEdit, 'ic-file-key': ICFileKey, + 'ic-file-log-search': ICFileLogSearch, 'ic-file': ICFile, 'ic-files-changed': ICFilesChanged, 'ic-files': ICFiles, diff --git a/src/Shared/Hooks/useUserPreferences/types.ts b/src/Shared/Hooks/useUserPreferences/types.ts index ce2c24054..4f52c04e5 100644 --- a/src/Shared/Hooks/useUserPreferences/types.ts +++ b/src/Shared/Hooks/useUserPreferences/types.ts @@ -17,7 +17,7 @@ import { USER_PREFERENCES_ATTRIBUTE_KEY } from '@Shared/Hooks/useUserPreferences/constants' import { AppThemeType, ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types' import { ResourceKindType } from '@Shared/types' -import { NavigationItemID, NavigationSubMenuItemID } from '@PagesDevtron2.0/Navigation' +import { NavigationItemID, NavigationRootItemID, NavigationSubMenuItemID } from '@PagesDevtron2.0/Navigation' export interface GetUserPreferencesQueryParamsType { key: typeof USER_PREFERENCES_ATTRIBUTE_KEY @@ -78,7 +78,9 @@ export interface GetUserPreferencesParsedDTO { */ resources?: UserPreferenceResourceType commandBar: { - recentNavigationActions: { id: NavigationItemID | NavigationSubMenuItemID | CommandBarAdditionalItemsId }[] + recentNavigationActions: { + id: NavigationItemID | NavigationRootItemID | NavigationSubMenuItemID | CommandBarAdditionalItemsId + }[] } } export interface UserPreferencesPayloadValueType extends GetUserPreferencesParsedDTO {}