Skip to content

Commit 3411e50

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/dashboard into feat/combined-ci-cd-pipeline
2 parents 1be717e + 97b23a1 commit 3411e50

File tree

11 files changed

+13671
-8608
lines changed

11 files changed

+13671
-8608
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache: 'yarn'
2626

2727
- name: Install dependencies
28-
run: yarn install --frozen-lockfile
28+
run: yarn install --immutable
2929

3030
- name: Check linting issues
3131
run: yarn lint

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.0
1+
v22

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
FROM node:20-alpine AS builder
1+
FROM node:22-alpine AS builder
22

33
WORKDIR /app
44

5-
COPY package.json yarn.lock .
5+
RUN corepack enable yarn && \
6+
yarn set version 4.9.2
7+
8+
COPY package.json .
9+
COPY yarn.lock .
10+
COPY .yarn/ .yarn/
11+
COPY .yarnrc.yml ./
612

713
RUN apk add --no-cache git
8-
RUN yarn install --frozen-lockfile --network-timeout 600000
14+
RUN yarn install --immutable --network-timeout 600000
915

1016
COPY . .
1117

package.json

Lines changed: 8 additions & 8 deletions
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": "1.15.3-beta-0",
7+
"@devtron-labs/devtron-fe-common-lib": "1.15.3-pre-3",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -14,7 +14,6 @@
1414
"@sentry/tracing": "7.50.0",
1515
"@tippyjs/react": "4.2.6",
1616
"@typeform/embed-react": "2.20.0",
17-
"@vitejs/plugin-react": "4.3.1",
1817
"command-line-parser": "^0.2.10",
1918
"compute-histogram": "^0.9.11",
2019
"dayjs": "^1.11.8",
@@ -39,9 +38,6 @@
3938
"rxjs": "^7.5.4",
4039
"sockjs-client": "1.6.1",
4140
"tippy.js": "^6.3.7",
42-
"vite": "5.4.19",
43-
"vite-plugin-require-transform": "1.0.21",
44-
"vite-plugin-svgr": "^2.4.0",
4541
"xterm": "^4.19.0",
4642
"xterm-addon-fit": "^0.5.0",
4743
"xterm-addon-search": "^0.9.0",
@@ -87,6 +83,7 @@
8783
"@types/recompose": "^0.30.10",
8884
"@typescript-eslint/eslint-plugin": "8.3.0",
8985
"@typescript-eslint/parser": "8.3.0",
86+
"@vitejs/plugin-react": "4.5.2",
9087
"env-cmd": "10.1.0",
9188
"eslint": "^8.57.1",
9289
"eslint-config-airbnb": "^19.0.4",
@@ -115,9 +112,11 @@
115112
"ts-jest": "29.2.5",
116113
"ts-node": "10.9.2",
117114
"typescript": "5.5.4",
118-
"vite-plugin-compression2": "^1.3.3",
119-
"vite-plugin-image-optimizer": "^1.1.8",
115+
"vite": "6.3.5",
116+
"vite-plugin-compression2": "2.0.1",
120117
"vite-plugin-pwa": "^0.21.1",
118+
"vite-plugin-require-transform": "1.0.21",
119+
"vite-plugin-svgr": "^2.4.0",
121120
"vite-tsconfig-paths": "5.0.1"
122121
},
123122
"jest": {
@@ -139,5 +138,6 @@
139138
"rollup": "^4.22.4",
140139
"path-to-regexp": "^1.9.0",
141140
"cross-spawn": "^7.0.5"
142-
}
141+
},
142+
"packageManager": "[email protected]"
143143
}

