Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
99d7f78
init
lucasgoral Oct 6, 2025
31416d8
Merge branch 'main' into edit-resources
lucasgoral Oct 7, 2025
4c78673
fix
lucasgoral Oct 8, 2025
667bb38
fixes
lucasgoral Oct 8, 2025
cae0b1d
fix
lucasgoral Oct 8, 2025
a7524f9
fixes
lucasgoral Oct 8, 2025
b71be75
Update ManagedResources.tsx
lucasgoral Oct 8, 2025
1b65dde
refactor
lucasgoral Oct 8, 2025
dc27602
fix
lucasgoral Oct 8, 2025
3548a2f
Update YamlSidePanel.tsx
lucasgoral Oct 9, 2025
2dbea4b
Update ManagedResources.tsx
lucasgoral Oct 9, 2025
39533d5
Merge branch 'main' into edit-resources
lucasgoral Oct 9, 2025
23dba77
refactor
lucasgoral Oct 9, 2025
e5b3d3c
Update ProvidersConfig.tsx
lucasgoral Oct 9, 2025
27a6e75
Update src/components/YamlEditor/YamlDiffEditor.tsx
lucasgoral Oct 9, 2025
7309a85
Update src/components/YamlEditor/YamlEditor.tsx
lucasgoral Oct 9, 2025
5d2af7c
refactor
lucasgoral Oct 10, 2025
e3d4f02
removed finalizers
lucasgoral Oct 10, 2025
6082362
refactor
lucasgoral Oct 10, 2025
80035ae
fix
lucasgoral Oct 10, 2025
f42c67c
fix
lucasgoral Oct 10, 2025
918f04c
refactor
lucasgoral Oct 10, 2025
54fa61f
fix
lucasgoral Oct 10, 2025
2407778
Merge branch 'main' into edit-resources
lucasgoral Oct 10, 2025
0d8c56b
Merge branch 'main' into edit-resources
Hubert-Szczepanski-SAP Oct 20, 2025
3b59674
Update convertToResourceConfig.ts
lucasgoral Oct 20, 2025
f24a383
Update convertToResourceConfig.ts
lucasgoral Oct 20, 2025
40440fd
Merge branch 'main' into edit-resources
lucasgoral Oct 23, 2025
60629f9
fix
lucasgoral Oct 23, 2025
ac411c5
fix
lucasgoral Oct 23, 2025
7eaa038
refactor
lucasgoral Oct 24, 2025
53c0b3b
Update YamlEditor.module.css
lucasgoral Oct 24, 2025
0391900
refactor
lucasgoral Oct 24, 2025
841b024
Update YamlSidePanel.module.css
lucasgoral Oct 27, 2025
2a8f6f8
refactor
lucasgoral Oct 27, 2025
e1d3874
Merge branch 'main' into edit-resources
lucasgoral Oct 27, 2025
ba93909
Update ActionsMenu.tsx
lucasgoral Oct 27, 2025
0a94eca
fix
lucasgoral Oct 27, 2025
3c33acf
Merge branch 'main' into edit-resources
lucasgoral Oct 27, 2025
b55f44f
Update monaco.ts
lucasgoral Oct 27, 2025
f2fd02f
fix
lucasgoral Oct 27, 2025
c54e0e5
refactor
lucasgoral Oct 28, 2025
3fe0bfc
Update YamlEditor.tsx
lucasgoral Oct 28, 2025
bbb8b87
Merge branch 'main' into edit-resources
lucasgoral Oct 28, 2025
b128354
init
lucasgoral Oct 29, 2025
01fc245
init
lucasgoral Oct 29, 2025
8b6dace
init
lucasgoral Oct 30, 2025
d06c098
demo
lucasgoral Oct 31, 2025
92f06d7
Update YamlEditor.tsx
lucasgoral Nov 3, 2025
5af6627
fix
lucasgoral Nov 4, 2025
f63c900
fix
lucasgoral Nov 4, 2025
9c34b6f
refactor
lucasgoral Nov 5, 2025
16cfd2c
refactor
lucasgoral Nov 5, 2025
0ca4902
init
lucasgoral Nov 6, 2025
56bda8a
Update ProjectsList.tsx
lucasgoral Nov 6, 2025
663efbb
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 7, 2025
4801878
Update package-lock.json
lucasgoral Nov 7, 2025
10325c8
refactor
lucasgoral Nov 12, 2025
2f93439
refactor
lucasgoral Nov 12, 2025
61f39f4
fix
lucasgoral Nov 12, 2025
3bed46c
fix
lucasgoral Nov 12, 2025
1c08250
fix
lucasgoral Nov 12, 2025
5eecd45
refactor
lucasgoral Nov 12, 2025
919db44
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 12, 2025
6246ae4
fixes
lucasgoral Nov 12, 2025
9114764
Update Graph.tsx
lucasgoral Nov 12, 2025
8d5dc00
fix
lucasgoral Nov 13, 2025
0ac11df
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 13, 2025
215083b
Update build.yaml
lucasgoral Nov 13, 2025
57ce21e
Revert "Update build.yaml"
lucasgoral Nov 13, 2025
76cd190
Update package-lock.json
lucasgoral Nov 13, 2025
a9a6776
Update YamlEditor.tsx
lucasgoral Nov 13, 2025
6e22777
Update YamlEditor.tsx
lucasgoral Nov 13, 2025
0411073
Update YamlEditor.tsx
lucasgoral Nov 13, 2025
4ed10b4
fix
lucasgoral Nov 13, 2025
53b8958
fix
lucasgoral Nov 13, 2025
b11e2cd
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 14, 2025
7b156ca
Update package-lock.json
lucasgoral Nov 14, 2025
b15f292
Update YamlSidePanelWithLoader.tsx
lucasgoral Nov 14, 2025
71c8955
fix
lucasgoral Nov 14, 2025
9d34630
Update YamlSidePanelWithLoader.tsx
lucasgoral Nov 14, 2025
6e9cfaf
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 14, 2025
e08b327
fix
lucasgoral Nov 14, 2025
214c240
Update YamlEditor.tsx
lucasgoral Nov 14, 2025
7bf5584
Update AuthContextMcp.tsx
lucasgoral Nov 14, 2025
0c738b1
fix
lucasgoral Nov 17, 2025
49bc60d
fix
lucasgoral Nov 17, 2025
1bdd114
Delete openapi.json
lucasgoral Nov 17, 2025
599f1ff
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 17, 2025
2326f1e
added fixes from old PR
lucasgoral Nov 17, 2025
594f8d0
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 17, 2025
9d4c362
fix
lucasgoral Nov 18, 2025
3a34387
Merge branch 'main' into intellisense-for-yaml-editor
lucasgoral Nov 19, 2025
7e61a55
Update package-lock.json
lucasgoral Nov 19, 2025
bf1374e
Update package-lock.json
lucasgoral Nov 19, 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
7,868 changes: 3,866 additions & 4,002 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@fastify/vite": "8.2.1",
"@hookform/resolvers": "5.2.2",
"@monaco-editor/react": "4.7.0",
"@openapi-contrib/openapi-schema-to-json-schema": "5.1.0",
"@sentry/node": "10.24.0",
"@sentry/react": "10.24.0",
"@sentry/vite-plugin": "4.6.0",
Expand All @@ -61,6 +62,7 @@
"js-yaml": "4.1.1",
"monaco-editor": "0.54.0",
"monaco-yaml": "5.4.0",
"path-browserify": "1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why is this dependency needed?

