Skip to content

Commit 59656e5

Browse files
committed
Merge branch 'main' into protection-config-dev
2 parents ec32e46 + 6172db0 commit 59656e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1085
-497
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "0.0.43-beta-1",
7+
"@devtron-labs/devtron-fe-common-lib": "0.0.45",
8+
"@rjsf/core": "^5.13.3",
9+
"@rjsf/utils": "^5.13.3",
10+
"@rjsf/validator-ajv8": "^5.13.3",
811
"@sentry/browser": "^7.3.1",
912
"@sentry/integrations": "^7.3.1",
1013
"@sentry/tracing": "^7.3.1",

src/assets/img/cluster-redirect.png

-97.4 KB
Binary file not shown.

src/components/ClusterNodes/ClusterNodeContainer.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/components/ClusterNodes/ClusterOverview.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import { ReactComponent as ClusterOverviewIcon } from '../../assets/icons/cluste
2424
import { MAX_LENGTH_350, SOME_ERROR_MSG } from '../../config/constantMessaging'
2525
import ConnectingToClusterState from '../ResourceBrowser/ResourceList/ConnectingToClusterState'
2626
import { EditableTextArea } from '../common/EditableTextArea/EditableTextArea'
27+
import { importComponentFromFELibrary } from '../common'
28+
29+
const Catalog = importComponentFromFELibrary('Catalog')
2730

