Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c6578bf
init
lucasgoral Sep 30, 2025
cfb88ac
init
lucasgoral Sep 30, 2025
c72cfe8
fix
lucasgoral Sep 30, 2025
551137c
fixes
lucasgoral Sep 30, 2025
2c26168
Create YamlDiffEditor.tsx
lucasgoral Sep 30, 2025
74b20cf
fix
lucasgoral Sep 30, 2025
f0f6d7a
fix
lucasgoral Sep 30, 2025
a7d1fe5
Create remove-me.yaml
lucasgoral Oct 1, 2025
761f2b6
fix
lucasgoral Oct 1, 2025
2f8fbac
Delete remove-me.yaml
lucasgoral Oct 1, 2025
b7b3c66
fix
lucasgoral Oct 1, 2025
9cab399
Merge branch 'main' into resources-yaml-edit
lucasgoral Oct 1, 2025
de46380
Update YamlViewer.tsx
lucasgoral Oct 1, 2025
d303b4a
Update YamlLoader.tsx
lucasgoral Oct 1, 2025
eb5a125
fix
lucasgoral Oct 1, 2025
0e1fe63
Update YamlViewer.tsx
lucasgoral Oct 1, 2025
2d5d9f6
fix
lucasgoral Oct 1, 2025
4694584
Delete generate-github-themes.ts
lucasgoral Oct 1, 2025
3110aeb
fix
lucasgoral Oct 1, 2025
eb04c0e
Update monaco.ts
lucasgoral Oct 1, 2025
f8a59fd
merge
lucasgoral Oct 1, 2025
a937eef
fix
lucasgoral Oct 2, 2025
442bd02
Merge branch 'main' into resources-yaml-edit
lucasgoral Oct 2, 2025
33d4d0d
fixes
lucasgoral Oct 2, 2025
a7e6cb8
fix
lucasgoral Oct 2, 2025
a8428a4
fix
lucasgoral Oct 2, 2025
198714f
fix
lucasgoral Oct 2, 2025
6bc59d2
Update monaco.ts
lucasgoral Oct 2, 2025
736aac4
Revert "Update monaco.ts"
lucasgoral Oct 2, 2025
64412df
Update WorkspacesList.module.css
lucasgoral Oct 2, 2025
cd88b8e
Merge branch 'main' into resources-yaml-edit
lucasgoral Oct 2, 2025
eb98bcc
Update src/components/Yaml/YamlPanel.tsx
lucasgoral Oct 2, 2025
6e226d4
Update src/components/Yaml/YamlViewer.tsx
lucasgoral Oct 2, 2025
7dcf2e8
Update YamlViewer.tsx
lucasgoral Oct 2, 2025
b6ae075
Merge branch 'resources-yaml-edit' of https://github.com/openmcp-proj…
lucasgoral Oct 2, 2025
51cf3f0
Update monaco.ts
lucasgoral Oct 3, 2025
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
608 changes: 281 additions & 327 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@fastify/static": "8.2.0",
"@fastify/vite": "8.2.0",
"@hookform/resolvers": "5.2.2",
"@monaco-editor/react": "^4.7.0",
"@sentry/node": "10.15.0",
"@sentry/react": "10.15.0",
"@sentry/vite-plugin": "4.3.0",
Expand All @@ -54,13 +55,14 @@
"i18next": "25.5.2",
"javascript-time-ago": "2.5.12",
"js-yaml": "4.1.0",
"monaco-editor": "^0.45.0",
"monaco-yaml": "^5.4.0",
"react": "19.1.1",
"react-dom": "19.1.1",
"react-error-boundary": "6.0.0",
"react-hook-form": "7.63.0",
"react-i18next": "16.0.0",
"react-router-dom": "7.9.3",
"react-syntax-highlighter": "15.6.6",
"react-time-ago": "7.3.5",
"swr": "2.3.6",
"yaml": "2.8.1",
Expand All @@ -76,7 +78,6 @@
"@types/node": "22.18.6",
"@types/react": "19.1.15",
"@types/react-dom": "19.1.9",
"@types/react-syntax-highlighter": "15.5.13",
"@ui5/webcomponents-cypress-commands": "2.14.1",
"@vitejs/plugin-react": "5.0.4",
"@vitest/eslint-plugin": "1.3.13",
Expand All @@ -97,6 +98,7 @@
"typescript": "5.9.2",
"typescript-eslint": "8.44.1",
"vite": "7.1.7",
"vite-plugin-static-copy": "^3.1.2",
"vitest": "3.2.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.card {
margin: 0.75rem 0.75rem 0.75rem 0;
margin: 0;
}