"react": "19.2.0",
"react-dom": "19.2.0",
"react-error-boundary": "6.0.0",
Expand Down
8 changes: 5 additions & 3 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,19 +417,21 @@
"back": "Back",
"cancel": "Cancel",
"update": "Update",
"applyChanges": "Apply changes"
"applyChanges": "Apply changes",
"edit": "Edit"
},
"yaml": {
"YAML": "File",
"showOnlyImportant": "Show only important fields",
"panelTitle": "YAML",
"editorTitle": "YAML Editor",
"applySuccess2": "The Managed Control Plane will reconcile this resource shortly.",
"applySuccess": "Update submitted ",
"diffConfirmTitle": "Review changes",
"diffConfirmMessage": "Are you sure that you want to apply these changes?",
"diffNo": "No, go back",
"diffYes": "Yes"
"diffYes": "Yes",
"validationErrors": "Validation errors",
"fluxManaged": "This resource is managed by Flux and cannot be edited here"
},
"createMCP": {
"dialogTitle": "Create Managed Control Plane",
Expand Down
10 changes: 9 additions & 1 deletion src/components/ControlPlane/ActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type ActionItem<T> = {
icon?: string;
disabled?: boolean;
onClick: (item: T) => void;
tooltip?: string;
};

export type ActionsMenuProps<T> = {
Expand Down Expand Up @@ -45,7 +46,14 @@ export function ActionsMenu<T>({ item, actions }: ActionsMenuProps<T>) {
}}
>
{actions.map((a) => (
<MenuItem key={a.key} text={a.text} icon={a.icon} data-action-key={a.key} disabled={a.disabled} />
<MenuItem
key={a.key}
text={a.text}
icon={a.icon}
data-action-key={a.key}
disabled={a.disabled}
tooltip={a.tooltip}
/>
))}
</Menu>
</>
Expand Down
46 changes: 40 additions & 6 deletions src/components/ControlPlane/GitRepositories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import ConfiguredAnalyticstable from '../Shared/ConfiguredAnalyticsTable.tsx';
import { AnalyticalTableColumnDefinition, Panel, Title, Toolbar, ToolbarSpacer } from '@ui5/webcomponents-react';
import {
AnalyticalTableColumnDefinition,
Panel,
Title,
Toolbar,
ToolbarSpacer,
Button,
} from '@ui5/webcomponents-react';
import IllustratedError from '../Shared/IllustratedError.tsx';
import { useApiResource } from '../../lib/api/useApiResource';
import { FluxRequest } from '../../lib/api/types/flux/listGitRepo';
import { useTranslation } from 'react-i18next';
import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo.ts';

import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
import { Fragment, useCallback, useMemo, useRef } from 'react';
import { Fragment, useCallback, useContext, useMemo, useRef } from 'react';
import StatusFilter from '../Shared/StatusFilter/StatusFilter.tsx';
import { ResourceStatusCell } from '../Shared/ResourceStatusCell.tsx';
import { Resource } from '../../utils/removeManagedFieldsAndFilterData.ts';
Expand All @@ -18,6 +25,9 @@ import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx';
import type { GitReposResponse } from '../../lib/api/types/flux/listGitRepo';
import { ActionsMenu, type ActionItem } from './ActionsMenu';

import { ApiConfigContext } from '../Shared/k8s';
import { useHasMcpAdminRights } from '../../spaces/mcp/auth/useHasMcpAdminRights.ts';

export type GitRepoItem = GitReposResponse['items'][0] & {
apiVersion?: string;
metadata: GitReposResponse['items'][0]['metadata'] & { namespace?: string };
Expand All @@ -39,7 +49,8 @@ export function GitRepositories() {
readyMessage: string;
revision?: string;
};

const apiConfig = useContext(ApiConfigContext);
const hasMCPAdminRights = useHasMcpAdminRights();
const openEditPanel = useCallback(
(item: GitRepoItem) => {
const identityKey = `${item.kind}:${item.metadata.namespace ?? ''}:${item.metadata.name}`;
Expand All @@ -49,12 +60,13 @@ export function GitRepositories() {
isEdit={true}
resource={item as unknown as Resource}
filename={`${item.kind}_${item.metadata.name}`}
apiConfig={apiConfig}
onApply={async (parsed) => await handlePatch(item, parsed)}
/>
</Fragment>,
);
},
[openInAside, handlePatch],
[openInAside, handlePatch, apiConfig],
);

const columns = useMemo<AnalyticalTableColumnDefinition[]>(
Expand Down Expand Up @@ -96,7 +108,28 @@ export function GitRepositories() {
width: 75,
accessor: 'yaml',
disableFilters: true,
Cell: ({ row }) => <YamlViewButton variant="resource" resource={row.original.item as unknown as Resource} />,
Cell: ({ row }) => {
const item = row.original?.item;
return item ? (
<YamlViewButton
variant="resource"
resource={item as unknown as Resource}
toolbarContent={
hasMCPAdminRights ? (
<Button
icon={'edit'}
design={'Transparent'}
onClick={() => {
openEditPanel(item);
}}
>
{t('buttons.edit')}
</Button>
) : undefined
}
/>
) : undefined;
},
},
{
Header: t('ManagedResources.actionColumnHeader'),
Expand All @@ -113,13 +146,14 @@ export function GitRepositories() {
text: t('ManagedResources.editAction', 'Edit'),
icon: 'edit',
onClick: openEditPanel,
disabled: !hasMCPAdminRights,
},
];
return <ActionsMenu item={item} actions={actions} />;
},
},
] as AnalyticalTableColumnDefinition[],
[t, openEditPanel],
[t, hasMCPAdminRights, openEditPanel],
);

