Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4425 add additional tag based filtering in helm UI page #4525

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"@mui/lab": "^6.0.0-beta.10",
"@mui/material": "^6.1.0",
"@mui/styles": "^6.1.2",
"@mui/x-tree-view": "^7.18.0",
"@rjsf/core": "^5.21.2",
"@rjsf/mui": "^5.21.2",
"@rjsf/utils": "^5.21.2",
Expand Down
34 changes: 2 additions & 32 deletions src/webview/common/devfileSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { DevfileListItem } from './devfileListItem';
import { LoadScreen } from './loading';
import CodeMirror from '@uiw/react-codemirror';
import { yaml } from '@codemirror/lang-yaml';
import { vscodeDarkInit, vscodeLightInit } from '@uiw/codemirror-theme-vscode';
import { vsDarkCodeMirrorTheme, vsLightCodeMirrorTheme } from './vscode-theme';

// in order to add custom named colours for use in Material UI's `color` prop,
// you need to use module augmentation.
Expand Down Expand Up @@ -75,36 +75,6 @@ function LinkButton(props: { href: string; disabled: boolean; onClick: () => voi
);
}

const vsDark = vscodeDarkInit({
settings: {
background: 'var(--vscode-editor-background)',
foreground: 'var(--vscode-editor-foreground)',
caret: 'var(--vscode-editorCursor-foreground)',
selection: 'var(--vscode-editor-selectionBackground)',
selectionMatch: 'var(--vscode-editor-findMatchBackground)',
lineHighlight: 'var(--vscode-editor-lineHighlightBackground)',
gutterBackground: 'var(--vscode-editorGutter-background)',
gutterForeground: 'var(--vscode-editorHint-foreground)',
fontFamily: 'var(--vscode-editor-font-family)',
fontSize: 'var(--vscode-editor-font-size)'
}
});

const vsLight = vscodeLightInit({
settings: {
background: 'var(--vscode-editor-background)',
foreground: 'var(--vscode-editor-foreground)',
caret: 'var(--vscode-editorCursor-foreground)',
selection: 'var(--vscode-editor-selectionBackground)',
selectionMatch: 'var(--vscode-editor-findMatchBackground)',
lineHighlight: 'var(--vscode-editor-lineHighlightBackground)',
gutterBackground: 'var(--vscode-editorGutter-background)',
gutterForeground: 'var(--vscode-editorHint-foreground)',
fontFamily: 'var(--vscode-editor-font-family)',
fontSize: 'var(--vscode-editor-font-size)'
}
});

function SearchBar(props: {
searchText: string;
setSearchText: React.Dispatch<React.SetStateAction<string>>;
Expand Down Expand Up @@ -464,7 +434,7 @@ const SelectTemplateProject = React.forwardRef(
width='fullWidth'
extensions={[yaml()]}
readOnly
theme={props.theme?.palette.mode === 'light' ? vsLight : vsDark}
theme={props.theme?.palette.mode === 'light' ? vsLightCodeMirrorTheme : vsDarkCodeMirrorTheme}
basicSetup={{
lineNumbers: true,
highlightActiveLine: true,
Expand Down
31 changes: 31 additions & 0 deletions src/webview/common/vscode-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*-----------------------------------------------------------------------------------------------*/

import { createTheme, PaletteMode, Theme } from '@mui/material';
import { vscodeDarkInit, vscodeLightInit } from '@uiw/codemirror-theme-vscode';

// in order to add custom named colours for use in Material UI's `color` prop,
// you need to use module augmentation.
Expand Down Expand Up @@ -175,3 +176,33 @@ export function createVSCodeTheme(paletteMode: PaletteMode): Theme {
},
});
}

export const vsDarkCodeMirrorTheme = vscodeDarkInit({
settings: {
background: 'var(--vscode-editor-background)',
foreground: 'var(--vscode-editor-foreground)',
caret: 'var(--vscode-editorCursor-foreground)',
selection: 'var(--vscode-editor-selectionBackground)',
selectionMatch: 'var(--vscode-editor-findMatchBackground)',
lineHighlight: 'var(--vscode-editor-lineHighlightBackground)',
gutterBackground: 'var(--vscode-editorGutter-background)',
gutterForeground: 'var(--vscode-editorHint-foreground)',
fontFamily: 'var(--vscode-editor-font-family)',
fontSize: 'var(--vscode-editor-font-size)'
}
});

export const vsLightCodeMirrorTheme = vscodeLightInit({
settings: {
background: 'var(--vscode-editor-background)',
foreground: 'var(--vscode-editor-foreground)',
caret: 'var(--vscode-editorCursor-foreground)',
selection: 'var(--vscode-editor-selectionBackground)',
selectionMatch: 'var(--vscode-editor-findMatchBackground)',
lineHighlight: 'var(--vscode-editor-lineHighlightBackground)',
gutterBackground: 'var(--vscode-editorGutter-background)',
gutterForeground: 'var(--vscode-editorHint-foreground)',
fontFamily: 'var(--vscode-editor-font-family)',
fontSize: 'var(--vscode-editor-font-size)'
}
});
7 changes: 4 additions & 3 deletions src/webview/helm-chart/app/helmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { VSCodeMessage } from '../vsCodeMessage';
import { HelmListItem } from './helmListItem';
import CodeMirror from '@uiw/react-codemirror';
import { yaml } from '@codemirror/lang-yaml';
import { githubLight, githubDark } from '@uiw/codemirror-theme-github';
import { vsDarkCodeMirrorTheme, vsLightCodeMirrorTheme } from '../../common/vscode-theme';
import jsyaml from 'js-yaml';

type Message = {
Expand Down Expand Up @@ -219,11 +219,12 @@ export const HelmModal = React.forwardRef(
value={yamlValues}
height='300px'
extensions={[yaml()]}
theme={props.theme?.palette.mode === 'light' ? githubLight : githubDark}
theme={props.theme?.palette.mode === 'light' ? vsLightCodeMirrorTheme : vsDarkCodeMirrorTheme}
onChange={handleChange}
basicSetup={{
lineNumbers: true,
highlightActiveLine: true
highlightActiveLine: true,
syntaxHighlighting: true
}} />
{yamlError && <div style={{ color: '#EE0000' }}>Error: {yamlError}</div>}
</Stack>
Expand Down
Loading
Loading