Skip to content

Commit a0ca58b

Browse files
committed
feat: move user permission enum and types to common-lib
1 parent 80bf204 commit a0ca58b

File tree

15 files changed

+30
-61
lines changed

15 files changed

+30
-61
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.5.0-beta-2",
7+
"@devtron-labs/devtron-fe-common-lib": "0.5.0-beta-4",
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/AppPermissions.component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ import {
2626
useAsync,
2727
useMainContext,
2828
ACCESS_TYPE_MAP,
29+
EntityTypes,
2930
} from '@devtron-labs/devtron-fe-common-lib'
30-
import { EntityTypes, ActionTypes } from '../../../constants'
31+
import { ActionTypes } from '../../../constants'
3132
import { HELM_APP_UNASSIGNED_PROJECT, SELECT_ALL_VALUE, SERVER_MODE } from '../../../../../../config'
3233
import { importComponentFromFELibrary, mapByKey } from '../../../../../../components/common'
3334
import K8sPermissions from '../K8sObjectPermissions/K8sPermissions.component'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
LoadingIndicator,
2525
ReactSelectInputAction,
2626
ACCESS_TYPE_MAP,
27+
EntityTypes,
2728
} from '@devtron-labs/devtron-fe-common-lib'
2829
import Select, { components } from 'react-select'
2930
import Tippy from '@tippyjs/react'
@@ -36,7 +37,6 @@ import { useAuthorizationContext } from '../../../AuthorizationProvider'
3637
import {
3738
CONFIG_APPROVER_ACTION,
3839
authorizationSelectStyles,
39-
EntityTypes,
4040
ARTIFACT_PROMOTER_ACTION,
4141
TERMINAL_EXEC_ACTION,
4242
} from '../../../constants'
@@ -225,6 +225,7 @@ const DirectPermission = ({
225225
}}
226226
formatOptionLabel={formatOptionLabel}
227227
accessType={permission.accessType}
228+
customRoles={customRoles}
228229
/>
229230
)}
230231
</components.MenuList>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
/* eslint-disable react/destructuring-assignment */
1818
/* eslint-disable react/prop-types */
19-
import { Checkbox, CHECKBOX_VALUE, noop } from '@devtron-labs/devtron-fe-common-lib'
19+
import { Checkbox, CHECKBOX_VALUE, noop, EntityTypes } from '@devtron-labs/devtron-fe-common-lib'
2020
import React from 'react'
2121
import { components } from 'react-select'
2222
import { GroupHeading } from '../../../../../../components/v2/common/ReactSelect.utils'
2323
import { SELECT_ALL_VALUE } from '../../../../../../config'
24-
import { EntityTypes } from '../../../constants'
2524
import { ALL_EXISTING_AND_FUTURE_ENVIRONMENTS_VALUE, DirectPermissionFieldName } from './constants'
2625

2726
export const WorkflowGroupHeading = (props) => <GroupHeading {...props} hideClusterName />

src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ACCESS_TYPE_MAP } from '@devtron-labs/devtron-fe-common-lib'
17+
import { ACCESS_TYPE_MAP, EntityTypes } from '@devtron-labs/devtron-fe-common-lib'
1818
import { SELECT_ALL_VALUE } from '../../../../../../config'
19-
import { ActionTypes, authorizationSelectStyles, EntityTypes } from '../../../constants'
19+
import { ActionTypes, authorizationSelectStyles } from '../../../constants'
2020
import { getDefaultStatusAndTimeout } from '../../../libUtils'
2121
import { DirectPermissionsRoleFilter } from '../../../types'
2222

src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { OptionType, ACCESS_TYPE_MAP } from '@devtron-labs/devtron-fe-common-lib'
17+
import { OptionType, ACCESS_TYPE_MAP, EntityTypes } from '@devtron-labs/devtron-fe-common-lib'
1818
import { DEFAULT_ENV } from '../../../../../../components/app/details/triggerView/Constants'
1919
import { createClusterEnvGroup } from '../../../../../../components/common'
2020
import { SELECT_ALL_VALUE, SERVER_MODE } from '../../../../../../config'
21-
import { EntityTypes } from '../../../constants'
2221
import { ALL_EXISTING_AND_FUTURE_ENVIRONMENTS_VALUE } from './constants'
2322
import { DirectPermissionRow } from './types'
2423

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
OptionType,
2929
LoadingIndicator,
3030
GVKType,
31+
EntityTypes,
3132
} from '@devtron-labs/devtron-fe-common-lib'
3233
import CreatableSelect from 'react-select/creatable'
3334
import Tippy from '@tippyjs/react'
@@ -56,7 +57,7 @@ import { ReactComponent as InfoIcon } from '../../../../../../assets/icons/info-
5657
import { formatResourceKindOptionLabel, k8sRoleSelectionStyle, multiSelectAllState } from './utils'
5758
import { useAuthorizationContext } from '../../../AuthorizationProvider'
5859
import { parseData } from '../../../utils'
59-
import { authorizationSelectStyles, ALL_NAMESPACE, EntityTypes } from '../../../constants'
60+
import { authorizationSelectStyles, ALL_NAMESPACE } from '../../../constants'
6061
import { K8sPermissionActionType, K8S_PERMISSION_INFO_MESSAGE, resourceSelectStyles } from './constants'
6162
import { SELECT_ALL_VALUE } from '../../../../../../config'
6263
import { K8sItemCardLoadingState, K8sListItemCardType } from './types'

src/Pages/GlobalConfigurations/Authorization/Shared/components/K8sObjectPermissions/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ReactSelectInputAction } from '@devtron-labs/devtron-fe-common-lib'
17+
import { ReactSelectInputAction, EntityTypes } from '@devtron-labs/devtron-fe-common-lib'
1818
import { SELECT_ALL_VALUE } from '../../../../../../config'
19-
import { ActionTypes, ACTION_LABEL, EntityTypes, authorizationSelectStyles } from '../../../constants'
19+
import { ActionTypes, ACTION_LABEL, authorizationSelectStyles } from '../../../constants'
2020
import { K8sPermissionFilter } from '../../../types'
2121
import { getDefaultStatusAndTimeout } from '../../../libUtils'
2222
import { K8S_EMPTY_GROUP } from '../../../../../../components/ResourceBrowser/Constants'

src/Pages/GlobalConfigurations/Authorization/Shared/components/PermissionConfigurationForm/PermissionConfigurationFormProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { UserStatus } from '@devtron-labs/devtron-fe-common-lib'
17+
import { UserStatus, EntityTypes } from '@devtron-labs/devtron-fe-common-lib'
1818
import React, { createContext, ReactNode, useContext, useEffect, useMemo, useRef, useState } from 'react'
1919
import { importComponentFromFELibrary } from '../../../../../../components/common'
20-
import { ActionTypes, EntityTypes, PermissionType } from '../../../constants'
20+
import { ActionTypes, PermissionType } from '../../../constants'
2121
import { getDefaultStatusAndTimeout } from '../../../libUtils'
2222
import {
2323
ChartGroupPermissionsFilter,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import {
2626
trash,
2727
UserListFilterParams,
2828
UserStatus,
29+
CustomRoles,
2930
} from '@devtron-labs/devtron-fe-common-lib'
3031
import { Routes } from '../../../config'
3132
import {
32-
CustomRoles,
3333
PermissionGroup,
3434
PermissionGroupBulkDeletePayload,
3535
PermissionGroupCreateOrUpdatePayload,

0 commit comments

Comments
 (0)