Skip to content

Commit 5103725

Browse files
committed
Stringify object cell values; reorder SetupPlugin
Convert object cell values to strings in table and virtual grid renderers to avoid rendering issues when cell values are objects. Reorder SetupPlugin to come after AuthPlugin and add comments clarifying why: AuthPlugin (com.objectstack.system) must register before ObjectQL scans to ensure the 'sys' namespace and owning package are registered, while SetupPlugin still registers setupNav during init and the merged Setup app during start.
1 parent 8d603e9 commit 5103725

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

objectstack.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ class MemoryI18nPlugin {
5858
export default {
5959
plugins: [
6060
new MemoryI18nPlugin(),
61-
// SetupPlugin first: registers setupNav during init for contributing plugins,
62-
// and registers the merged Setup app during start before ObjectQL scans.
63-
new SetupPlugin(),
6461
new ObjectQLPlugin(),
6562
new DriverPlugin(new InMemoryDriver()),
6663
// Each example stack loaded as an independent AppPlugin
6764
new AppPlugin(prepareConfig(crmConfig)),
6865
new AppPlugin(prepareConfig(todoConfig)),
6966
new AppPlugin(prepareConfig(kitchenSinkConfig)),
70-
// AuthPlugin after ObjectQL (needs 'data' service) and after SetupPlugin (uses setupNav)
67+
// AuthPlugin before SetupPlugin: both use namespace 'sys', and the
68+
// ObjectQL registry requires the package that owns objects (AuthPlugin →
69+
// com.objectstack.system) to register first.
7170
new AuthPlugin({
7271
secret: process.env.AUTH_SECRET || 'objectui-dev-secret',
7372
baseUrl: 'http://localhost:3000',
7473
}),
74+
// SetupPlugin registers setupNav during init and the merged Setup app
75+
// during start. Must come after AuthPlugin to avoid sys namespace collision.
76+
new SetupPlugin(),
7577
new HonoServerPlugin({ port: 3000 }),
7678
new ConsolePlugin(),
7779
],

packages/components/src/renderers/data-display/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const SimpleTableRenderer = ({ schema, className }: any) => {
6060
const value = accessor ? row[accessor] : '';
6161
return (
6262
<TableCell key={col.key || col.accessorKey || index}>
63-
{value}
63+
{value != null && typeof value === 'object' ? String(value) : value}
6464
</TableCell>
6565
);
6666
})}

packages/plugin-grid/src/VirtualGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const VirtualGrid: React.FC<VirtualGridProps> = ({
151151
const value = row[column.accessorKey];
152152
const cellContent = column.cell
153153
? column.cell(value, row)
154-
: value;
154+
: (value != null && typeof value === 'object' ? String(value) : value);
155155

156156
return (
157157
<div

0 commit comments

Comments
 (0)