Skip to content

Commit 57c209a

Browse files
Merge branch 'develop' into feat/theme-dialog
2 parents 9f674ac + 84bf352 commit 57c209a

30 files changed

+212
-80
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ src/Common/Drawer/Drawer.tsx
3030
src/Common/Grid/Grid.tsx
3131
src/Common/Helper.tsx
3232
src/Common/Hooks/UseClickOutside/UseClickOutside.tsx
33-
src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx
3433
src/Common/Hooks/UseWindowSize/UseWindowSize.tsx
3534
src/Common/ImageTags.tsx
3635
src/Common/InfoColorBar/InfoColourbar.tsx

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.8.6",
3+
"version": "1.8.8",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -107,7 +107,8 @@
107107
"@replit/codemirror-indentation-markers": "6.5.3",
108108
"@replit/codemirror-vscode-keymap": "6.0.2",
109109
"@types/react-dates": "^21.8.6",
110-
"@uiw/codemirror-theme-github": "^4.23.7",
110+
"@uiw/codemirror-extensions-hyper-link": "4.23.10",
111+
"@uiw/codemirror-theme-github": "4.23.7",
111112
"@uiw/react-codemirror": "4.23.7",
112113
"ansi_up": "^5.2.1",
113114
"codemirror-json-schema": "0.8.0",

src/Assets/IconV2/ic-crown.svg

Lines changed: 3 additions & 0 deletions
Loading

src/Assets/IconV2/ic-user-key.svg

Lines changed: 4 additions & 0 deletions
Loading

src/Common/AddCDButton/AddCDButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const TooltipContent = ({ tooltipContent }: TooltipContentProps) => {
2222
if (tooltipContent) {
2323
return (
2424
<div className="dc__white-space-pre-wrap">
25-
<p className="m-0 cn-0 fs-12 fw-6 lh-18">Click to add</p>
25+
<p className="m-0 fs-12 fw-6 lh-18">Click to add</p>
2626

2727
{tooltipContent}
2828
</div>

src/Common/ChartVersionAndTypeSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const ChartVersionAndTypeSelector = ({ setSelectedChartRefId }: ChartVersionAndT
7575
}
7676

7777
return (
78-
<div className="flex">
78+
<div className="flex left">
7979
<div className="chart-type-options flex" data-testid="chart-type-options">
8080
<span className="cn-7 mr-4">Chart Type</span>
8181
<SelectPicker

src/Common/CodeEditor/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export interface CodeEditorHeaderComposition {
101101
Clipboard?: React.FC<any>
102102
}
103103

104-
export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight'
104+
type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight'
105105

106106
export interface Action {
107107
type: ActionTypes

src/Common/CodeMirror/CodeEditor.components.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const SplitPane = () => {
4545
}
4646

4747
export const Header = ({ children, className, hideDefaultSplitHeader }: CodeEditorHeaderProps) => {
48-
const { diffMode, lhsValue, hasCodeEditorContainer, theme } = useCodeEditorContext()
48+
const { diffMode, readOnly, lhsValue, hasCodeEditorContainer, theme } = useCodeEditorContext()
4949

5050
return (
5151
<div className={`${getComponentSpecificThemeClass(theme)} flexbox w-100 border__primary--bottom`}>
@@ -56,7 +56,9 @@ export const Header = ({ children, className, hideDefaultSplitHeader }: CodeEdit
5656
{children}
5757
{!hideDefaultSplitHeader && lhsValue && <SplitPane />}
5858
</div>
59-
{diffMode ? <div className="bg__secondary px-5 dc__align-self-stretch" /> : null}
59+
{diffMode ? (
60+
<div className={`bg__secondary dc__align-self-stretch ${readOnly ? 'px-15' : 'px-5'}`} />
61+
) : null}
6062
</div>
6163
)
6264
}

src/Common/CodeMirror/CodeEditor.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ import { search } from '@codemirror/search'
2828
import { lintGutter } from '@codemirror/lint'
2929
import { vscodeKeymap } from '@replit/codemirror-vscode-keymap'
3030
import { indentationMarkers } from '@replit/codemirror-indentation-markers'
31+
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link'
3132

3233
import { AppThemeType, useTheme } from '@Shared/Providers'
3334
import { getUniqueId } from '@Shared/Helpers'
3435
import { cleanKubeManifest } from '@Common/Helper'
3536
import { DEFAULT_JSON_SCHEMA_URI, MODES } from '@Common/Constants'
3637

3738
import { codeEditorFindReplace, readOnlyTooltip, yamlHighlight } from './Extensions'
38-
import { openSearchPanel, openSearchPanelWithReplace, replaceAll, showReplaceFieldState } from './Commands'
39+
import {
40+
blurOnEscape,
41+
openSearchPanel,
42+
openSearchPanelWithReplace,
43+
replaceAll,
44+
showReplaceFieldState,
45+
} from './Commands'
3946
import { CodeEditorContextProps, CodeEditorProps } from './types'
4047
import { getFoldGutterElement, getLanguageExtension, getValidationSchema, parseValueToCode } from './utils'
4148
import { CodeEditorContext } from './CodeEditor.context'
@@ -48,6 +55,11 @@ import './codeEditor.scss'
4855
// CODEMIRROR CLASSES
4956
const foldingCompartment = new Compartment()
5057

58+
// EXTENSIONS
59+
const foldConfig = foldGutter({
60+
markerDOM: getFoldGutterElement,
61+
})
62+
5163
const CodeEditor = <DiffView extends boolean = false>({
5264
theme,
5365
value: propValue,
@@ -184,10 +196,6 @@ const CodeEditor = <DiffView extends boolean = false>({
184196
}
185197

186198
// EXTENSIONS
187-
const foldConfig = foldGutter({
188-
markerDOM: getFoldGutterElement,
189-
})
190-
191199
const getBaseExtensions = (): Extension[] => [
192200
basicSetup(basicSetupOptions),
193201
themeExtension,
@@ -196,6 +204,7 @@ const CodeEditor = <DiffView extends boolean = false>({
196204
...(!disableSearch ? [{ key: 'Mod-f', run: openSearchPanel, scope: 'editor search-panel' }] : []),
197205
{ key: 'Mod-Enter', run: replaceAll, scope: 'editor search-panel' },
198206
{ key: 'Mod-Alt-f', run: openSearchPanelWithReplace, scope: 'editor search-panel' },
207+
{ key: 'Escape', run: blurOnEscape, stopPropagation: true },
199208
]),
200209
indentationMarkers(),
201210
getLanguageExtension(mode),
@@ -206,6 +215,7 @@ const CodeEditor = <DiffView extends boolean = false>({
206215
}),
207216
showReplaceFieldState,
208217
...(mode === MODES.YAML ? [yamlHighlight] : []),
218+
hyperLink,
209219
]
210220

211221
const extensions: Extension[] = [
@@ -222,7 +232,6 @@ const CodeEditor = <DiffView extends boolean = false>({
222232
basicSetup({
223233
...basicSetupOptions,
224234
lineNumbers: false,
225-
foldGutter: false,
226235
highlightActiveLine: false,
227236
highlightActiveLineGutter: false,
228237
syntaxHighlighting: false,

0 commit comments

Comments
 (0)