Skip to content

Commit d61c36b

Browse files
Merge pull request #267 from devtron-labs/release-candidate-v0.17.0
feat: Release candidate v0.17.0
2 parents e6ec5e3 + ec4bf31 commit d61c36b

File tree

94 files changed

+4035
-1236
lines changed

Some content is hidden

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

94 files changed

+4035
-1236
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.2.6-patch-1",
3+
"version": "0.2.17",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -23,12 +23,12 @@
2323
],
2424
"scripts": {
2525
"prepare": "node -e \"try { require('husky').install() } catch (e) {}\"",
26-
"lint": "tsc --noEmit && NODE_OPTIONS=--max_old_space_size=8192 eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
26+
"lint": "tsc --noEmit && NODE_OPTIONS=--max_old_space_size=3072 eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
2727
"lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
2828
"test": "exit 0",
29-
"dev": "NODE_OPTIONS=--max_old_space_size=8192 vite",
30-
"build": "NODE_OPTIONS=--max_old_space_size=8192 vite build --sourcemap",
31-
"build-watch": "NODE_OPTIONS=--max_old_space_size=8192 vite build --sourcemap --watch",
29+
"dev": "NODE_OPTIONS=--max_old_space_size=3072 vite",
30+
"build": "NODE_OPTIONS=--max_old_space_size=3072 vite build --sourcemap",
31+
"build-watch": "NODE_OPTIONS=--max_old_space_size=3072 vite build --sourcemap --watch",
3232
"build-lib": "vite build",
3333
"preview": "vite preview",
3434
"lint-staged": "lint-staged"

src/Assets/Icon/ic-aborted.svg

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading

src/Assets/Icon/ic-expand.svg

Lines changed: 19 additions & 0 deletions
Loading

src/Assets/Icon/ic-filter-applied.svg

Lines changed: 3 additions & 3 deletions
Loading

src/Assets/Icon/ic-filter.svg

Lines changed: 2 additions & 2 deletions
Loading

src/Assets/Icon/ic-lines.svg

Lines changed: 3 additions & 0 deletions
Loading

src/Assets/Icon/ic-pulsate-status.svg

Lines changed: 21 additions & 0 deletions
Loading

src/Assets/Icon/ic-stamp.svg

Lines changed: 9 additions & 0 deletions
Loading

src/Assets/Img/delete-medium.svg

Lines changed: 9 additions & 13 deletions
Loading

src/Common/AppStatus/utils.ts

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

17-
import { TIMELINE_STATUS } from "../../Shared/constants"
17+
import { TIMELINE_STATUS } from '../../Shared/constants'
1818

1919
export const triggerStatus = (triggerDetailStatus: string): string => {
2020
const triggerStatus = triggerDetailStatus?.toUpperCase()

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ import ReactGA from 'react-ga4'
2121
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
2222
import { configureMonacoYaml } from 'monaco-yaml'
2323

24-
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
2524
import { ReactComponent as Info } from '../../Assets/Icon/ic-info-filled.svg'
2625
import { ReactComponent as ErrorIcon } from '../../Assets/Icon/ic-error-exclamation.svg'
2726
import { ReactComponent as WarningIcon } from '../../Assets/Icon/ic-warning.svg'
2827
import './codeEditor.scss'
2928
import 'monaco-editor'
3029

31-
import YamlWorker from '../../yaml.worker.js?worker'
3230
import { YAMLStringify, cleanKubeManifest, useJsonYaml } from '../Helper'
3331
import { useWindowSize } from '../Hooks'
3432
import Select from '../Select/Select'
@@ -46,15 +44,6 @@ import {
4644
import { CodeEditorReducer, initialState } from './CodeEditor.reducer'
4745
import { MODES } from '../Constants'
4846

49-
self.MonacoEnvironment = {
50-
getWorker(_, label) {
51-
if (label === MODES.YAML) {
52-
return new YamlWorker()
53-
}
54-
return new editorWorker()
55-
},
56-
}
57-
5847
const CodeEditorContext = React.createContext(null)
5948

6049
function useCodeEditorContext() {
@@ -70,7 +59,7 @@ function useCodeEditorContext() {
7059
* see: https://github.com/react-monaco-editor/react-monaco-editor/pull/955
7160
* */
7261
const _onChange = {
73-
onChange: null
62+
onChange: null,
7463
}
7564

7665
const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.memo(
@@ -98,7 +87,7 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
9887
cleanData = false,
9988
onBlur,
10089
onFocus,
101-
adjustEditorHeightToContent,
90+
adjustEditorHeightToContent = false,
10291
}) => {
10392
if (cleanData) {
10493
value = cleanKubeManifest(value)
@@ -125,6 +114,18 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
125114
},
126115
})
127116

117+
monaco.editor.defineTheme(CodeEditorThemesKeys.networkStatusInterface, {
118+
base: 'vs-dark',
119+
inherit: true,
120+
rules: [
121+
// @ts-ignore
122+
{ background: '#1A1A1A' },
123+
],
124+
colors: {
125+
'editor.background': '#1A1A1A',
126+
},
127+
})
128+
128129
monaco.editor.defineTheme(CodeEditorThemesKeys.deleteDraft, {
129130
base: 'vs',
130131
inherit: true,

src/Common/CodeEditor/codeEditor.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
overflow: hidden;
2626
}
2727

28-
.radio-group input[type=checkbox]:checked+.radio__item-label {
28+
.radio-group input[type='checkbox']:checked + .radio__item-label {
2929
background: var(--N700);
3030
border-radius: 0;
3131
color: var(--white);
@@ -165,3 +165,9 @@
165165
.monaco-editor-hover {
166166
margin-left: 40px;
167167
}
168+
169+
.monaco-scrollable-element {
170+
& > .visible {
171+
z-index: 9;
172+
}
173+
}

src/Common/CodeEditor/types.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface InformationBarProps {
2222
children?: React.ReactNode
2323
}
2424

25-
export interface CodeEditorInterface {
25+
interface CodeEditorBaseInterface {
2626
value?: string
2727
lineDecorationsWidth?: number
2828
responseType?: string
@@ -36,7 +36,6 @@ export interface CodeEditorInterface {
3636
readOnly?: boolean
3737
noParsing?: boolean
3838
inline?: boolean
39-
height?: number | string
4039
shebang?: string | JSX.Element
4140
diffView?: boolean
4241
loading?: boolean
@@ -48,9 +47,20 @@ export interface CodeEditorInterface {
4847
isKubernetes?: boolean
4948
cleanData?: boolean
5049
chartVersion?: any
51-
adjustEditorHeightToContent?: boolean
5250
}
5351

52+
export type CodeEditorInterface = CodeEditorBaseInterface &
53+
(
54+
| {
55+
adjustEditorHeightToContent?: boolean
56+
height?: never
57+
}
58+
| {
59+
adjustEditorHeightToContent?: never
60+
height?: number | string
61+
}
62+
)
63+
5464
export interface CodeEditorHeaderInterface {
5565
children?: any
5666
className?: string
@@ -85,6 +95,7 @@ export enum CodeEditorThemesKeys {
8595
deleteDraft = 'delete-draft',
8696
unpublished = 'unpublished',
8797
vs = 'vs',
98+
networkStatusInterface = 'network-status-interface',
8899
}
89100

90101
export interface CodeEditorInitialValueType {

src/Common/Constants.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const URLS = {
6363
DEPLOYMENT_HISTORY_CONFIGURATIONS: '/configuration',
6464
GLOBAL_CONFIG_SCOPED_VARIABLES: '/global-config/scoped-variables',
6565
GLOBAL_CONFIG_DEPLOYMENT_CHARTS_LIST: '/global-config/deployment-charts',
66+
NETWORK_STATUS_INTERFACE: '/network-status-interface',
6667
}
6768

6869
export const ROUTES = {
@@ -97,12 +98,16 @@ export const ROUTES = {
9798
CONFIG_CD_PIPELINE: 'config/cd-pipeline',
9899
MODULE_CONFIGURED: 'module/config',
99100
RESOURCE_HISTORY_DEPLOYMENT: 'resource/history/deployment',
101+
ATTRIBUTES: 'attributes',
102+
ATTRIBUTES_CREATE: 'attributes/create',
103+
ATTRIBUTES_UPDATE: 'attributes/update',
100104
APP_LIST_MIN: 'app/min',
101105
CLUSTER_LIST_MIN: 'cluster/autocomplete',
102106
PLUGIN_GLOBAL_LIST_DETAIL_V2: 'plugin/global/list/detail/v2',
103107
PLUGIN_GLOBAL_LIST_V2: 'plugin/global/list/v2',
104108
PLUGIN_GLOBAL_LIST_TAGS: 'plugin/global/list/tags',
105109
DEPLOYMENT_CHARTS_LIST: 'deployment/template/fetch',
110+
CONFIG_DATA: 'config/data',
106111
}
107112

108113
export enum KEY_VALUE {
@@ -523,3 +528,11 @@ export const DATE_TIME_FORMATS = {
523528
DD_MMM_YYYY_HH_MM: 'DD MMM YYYY, hh:mm',
524529
DD_MMM_YYYY: 'DD MMM YYYY',
525530
}
531+
532+
export const VULNERABILITIES_SORT_PRIORITY = {
533+
critical: 1,
534+
high: 2,
535+
medium: 3,
536+
low: 4,
537+
unknown: 5,
538+
}

src/Common/CustomInput/CustomInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const CustomInput = ({
135135

136136
{getInputError()}
137137
{helperText && (
138-
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7">
138+
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7 mt-4">
139139
<Info className="icon-dim-16" />
140140
<div>{helperText}</div>
141141
</div>

src/Common/CustomTagSelector/TagDetails.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const TagDetails = ({
3030
removeTag,
3131
tabIndex = 1,
3232
suggestedTagsOptions,
33+
hidePropagateTag,
3334
}: TagDetailType) => {
3435
const keyRef = useRef(null)
3536
const valueRef = useRef(null)
@@ -56,13 +57,15 @@ export const TagDetails = ({
5657
}
5758
return (
5859
<div className="flexbox mb-8">
59-
<div
60-
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith('devtron.ai/') ? 'cursor-not-allowed bcn-1' : ''}`}
61-
onClick={propagateTagToResource}
62-
data-testid={`propagate-tag-${index}`}
63-
>
64-
<InjectTag className={`icon-dim-20 mt-4 ${tagData.propagate ? 'scn-0' : ''}`} />
65-
</div>
60+
{!hidePropagateTag && (
61+
<div
62+
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith('devtron.ai/') ? 'cursor-not-allowed bcn-1' : ''}`}
63+
onClick={propagateTagToResource}
64+
data-testid={`propagate-tag-${index}`}
65+
>
66+
<InjectTag className={`icon-dim-20 mt-4 ${tagData.propagate ? 'scn-0' : ''}`} />
67+
</div>
68+
)}
6669
<TagLabelValueSelector
6770
selectedTagIndex={index}
6871
tagData={tagData}

0 commit comments

Comments
 (0)