Skip to content

Commit 95352f8

Browse files
authored
updating datatable type (#77320) (#77361)
1 parent 77119d3 commit 95352f8

File tree

5 files changed

+3
-10
lines changed

5 files changed

+3
-10
lines changed

src/plugins/expressions/common/expression_types/specs/boolean.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const boolean: ExpressionTypeDefinition<'boolean', boolean> = {
4141
},
4242
datatable: (value): Datatable => ({
4343
type: 'datatable',
44-
meta: {},
4544
columns: [{ id: 'value', name: 'value', meta: { type: name } }],
4645
rows: [{ value }],
4746
}),

src/plugins/expressions/common/expression_types/specs/datatable.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export type DatatableRow = Record<string, any>;
5252
export interface DatatableColumnMeta {
5353
type: DatatableColumnType;
5454
field?: string;
55+
index?: string;
5556
params?: SerializableState;
57+
source?: string;
58+
sourceParams?: SerializableState;
5659
}
5760
/**
5861
* This type represents the shape of a column in a `Datatable`.
@@ -63,17 +66,11 @@ export interface DatatableColumn {
6366
meta: DatatableColumnMeta;
6467
}
6568

66-
export interface DatatableMeta {
67-
type?: string;
68-
source?: string;
69-
}
70-
7169
/**
7270
* A `Datatable` in Canvas is a unique structure that represents tabulated data.
7371
*/
7472
export interface Datatable {
7573
type: typeof name;
76-
meta?: DatatableMeta;
7774
columns: DatatableColumn[];
7875
rows: DatatableRow[];
7976
}

src/plugins/expressions/common/expression_types/specs/num.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const num: ExpressionTypeDefinition<'num', ExpressionValueNum> = {
7373
},
7474
datatable: ({ value }): Datatable => ({
7575
type: 'datatable',
76-
meta: {},
7776
columns: [{ id: 'value', name: 'value', meta: { type: 'number' } }],
7877
rows: [{ value }],
7978
}),

src/plugins/expressions/common/expression_types/specs/number.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const number: ExpressionTypeDefinition<typeof name, number> = {
5555
},
5656
datatable: (value): Datatable => ({
5757
type: 'datatable',
58-
meta: {},
5958
columns: [{ id: 'value', name: 'value', meta: { type: 'number' } }],
6059
rows: [{ value }],
6160
}),

src/plugins/expressions/common/expression_types/specs/string.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const string: ExpressionTypeDefinition<typeof name, string> = {
4040
},
4141
datatable: (value): Datatable => ({
4242
type: 'datatable',
43-
meta: {},
4443
columns: [{ id: 'value', name: 'value', meta: { type: 'string' } }],
4544
rows: [{ value }],
4645
}),

0 commit comments

Comments
 (0)