if (error) {
Expand Down
46 changes: 41 additions & 5 deletions src/components/ControlPlane/Kustomizations.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import ConfiguredAnalyticstable from '../Shared/ConfiguredAnalyticsTable.tsx';
import { AnalyticalTableColumnDefinition, Panel, Title, Toolbar, ToolbarSpacer } from '@ui5/webcomponents-react';
import {
AnalyticalTableColumnDefinition,
Panel,
Title,
Toolbar,
ToolbarSpacer,
Button,
} from '@ui5/webcomponents-react';
import IllustratedError from '../Shared/IllustratedError.tsx';
import { useApiResource } from '../../lib/api/useApiResource';
import { FluxKustomization } from '../../lib/api/types/flux/listKustomization';

import { useTranslation } from 'react-i18next';
import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo.ts';

import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
import { Fragment, useCallback, useMemo, useRef } from 'react';
import { Fragment, useCallback, useContext, useMemo, useRef } from 'react';
import StatusFilter from '../Shared/StatusFilter/StatusFilter.tsx';
import { ResourceStatusCell } from '../Shared/ResourceStatusCell.tsx';
import { Resource } from '../../utils/removeManagedFieldsAndFilterData.ts';
Expand All @@ -18,13 +26,17 @@ import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx';
import type { KustomizationsResponse } from '../../lib/api/types/flux/listKustomization';
import { ActionsMenu, type ActionItem } from './ActionsMenu';

import { ApiConfigContext } from '../Shared/k8s';
import { useHasMcpAdminRights } from '../../spaces/mcp/auth/useHasMcpAdminRights.ts';

export type KustomizationItem = KustomizationsResponse['items'][0] & {
apiVersion?: string;
metadata: KustomizationsResponse['items'][0]['metadata'] & { namespace?: string };
};

export function Kustomizations() {
const { data, error, isLoading } = useApiResource(FluxKustomization); //404 if component not enabled
const apiConfig = useContext(ApiConfigContext);
const { t } = useTranslation();
const { openInAside } = useSplitter();
const errorDialogRef = useRef<ErrorDialogHandle>(null);
Expand All @@ -48,13 +60,15 @@ export function Kustomizations() {
isEdit={true}
resource={item as unknown as Resource}
filename={`${item.kind}_${item.metadata.name}`}
apiConfig={apiConfig}
onApply={async (parsed) => await handlePatch(item, parsed)}
/>
</Fragment>,
);
},
[openInAside, handlePatch],
[openInAside, handlePatch, apiConfig],
);
const hasMCPAdminRights = useHasMcpAdminRights();

