Skip to content

Commit fc5b46c

Browse files
committed
Merge branch 'main' into config-diff-navigation
2 parents 81e5fba + 441de04 commit fc5b46c

File tree

12 files changed

+1058
-1022
lines changed

12 files changed

+1058
-1022
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ GLOBAL_API_TIMEOUT=60000
4141
TRIGGER_API_TIMEOUT=60000
4242
LOGIN_DT_LOGO=
4343
SIDEBAR_DT_LOGO=
44+
USE_V2=
45+
ENABLE_EXTERNAL_ARGO_CD=false

config-overrides.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
"http-proxy-middleware": "^2.0.6",
2626
"marked": "4.3.0",
2727
"moment": "^2.29.4",
28-
"monaco-editor": "0.38.0",
29-
"monaco-editor-webpack-plugin": "^7.1.0",
30-
"monaco-yaml": "4.0.4",
28+
"monaco-editor": "0.45.0",
29+
"monaco-yaml": "5.1.1",
3130
"query-string": "^7.1.1",
3231
"react": "^17.0.2",
3332
"react-csv": "^2.2.2",
@@ -38,7 +37,7 @@
3837
"react-gtm-module": "^2.0.11",
3938
"react-keybind": "^0.9.4",
4039
"react-mde": "^11.5.0",
41-
"react-monaco-editor": "^0.54.0",
40+
"react-monaco-editor": "^0.55.0",
4241
"react-router-dom": "^5.3.4",
4342
"react-select": "^5.2.2",
4443
"react-toastify": "^8.2.0",

