Skip to content

Commit 946ed1e

Browse files
authored
Merge pull request #710 from objectstack-ai/copilot/fix-typescript-errors
2 parents 08df39f + 6ce8e23 commit 946ed1e

17 files changed

+44
-44
lines changed

apps/console/src/hooks/useNavPins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @module
88
*/
99

10-
import { useState, useCallback, useEffect, useMemo } from 'react';
10+
import { useState, useCallback, useEffect } from 'react';
1111
import type { NavigationItem } from '@object-ui/types';
1212

1313
const STORAGE_KEY = 'objectui-nav-pins';

examples/crm/src/dashboards/crm.dashboard.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,56 @@ export const CrmDashboard = {
44
widgets: [
55
// --- KPI Row ---
66
{
7-
type: 'metric',
7+
type: 'metric' as const,
88
layout: { x: 0, y: 0, w: 1, h: 1 },
99
options: {
1010
label: 'Total Revenue',
1111
value: '$652,000',
12-
trend: { value: 12.5, direction: 'up', label: 'vs last month' },
12+
trend: { value: 12.5, direction: 'up' as const, label: 'vs last month' },
1313
icon: 'DollarSign'
1414
}
1515
},
1616
{
17-
type: 'metric',
17+
type: 'metric' as const,
1818
layout: { x: 1, y: 0, w: 1, h: 1 },
1919
options: {
2020
label: 'Active Deals',
2121
value: '5',
22-
trend: { value: 2.1, direction: 'down', label: 'vs last month' },
22+
trend: { value: 2.1, direction: 'down' as const, label: 'vs last month' },
2323
icon: 'Briefcase'
2424
}
2525
},
2626
{
27-
type: 'metric',
27+
type: 'metric' as const,
2828
layout: { x: 2, y: 0, w: 1, h: 1 },
2929
options: {
3030
label: 'Win Rate',
3131
value: '42%',
32-
trend: { value: 4.3, direction: 'up', label: 'vs last month' },
32+
trend: { value: 4.3, direction: 'up' as const, label: 'vs last month' },
3333
icon: 'Trophy'
3434
}
3535
},
3636
{
37-
type: 'metric',
37+
type: 'metric' as const,
3838
layout: { x: 3, y: 0, w: 1, h: 1 },
3939
options: {
4040
label: 'Avg Deal Size',
4141
value: '$93,000',
42-
trend: { value: 1.2, direction: 'up', label: 'vs last month' },
42+
trend: { value: 1.2, direction: 'up' as const, label: 'vs last month' },
4343
icon: 'BarChart3'
4444
}
4545
},
4646

4747
// --- Row 2: Charts ---
4848
{
4949
title: 'Revenue Trends',
50-
type: 'area',
50+
type: 'area' as const,
5151
layout: { x: 0, y: 1, w: 3, h: 2 },
5252
options: {
5353
xField: 'month',
5454
yField: 'revenue',
5555
data: {
56-
provider: 'value',
56+
provider: 'value' as const,
5757
items: [
5858
{ month: 'Jan', revenue: 155000 },
5959
{ month: 'Feb', revenue: 87000 },
@@ -68,13 +68,13 @@ export const CrmDashboard = {
6868
},
6969
{
7070
title: 'Lead Source',
71-
type: 'donut',
71+
type: 'donut' as const,
7272
layout: { x: 3, y: 1, w: 1, h: 2 },
7373
options: {
7474
xField: 'source',
7575
yField: 'value',
7676
data: {
77-
provider: 'value',
77+
provider: 'value' as const,
7878
items: [
7979
{ source: 'Web', value: 2 },
8080
{ source: 'Referral', value: 1 },
@@ -88,13 +88,13 @@ export const CrmDashboard = {
8888
// --- Row 3: More Charts ---
8989
{
9090
title: 'Pipeline by Stage',
91-
type: 'bar',
91+
type: 'bar' as const,
9292
layout: { x: 0, y: 3, w: 2, h: 2 },
9393
options: {
9494
xField: 'stage',
9595
yField: 'amount',
9696
data: {
97-
provider: 'value',
97+
provider: 'value' as const,
9898
items: [
9999
{ stage: 'Prospecting', amount: 250000 },
100100
{ stage: 'Qualification', amount: 35000 },
@@ -107,13 +107,13 @@ export const CrmDashboard = {
107107
},
108108
{
109109
title: 'Top Products',
110-
type: 'bar',
110+
type: 'bar' as const,
111111
layout: { x: 2, y: 3, w: 2, h: 2 },
112112
options: {
113113
xField: 'name',
114114
yField: 'sales',
115115
data: {
116-
provider: 'value',
116+
provider: 'value' as const,
117117
items: [
118118
{ name: 'Workstation Pro Laptop', sales: 45000 },
119119
{ name: 'Implementation Service', sales: 32000 },
@@ -127,7 +127,7 @@ export const CrmDashboard = {
127127
// --- Row 4: Table ---
128128
{
129129
title: 'Recent Opportunities',
130-
type: 'table',
130+
type: 'table' as const,
131131
layout: { x: 0, y: 5, w: 4, h: 2 },
132132
options: {
133133
columns: [
@@ -137,7 +137,7 @@ export const CrmDashboard = {
137137
{ header: 'Close Date', accessorKey: 'date' }
138138
],
139139
data: {
140-
provider: 'value',
140+
provider: 'value' as const,
141141
items: [
142142
{ name: 'Berlin Automation Project', amount: '$250,000', stage: 'Prospecting', date: '2024-09-01' },
143143
{ name: 'ObjectStack Enterprise License', amount: '$150,000', stage: 'Closed Won', date: '2024-01-15' },
@@ -152,15 +152,15 @@ export const CrmDashboard = {
152152
// --- Row 5: Dynamic KPI from Object Data ---
153153
{
154154
title: 'Revenue by Account',
155-
type: 'bar',
155+
type: 'bar' as const,
156156
layout: { x: 0, y: 7, w: 4, h: 2 },
157157
options: {
158158
xField: 'account',
159159
yField: 'total',
160160
data: {
161-
provider: 'object',
161+
provider: 'object' as const,
162162
object: 'opportunity',
163-
aggregate: { field: 'amount', function: 'sum', groupBy: 'account' }
163+
aggregate: { field: 'amount', function: 'sum' as const, groupBy: 'account' }
164164
}
165165
},
166166
}

examples/crm/src/data/account.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const AccountData = {
22
object: 'account',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{
66
_id: "1",

examples/crm/src/data/contact.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const ContactData = {
22
object: 'contact',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{
66
_id: "1",

examples/crm/src/data/event.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const EventData = {
22
object: 'event',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{ _id: "e1", subject: "Weekly Standup", start: new Date("2024-02-05T09:00:00"), end: new Date("2024-02-05T10:00:00"), location: "Conference Room A", type: "meeting", status: "completed", organizer: "1", reminder: "min_15", description: "Team synchronization regarding Project Alpha", participants: ["1", "2", "5"] },
66
{ _id: "e2", subject: "Client Call - TechCorp", start: new Date("2024-02-06T14:00:00"), end: new Date("2024-02-06T15:00:00"), location: "Zoom", type: "call", status: "completed", organizer: "2", reminder: "min_5", description: "Reviewing Q1 Goals and Roadblocks", participants: ["2", "7"] },

examples/crm/src/data/opportunity.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const OpportunityData = {
22
object: 'opportunity',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{
66
_id: "101",

examples/crm/src/data/opportunity_contact.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const OpportunityContactData = {
22
object: 'opportunity_contact',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{ _id: "oc1", name: 'Bob Smith — Enterprise License', opportunity: "101", contact: "2", role: 'decision_maker', is_primary: true },
66
{ _id: "oc2", name: 'George Martin — Enterprise License', opportunity: "101", contact: "7", role: 'evaluator', is_primary: false },

examples/crm/src/data/order.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const OrderData = {
22
object: 'order',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{ _id: "o1", name: 'ORD-2024-001', customer: "2", account: "2", order_date: new Date('2024-01-15'), amount: 15459.99, status: 'paid', payment_method: 'Wire Transfer', shipping_address: '415 Mission St, San Francisco, CA 94105', tracking_number: '1Z999AA10123456784' },
66
{ _id: "o2", name: 'ORD-2024-002', customer: "3", account: "3", order_date: new Date('2024-01-18'), amount: 289.50, status: 'pending', payment_method: 'Credit Card', discount: 5 },

examples/crm/src/data/order_item.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const OrderItemData = {
22
object: 'order_item',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{ _id: "li1", name: 'LI-001', order: "o1", product: "p1", quantity: 5, unit_price: 2499.99, discount: 0, line_total: 12499.95, item_type: 'product' },
66
{ _id: "li2", name: 'LI-002', order: "o1", product: "p2", quantity: 10, unit_price: 89.99, discount: 0, line_total: 899.90, item_type: 'product' },

examples/crm/src/data/product.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const ProductData = {
22
object: 'product',
3-
mode: 'upsert',
3+
mode: 'upsert' as const,
44
records: [
55
{ _id: "p1", sku: 'HW-LAP-001', name: 'Workstation Pro Laptop', category: 'electronics', price: 2499.99, stock: 15, is_active: true, manufacturer: 'TechPro', weight: 2.1, tags: ['best_seller'], image: 'https://images.unsplash.com/photo-1593642702821-c8da6771f0c6?w=600&q=80' },
66
{ _id: "p2", sku: 'HW-ACC-002', name: 'Wireless Ergonomic Mouse', category: 'electronics', price: 89.99, stock: 120, is_active: true, manufacturer: 'ErgoTech', weight: 0.12, tags: ['new'], image: 'https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=600&q=80' },

0 commit comments

Comments
 (0)