src/components/ResourceBrowser/ResourceList/ClusterSelector.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import ReactSelect, { Props as SelectProps, SelectInstance } from 'react-select'
2121
import {
2222
APP_SELECTOR_STYLES,
2323
AppSelectorDropdownIndicator,
24+
Badge,
25+
ComponentSizeType,
2426
DocLink,
2527
DocLinkProps,
2628
Icon,
@@ -114,7 +116,7 @@ const ClusterSelector: React.FC<ClusterSelectorType> = ({
114116
}}
115117
/>
116118

117-
{defaultOption?.isProd && <span className="px-6 py-2 br-4 bcb-1 cb-7 fs-12 lh-16 fw-5">Production</span>}
119+
{defaultOption?.isProd && <Badge label="Production" size={ComponentSizeType.xxs} />}
118120

119121
{defaultOption?.value !== String(DEFAULT_CLUSTER_ID) && (
120122
<PopupMenu autoClose>

src/components/common/helpers/Helpers.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import {
3030
useMainContext,
3131
SelectPickerOptionType,
3232
InfoBlock,
33+
Badge,
34+
SeveritiesDTO,
3335
} from '@devtron-labs/devtron-fe-common-lib'
3436
import YAML from 'yaml'
3537
import { Link } from 'react-router-dom'
@@ -1098,33 +1100,31 @@ export const getPluginIdsFromBuildStage = (
10981100
return pluginIds
10991101
}
11001102

1103+
const SEVERITY_ORDER = [
1104+
{ key: SeveritiesDTO.CRITICAL, label: 'Critical', variant: 'negative' },
1105+
{ key: SeveritiesDTO.HIGH, label: 'High', variant: 'custom', fontColor: 'R500', bgColor: 'R100' },
1106+
{ key: SeveritiesDTO.MEDIUM, label: 'Medium', variant: 'custom', fontColor: 'O600', bgColor: 'O100' },
1107+
{ key: SeveritiesDTO.LOW, label: 'Low', variant: 'warning' },
1108+
{ key: SeveritiesDTO.UNKNOWN, label: 'Unknown', variant: 'neutral' },
1109+
] as const
1110+
11011111
export const getSeverityWithCount = (severityCount: SeverityCount) => {
1102-
if (severityCount.critical) {
1103-
return (
1104-
<span className="severity-chip severity-chip--critical dc__w-fit-content">
1105-
{severityCount.critical} Critical
1106-
</span>
1107-
)
1108-
}
1109-
if (severityCount.high) {
1110-
return <span className="severity-chip severity-chip--high dc__w-fit-content">{severityCount.high} High</span>
1111-
}
1112-
if (severityCount.medium) {
1113-
return (
1114-
<span className="severity-chip severity-chip--medium dc__w-fit-content">{severityCount.medium} Medium</span>
1115-
)
1116-
}
1117-
if (severityCount.low) {
1118-
return <span className="severity-chip severity-chip--low dc__w-fit-content">{severityCount.low} Low</span>
1119-
}
1120-
if (severityCount.unknown) {
1121-
return (
1122-
<span className="severity-chip severity-chip--unknown dc__w-fit-content">
1123-
{severityCount.unknown} Unknown
1124-
</span>
1125-
)
1112+
for (const item of SEVERITY_ORDER) {
1113+
if (severityCount[item.key]) {
1114+
if (item.variant === 'custom') {
1115+
return (
1116+
<Badge
1117+
label={`${severityCount[item.key]} ${item.label}`}
1118+
variant="custom"
1119+
fontColor={item.fontColor}
1120+
bgColor={item.bgColor}
1121+
/>
1122+
)
1123+
}
1124+
return <Badge label={`${severityCount[item.key]} ${item.label}`} variant={item.variant} />
1125+
}
11261126
}
1127-
return <span className="severity-chip severity-chip--passed dc__w-fit-content">Passed</span>
1127+
return <Badge label="Passed" variant="positive" />
11281128
}
11291129

11301130
// FIXME: Ideally whole branch calculations should be in fe-lib

src/css/base.scss

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4826,55 +4826,6 @@ textarea::placeholder {
48264826
background-color: var(--Y200);
48274827
}
48284828

4829-
.severity-chip {
4830-
display: flex;
4831-
padding: 0px 6px;
4832-
align-items: center;
4833-
gap: 4px;
4834-
border-radius: 4px;
4835-
font-size: 12px;
4836-
font-style: normal;
4837-
font-weight: 600;
4838-
line-height: 20px;
4839-
text-transform: capitalize;
4840-
4841-
&--passed {
4842-
color: var(--G500);
4843-
border: 1px solid var(--G200);
4844-
background: var(--G100);
4845-
}
4846-
4847-
&--critical {
4848-
color: var(--R700);
4849-
border: 1px solid var(--R700);
4850-
background: var(--R100);
4851-
}
4852-
4853-
&--high {
4854-
color: var(--R500);
4855-
border: 1px solid var(--R200);
4856-
background: var(--R100);
4857-
}
4858-
4859-
&--medium {
4860-
color: var(--O600);
4861-
border: 1px solid var(--O200);
4862-
background: var(--O100);
4863-
}
4864-
4865-
&--low {
4866-
color: var(--Y700);
4867-
border: 1px solid var(--Y200);
4868-
background: var(--Y100);
4869-
}
4870-
4871-
&--unknown {
4872-
color: var(--N700);
4873-
border: 1px solid var(--N200);
4874-
background: var(--N100);
4875-
}
4876-
}
4877-
48784829
.dc__grid-full {
48794830
display: grid;
48804831
grid-template-columns: 100% 0;

vite.config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfil
2828
import { VitePWA } from 'vite-plugin-pwa'
2929
// import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
3030
import tsconfigPaths from 'vite-tsconfig-paths'
31-
import { compression } from 'vite-plugin-compression2'
31+
import { compression, defineAlgorithm } from 'vite-plugin-compression2'
3232

3333
const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`
3434
const TARGET_URL = 'https://preview.devtron.ai/'
@@ -184,7 +184,7 @@ export default defineConfig(({ mode }) => {
184184
svgrOptions: {},
185185
}),
186186
compression({
187-
algorithm: 'brotliCompress',
187+
algorithms: [defineAlgorithm('brotliCompress')],
188188
}),
189189
reactVirtualized(),
190190
requireTransform(),

0 commit comments

Comments
 (0)