Skip to content

Commit 524d850

Browse files
committed
refactor: move the common components to common lib and refactoring
1 parent afeacc1 commit 524d850

File tree

32 files changed

+49
-236
lines changed

32 files changed

+49
-236
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": "0.0.58",
7+
"@devtron-labs/devtron-fe-common-lib": "0.0.58-beta-6",
88
"@rjsf/core": "^5.13.3",
99
"@rjsf/utils": "^5.13.3",
1010
"@rjsf/validator-ajv8": "^5.13.3",

src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
TippyCustomized,
1414
TippyTheme,
1515
CustomInput,
16+
OptionType,
1617
} from '@devtron-labs/devtron-fe-common-lib'
1718
import { FormType, GenerateTokenType } from './authorization.type'
1819
import { createGeneratedAPIToken } from './service'
@@ -28,7 +29,6 @@ import {
2829
ChartGroupPermissionsFilter,
2930
DirectPermissionsRoleFilter,
3031
EntityTypes,
31-
OptionType,
3232
} from '../shared/components/userGroups/userGroups.types'
3333
import GroupPermission from './GroupPermission'
3434
import { mainContext } from '../../../../components/common/navigation/NavigationRoutes'

src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
copyToClipboard,
1111
CustomInput,
1212
noop,
13+
OptionType,
1314
} from '@devtron-labs/devtron-fe-common-lib'
1415
import { useHistory, useRouteMatch, useParams } from 'react-router-dom'
1516
import moment from 'moment'
@@ -31,7 +32,6 @@ import {
3132
ChartGroupPermissionsFilter,
3233
DirectPermissionsRoleFilter,
3334
EntityTypes,
34-
OptionType,
3535
} from '../shared/components/userGroups/userGroups.types'
3636
import { mainContext } from '../../../../components/common/navigation/NavigationRoutes'
3737
import DeleteAPITokenModal from './DeleteAPITokenModal'

src/Pages/GlobalConfigurations/Authorization/APITokens/authorization.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { OptionType } from '@devtron-labs/devtron-fe-common-lib'
12
import { ACCESS_TYPE_MAP, SERVER_MODE } from '../../../../config'
23
import {
34
ActionTypes,
45
ChartGroupPermissionsFilter,
56
DirectPermissionsRoleFilter,
67
EntityTypes,
7-
OptionType,
88
ViewChartGroupPermission,
99
} from '../shared/components/userGroups/userGroups.types'
1010
import { UserCreateOrUpdatePayload } from '../types'

src/Pages/GlobalConfigurations/Authorization/PermissionGroups/List/PermissionGroupList.component.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
import React, { useCallback, useMemo, useRef } from 'react'
22
import {
3+
SortingOrder,
4+
SortableTableHeaderCell,
35
ErrorScreenNotAuthorized,
46
ERROR_EMPTY_SCREEN,
57
noop,
68
Pagination,
79
Reload,
810
TOAST_ACCESS_DENIED,
911
useAsync,
12+
DEFAULT_BASE_PAGE_SIZE,
13+
useUrlFilters,
1014
} from '@devtron-labs/devtron-fe-common-lib'
11-
import { API_STATUS_CODES, DEFAULT_BASE_PAGE_SIZE, SortingOrder } from '../../../../../config'
15+
import { API_STATUS_CODES } from '../../../../../config'
1216

1317
import { getPermissionGroupList } from '../../authorization.service'
1418
import { permissionGroupLoading, SortableKeys } from './constants'
1519
import PermissionGroupListHeader from './PermissionGroupListHeader'
1620
import PermissionGroupRow from './PermissionGroupRow'
1721
import { useAuthorizationContext } from '../../AuthorizationProvider'
1822
import { importComponentFromFELibrary } from '../../../../../components/common'
19-
import useUrlFilters from '../../shared/hooks/useUrlFilters'
20-
import SortableTableHeaderCell from '../../../../../components/common/SortableTableHeaderCell'
2123
import FiltersEmptyState from '../../shared/components/FilterEmptyState/FilterEmptyState.component'
2224
import NoPermissionGroups from './NoPermissionGroups'
2325
import { abortPreviousRequests, getIsRequestAborted } from '../../utils'

