Skip to content

Commit

Permalink
frontend: EditorDialog: Remove unneeded Monaco override
Browse files Browse the repository at this point in the history
This change addresses a regression where a local MonacoEnvironment
override caused conflicts with Monaco-based components like DiffEditor.
The Monaco override logic in EditorDialog is now removed to restore the
default environment.

Fixes: #2693

Signed-off-by: Evangelos Skopelitis <[email protected]>

change
  • Loading branch information
skoeva committed Jan 17, 2025
1 parent 59db42b commit 18bdbc1
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions frontend/src/components/common/Resource/EditorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import Switch from '@mui/material/Switch';
import Typography from '@mui/material/Typography';
import * as yaml from 'js-yaml';
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
Expand All @@ -38,24 +33,6 @@ import Tabs from '../Tabs';
import DocsViewer from './DocsViewer';
import SimpleEditor from './SimpleEditor';

(self as any).MonacoEnvironment = {
getWorker(_: unknown, label: string) {
if (label === 'json') {
return new jsonWorker();
}
if (label === 'css' || label === 'scss' || label === 'less') {
return new cssWorker();
}
if (label === 'html' || label === 'handlebars' || label === 'razor') {
return new htmlWorker();
}
if (label === 'typescript' || label === 'javascript') {
return new tsWorker();
}
return new editorWorker();
},
};

type KubeObjectIsh = Partial<KubeObjectInterface>;

export interface EditorDialogProps extends DialogProps {
Expand Down

0 comments on commit 18bdbc1

Please sign in to comment.