Skip to content

Commit 5b22dc2

Browse files
feat(datagrid-web): add refreshIndicator prop to Widget and update GridBody component
1 parent ceed3c9 commit 5b22dc2

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/pluggableWidgets/datagrid-web/src/components/GridBody.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
className?: string;
99
children?: React.ReactNode;
1010
loadingType: LoadingTypeEnum;
11-
isLoading: boolean;
11+
// isLoading: boolean;
1212
isFetchingNextBatch?: boolean;
1313
columnsHidable: boolean;
1414
columnsSize: number;
@@ -20,9 +20,9 @@ export function GridBody(props: Props): ReactElement {
2020
const { children } = props;
2121

2222
const content = (): React.ReactElement => {
23-
if (props.isLoading) {
24-
return <Loader {...props} rowsSize={props.rowsSize > 0 ? props.rowsSize : props.pageSize} />;
25-
}
23+
// if (props.isLoading) {
24+
// return <Loader {...props} rowsSize={props.rowsSize > 0 ? props.rowsSize : props.pageSize} />;
25+
// }
2626
return (
2727
<Fragment>
2828
{children}

packages/pluggableWidgets/datagrid-web/src/components/Widget.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface WidgetProps<C extends GridColumn, T extends ObjectItem = Object
7070
isFetchingNextBatch: boolean;
7171
loadingType: LoadingTypeEnum;
7272
columnsLoading: boolean;
73+
refreshIndicator: boolean;
7374

7475
// Helpers
7576
cellEventsController: EventsController;
@@ -132,6 +133,7 @@ const Main = observer(<C extends GridColumn>(props: WidgetProps<C>): ReactElemen
132133
paging,
133134
pagingPosition,
134135
preview,
136+
refreshIndicator,
135137
selectActionHelper,
136138
setPage,
137139
visibleColumns
@@ -190,9 +192,9 @@ const Main = observer(<C extends GridColumn>(props: WidgetProps<C>): ReactElemen
190192
isLoading={props.columnsLoading}
191193
preview={props.preview}
192194
/>
193-
<RefreshIndicator />
195+
{refreshIndicator && props.isLoading ? <RefreshIndicator /> : null}
194196
<GridBody
195-
isLoading={props.isLoading}
197+
// isLoading={props.isLoading}
196198
isFetchingNextBatch={props.isFetchingNextBatch}
197199
loadingType={props.loadingType}
198200
columnsHidable={columnsHidable}

0 commit comments

Comments
 (0)