Skip to content
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f826af3
OSAC-2936: add field definition value model and protobuf Value serial…
ElayAharoni Jul 26, 2026
6518dd5
OSAC-2936: add shared field definition primitives
ElayAharoni Jul 26, 2026
e6d7878
OSAC-2936: add NodeSetsFieldEditor for cluster catalog item configura…
ElayAharoni Jul 26, 2026
b154320
OSAC-2936: add template, organization, and project list hooks for the…
ElayAharoni Jul 26, 2026
8af9995
OSAC-2936: add CatalogItemGeneralFields shared wizard step
ElayAharoni Jul 26, 2026
e51aa0e
OSAC-2936: bind the wizard Name field to title, not metadata.name
ElayAharoni Jul 26, 2026
c58ac0f
OSAC-2936: add cluster catalog item step components and create hook
ElayAharoni Jul 26, 2026
9f8342f
OSAC-2936: add VM catalog item step components and create hook
ElayAharoni Jul 26, 2026
cae826f
OSAC-2936: add bare metal catalog item step components and create hook
ElayAharoni Jul 26, 2026
8f189ea
OSAC-2936: add kind-specific catalog item create wizard pages
ElayAharoni Jul 26, 2026
2235067
OSAC-2936: add test for unrecognized :type route fallback
ElayAharoni Jul 26, 2026
112ef6d
OSAC-2936: address CodeRabbit review feedback on catalog item wizards
ElayAharoni Jul 27, 2026
a5f2671
OSAC-2936: address second round of CodeRabbit feedback, fix i18n lint…
ElayAharoni Jul 27, 2026
da2392f
OSAC-2936: scope cluster node sets to the selected template's host types
ElayAharoni Jul 27, 2026
9e9a173
OSAC-2936: fix imports dropped by rebase in baremetal-instance.test.ts
ElayAharoni Jul 28, 2026
7d8c0c7
OSAC-2936: regenerate translation.json after rebasing onto main
ElayAharoni Jul 28, 2026
e7d22af
OSAC-2936: regenerate translation.json after rebasing onto latest main
ElayAharoni Jul 28, 2026
6652a02
OSAC-2936: fix AdminCatalogRoutes test after rebasing onto OSAC-2932
ElayAharoni Jul 28, 2026
cb69e1e
OSAC-2936: fix import order after rebase conflict resolution
ElayAharoni Jul 28, 2026
21b3583
OSAC-2936: fix organizations 404 and stop polling wizard lookup data
ElayAharoni Jul 28, 2026
c24a572
OSAC-2936: register well-known types so Any-packed template defaults …
ElayAharoni Jul 28, 2026
4522c5f
OSAC-2936: fix catalog item wizard validation, authz, and layout issues
ElayAharoni Jul 28, 2026
8acc8d7
OSAC-2936: use project.metadata.name for the project selector label
ElayAharoni Jul 28, 2026
157bb8e
OSAC-2936: fix PR review comments (rawagner takes precedence)
ElayAharoni Jul 28, 2026
cf9fb16
OSAC-2936: enhance the node sets editor's layout
ElayAharoni Jul 29, 2026
c133279
OSAC-2936: make field-definition group headings bolder and clearer
ElayAharoni Jul 29, 2026
01e629b
OSAC-2936: give NodeSetsFieldEditor a top-level Node Sets heading
ElayAharoni Jul 29, 2026
6ad2812
OSAC-2936: remove cores/memory_gib fields from VM catalog item wizard
ElayAharoni Jul 29, 2026
f3a373b
OSAC-2936: rename Display name/Resource name to Title/Name, make Titl…
ElayAharoni Jul 29, 2026
91547e8
OSAC-2936: remove deprecated is_windows field, rename Image to Source…
ElayAharoni Jul 29, 2026
3d60a9e
OSAC-2936: address rawagner and batzionb review comments
ElayAharoni Jul 29, 2026
5d19b80
OSAC-2936: clean up node set headers and field labels
ElayAharoni Jul 30, 2026
6406e9a
OSAC-2936: show host type alone as each node set's header
ElayAharoni Jul 30, 2026
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
2 changes: 2 additions & 0 deletions apps/app-frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import { ApiProvider, connectErrorInterceptor } from '@osac/ui-components/api/ap