2831
function ClusterOverview({
2932
isSuperAdmin,
@@ -567,12 +570,13 @@ function ClusterOverview({
567570
return (
568571
<div
569572
className="pl-20 pt-20 pr-20 dc__column-gap-32 h-100 dc__overflow-auto flexbox flex-justify-center"
570-
style={{ backgroundImage: 'linear-gradient(249deg, #D4E6F7 0%, var(--N50)50.58%)' }}
573+
style={{ backgroundImage: 'linear-gradient(249deg, #D4E6F7 0%, var(--N0)50.58%)' }}
571574
>
572575
{renderSideInfoData()}
573-
<div className="dc__mxw-1068 flex-grow-1">
576+
<div className="dc__mxw-1068 flex-grow-1 mw-none">
574577
{renderCardDetails()}
575578
{renderClusterError()}
579+
{Catalog && <Catalog resourceId={clusterId} resourceType="cluster" />}
576580
<GenericDescription
577581
isClusterTerminal={true}
578582
clusterId={clusterId}

src/components/Jobs/Constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const JOB_LIST_HEADERS = {
4242
RUN_IN_ENVIRONMENT: 'RUN IN ENVIRONMENT'
4343
}
4444

45-
export const YET_TO_RUN = 'Yet to run'
4645
export const JOBLIST_EMPTY_STATE_MESSAGING = {
4746
createJob: 'Create your first job',
4847
createJobInfoText:

src/components/Jobs/ExpandedRow/ExpandedRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Link } from 'react-router-dom'
33
import { ReactComponent as Expand } from '../../../assets/icons/ic-dropdown-filled.svg'
44
import { ReactComponent as Settings } from '../../../assets/icons/ic-settings.svg'
55
import { ExpandedRowProps, Job, JobCIPipeline } from '../Types'
6-
import AppStatus from '../../app/AppStatus'
76
import './ExpandedRow.scss'
87
import { URLS } from '../../../config'
98
import { environmentName } from '../Utils'
109
import { DEFAULT_ENV } from '../../app/details/triggerView/Constants'
10+
import { AppStatus } from '@devtron-labs/devtron-fe-common-lib'
1111

1212
export default function ExpandedRow(props: ExpandedRowProps) {
1313
const handleEditJob = () => {

src/components/Jobs/JobDetails/JobDetails.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export default function JobDetails() {
3030
const { appId } = useParams<{ appId: string }>()
3131
const [jobName, setJobName] = useState('')
3232
const [appMetaInfo, setAppMetaInfo] = useState<AppMetaInfo>()
33+
const [jobListLoading, setJobListLoading] = useState<boolean>(false)
3334

3435
useEffect(() => {
35-
getAppMetaInfoRes()
36+
setJobListLoading(true)
37+
getAppMetaInfoRes().finally(() => setJobListLoading(false))
3638
}, [appId])
3739

3840
const getAppMetaInfoRes = async (): Promise<AppMetaInfo> => {
@@ -47,6 +49,9 @@ export default function JobDetails() {
4749
showError(err)
4850
}
4951
}
52+
if (jobListLoading) {
53+
return <Progressing pageLoader />
54+
}
5055

5156
return (
5257
<div className="job-details-page">

src/components/Jobs/JobList/JobListView.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React from 'react'
2-
import { ErrorScreenManager, Progressing } from '@devtron-labs/devtron-fe-common-lib'
2+
import { AppStatus, ErrorScreenManager, Progressing } from '@devtron-labs/devtron-fe-common-lib'
33
import { Pagination } from '../../common'
44
import { Link, useHistory, useLocation } from 'react-router-dom'
55
import { ReactComponent as Edit } from '../../../assets/icons/ic-settings.svg'
66
import { ReactComponent as JobIcon } from '../../../assets/icons/ic-job-node.svg'
77
import { ReactComponent as Arrow } from '../../../assets/icons/ic-dropdown-filled.svg'
88
import { OrderBy, SortBy } from '../../app/list/types'
9-
import AppStatus from '../../app/AppStatus'
109
import { Job, JobListViewProps } from '../Types'
1110
import { JobListViewType, JOB_LIST_HEADERS } from '../Constants'
1211
import ExpandedRow from '../ExpandedRow/ExpandedRow'

src/components/apiTokens/CreateAPIToken.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function CreateAPIToken({
9494
action: ActionTypes.VIEW,
9595
entityName: [],
9696
})
97-
const [k8sPermission, setK8sPermission] = useState<any[]>([]);
97+
const [k8sPermission, setK8sPermission] = useState<any[]>([])
9898
const [customDate, setCustomDate] = useState<Moment>(null)
9999
const validationRules = new ValidationRules()
100100

src/components/apiTokens/authorization.utils.ts

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const getDateInMilliseconds = (days) => {
3333
}
3434

3535
export const getSelectedEnvironments = (permission) => {
36-
if (permission.accessType === ACCESS_TYPE_MAP.DEVTRON_APPS) {
37-
return getSelectedPermissionValues(permission.environment)
36+
if (permission.accessType === ACCESS_TYPE_MAP.DEVTRON_APPS || permission.entity === EntityTypes.JOB) {
37+
return getSelectedPermissionValues(permission.environment)
3838
} else {
3939
let allFutureCluster = {}
4040
let envList = ''
@@ -83,25 +83,36 @@ export const createUserPermissionPayload = (
8383
(permission) =>
8484
permission.team?.value && permission.environment.length && permission.entityName.length,
8585
)
86-
.map((permission) => ({
87-
...permission,
88-
action: permission.action.value,
89-
team: permission.team.value,
90-
environment: getSelectedEnvironments(permission),
91-
entityName: getSelectedPermissionValues(permission.entityName),
92-
})),
93-
...k8sPermission.map((permission) => ({
94-
...permission,
95-
entity: EntityTypes.CLUSTER,
96-
action: permission.action.value,
97-
cluster: permission.cluster.label,
98-
group: permission.group.value === '*' ? '' : permission.group.value,
99-
kind: permission.kind.value === '*' ? '' : permission.kind.label,
100-
namespace: permission.namespace.value === '*' ? '' : permission.namespace.value,
101-
resource: permission.resource.find((entity) => entity.value === '*')
86+
.map((permission) => {
87+
const payload = {
88+
...permission,
89+
action: permission.action.value,
90+
team: permission.team.value,
91+
environment: getSelectedEnvironments(permission),
92+
entityName: getSelectedPermissionValues(permission.entityName),
93+
entity: permission.entity,
94+
...(permission.entity === EntityTypes.JOB && {
95+
workflow: permission.workflow?.length
96+
? permission.workflow.find((workflow) => workflow.value === '*')
97+
? ''
98+
: permission.workflow.map((workflow) => workflow.value).join(',')
99+
: '',
100+
}),
101+
}
102+
return payload
103+
}),
104+
...k8sPermission.map((permission) => ({
105+
...permission,
106+
entity: EntityTypes.CLUSTER,
107+
action: permission.action.value,
108+
cluster: permission.cluster.label,
109+
group: permission.group.value === '*' ? '' : permission.group.value,
110+
kind: permission.kind.value === '*' ? '' : permission.kind.label,
111+
namespace: permission.namespace.value === '*' ? '' : permission.namespace.value,
112+
resource: permission.resource.find((entity) => entity.value === '*')
102113
? ''
103-
: permission.resource.map((entity) => entity.value).join(',')
104-
}))
114+
: permission.resource.map((entity) => entity.value).join(','),
115+
})),
105116
],
106117
superAdmin: isSuperAdminAccess,
107118
}

0 commit comments

Comments
 (0)