Skip to content

Commit 561859d

Browse files
bloveclaude
andcommitted
fix(cockpit-render): computed-functions specs use $computed, not $fn
The specs bound values with { $fn: 'uppercase', args: {...} }, but the render library's computed-function binding key is $computed ({ $computed: name, args }). $fn is unrecognized, so the raw binding object was passed through and rendered as [object Object]. Rename $fn → $computed across the three specs; the registered functions (provideRender) and args shape were already correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 612740b commit 561859d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • cockpit/render/computed-functions/angular/src/app

cockpit/render/computed-functions/angular/src/app/specs.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ export const COMPUTED_FUNCTIONS_SPECS: DemoSpec[] = [
1616
type: 'Value',
1717
props: {
1818
label: 'Uppercase',
19-
value: { $fn: 'uppercase', args: { value: 'hello world' } },
19+
value: { $computed: 'uppercase', args: { value: 'hello world' } },
2020
},
2121
},
2222
reversed: {
2323
type: 'Value',
2424
props: {
2525
label: 'Reversed',
26-
value: { $fn: 'reverse', args: { value: 'streaming' } },
26+
value: { $computed: 'reverse', args: { value: 'streaming' } },
2727
},
2828
},
2929
},
@@ -43,14 +43,14 @@ export const COMPUTED_FUNCTIONS_SPECS: DemoSpec[] = [
4343
type: 'Value',
4444
props: {
4545
label: 'Formatted Date',
46-
value: { $fn: 'formatDate', args: { value: '2024-06-15T12:00:00Z' } },
46+
value: { $computed: 'formatDate', args: { value: '2024-06-15T12:00:00Z' } },
4747
},
4848
},
4949
product: {
5050
type: 'Value',
5151
props: {
5252
label: 'Multiply 7 x 6',
53-
value: { $fn: 'multiply', args: { a: 7, b: 6 } },
53+
value: { $computed: 'multiply', args: { a: 7, b: 6 } },
5454
},
5555
},
5656
},
@@ -70,21 +70,21 @@ export const COMPUTED_FUNCTIONS_SPECS: DemoSpec[] = [
7070
type: 'Value',
7171
props: {
7272
label: 'Multiply 12 x 5',
73-
value: { $fn: 'multiply', args: { a: 12, b: 5 } },
73+
value: { $computed: 'multiply', args: { a: 12, b: 5 } },
7474
},
7575
},
7676
transform: {
7777
type: 'Value',
7878
props: {
7979
label: 'Uppercase',
80-
value: { $fn: 'uppercase', args: { value: 'computed functions' } },
80+
value: { $computed: 'uppercase', args: { value: 'computed functions' } },
8181
},
8282
},
8383
format: {
8484
type: 'Value',
8585
props: {
8686
label: 'Date',
87-
value: { $fn: 'formatDate', args: { value: '2025-01-01T00:00:00Z' } },
87+
value: { $computed: 'formatDate', args: { value: '2025-01-01T00:00:00Z' } },
8888
},
8989
},
9090
},

0 commit comments

Comments
 (0)