src/Pages/GlobalConfigurations/Authorization/UserPermissions/List/UserPermissionListHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ const UserPermissionListHeader = ({
5050
</div>
5151
}
5252
>
53-
<HelpOutlineIcon className="mw-20 icon-dim-20 fcn-6 cursor" />
53+
<div className="flex">
54+
<HelpOutlineIcon className="mw-20 icon-dim-20 fcn-6 cursor" />
55+
</div>
5456
</TippyCustomized>
5557
</div>
5658
<div className="flex dc__gap-8">

src/components/CodeEditor/CodeEditor.tsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
import React, { useEffect, useCallback, useReducer, useRef } from 'react'
22
import MonacoEditor, { MonacoDiffEditor } from 'react-monaco-editor'
3-
import { Progressing, copyToClipboard, useWindowSize } from '@devtron-labs/devtron-fe-common-lib'
3+
import { MODES, Progressing, copyToClipboard, useWindowSize } from '@devtron-labs/devtron-fe-common-lib'
44
import YAML from 'yaml'
55
import ReactGA from 'react-ga4'
66
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
7+
import { configureMonacoYaml } from 'monaco-yaml'
8+
79
import { useJsonYaml, Select, RadioGroup } from '../common'
810
import { ReactComponent as ClipboardIcon } from '../../assets/icons/ic-copy.svg'
911
import { ReactComponent as Info } from '../../assets/icons/ic-info-filled.svg'
1012
import { ReactComponent as ErrorIcon } from '../../assets/icons/ic-error-exclamation.svg'
1113
import { ReactComponent as WarningIcon } from '../../assets/icons/ic-warning.svg'
1214
import './codeEditor.scss'
1315
import 'monaco-editor'
16+
17+
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
18+
import YamlWorker from '../../yaml.worker.js?worker'
1419
import { cleanKubeManifest } from '../../util/Util'
1520

21+
self.MonacoEnvironment = {
22+
getWorker(_, label) {
23+
if (label === MODES.YAML) {
24+
return new YamlWorker()
25+
}
26+
return new editorWorker()
27+
},
28+
}
29+
1630
// @ts-ignore
1731
const { yaml } = monaco.languages || {}
1832

@@ -223,22 +237,20 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
223237
if (!validatorSchema) {
224238
return
225239
}
226-
yaml &&
227-
yaml.yamlDefaults.setDiagnosticsOptions({
228-
validate: true,
229-
enableSchemaRequest: true,
230-
hover: true,
231-
completion: true,
232-
isKubernetes,
233-
format: true,
234-
schemas: [
235-
{
236-
uri: `https://github.com/devtron-labs/devtron/tree/main/scripts/devtron-reference-helm-charts/reference-chart_${chartVersion}/schema.json`, // id of the first schema
237-
fileMatch: ['*'], // associate with our model
238-
schema: validatorSchema,
239-
},
240-
],
241-
})
240+
const config= configureMonacoYaml(monaco, {
241+
enableSchemaRequest: true,
242+
isKubernetes,
243+
schemas: [
244+
{
245+
uri: `https://github.com/devtron-labs/devtron/tree/main/scripts/devtron-reference-helm-charts/reference-chart_${chartVersion}/schema.json`, // id of the first schema
246+
fileMatch: ['*'], // associate with our model
247+
schema: validatorSchema,
248+
},
249+
],
250+
})
251+
return ()=>{
252+
config.dispose()
253+
}
242254
// eslint-disable-next-line react-hooks/exhaustive-deps
243255
}, [validatorSchema, chartVersion])
244256
useEffect(() => {

src/components/app/list-new/AppList.tsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ export default function AppList({ isSuperAdmin, appListCount, isArgoInstalled }:
720720
{isArgoInstalled && (
721721
<>
722722
<Filter
723-
list={masterFilters.appStatus}
723+
list={appStatusFilters}
724724
labelKey="label"
725725
buttonText={APP_LIST_HEADERS.AppStatus}
726726
placeholder={APP_LIST_HEADERS.SearchAppStatus}
@@ -737,7 +737,7 @@ export default function AppList({ isSuperAdmin, appListCount, isArgoInstalled }:
737737
</>
738738
)}
739739
<Filter
740-
list={appStatusFilters}
740+
list={masterFilters.projects}
741741
labelKey="label"
742742
buttonText="Projects"
743743
placeholder="Search Project"
@@ -915,17 +915,19 @@ export default function AppList({ isSuperAdmin, appListCount, isArgoInstalled }:
915915
Helm Apps
916916
</a>
917917
</li>
918-
<li className="tab-list__tab">
919-
<a
920-
className={`tab-list__tab-link ${
921-
currentTab === AppListConstants.AppTabs.ARGO_APPS ? 'active' : ''
922-
}`}
923-
onClick={() => changeAppTab(AppListConstants.AppTabs.ARGO_APPS)}
924-
data-testid="helm-app-list-button"
925-
>
926-
{AppListConstants.AppTabs.ARGO_APPS}
927-
</a>
928-
</li>
918+
{window._env_?.ENABLE_EXTERNAL_ARGO_CD && (
919+
<li className="tab-list__tab">
920+
<a
921+
className={`tab-list__tab-link ${
922+
currentTab === AppListConstants.AppTabs.ARGO_APPS ? 'active' : ''
923+
}`}
924+
onClick={() => changeAppTab(AppListConstants.AppTabs.ARGO_APPS)}
925+
data-testid="helm-app-list-button"
926+
>
927+
{AppListConstants.AppTabs.ARGO_APPS}
928+
</a>
929+
</li>
930+
)}
929931
</ul>
930932
<div className="app-tabs-sync fs-13">
931933
{lastDataSyncTimeString &&
@@ -1048,7 +1050,7 @@ export default function AppList({ isSuperAdmin, appListCount, isArgoInstalled }:
10481050
</>
10491051
)
10501052
}
1051-
if (params.appType === AppListConstants.AppType.ARGO_APPS) {
1053+
if (params.appType === AppListConstants.AppType.ARGO_APPS && window?._env_?.ENABLE_EXTERNAL_ARGO_CD) {
10521054
return (
10531055
<>
10541056
<ExternalArgoList
@@ -1083,13 +1085,13 @@ export default function AppList({ isSuperAdmin, appListCount, isArgoInstalled }:
10831085
}
10841086

10851087
return (
1086-
<>
1088+
<div>
10871089
<HeaderWithCreateButton headerName="Applications" isSuperAdmin={isSuperAdmin} />
10881090
{renderMasterFilters()}
10891091
{renderAppliedFilters()}
10901092
{renderAppTabs()}
10911093
{serverMode === SERVER_MODE.FULL && renderAppCreateRouter()}
10921094
{renderAppListBody()}
1093-
</>
1095+
</div>
10941096
)
10951097
}

src/components/app/list-new/ExternalArgoList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ export default function ExternalArgoList({
197197
<div className="app-list__cell app-list__cell--env">
198198
<span className="app-list__cell-header mr-4">{APP_LIST_HEADERS.Environment}</span>
199199
<Tippy className="default-tt" arrow placement="top" content={ENVIRONMENT_HEADER_TIPPY_CONTENT}>
200-
<HelpOutlineIcon className="icon-dim-20" />
200+
<span>
201+
<HelpOutlineIcon className="icon-dim-20" />
202+
</span>
201203
</Tippy>
202204
</div>
203205

src/components/deploymentConfig/DeploymentTemplateView/DeploymentTemplateEditorView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ const DeploymentTemplateEditorView = ({
466466
value === null ||
467467
fetchingValues ||
468468
draftLoading ||
469-
resolveLoading
469+
resolveLoading ||
470+
!rhs ||
471+
(state.openComparison && !lhs)
470472
}
471473
height={getCodeEditorHeight(isUnSet, isEnvOverride, state.openComparison, state.showReadme)}
472474
diffView={state.openComparison}

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/Logs.component.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -685,15 +685,17 @@ const LogsComponent = ({
685685
/>
686686
) : (
687687
<Tippy className="default-tt" arrow={false} placement="top" content="Download logs">
688-
<Download
689-
className={`icon-dim-16 mr-8 cursor ${
690-
(podContainerOptions?.containerOptions ?? []).length === 0 ||
691-
(prevContainer && showNoPrevContainer != '')
692-
? 'cursor-not-allowed dc__opacity-0_5'
693-
: ''
694-
}`}
695-
onClick={handleDownloadLogs}
696-
/>
688+
<span>
689+
<Download
690+
className={`icon-dim-16 mr-8 cursor ${
691+
(podContainerOptions?.containerOptions ?? []).length === 0 ||
692+
(prevContainer && showNoPrevContainer != '')
693+
? 'cursor-not-allowed dc__opacity-0_5'
694+
: ''
695+
}`}
696+
onClick={handleDownloadLogs}
697+
/>
698+
</span>
697699
</Tippy>
698700
))}
699701
</div>

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ interface customEnv {
5454
NODE_ENV?: string
5555
LOGIN_DT_LOGO?: string
5656
SIDEBAR_DT_LOGO?: string
57+
ENABLE_EXTERNAL_ARGO_CD: boolean
5758
}
5859
declare global {
5960
interface Window {
@@ -169,6 +170,7 @@ if (!window || !window._env_) {
169170
TRIGGER_API_TIMEOUT: 60000,
170171
LOGIN_DT_LOGO: '',
171172
SIDEBAR_DT_LOGO: '',
173+
ENABLE_EXTERNAL_ARGO_CD: false,
172174
}
173175
}
174176

0 commit comments

Comments
 (0)