const columns = useMemo<AnalyticalTableColumnDefinition[]>(
() =>
Expand Down Expand Up @@ -91,7 +105,28 @@ export function Kustomizations() {
width: 75,
accessor: 'yaml',
disableFilters: true,
Cell: ({ row }) => <YamlViewButton variant="resource" resource={row.original.item as unknown as Resource} />,
Cell: ({ row }) => {
const item = row.original?.item;
return item ? (
<YamlViewButton
variant="resource"
resource={item as unknown as Resource}
toolbarContent={
hasMCPAdminRights ? (
<Button
icon={'edit'}
design={'Transparent'}
onClick={() => {
openEditPanel(item);
}}
>
{t('buttons.edit')}
</Button>
) : undefined
}
/>
) : undefined;
},
},
{
Header: t('ManagedResources.actionColumnHeader'),
Expand All @@ -108,13 +143,14 @@ export function Kustomizations() {
text: t('ManagedResources.editAction', 'Edit'),
icon: 'edit',
onClick: openEditPanel,
disabled: !hasMCPAdminRights,
},
];
return <ActionsMenu item={item} actions={actions} />;
},
},
] as AnalyticalTableColumnDefinition[],
[t, openEditPanel],
[t, openEditPanel, hasMCPAdminRights],
);

if (error) {
Expand Down
13 changes: 13 additions & 0 deletions src/components/ControlPlane/ManagedResources.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ describe('ManagedResources - Delete Resource', () => {
};
};

const fakeuseHasMcpAdminRights = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also add a test where the user doesn’t have the admin rights?

return true;
};

