Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "0.5.0",
"version": "0.5.0-beta-4",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
41 changes: 41 additions & 0 deletions src/Shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,44 @@ export enum RuntimeParamsHeadingType {
KEY = 'key',
VALUE = 'value',
}

export enum ACCESS_TYPE_MAP {
DEVTRON_APPS = 'devtron-app', // devtron app work flow
HELM_APPS = 'helm-app', // helm app work flow
JOBS = '', // Empty string is intentional since there is no bifurcation in jobs as of now
}

export enum EntityTypes {
CHART_GROUP = 'chart-group',
DIRECT = 'apps',
JOB = 'jobs',
DOCKER = 'docker',
GIT = 'git',
CLUSTER = 'cluster',
NOTIFICATION = 'notification',
}

export interface CustomRoles {
id: number
roleName: string
roleDisplayName: string
roleDescription: string
entity: EntityTypes
accessType: ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.HELM_APPS
}

export type MetaPossibleRoles = Record<
CustomRoles['roleName'],
{
value: CustomRoles['roleDisplayName']
description: CustomRoles['roleDescription']
}
>

export interface CustomRoleAndMeta {
customRoles: CustomRoles[]
possibleRolesMeta: MetaPossibleRoles
possibleRolesMetaForHelm: MetaPossibleRoles
possibleRolesMetaForCluster: MetaPossibleRoles
possibleRolesMetaForJob: MetaPossibleRoles
}