Skip to content

Commit

Permalink
updating datatable type (elastic#77320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Sep 14, 2020
1 parent c5358f3 commit 0c3a8c5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const boolean: ExpressionTypeDefinition<'boolean', boolean> = {
},
datatable: (value): Datatable => ({
type: 'datatable',
meta: {},
columns: [{ id: 'value', name: 'value', meta: { type: name } }],
rows: [{ value }],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export type DatatableRow = Record<string, any>;
export interface DatatableColumnMeta {
type: DatatableColumnType;
field?: string;
index?: string;
params?: SerializableState;
source?: string;
sourceParams?: SerializableState;
}
/**
* This type represents the shape of a column in a `Datatable`.
Expand All @@ -63,17 +66,11 @@ export interface DatatableColumn {
meta: DatatableColumnMeta;
}

export interface DatatableMeta {
type?: string;
source?: string;
}

/**
* A `Datatable` in Canvas is a unique structure that represents tabulated data.
*/
export interface Datatable {
type: typeof name;
meta?: DatatableMeta;
columns: DatatableColumn[];
rows: DatatableRow[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const num: ExpressionTypeDefinition<'num', ExpressionValueNum> = {
},
datatable: ({ value }): Datatable => ({
type: 'datatable',
meta: {},
columns: [{ id: 'value', name: 'value', meta: { type: 'number' } }],
rows: [{ value }],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const number: ExpressionTypeDefinition<typeof name, number> = {
},
datatable: (value): Datatable => ({
type: 'datatable',
meta: {},
columns: [{ id: 'value', name: 'value', meta: { type: 'number' } }],
rows: [{ value }],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const string: ExpressionTypeDefinition<typeof name, string> = {
},
datatable: (value): Datatable => ({
type: 'datatable',
meta: {},
columns: [{ id: 'value', name: 'value', meta: { type: 'string' } }],
rows: [{ value }],
}),
Expand Down

0 comments on commit 0c3a8c5

Please sign in to comment.