Skip to content

Commit 9a1074c

Browse files
committed
refactor: remove CodeEditorWrapper, move CodeEditor to Shared/Components, update instances of CodeEditor
1 parent 623112d commit 9a1074c

25 files changed

+6
-154
lines changed

src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useMemo, useState } from 'react'
1818
import { useParams } from 'react-router-dom'
1919
import Tippy from '@tippyjs/react'
2020

21-
import { CodeEditor } from '@Shared/Components/CodeEditorWrapper'
21+
import { CodeEditor } from '@Shared/Components/CodeEditor'
2222
import { renderDiffViewNoDifferenceState } from '@Shared/Components/DeploymentConfigDiff'
2323
import { DiffViewer } from '@Shared/Components/DiffViewer'
2424

@@ -79,19 +79,12 @@ const DeploymentHistoryDiffView = ({
7979
) : (
8080
<CodeEditor
8181
key={codeEditorKey}
82+
value={editorValuesRHS}
83+
height="auto"
8284
disableSearch
8385
readOnly
8486
noParsing
8587
mode={MODES.YAML}
86-
codeEditorProps={{
87-
value: editorValuesRHS,
88-
defaultValue: editorValuesLHS,
89-
adjustEditorHeightToContent: true,
90-
}}
91-
codeMirrorProps={{
92-
value: editorValuesRHS,
93-
height: 'auto',
94-
}}
9588
/>
9689
)
9790

src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { MODES } from '@Common/Constants'
1818
import { Progressing } from '@Common/Progressing'
1919
import { hasHashiOrAWS } from '@Pages/index'
2020

21-
import { CodeEditor } from '../CodeEditorWrapper'
21+
import { CodeEditor } from '../CodeEditor'
2222
import { renderHashiOrAwsDeprecatedInfo } from './helpers'
2323
import { ConfigMapSecretReadyOnlyProps } from './types'
2424
import { getConfigMapSecretReadOnlyValues } from './utils'
@@ -68,19 +68,7 @@ const ConfigMapSecretReadyOnly = ({
6868
</div>
6969
{!hideCodeEditor && displayValues.data && (
7070
<CodeEditor.Container>
71-
<CodeEditor
72-
mode={MODES.YAML}
73-
readOnly
74-
codeEditorProps={{
75-
value: displayValues.data,
76-
inline: true,
77-
adjustEditorHeightToContent: true,
78-
}}
79-
codeMirrorProps={{
80-
value: displayValues.data,
81-
height: 'auto',
82-
}}
83-
>
71+
<CodeEditor mode={MODES.YAML} readOnly value={displayValues.data} height="auto">
8472
<CodeEditor.Header>
8573
<div className="flex dc__content-space">
8674
<p className="m-0 fs-13 lh-20 fw-6 cn-9">Data</p>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/Common/CodeMirror/Commands/findAndReplace.ts renamed to src/Shared/Components/CodeEditor/Commands/findAndReplace.ts

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)