.container {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, FlexBox, Grid, ObjectPageSection, Panel, Title } from '@ui5/webcomponents-react';
import { Button, FlexBox, ObjectPageSection, Panel, Title } from '@ui5/webcomponents-react';
import '@ui5/webcomponents-fiori/dist/illustrations/NoData.js';
import '@ui5/webcomponents-fiori/dist/illustrations/EmptyList.js';
import '@ui5/webcomponents-icons/dist/delete';
Expand Down Expand Up @@ -161,16 +161,18 @@ export function ControlPlaneListWorkspaceGridTile({ projectName, workspace }: Pr
}
/>
) : (
<Grid defaultSpan="XL4 L4 M7 S12">
{controlplanes?.map((cp) => (
<ControlPlaneCard
key={`${cp.metadata.name}--${cp.metadata.namespace}`}
controlPlane={cp}
projectName={projectName}
workspace={workspace}
/>
))}
</Grid>
<div className={styles.wrapper}>
<div className={styles.grid}>
{controlplanes?.map((cp) => (
<ControlPlaneCard
key={`${cp.metadata.name}--${cp.metadata.namespace}`}
controlPlane={cp}
projectName={projectName}
workspace={workspace}
/>
))}
</div>
</div>
)}
</Panel>
</ObjectPageSection>
Expand Down
17 changes: 17 additions & 0 deletions src/components/ControlPlanes/List/WorkspacesList.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.createButton {
margin-bottom: 2rem;
}

.wrapper {
margin-top: 0.375rem;
margin-bottom: 0.375rem;
}

.grid {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
@container (width > 768px) {
grid-template-columns: 1fr 1fr;
}
@container (width > 1024px) {
grid-template-columns: 1fr 1fr 1fr;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.wrapper {
position: relative;
height: 100%;
}
41 changes: 20 additions & 21 deletions src/components/Wizards/CreateManagedControlPlane/SummarizeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
ComponentsListItem,
CreateManagedControlPlane,
} from '../../../lib/api/types/crate/createManagedControlPlane.ts';

import YamlPanel from '../../Yaml/YamlPanel.tsx';
import { idpPrefix } from '../../../utils/idpPrefix.ts';
import { UseFormWatch } from 'react-hook-form';
import { CreateDialogProps } from '../../Dialogs/CreateWorkspaceDialogContainer.tsx';
import { YamlDiff } from '../../Yaml/YamlDiff.tsx';

import styles from './SummarizeStep.module.css';
import { YamlDiff } from './YamlDiff.tsx';
interface SummarizeStepProps {
watch: UseFormWatch<CreateDialogProps>;
projectName: string;
Expand All @@ -30,9 +32,22 @@ export const SummarizeStep: React.FC<SummarizeStepProps> = ({
isEditMode = false,
}) => {
const { t } = useTranslation();

const yamlString = stringify(
CreateManagedControlPlane(
watch('name'),
`${projectName}--ws-${workspaceName}`,
{
displayName: watch('displayName'),
chargingTarget: watch('chargingTarget'),
members: watch('members'),
componentsList: componentsList ?? [],
chargingTargetType: watch('chargingTargetType'),
},
idpPrefix,
),
);
return (
<>
<div className={styles.wrapper}>
<Title>{t('common.summarize')}</Title>
<Grid defaultSpan="XL6 L6 M6 S6">
<div>
Expand Down Expand Up @@ -78,26 +93,10 @@ export const SummarizeStep: React.FC<SummarizeStepProps> = ({
)}
/>
) : (
<YamlPanel
yamlString={stringify(
CreateManagedControlPlane(
watch('name'),
`${projectName}--ws-${workspaceName}`,
{
displayName: watch('displayName'),
chargingTarget: watch('chargingTarget'),
members: watch('members'),
componentsList: componentsList ?? [],
chargingTargetType: watch('chargingTargetType'),
},
idpPrefix,
),
)}
filename={`mcp_${projectName}--ws-${workspaceName}`}
/>
<YamlPanel yamlString={yamlString} filename={`mcp_${projectName}--ws-${workspaceName}`} />
)}
</div>
</Grid>
</>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.container {
position: absolute;
top: 0;
bottom: 0;
width: calc(50% - 2rem);
right: 0;
overflow: hidden;
}
16 changes: 16 additions & 0 deletions src/components/Wizards/CreateManagedControlPlane/YamlDiff.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { FC } from 'react';

import styles from './YamlDiff.module.css';
import { YamlDiffEditor } from '../../YamlEditor/YamlDiffEditor.tsx';
type YamlDiffProps = {
originalYaml: string;
modifiedYaml: string;
};

export const YamlDiff: FC<YamlDiffProps> = ({ originalYaml, modifiedYaml }) => {
return (
<div className={styles.container}>
<YamlDiffEditor original={originalYaml} modified={modifiedYaml} />
</div>
);
};
11 changes: 0 additions & 11 deletions src/components/Yaml/YamlDiff.module.css

This file was deleted.

56 changes: 0 additions & 56 deletions src/components/Yaml/YamlDiff.tsx

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion src/components/Yaml/YamlPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const YamlPanel: FC<YamlPanelProps> = ({ yamlString, filename }) => {
</Button>
)}
</FlexBox>
<YamlViewer yamlString={yamlString} />
<YamlViewer yamlString={yamlString} filename={filename} />
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/components/Yaml/YamlViewButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button } from '@ui5/webcomponents-react';
import styles from './YamlViewButton.module.css';
import { useTranslation } from 'react-i18next';
import { Resource } from '../../utils/removeManagedFieldsAndFilterData.ts';