src/Pages/GlobalConfigurations/Authorization/UserPermissions/AddEdit/UserForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
RadioGroup,
1212
RadioGroupItem,
1313
ServerErrors,
14+
OptionType,
1415
} from '@devtron-labs/devtron-fe-common-lib'
1516
import Creatable from 'react-select/creatable'
1617
import Select from 'react-select'
@@ -21,7 +22,6 @@ import {
2122
ChartGroupPermissionsFilter,
2223
EntityTypes,
2324
ActionTypes,
24-
OptionType,
2525
ViewChartGroupPermission,
2626
} from '../../shared/components/userGroups/userGroups.types'
2727
import { mapByKey, validateEmail, deepEqual, importComponentFromFELibrary } from '../../../../../components/common'

src/Pages/GlobalConfigurations/Authorization/UserPermissions/List/UserPermissionList.component.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import React, { useCallback, useMemo, useRef } from 'react'
22
import {
3+
SortingOrder,
4+
SortableTableHeaderCell,
35
ErrorScreenNotAuthorized,
46
ERROR_EMPTY_SCREEN,
57
Pagination,
68
Reload,
79
TOAST_ACCESS_DENIED,
810
useAsync,
11+
DEFAULT_BASE_PAGE_SIZE,
12+
useUrlFilters,
913
} from '@devtron-labs/devtron-fe-common-lib'
10-
import { API_STATUS_CODES, DEFAULT_BASE_PAGE_SIZE, SortingOrder } from '../../../../../config'
14+
import { API_STATUS_CODES } from '../../../../../config'
1115

1216
import { getUserList } from '../../authorization.service'
1317
import { SortableKeys, userListLoading } from './constants'
1418
import UserPermissionListHeader from './UserPermissionListHeader'
1519
import UserPermissionRow from './UserPermissionRow'
16-
import useUrlFilters from '../../shared/hooks/useUrlFilters'
17-
import SortableTableHeaderCell from '../../../../../components/common/SortableTableHeaderCell'
1820
import FiltersEmptyState from '../../shared/components/FilterEmptyState/FilterEmptyState.component'
1921
import NoUsers from './NoUsers'
2022
import { importComponentFromFELibrary } from '../../../../../components/common'

src/Pages/GlobalConfigurations/Authorization/shared/components/K8sObjectPermissions/K8sListItemCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Option,
88
MultiValueRemove,
99
MultiValueChipContainer,
10+
OptionType,
1011
} from '@devtron-labs/devtron-fe-common-lib'
1112
import CreatableSelect from 'react-select/creatable'
1213
import Tippy from '@tippyjs/react'
@@ -33,7 +34,6 @@ import {
3334
ALL_NAMESPACE,
3435
K8sListItemCardType,
3536
K8S_PERMISSION_INFO_MESSAGE,
36-
OptionType,
3737
EntityTypes,
3838
} from '../userGroups/userGroups.types'
3939
import { ReactComponent as Clone } from '../../../../../../assets/icons/ic-copy.svg'

src/Pages/GlobalConfigurations/Authorization/shared/components/K8sObjectPermissions/K8sPermissionModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react'
22
import { toast } from 'react-toastify'
3-
import { Drawer, stopPropagation } from '@devtron-labs/devtron-fe-common-lib'
4-
import { K8sPermissionModalType, OptionType } from '../userGroups/userGroups.types'
3+
import { Drawer, OptionType, stopPropagation } from '@devtron-labs/devtron-fe-common-lib'
4+
import { K8sPermissionModalType } from '../userGroups/userGroups.types'
55
import { ReactComponent as Close } from '../../../../../../assets/icons/ic-close.svg'
66
import { ReactComponent as AddIcon } from '../../../../../../assets/icons/ic-add.svg'
77
import K8sListItemCard from './K8sListItemCard'

src/Pages/GlobalConfigurations/Authorization/shared/components/userGroups/UserGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
MultiValueContainer,
66
MultiValueRemove,
77
multiSelectStyles,
8+
OptionType,
89
} from '@devtron-labs/devtron-fe-common-lib'
910
import Select, { components } from 'react-select'
1011
import {
@@ -17,7 +18,6 @@ import {
1718
DirectPermissionsRoleFilter,
1819
ChartGroupPermissionsFilter,
1920
ActionTypes,
20-
OptionType,
2121
EntityTypes,
2222
} from './userGroups.types'
2323
import { ACCESS_TYPE_MAP, HELM_APP_UNASSIGNED_PROJECT } from '../../../../../../config'

0 commit comments

Comments
 (0)