Skip to content

Commit bd6b48b

Browse files
authored
Merge pull request #478 from devtron-labs/feat/deleted-user-in-export
feat: add type for user typeToFetch
2 parents add977f + bc414df commit bd6b48b

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 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": "1.3.2",
3+
"version": "1.3.3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Helper.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
ZERO_TIME_STRING,
3333
TOAST_ACCESS_DENIED,
3434
UNCHANGED_ARRAY_ELEMENT_SYMBOL,
35+
DATE_TIME_FORMATS,
3536
} from './Constants'
3637
import { ServerErrors } from './ServerError'
3738
import { AsyncOptions, AsyncState, DeploymentNodeType, UseSearchString } from './Types'
@@ -233,6 +234,9 @@ export function handleUTCTime(ts: string, isRelativeTime = false) {
233234
return timestamp
234235
}
235236

237+
export const getFormattedUTCTimeForExport = (timeToConvert: string, fallback = '-') =>
238+
timeToConvert ? `${moment(timeToConvert).utc().format(DATE_TIME_FORMATS.TWELVE_HOURS_EXPORT_FORMAT)} (UTC)` : '-'
239+
236240
export function useSearchString(): UseSearchString {
237241
const location = useLocation()
238242
const queryParams: URLSearchParams = useMemo(() => {

src/Pages/GlobalConfigurations/Authorization/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
export * from './constants'
1818
export type { UserListFilterParams, UserRoleGroup, UserGroupDTO, UserGroupType } from './types'
19+
export { UserTypeToFetchType } from './types'
1920
export * from './shared'
2021
export * from './service'
2122
export { getUserAndApiTokenOption } from './utils'

src/Pages/GlobalConfigurations/Authorization/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
import { BaseFilterQueryParams } from '../../../Shared'
1818
import { UserListSortableKeys, UserStatus } from './constants'
1919

20+
export enum UserTypeToFetchType {
21+
includeDeleted = 'includeDeleted',
22+
excludeDelete = 'excludeDelete',
23+
onlyDeleted = 'onlyDeleted',
24+
}
25+
2026
export type UserListFilterParams = BaseFilterQueryParams<UserListSortableKeys> & {
2127
/**
2228
* Selected statuses (if any)
2329
*/
2430
status: UserStatus[]
31+
typeToFetch?: UserTypeToFetchType
2532
}
2633

2734
export interface UserMinType {

0 commit comments

Comments
 (0)