Skip to content

Commit ba2034f

Browse files
committed
chore(datagrid-web): use dropzone helper in structure preview
1 parent 28fc0b4 commit ba2034f

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

packages/pluggableWidgets/datagrid-web/src/Datagrid.editorConfig.ts

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
container,
3-
DropZoneProps,
3+
dropzone,
44
RowLayoutProps,
55
selectable,
66
StructurePreviewProps,
@@ -171,10 +171,7 @@ export const getPreview = (values: DatagridPreviewProps, isDarkMode: boolean): S
171171
: undefined
172172
})(
173173
column.showContentAs === "customContent"
174-
? {
175-
type: "DropZone",
176-
property: column.content
177-
}
174+
? dropzone()(column.content)
178175
: container({
179176
padding: 8
180177
})(
@@ -203,13 +200,7 @@ export const getPreview = (values: DatagridPreviewProps, isDarkMode: boolean): S
203200
type: "RowLayout",
204201
columnSize: "fixed",
205202
borders: true,
206-
children: [
207-
{
208-
type: "DropZone",
209-
property: values.filtersPlaceholder,
210-
placeholder: "Place filter widget(s) here"
211-
} as DropZoneProps
212-
]
203+
children: [dropzone(dropzone.placeholder("Place filter widget(s) here"))(values.filtersPlaceholder)]
213204
} as RowLayoutProps;
214205
const headers: RowLayoutProps = {
215206
type: "RowLayout",
@@ -250,13 +241,7 @@ export const getPreview = (values: DatagridPreviewProps, isDarkMode: boolean): S
250241
})(column.header ? column.header : "Header")
251242
),
252243
...(hasColumns && values.columnsFilterable
253-
? [
254-
{
255-
type: "DropZone",
256-
property: column.filter,
257-
placeholder: "Place filter widget here"
258-
} as DropZoneProps
259-
]
244+
? [dropzone(dropzone.placeholder("Place filter widget here"))(column.filter)]
260245
: [])
261246
);
262247
return values.columns.length > 0
@@ -274,11 +259,9 @@ export const getPreview = (values: DatagridPreviewProps, isDarkMode: boolean): S
274259
columnSize: "fixed",
275260
borders: true,
276261
children: [
277-
{
278-
type: "DropZone",
279-
property: values.emptyPlaceholder,
280-
placeholder: "Empty list message: Place widgets here"
281-
} as DropZoneProps
262+
dropzone(dropzone.placeholder("Empty list message: Place widgets here"))(
263+
values.emptyPlaceholder
264+
)
282265
]
283266
} as RowLayoutProps
284267
]

0 commit comments

Comments
 (0)