import { YamlIcon } from './YamlIcon.tsx';
import { useSplitter } from '../Splitter/SplitterContext.tsx';
import { YamlSidePanel } from './YamlSidePanel.tsx';
Expand Down
4 changes: 3 additions & 1 deletion src/components/Yaml/YamlViewer.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.container {
position: relative;
width: 100%;
height: calc(100vh - 8rem);
max-width: 100%;
}
36 changes: 6 additions & 30 deletions src/components/Yaml/YamlViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
import { FC } from 'react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { materialLight, materialDark } from 'react-syntax-highlighter/dist/esm/styles/prism';

import { YamlEditor } from '../YamlEditor/YamlEditor';

import styles from './YamlViewer.module.css';
import { useTheme } from '../../hooks/useTheme.ts';

type YamlViewerProps = {
yamlString: string;
filename: string;
};

export const YamlViewer: FC<YamlViewerProps> = ({ yamlString }) => {
const { isDarkTheme } = useTheme();

export const YamlViewer: FC<YamlViewerProps> = ({ yamlString, filename }) => {
return (
<div className={styles.container}>
<SyntaxHighlighter
language="yaml"
style={isDarkTheme ? materialDark : materialLight}
showLineNumbers
lineNumberStyle={{
paddingRight: '20px',
minWidth: '40px',
textAlign: 'right',
}}
customStyle={{
margin: 0,
padding: '20px',
borderRadius: '4px',
fontSize: '1rem',
background: 'transparent',
}}
codeTagProps={{
style: {
whiteSpace: 'pre-wrap',
},
}}
>
{yamlString}
</SyntaxHighlighter>
<YamlEditor value={yamlString} path={`${filename}.yaml`} options={{ readOnly: true }} />
</div>
);
};
41 changes: 41 additions & 0 deletions src/components/YamlEditor/YamlDiffEditor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { DiffEditor } from '@monaco-editor/react';
import type { ComponentProps } from 'react';
import { useTheme } from '../../hooks/useTheme';
import { GITHUB_DARK_DEFAULT, GITHUB_LIGHT_DEFAULT } from '../../lib/monaco.ts';

// Reuse all props from the underlying Monaco DiffEditor component, except language (we force YAML)
export type YamlDiffEditorProps = Omit<
ComponentProps<typeof DiffEditor>,
'language' | 'defaultLanguage' | 'originalLanguage' | 'modifiedLanguage'
>;

// Simple wrapper that forwards all props to Monaco DiffEditor
export const YamlDiffEditor = (props: YamlDiffEditorProps) => {
const { isDarkTheme } = useTheme();
const { theme, options, ...rest } = props;
const computedTheme = theme ?? (isDarkTheme ? GITHUB_DARK_DEFAULT : GITHUB_LIGHT_DEFAULT);

const simplifiedOptions = {
// Start from consumer-provided options, then enforce our simplified look
...options,
scrollbar: {
...(options?.scrollbar ?? {}),
useShadows: false,
vertical: 'auto' as const,
horizontal: 'auto' as const,
alwaysConsumeMouseWheel: false,
},
lineNumbers: 'off' as const,
minimap: { enabled: false },
glyphMargin: false,
renderLineHighlight: 'none' as const,
folding: false,
renderOverviewRuler: false,
scrollBeyondLastLine: false,
renderMarginRevertIcon: false,
automaticLayout: true,
readOnly: true,
};

return <DiffEditor {...rest} theme={computedTheme} options={simplifiedOptions} height="100%" language="yaml" />;
};
Loading
Loading