Skip to content

Commit 14fa038

Browse files
committed
Remove 'spreadsheet' view type from ListView and related components
1 parent 442eb38 commit 14fa038

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

packages/components/src/renderers/placeholders.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const PlaceholderRenderer = ({ schema, className }: any) => {
4646
const PROTOCOL_COMPONENTS = [
4747
// 1. Views (List)
4848
'view:grid', 'view:kanban', 'view:map', 'view:calendar', 'view:gantt',
49-
'view:timeline', 'view:gallery', 'view:spreadsheet',
49+
'view:timeline', 'view:gallery',
5050

5151
// 2. Views (Form)
5252
'view:simple', 'view:wizard', 'view:tabbed', 'view:drawer', 'view:modal', 'view:split',

packages/plugin-list/src/ListView.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ export const ListView: React.FC<ListViewProps> = ({
132132
yAxisFields: schema.options?.chart?.yAxisFields || ['value'],
133133
...(schema.options?.chart || {}),
134134
};
135-
case 'spreadsheet':
136-
return {
137-
type: 'object-spreadsheet',
138-
...baseProps,
139-
...(schema.options?.spreadsheet || {}),
140-
};
141135
case 'gallery':
142136
return {
143137
type: 'object-gallery',
@@ -179,7 +173,7 @@ export const ListView: React.FC<ListViewProps> = ({
179173

180174
// Available view types based on schema configuration
181175
const availableViews = React.useMemo(() => {
182-
const views: ViewType[] = ['grid', 'list', 'spreadsheet'];
176+
const views: ViewType[] = ['grid', 'list'];
183177

184178
// Check for Kanban capabilities
185179
if (schema.options?.kanban?.groupField) {
@@ -214,7 +208,7 @@ export const ListView: React.FC<ListViewProps> = ({
214208
// Always allow switching back to the viewType defined in schema if it's one of the supported types
215209
// This ensures that if a view is configured as "map", the map button is shown even if we missed the options check above
216210
if (schema.viewType && !views.includes(schema.viewType as ViewType) &&
217-
['grid', 'list', 'kanban', 'calendar', 'spreadsheet', 'timeline', 'gantt', 'map', 'chart', 'gallery'].includes(schema.viewType)) {
211+
['grid', 'list', 'kanban', 'calendar', 'timeline', 'gantt', 'map', 'chart', 'gallery'].includes(schema.viewType)) {
218212
views.push(schema.viewType as ViewType);
219213
}
220214

packages/plugin-list/src/ViewSwitcher.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
LayoutGrid,
1515
Calendar,
1616
BarChart3,
17-
Table2, // spreadsheet
1817
Images, // gallery
1918
Activity, // timeline
2019
GanttChartSquare, // gantt
@@ -27,7 +26,6 @@ export type ViewType =
2726
| 'kanban'
2827
| 'calendar'
2928
| 'chart'
30-
| 'spreadsheet'
3129
| 'gallery'
3230
| 'timeline'
3331
| 'gantt'
@@ -46,7 +44,6 @@ const VIEW_ICONS: Record<ViewType, React.ReactNode> = {
4644
kanban: <LayoutGrid className="h-4 w-4" />,
4745
calendar: <Calendar className="h-4 w-4" />,
4846
chart: <BarChart3 className="h-4 w-4" />,
49-
spreadsheet: <Table2 className="h-4 w-4" />,
5047
gallery: <Images className="h-4 w-4" />,
5148
timeline: <Activity className="h-4 w-4" />,
5249
gantt: <GanttChartSquare className="h-4 w-4" />,
@@ -59,7 +56,6 @@ const VIEW_LABELS: Record<ViewType, string> = {
5956
kanban: 'Kanban',
6057
calendar: 'Calendar',
6158
chart: 'Chart',
62-
spreadsheet: 'Spreadsheet',
6359
gallery: 'Gallery',
6460
timeline: 'Timeline',
6561
gantt: 'Gantt',
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import { describe, it, expect, vi, beforeAll } from 'vitest';
1+
import { describe, it, expect, beforeAll } from 'vitest';
42
import { ComponentRegistry } from '@object-ui/core';
3+
import { ListView } from './index';
54

65
describe('Plugin List Registration', () => {
7-
beforeAll(async () => {
8-
await import('./index');
9-
});
10-
11-
it('registers list-view component', () => {
12-
const config = ComponentRegistry.get('list-view');
13-
expect(config).toBeDefined();
14-
expect(config?.label).toBe('List View');
6+
it('exports ListView component', () => {
7+
expect(ListView).toBeDefined();
158
});
169
});

packages/types/src/objectql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ export interface ListViewSchema extends BaseSchema {
688688
objectName: string;
689689

690690
/** View Type (grid, kanban, etc) */
691-
viewType?: 'grid' | 'list' | 'kanban' | 'calendar' | 'gantt' | 'map' | 'chart' | 'spreadsheet' | 'gallery' | 'timeline';
691+
viewType?: 'grid' | 'list' | 'kanban' | 'calendar' | 'gantt' | 'map' | 'chart' | 'gallery' | 'timeline';
692692

693693
/** Fields to fetch/display */
694694
fields?: string[];

0 commit comments

Comments
 (0)