Skip to content

Commit 3c91c61

Browse files
authored
Merge pull request #220 from devtron-labs/feat/config-diff-phase-1
feat: Config Diff - Revamp UI of CM & Secret and Comparison of deployment configurations
2 parents 47128b8 + 49a3bee commit 3c91c61

39 files changed

+1911
-186
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: 1 addition & 1 deletion
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.4",
3+
"version": "0.2.2-beta-19",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
Lines changed: 10 additions & 0 deletions
Loading

src/Assets/Icon/ic-expand.svg

Lines changed: 19 additions & 0 deletions
Loading

src/Assets/Icon/ic-stamp.svg

Lines changed: 9 additions & 0 deletions
Loading

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 1 addition & 12 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() {
@@ -73,7 +62,7 @@ function useCodeEditorContext() {
7362
* Thus as a hack we are using this objects reference to call the latest onChange reference
7463
*/
7564
const _onChange = {
76-
onChange: null
65+
onChange: null,
7766
}
7867

7968
const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.memo(

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/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export const ROUTES = {
105105
PLUGIN_GLOBAL_LIST_DETAIL_V2: 'plugin/global/list/detail/v2',
106106
PLUGIN_GLOBAL_LIST_V2: 'plugin/global/list/v2',
107107
PLUGIN_GLOBAL_LIST_TAGS: 'plugin/global/list/tags',
108+
CONFIG_DATA: 'config/data',
108109
}
109110

110111
export enum KEY_VALUE {

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/Hooks/useUrlFilters/useUrlFilters.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { useMemo } from 'react'
1818
import { useHistory, useLocation } from 'react-router-dom'
19-
import { DEFAULT_BASE_PAGE_SIZE, SortingOrder } from '../../Constants'
19+
import { DEFAULT_BASE_PAGE_SIZE, EXCLUDED_FALSY_VALUES, SortingOrder } from '../../Constants'
2020
import { DEFAULT_PAGE_NUMBER, URL_FILTER_KEYS } from './constants'
2121
import { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types'
2222

@@ -130,7 +130,7 @@ const useUrlFilters = <T = string, K = unknown>({
130130

131131
const updateSearchParams = (paramsToSerialize: Partial<K>) => {
132132
Object.keys(paramsToSerialize).forEach((key) => {
133-
if (paramsToSerialize[key]) {
133+
if (!EXCLUDED_FALSY_VALUES.includes(paramsToSerialize[key])) {
134134
if (Array.isArray(paramsToSerialize[key])) {
135135
searchParams.delete(key)
136136
paramsToSerialize[key].forEach((val) => {
@@ -139,6 +139,8 @@ const useUrlFilters = <T = string, K = unknown>({
139139
} else {
140140
searchParams.set(key, paramsToSerialize[key])
141141
}
142+
} else {
143+
searchParams.delete(key)
142144
}
143145
})
144146
// Not replacing the params as it is being done by _resetPageNumber

0 commit comments

Comments
 (0)