Skip to content

Commit ab7510c

Browse files
authored
Merge pull request #2478 from devtron-labs/chore/main-to-dev-sync
chore: sync develop with main
2 parents 1a16504 + b4a01ad commit ab7510c

File tree

51 files changed

+1076
-670
lines changed

Some content is hidden

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

51 files changed

+1076
-670
lines changed

package.json

Lines changed: 9 additions & 2 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.7.0",
7+
"@devtron-labs/devtron-fe-common-lib": "1.7.1",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -23,6 +23,8 @@
2323
"flexsearch": "^0.6.32",
2424
"jsonpath-plus": "^10.0.0",
2525
"moment": "^2.29.4",
26+
"monaco-editor": "0.44.0",
27+
"monaco-yaml": "5.1.1",
2628
"query-string": "^7.1.1",
2729
"react": "^17.0.2",
2830
"react-csv": "^2.2.2",
@@ -31,6 +33,7 @@
3133
"react-ga4": "^1.4.1",
3234
"react-gtm-module": "^2.0.11",
3335
"react-mde": "^11.5.0",
36+
"react-monaco-editor": "^0.55.0",
3437
"react-router-dom": "^5.3.4",
3538
"react-select": "5.8.0",
3639
"react-virtualized": "^9.22.5",
@@ -142,7 +145,11 @@
142145
],
143146
"setupFilesAfterEnv": [
144147
"jest-extended"
145-
]
148+
],
149+
"moduleNameMapper": {
150+
"monaco-editor": "<rootDir>/node_modules/react-monaco-editor",
151+
"monaco-yaml": "<rootDir>/node_modules/react-monaco-editor"
152+
}
146153
},
147154
"resolutions": {
148155
"nanoid": "^3.3.8",

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const CompareConfigView = ({
3434
selectedChartVersion,
3535
draftChartVersion,
3636
isDeleteOverrideView,
37+
editorKey = `${compareFromSelectedOptionValue || 'compare'}-draft-editor-key`,
3738
className = '',
3839
errorInfo,
3940
handleErrorReload,
@@ -71,6 +72,7 @@ const CompareConfigView = ({
7172
) : (
7273
<div className="p-16">
7374
<DeploymentHistoryDiffView
75+
key={editorKey}
7476
currentConfiguration={getCompareViewHistoryDiffConfigProps(
7577
publishedEditorTemplate,
7678
publishedEditorConfig,

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigDryRun.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const ConfigDryRun = ({
9595
return (
9696
<CodeEditor
9797
value={editorTemplate}
98-
height="fitToParent"
98+
height="100%"
9999
readOnly
100100
mode={MODES.YAML}
101101
noParsing
@@ -155,7 +155,7 @@ const ConfigDryRun = ({
155155
>
156156
<CodeEditor
157157
value={manifestResponse?.result?.data || ''}
158-
height="fitToParent"
158+
height="100%"
159159
mode={MODES.YAML}
160160
readOnly
161161
noParsing

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@ const DeploymentTemplate = ({
15561556
}
15571557
draftChartVersion={draftTemplateData?.selectedChart?.version}
15581558
isDeleteOverrideView={isDeleteOverrideDraft}
1559+
editorKey={`${compareFromSelectedOptionValue || 'compare'}-draft-editor-key-${Number(!!hideLockedKeys)}-${shouldMergeTemplateWithPatches ? 'with-merged-values' : 'without-merged-values'}-${resolveScopedVariables ? 'in-resolved-view' : 'in-unresolved-view'}`}
15591560
{...getCompareFromEditorConfig({
15601561
envId,
15611562
isDeleteOverrideDraft,

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ export type CompareConfigViewProps = {
304304
publishedEditorConfig: CompareConfigViewEditorConfigType
305305
draftChartVersion?: string
306306
selectedChartVersion?: string
307+
/**
308+
* @default ${compareFromSelectedOptionValue}-"draft-editor-key"
309+
*/
310+
editorKey?: string
307311
className?: string
308312
/**
309313
* @default 'Data'

src/Pages/GlobalConfigurations/Authorization/SSOLoginServices/SSOLogin.component.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
Button,
4242
ButtonVariantType,
4343
ComponentSizeType,
44-
MODES,
4544
ConfirmationModal,
4645
ConfirmationModalVariantType,
4746
} from '@devtron-labs/devtron-fe-common-lib'
@@ -681,20 +680,23 @@ class SSOLogin extends Component<SSOLoginProps, SSOLoginState> {
681680

682681
const shebangHtml = this.state.configMap === SwitchItemValues.Configuration ? presetConfig : null
683682

683+
const decorationWidth = this.state.sso !== OIDCType ? 50 : 25
684684
return (
685-
<CodeEditor.Container>
685+
<div className="br-4 dc__border w-100 dc__overflow-hidden">
686686
<CodeEditor
687687
value={codeEditorBody}
688-
mode={MODES.YAML}
688+
mode="yaml"
689689
noParsing={this.state.sso === OIDCType}
690+
lineDecorationsWidth={this.state.configMap === SwitchItemValues.Configuration ? decorationWidth : 0}
690691
shebang={shebangHtml}
691692
readOnly={this.state.configMap !== SwitchItemValues.Configuration}
692693
onChange={this.handleConfigChange}
693694
onBlur={this.handleOnBlur}
694-
height="auto"
695+
adjustEditorHeightToContent
695696
>
696697
<CodeEditor.Header>
697698
<div className="flex dc__content-space dc__gap-6">
699+
<CodeEditor.ValidationError />
698700
<div className="dc__no-shrink">
699701
<Switch
700702
value={this.state.configMap}
@@ -710,7 +712,7 @@ class SSOLogin extends Component<SSOLoginProps, SSOLoginState> {
710712
</div>
711713
</CodeEditor.Header>
712714
</CodeEditor>
713-
</CodeEditor.Container>
715+
</div>
714716
)
715717
}
716718

src/Pages/GlobalConfigurations/Authorization/SSOLoginServices/ssoLogin.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
1717
.sso-login__wrapper {
1818
.code-editor__text {
1919
resize: none;
2020
line-height: 1.4;
2121
border: none;
22+
padding: 0 35px;
2223
overflow: hidden;
2324
color: var(--R500);
2425
font-size: 14px;

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretData.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
ComponentSizeType,
2626
KeyValueConfig,
2727
KeyValueTable,
28-
MODES,
2928
noop,
3029
StyledRadioGroup,
3130
ToastManager,
@@ -294,15 +293,16 @@ export const ConfigMapSecretData = ({
294293
})
295294

296295
return (
297-
<CodeEditor.Container>
296+
<div className="dc__border br-4 dc__overflow-hidden">
298297
<CodeEditor
299298
key={codeEditorRadio}
300299
value={getCodeEditorValue()}
301300
// Skip calling onChange if resolvedData exists
302301
onChange={!isLocked && !data.isResolvedData ? onChange : noop}
303302
onFocus={onFocus}
304-
mode={MODES.YAML}
305-
height="100%"
303+
mode="yaml"
304+
inline
305+
height={350}
306306
shebang={sheBangText}
307307
readOnly={
308308
readOnly || isHashiOrAWS || isLocked || codeEditorRadio === CODE_EDITOR_RADIO_STATE.SAMPLE
@@ -338,7 +338,7 @@ export const ConfigMapSecretData = ({
338338
)}
339339
</CodeEditor>
340340
{!data.external && data.yamlMode && renderYamlInfoText()}
341-
</CodeEditor.Container>
341+
</div>
342342
)
343343
}
344344

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretDryRun.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,13 @@ export const ConfigMapSecretDryRun = ({
195195
areScopeVariablesResolving={areScopeVariablesResolving}
196196
fallbackMergeStrategy={DEFAULT_MERGE_STRATEGY}
197197
/>
198-
{renderExternalInfo(
199-
dryRunConfigMapSecretData.externalType,
200-
dryRunConfigMapSecretData.external,
201-
componentType,
202-
'mr-16 ml-16',
203-
)}
198+
<div className="px-16 pb-16">
199+
{renderExternalInfo(
200+
dryRunConfigMapSecretData.externalType,
201+
dryRunConfigMapSecretData.external,
202+
componentType,
203+
)}
204+
</div>
204205
</>
205206
)
206207
}
@@ -231,7 +232,7 @@ export const ConfigMapSecretDryRun = ({
231232
/>
232233
</div>
233234
</div>
234-
{renderLHSContent()}
235+
<div className="flex-grow-1 dc__overflow-auto">{renderLHSContent()}</div>
235236
</div>
236237
)
237238

@@ -251,7 +252,9 @@ export const ConfigMapSecretDryRun = ({
251252
reload: reloadConfigMapSecretManifest,
252253
}}
253254
>
254-
<CodeEditor value={configMapSecretManifest?.manifest} height="fitToParent" mode={MODES.YAML} readOnly />
255+
<div className="flex-grow-1 dc__overflow-auto">
256+
<CodeEditor value={configMapSecretManifest?.manifest} height="100%" mode={MODES.YAML} readOnly />
257+
</div>
255258
</APIResponseHandler>
256259
</div>
257260
)

src/components/CIPipelineN/CustomScript.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import React, { useContext, useEffect, useState } from 'react'
18-
import { ScriptType, CodeEditor, MODES } from '@devtron-labs/devtron-fe-common-lib'
18+
import { ScriptType, CodeEditor } from '@devtron-labs/devtron-fe-common-lib'
1919
import { TaskFieldDescription, TaskFieldLabel } from '../ciPipeline/types'
2020
import TaskFieldTippyDescription from './TaskFieldTippyDescription'
2121
import { ReactComponent as AlertTriangle } from '../../assets/icons/ic-alert-triangle.svg'
@@ -44,15 +44,16 @@ const CustomScript = ({ handleScriptChange }: CustomScriptType) => {
4444
contentDescription={TaskFieldDescription.SCRIPT}
4545
/>
4646
)}
47-
<CodeEditor.Container>
47+
<div className="script-container no-padding-script-container">
4848
<CodeEditor
49-
mode={MODES.SHELL}
49+
mode="shell"
5050
noParsing
5151
onChange={(value) => handleScriptChange({ target: { value } })}
52+
inline
5253
height={300}
5354
value={editorValue}
5455
/>
55-
</CodeEditor.Container>
56+
</div>
5657
</div>
5758

5859
{formDataErrorObj[activeStageName].steps[selectedTaskIndex].inlineStepDetail?.script &&

0 commit comments

Comments
 (0)