import App from './App';
import './i18n';
import { wellKnownTypeRegistry } from './wellKnownTypeRegistry';

const connectTransport = createConnectTransport({
baseUrl: '/api/fulfillment',
interceptors: [connectErrorInterceptor],
jsonOptions: { registry: wellKnownTypeRegistry },
});

// CSS load order is intentional: base → addons → local overrides
Expand Down
65 changes: 65 additions & 0 deletions apps/app-frontend/src/shell/AdminCatalogRoutes.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { MemoryRouter, Route, Routes } from 'react-router-dom';
import { render, screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';

import { AdminCatalogRoutes } from './AdminCatalogRoutes';
Comment thread
coderabbitai[bot] marked this conversation as resolved.

vi.mock('@osac/ui-components/pages/admin/cluster/ClusterCatalogItemCreatePage', () => ({
default: () => <div>Cluster create page</div>,
}));
vi.mock(
'@osac/ui-components/pages/admin/compute-instance/ComputeInstanceCatalogItemCreatePage',
() => ({
default: () => <div>Compute instance create page</div>,
}),
);
vi.mock(
'@osac/ui-components/pages/admin/baremetal-instance/BareMetalInstanceCatalogItemCreatePage',
() => ({
default: () => <div>Bare metal create page</div>,
}),
);
vi.mock('@osac/ui-components/pages/admin/CatalogManagementListPage', () => ({
default: () => <div>Catalog management list page</div>,
}));
vi.mock('@osac/ui-components/hooks/useTranslation', () => ({
useTranslation: () => ({ t: (key: string) => key }),
}));

// Mounted at /admin/catalog/* to match the real route registered in AppShell.tsx, so
// AdminCatalogRoutes' internal <Navigate to="/admin/catalog" /> fallback resolves correctly.
const renderAt = (path: string) =>
render(
<MemoryRouter initialEntries={[path]}>
<Routes>
<Route path="/admin/catalog/*" element={<AdminCatalogRoutes />} />
</Routes>
</MemoryRouter>,
);

describe('AdminCatalogRoutes', () => {
it('renders the cluster create page for :type = cluster', () => {
renderAt('/admin/catalog/cluster/create');

expect(screen.getByText('Cluster create page')).toBeInTheDocument();
});

it('renders the compute instance create page for :type = compute-instance', () => {
renderAt('/admin/catalog/compute-instance/create');

expect(screen.getByText('Compute instance create page')).toBeInTheDocument();
});

it('renders the bare metal create page for :type = baremetal-instance', () => {
renderAt('/admin/catalog/baremetal-instance/create');

expect(screen.getByText('Bare metal create page')).toBeInTheDocument();
});

it('redirects to the list page for an unrecognized :type', () => {
renderAt('/admin/catalog/not-a-real-type/create');

expect(screen.getByText('Catalog management list page')).toBeInTheDocument();
expect(screen.queryByText('Cluster create page')).not.toBeInTheDocument();
});
});
22 changes: 20 additions & 2 deletions apps/app-frontend/src/shell/AdminCatalogRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import { Route, Routes } from 'react-router-dom';
import { Navigate, Route, Routes, useParams } from 'react-router-dom';

import BareMetalInstanceCatalogItemCreatePage from '@osac/ui-components/pages/admin/baremetal-instance/BareMetalInstanceCatalogItemCreatePage';
import CatalogManagementListPage from '@osac/ui-components/pages/admin/CatalogManagementListPage';
import ClusterCatalogItemCreatePage from '@osac/ui-components/pages/admin/cluster/ClusterCatalogItemCreatePage';
import ComputeInstanceCatalogItemCreatePage from '@osac/ui-components/pages/admin/compute-instance/ComputeInstanceCatalogItemCreatePage';

const CatalogItemCreateRoute = () => {
const { type } = useParams<{ type: string }>();

switch (type) {
case 'cluster':
return <ClusterCatalogItemCreatePage />;
case 'compute-instance':
return <ComputeInstanceCatalogItemCreatePage />;
case 'baremetal-instance':
return <BareMetalInstanceCatalogItemCreatePage />;
default:
return <Navigate to="/admin/catalog" replace />;
}
};

export const AdminCatalogRoutes = () => {
return (
<Routes>
<Route index element={<CatalogManagementListPage />} />
<Route path=":type/create" element={<div />} />
<Route path=":type/create" element={<CatalogItemCreateRoute />} />
Comment thread
ElayAharoni marked this conversation as resolved.
Outdated
<Route path=":type/:id" element={<div />} />
<Route path=":type/:id/edit" element={<div />} />
</Routes>
Expand Down
41 changes: 41 additions & 0 deletions apps/app-frontend/src/wellKnownTypeRegistry.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { fromJson } from '@bufbuild/protobuf';
import { AnySchema } from '@bufbuild/protobuf/wkt';
import { describe, expect, it } from 'vitest';

import { wellKnownTypeRegistry } from './wellKnownTypeRegistry';

describe('wellKnownTypeRegistry', () => {
it.each([
['google.protobuf.BoolValue', true],
['google.protobuf.BytesValue', 'AQI='],
['google.protobuf.StringValue', 'hello'],
['google.protobuf.Int32Value', 42],
['google.protobuf.Int64Value', '42'],
['google.protobuf.UInt32Value', 42],
['google.protobuf.UInt64Value', '42'],
['google.protobuf.DoubleValue', 4.2],
['google.protobuf.FloatValue', 4.2],
['google.protobuf.Value', { nested: true }],
['google.protobuf.Struct', { nested: true }],
['google.protobuf.ListValue', [1, 2, 3]],
['google.protobuf.Timestamp', '2026-01-01T00:00:00Z'],
['google.protobuf.Duration', '5s'],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
])('resolves %s packed in a google.protobuf.Any', (typeName, value) => {
const decode = () =>
fromJson(
AnySchema,
{ '@type': `type.googleapis.com/${typeName}`, value },
{ registry: wellKnownTypeRegistry },
);
expect(decode).not.toThrow();
});

it('fails to resolve an Any-packed well-known type without the registry', () => {
const decode = () =>
fromJson(AnySchema, {
'@type': 'type.googleapis.com/google.protobuf.BoolValue',
value: true,
});
expect(decode).toThrow(/not in the type registry/);
});
});
42 changes: 42 additions & 0 deletions apps/app-frontend/src/wellKnownTypeRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { createRegistry } from '@bufbuild/protobuf';
import {
BoolValueSchema,
BytesValueSchema,
DoubleValueSchema,
DurationSchema,
FloatValueSchema,
Int32ValueSchema,
Int64ValueSchema,
ListValueSchema,
StringValueSchema,
StructSchema,
TimestampSchema,
UInt32ValueSchema,
UInt64ValueSchema,
ValueSchema,
} from '@bufbuild/protobuf/wkt';

// google.protobuf.Any is decoded by looking up its packed type by name in a registry — unlike a
// field with a static well-known type (e.g. metadata.creation_timestamp), Any's packed type is
// only known at runtime from its "@type" URL. Without an entry here, @bufbuild/protobuf throws
// "cannot decode message google.protobuf.Any from JSON: <type> is not in the type registry".
//
// ClusterTemplateParameterDefinition.default (and the equivalent field on other template types) is
// documented to pack one of these well-known types, so all of them must be registered for the
// catalog item wizards' template dropdowns to decode successfully.
export const wellKnownTypeRegistry = createRegistry(
BoolValueSchema,
BytesValueSchema,
DoubleValueSchema,
DurationSchema,
FloatValueSchema,
Int32ValueSchema,
Int64ValueSchema,
ListValueSchema,
StringValueSchema,
StructSchema,
TimestampSchema,
UInt32ValueSchema,
UInt64ValueSchema,
ValueSchema,
);
Loading
Loading