const fakeUseResourcePluralNames: typeof useResourcePluralNames = (): any => {
return {
getPluralKind: (kind: string) => `${kind.toLowerCase()}s`,
isLoading: false,
error: undefined,
isAuthenticated: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed?

Suggested change
isAuthenticated: true,

};
};

Expand Down Expand Up @@ -97,6 +102,7 @@ describe('ManagedResources - Delete Resource', () => {
useApiResourceMutation={fakeUseApiResourceMutation}
useApiResource={fakeUseApiResource}
useResourcePluralNames={fakeUseResourcePluralNames}
useHasMcpAdminRights={fakeuseHasMcpAdminRights}
/>
</SplitterProvider>
</MemoryRouter>,
Expand Down Expand Up @@ -131,6 +137,7 @@ describe('ManagedResources - Delete Resource', () => {
useApiResourceMutation={fakeUseApiResourceMutation}
useApiResource={fakeUseApiResource}
useResourcePluralNames={fakeUseResourcePluralNames}
useHasMcpAdminRights={fakeuseHasMcpAdminRights}
/>
</SplitterProvider>
</MemoryRouter>,
Expand Down Expand Up @@ -173,6 +180,7 @@ describe('ManagedResources - Delete Resource', () => {
useApiResourceMutation={fakeUseApiResourceMutation}
useApiResource={fakeUseApiResource}
useResourcePluralNames={fakeUseResourcePluralNames}
useHasMcpAdminRights={fakeuseHasMcpAdminRights}
/>
</SplitterProvider>
</MemoryRouter>,
Expand Down Expand Up @@ -208,6 +216,10 @@ describe('ManagedResources - Edit Resource', () => {
let patchCalled = false;
let patchedItem: any = null;

const fakeUseHasMcpAdminRights = () => {
return true;
};

const fakeUseHandleResourcePatch: typeof useHandleResourcePatch = () => {
return async (item: any) => {
patchCalled = true;
Expand Down Expand Up @@ -293,6 +305,7 @@ describe('ManagedResources - Edit Resource', () => {
useHandleResourcePatch={fakeUseHandleResourcePatch}
useApiResource={fakeUseApiResource}
useResourcePluralNames={fakeUseResourcePluralNames}
useHasMcpAdminRights={fakeUseHasMcpAdminRights}
/>
</SplitterLayout>
</SplitterProvider>
Expand Down
Loading
Loading