Skip to content

Commit d005633

Browse files
committed
refactor(crm): drop redundant currency format/prefix from dashboard configs
The metric/table widgets now derive currency formatting from the `Field.currency()` definition on the bound object — there's no need to restate `format: '$0,0'` or `prefix: '$'` per widget. Drop the duplication on the executive and CRM dashboards (headline KPIs + opportunity Amount / account Annual Revenue table columns). To customize the displayed currency code, set `defaultCurrency` on the field definition itself instead of formatting at the widget level. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 61dafc8 commit d005633

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

apps/cloud/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ compatibility_flags = ["nodejs_compat"]
4545
# rebuild + re-push to ship a new version, then run `wrangler deploy`.
4646
[[containers]]
4747
class_name = "CloudContainer"
48-
image = "registry.cloudflare.com/2846eb40a60f4738e292b90dcd8cce10/objectstack-cloud:eefcfcf1"
48+
image = "registry.cloudflare.com/2846eb40a60f4738e292b90dcd8cce10/objectstack-cloud:61dafc8e"
4949
max_instances = 3
5050
instance_type = "standard-1"
5151

examples/app-crm/dist/objectstack.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14878,8 +14878,6 @@
1487814878
},
1487914879
"options": {
1488014880
"icon": "DollarSign",
14881-
"format": "$0,0",
14882-
"prefix": "$",
1488314881
"trend": {
1488414882
"value": 12.5,
1488514883
"direction": "up",
@@ -14976,8 +14974,6 @@
1497614974
},
1497714975
"options": {
1497814976
"icon": "bar-chart",
14979-
"format": "$0,0",
14980-
"prefix": "$",
1498114977
"trend": {
1498214978
"value": 1.2,
1498314979
"direction": "up",
@@ -15172,8 +15168,7 @@
1517215168
},
1517315169
{
1517415170
"header": "Amount",
15175-
"accessorKey": "amount",
15176-
"format": "$0,0"
15171+
"accessorKey": "amount"
1517715172
},
1517815173
{
1517915174
"header": "Stage",
@@ -15279,8 +15274,6 @@
1527915274
},
1528015275
"options": {
1528115276
"icon": "DollarSign",
15282-
"format": "$0,0",
15283-
"prefix": "$",
1528415277
"trend": {
1528515278
"value": 12.5,
1528615279
"direction": "up",
@@ -15576,8 +15569,7 @@
1557615569
},
1557715570
{
1557815571
"header": "Annual Revenue",
15579-
"accessorKey": "annual_revenue",
15580-
"format": "$0,0"
15572+
"accessorKey": "annual_revenue"
1558115573
},
1558215574
{
1558315575
"header": "Type",

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export const CrmOverviewDashboard: Dashboard = {
6868
layout: { x: 0, y: 0, w: 3, h: 2 },
6969
options: {
7070
icon: 'DollarSign',
71-
format: '$0,0',
7271
trend: { value: 12.5, direction: 'up', label: 'vs last month' },
7372
},
7473
},
@@ -127,7 +126,6 @@ export const CrmOverviewDashboard: Dashboard = {
127126
layout: { x: 9, y: 0, w: 3, h: 2 },
128127
options: {
129128
icon: 'bar-chart',
130-
format: '$0,0',
131129
trend: { value: 1.2, direction: 'up', label: 'vs last month' },
132130
},
133131
},
@@ -230,7 +228,7 @@ export const CrmOverviewDashboard: Dashboard = {
230228
columns: [
231229
{ header: 'Opportunity', accessorKey: 'name' },
232230
{ header: 'Account', accessorKey: 'account' },
233-
{ header: 'Amount', accessorKey: 'amount', format: '$0,0' },
231+
{ header: 'Amount', accessorKey: 'amount' },
234232
{ header: 'Stage', accessorKey: 'stage' },
235233
{ header: 'Probability', accessorKey: 'probability', format: '0%' },
236234
{ header: 'Close Date', accessorKey: 'close_date', format: 'MMM D, YYYY' },

examples/app-crm/src/dashboards/executive.dashboard.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export const ExecutiveDashboard: Dashboard = {
7878
layout: { x: 0, y: 0, w: 3, h: 2 },
7979
options: {
8080
icon: 'DollarSign',
81-
format: '$0,0',
8281
trend: { value: 12.5, direction: 'up', label: 'vs last quarter' },
8382
},
8483
},
@@ -241,7 +240,7 @@ export const ExecutiveDashboard: Dashboard = {
241240
columns: [
242241
{ header: 'Account', accessorKey: 'name' },
243242
{ header: 'Industry', accessorKey: 'industry' },
244-
{ header: 'Annual Revenue', accessorKey: 'annual_revenue', format: '$0,0' },
243+
{ header: 'Annual Revenue', accessorKey: 'annual_revenue' },
245244
{ header: 'Type', accessorKey: 'type' },
246245
{ header: 'Owner', accessorKey: 'owner' },
247246
],

0 commit comments

Comments
 (0)