From 6987b392d76766f47ed0ebb2f7f3bf65a498d51f Mon Sep 17 00:00:00 2001 From: Satbir Singh Date: Tue, 4 Feb 2020 09:41:12 +0000 Subject: [PATCH] Revert "Merge branch 'feature/server-side-pagination' into 'release'" This reverts merge request !271 --- app/client/src/actions/actionActions.ts | 9 +-- app/client/src/actions/widgetActions.tsx | 13 +-- app/client/src/api/ActionAPI.tsx | 4 - .../appsmith/TablePagination.tsx | 73 ----------------- .../designSystems/blueprint/Checkbox.tsx | 23 +----- .../syncfusion/TableComponent.tsx | 37 ++------- .../editorComponents/ApiResponseView.tsx | 2 +- .../EditorContextProvider.tsx | 24 +----- .../form/fields/CheckboxField.tsx | 5 +- app/client/src/index.css | 4 - app/client/src/pages/AppViewer/index.tsx | 7 +- .../src/pages/Editor/APIEditor/Form.tsx | 81 ++++++------------- .../src/pages/Editor/APIEditor/Pagination.tsx | 47 ----------- .../src/pages/Editor/APIEditor/index.tsx | 11 ++- app/client/src/sagas/ActionSagas.ts | 60 +++----------- app/client/src/selectors/editorSelectors.tsx | 24 ------ app/client/src/widgets/BaseWidget.tsx | 10 +-- app/client/src/widgets/TableWidget.tsx | 24 +++--- 18 files changed, 80 insertions(+), 378 deletions(-) delete mode 100644 app/client/src/components/designSystems/appsmith/TablePagination.tsx delete mode 100644 app/client/src/pages/Editor/APIEditor/Pagination.tsx diff --git a/app/client/src/actions/actionActions.ts b/app/client/src/actions/actionActions.ts index 65498fa21f..c7d2d87038 100644 --- a/app/client/src/actions/actionActions.ts +++ b/app/client/src/actions/actionActions.ts @@ -1,9 +1,9 @@ -import { RestAction, PaginationField } from "api/ActionAPI"; import { ReduxActionTypes, ReduxAction, ReduxActionErrorTypes, } from "constants/ReduxActionConstants"; +import { RestAction } from "api/ActionAPI"; export const createActionRequest = (payload: Partial) => { return { @@ -32,13 +32,10 @@ export const fetchActions = ( }; }; -export const runApiAction = (id: string, paginationField?: PaginationField) => { +export const runApiAction = (id: string) => { return { type: ReduxActionTypes.RUN_API_REQUEST, - payload: { - id: id, - paginationField: paginationField, - }, + payload: id, }; }; diff --git a/app/client/src/actions/widgetActions.tsx b/app/client/src/actions/widgetActions.tsx index 2e22d3589a..0cfed7b34b 100644 --- a/app/client/src/actions/widgetActions.tsx +++ b/app/client/src/actions/widgetActions.tsx @@ -3,8 +3,6 @@ import { ReduxAction, ReduxActionErrorTypes, } from "constants/ReduxActionConstants"; -import { PaginationField } from "api/ActionAPI"; - import { ActionPayload, ExecuteErrorPayload, @@ -13,17 +11,10 @@ import { export const executeAction = ( actionPayloads: ActionPayload[], - paginationField?: PaginationField, -): ReduxAction<{ - actions: ActionPayload[]; - paginationField: PaginationField; -}> => { +): ReduxAction => { return { type: ReduxActionTypes.EXECUTE_ACTION, - payload: { - actions: actionPayloads, - paginationField: paginationField, - }, + payload: actionPayloads, }; }; diff --git a/app/client/src/api/ActionAPI.tsx b/app/client/src/api/ActionAPI.tsx index 7028407f23..f5b6551aec 100644 --- a/app/client/src/api/ActionAPI.tsx +++ b/app/client/src/api/ActionAPI.tsx @@ -38,7 +38,6 @@ export interface APIConfigRequest { path: string; body: JSON | string | Record | null; queryParameters: Property[]; - isPaginated: boolean; } export interface QueryConfig { @@ -61,12 +60,9 @@ export interface RestAction { cacheResponse?: string; } -export type PaginationField = "PREV" | "NEXT" | undefined; - export interface ExecuteActionRequest extends APIRequest { action: Pick | Omit; params?: Property[]; - paginationField: PaginationField; } export interface ExecuteActionResponse extends ApiResponse { diff --git a/app/client/src/components/designSystems/appsmith/TablePagination.tsx b/app/client/src/components/designSystems/appsmith/TablePagination.tsx deleted file mode 100644 index fbacf301c9..0000000000 --- a/app/client/src/components/designSystems/appsmith/TablePagination.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import React from "react"; -import { Icon, IconName } from "@blueprintjs/core"; -import styled from "styled-components"; - -const PagerContainer = styled.div<{ - visible: boolean; -}>` - &&&&& { - height: 49px; - display: ${props => (props.visible ? "flex" : "none")}; - } -`; -function PagerIcon(props: { icon: IconName; onClick: Function }) { - return ( - - ); -} -interface PagerProps { - pageNo: number; - prevPageClick: Function; - nextPageClick: Function; - visible: boolean; -} - -const PageWrapper = styled.div` - &&&&& { - width: 140px; - display: flex; - margin: 0 auto; - } -`; - -export function TablePagination(props: PagerProps) { - return ( - - - - - - - - ); -} diff --git a/app/client/src/components/designSystems/blueprint/Checkbox.tsx b/app/client/src/components/designSystems/blueprint/Checkbox.tsx index f71f400c7f..a4f25f9f39 100644 --- a/app/client/src/components/designSystems/blueprint/Checkbox.tsx +++ b/app/client/src/components/designSystems/blueprint/Checkbox.tsx @@ -1,4 +1,4 @@ -import React, { FormEvent } from "react"; +import React from "react"; import styled from "styled-components"; import { Checkbox as BlueprintCheckbox, @@ -13,12 +13,6 @@ import { export type CheckboxProps = ICheckboxProps & { intent: Intent; align: "left" | "right"; - input?: { - onChange?: (value: boolean) => void; - value?: boolean; - checked?: boolean; - }; - label: string; }; export const StyledCheckbox = styled(BlueprintCheckbox)` @@ -41,20 +35,7 @@ export const StyledCheckbox = styled(BlueprintCheckbox)` `; export const Checkbox = (props: CheckboxProps) => { - const handleChange = (e: any) => { - props.input && - props.input.onChange && - props.input.onChange(e.target.checked); - }; - return ( - - ); + return ; }; export default Checkbox; diff --git a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx index 08313aabaf..9d3d791d19 100644 --- a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx +++ b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx @@ -21,7 +21,6 @@ import styled from "constants/DefaultTheme"; import { ColumnAction } from "components/propertyControls/ColumnActionSelectorControl"; import { ActionPayload } from "constants/ActionConstants"; import { Classes } from "@blueprintjs/core"; -import { TablePagination } from "../appsmith/TablePagination"; export interface TableComponentProps { data: object[]; @@ -33,28 +32,13 @@ export interface TableComponentProps { columnActions?: ColumnAction[]; onCommandClick: (actions: ActionPayload[]) => void; disableDrag: (disable: boolean) => void; - nextPageClick: Function; - prevPageClick: Function; - pageNo: number; - serverSidePaginationEnabled: boolean; } const StyledGridComponent = styled(GridComponent)` - &&& { - height: calc(100% - 49px); - .e-altrow { - background-color: #fafafa; - } - .e-gridcontent { - height: calc(100% - 50px); - overflow: auto; - } + .e-altrow { + background-color: #fafafa; } `; - -const TableContainer = styled.div` - height: 100%; -`; const settings: SelectionSettingsModel = { type: "Multiple", }; @@ -180,15 +164,15 @@ const TableComponent = memo( } return ( - +
- - +
); }, (prevProps, nextProps) => { @@ -230,9 +209,7 @@ const TableComponent = memo( JSON.stringify(nextProps.data) !== JSON.stringify(prevProps.data) || nextProps.height !== prevProps.height || JSON.stringify(nextProps.columnActions) !== - JSON.stringify(prevProps.columnActions) || - nextProps.serverSidePaginationEnabled !== - prevProps.serverSidePaginationEnabled; + JSON.stringify(prevProps.columnActions); return !propsNotEqual; }, diff --git a/app/client/src/components/editorComponents/ApiResponseView.tsx b/app/client/src/components/editorComponents/ApiResponseView.tsx index 66f260a025..ea48d73b73 100644 --- a/app/client/src/components/editorComponents/ApiResponseView.tsx +++ b/app/client/src/components/editorComponents/ApiResponseView.tsx @@ -16,7 +16,7 @@ import { getActionResponses } from "selectors/entitiesSelector"; const ResponseWrapper = styled.div` position: relative; - flex: 1; + flex: 4; height: 100%; overflow-y: scroll; `; diff --git a/app/client/src/components/editorComponents/EditorContextProvider.tsx b/app/client/src/components/editorComponents/EditorContextProvider.tsx index 6a5cf82d18..a78b71bf16 100644 --- a/app/client/src/components/editorComponents/EditorContextProvider.tsx +++ b/app/client/src/components/editorComponents/EditorContextProvider.tsx @@ -13,17 +13,10 @@ import { ActionPayload } from "constants/ActionConstants"; import { RenderModes } from "constants/WidgetConstants"; import { OccupiedSpace } from "constants/editorConstants"; -import { - getOccupiedSpaces, - getPaginatedWidgets, -} from "selectors/editorSelectors"; -import { PaginationField, RestAction } from "api/ActionAPI"; +import { getOccupiedSpaces } from "selectors/editorSelectors"; export type EditorContextType = { - executeAction?: ( - actionPayloads: ActionPayload[], - paginationField?: PaginationField, - ) => void; + executeAction?: (actionPayloads: ActionPayload[]) => void; updateWidget?: ( operation: WidgetOperation, widgetId: string, @@ -36,7 +29,6 @@ export type EditorContextType = { ) => void; disableDrag?: (disable: boolean) => void; occupiedSpaces?: { [containerWidgetId: string]: OccupiedSpace[] }; - paginatedWidgets?: string[]; }; export const EditorContext: Context = createContext({}); @@ -50,7 +42,6 @@ const EditorContextProvider = (props: EditorContextProviderProps) => { updateWidget, updateWidgetProperty, occupiedSpaces, - paginatedWidgets, disableDrag, children, } = props; @@ -61,7 +52,6 @@ const EditorContextProvider = (props: EditorContextProviderProps) => { updateWidget, updateWidgetProperty, occupiedSpaces, - paginatedWidgets, disableDrag, }} > @@ -72,10 +62,6 @@ const EditorContextProvider = (props: EditorContextProviderProps) => { const mapStateToProps = (state: AppState) => { return { - paginatedWidgets: getPaginatedWidgets( - state.entities.actions.map(action => action.config), - state.entities.canvasWidgets, - ), occupiedSpaces: getOccupiedSpaces(state), }; }; @@ -95,10 +81,8 @@ const mapDispatchToProps = (dispatch: any) => { RenderModes.CANVAS, ), ), - executeAction: ( - actionPayloads: ActionPayload[], - paginationField?: PaginationField, - ) => dispatch(executeAction(actionPayloads, paginationField)), + executeAction: (actionPayloads: ActionPayload[]) => + dispatch(executeAction(actionPayloads)), updateWidget: ( operation: WidgetOperation, widgetId: string, diff --git a/app/client/src/components/editorComponents/form/fields/CheckboxField.tsx b/app/client/src/components/editorComponents/form/fields/CheckboxField.tsx index 864838cfad..bc7c7bfd80 100644 --- a/app/client/src/components/editorComponents/form/fields/CheckboxField.tsx +++ b/app/client/src/components/editorComponents/form/fields/CheckboxField.tsx @@ -3,11 +3,8 @@ import { Field, BaseFieldProps } from "redux-form"; import Checkbox, { CheckboxProps, } from "components/designSystems/blueprint/Checkbox"; - export const CheckboxField = (props: BaseFieldProps & CheckboxProps) => { - return ( - - ); + return ; }; export default CheckboxField; diff --git a/app/client/src/index.css b/app/client/src/index.css index 98a1bd9637..c9294a31de 100755 --- a/app/client/src/index.css +++ b/app/client/src/index.css @@ -118,7 +118,3 @@ div.bp3-popover-arrow { transform: rotate(360deg); } } - -.display-none { - display: none; -} \ No newline at end of file diff --git a/app/client/src/pages/AppViewer/index.tsx b/app/client/src/pages/AppViewer/index.tsx index c73520793e..f2234bcbea 100644 --- a/app/client/src/pages/AppViewer/index.tsx +++ b/app/client/src/pages/AppViewer/index.tsx @@ -27,7 +27,6 @@ import { RenderModes } from "constants/WidgetConstants"; import { EditorContext } from "components/editorComponents/EditorContextProvider"; import AppViewerPageContainer from "./AppViewerPageContainer"; import AppViewerSideNavWrapper from "./viewer/AppViewerSideNavWrapper"; -import { PaginationField } from "api/ActionAPI"; const AppViewWrapper = styled.div` margin-top: ${props => props.theme.headerHeight}; @@ -114,10 +113,8 @@ const mapStateToProps = (state: AppState) => ({ }); const mapDispatchToProps = (dispatch: any) => ({ - executeAction: ( - actionPayloads: ActionPayload[], - paginationField?: PaginationField, - ) => dispatch(executeAction(actionPayloads, paginationField)), + executeAction: (actionPayloads: ActionPayload[]) => + dispatch(executeAction(actionPayloads)), updateWidgetProperty: ( widgetId: string, propertyName: string, diff --git a/app/client/src/pages/Editor/APIEditor/Form.tsx b/app/client/src/pages/Editor/APIEditor/Form.tsx index 1b5617a6ea..2e7097344c 100644 --- a/app/client/src/pages/Editor/APIEditor/Form.tsx +++ b/app/client/src/pages/Editor/APIEditor/Form.tsx @@ -5,7 +5,7 @@ import styled from "styled-components"; import FormLabel from "components/editorComponents/FormLabel"; import FormRow from "components/editorComponents/FormRow"; import { BaseButton } from "components/designSystems/blueprint/ButtonComponent"; -import { RestAction, PaginationField } from "api/ActionAPI"; +import { RestAction } from "api/ActionAPI"; import TextField from "components/editorComponents/form/fields/TextField"; import DynamicTextField from "components/editorComponents/form/fields/DynamicTextField"; import DropdownField from "components/editorComponents/form/fields/DropdownField"; @@ -15,8 +15,6 @@ import ApiResponseView from "components/editorComponents/ApiResponseView"; import { API_EDITOR_FORM_NAME } from "constants/forms"; import LoadingOverlayScreen from "components/editorComponents/LoadingOverlayScreen"; import { FormIcons } from "icons/FormIcons"; -import { BaseTabbedView } from "components/designSystems/appsmith/TabbedView"; -import Pagination from "./Pagination"; const Form = styled.form` display: flex; @@ -77,18 +75,13 @@ const DatasourceWrapper = styled.div` max-width: 320px; `; -const TabbedViewContainer = styled.div` - flex: 1; - padding-top: 12px; -`; - interface APIFormProps { pluginId: string; allowSave: boolean; allowPostBody: boolean; onSubmit: FormSubmitHandler; onSaveClick: () => void; - onRunClick: (paginationField?: PaginationField) => void; + onRunClick: () => void; onDeleteClick: () => void; isSaving: boolean; isRunning: boolean; @@ -130,9 +123,7 @@ const ApiEditorForm: React.FC = (props: Props) => { { - onRunClick(); - }} + onClick={onRunClick} loading={isRunning} /> = (props: Props) => { - - - - - {allowPostBody && ( - - {"Post Body"} - - - - - )} - - ), - }, - { - key: "pagination", - title: "Pagination", - panelComponent: ( - - ), - }, - ]} - > - - + + + + {allowPostBody && ( + + {"Post Body"} + + + + + )} + diff --git a/app/client/src/pages/Editor/APIEditor/Pagination.tsx b/app/client/src/pages/Editor/APIEditor/Pagination.tsx deleted file mode 100644 index b74ea5314e..0000000000 --- a/app/client/src/pages/Editor/APIEditor/Pagination.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from "react"; -import DynamicTextField from "components/editorComponents/form/fields/DynamicTextField"; -import { Button } from "@blueprintjs/core"; -import styled from "constants/DefaultTheme"; -import CheckboxField from "components/editorComponents/form/fields/CheckboxField"; -interface PaginationProps { - onTestClick: Function; -} -const PaginationFieldWrapper = styled.div` - display: flex; -`; -export default function Pagination(props: PaginationProps) { - return ( -
-
- -
- - - - - - - - - - -
- ); -} diff --git a/app/client/src/pages/Editor/APIEditor/index.tsx b/app/client/src/pages/Editor/APIEditor/index.tsx index cdcacec096..5a32f458e9 100644 --- a/app/client/src/pages/Editor/APIEditor/index.tsx +++ b/app/client/src/pages/Editor/APIEditor/index.tsx @@ -8,7 +8,7 @@ import { deleteAction, updateAction, } from "actions/actionActions"; -import { RestAction, PaginationField } from "api/ActionAPI"; +import { RestAction } from "api/ActionAPI"; import { AppState } from "reducers"; import { RouteComponentProps } from "react-router"; import { API_EDITOR_FORM_NAME } from "constants/forms"; @@ -28,7 +28,7 @@ interface ReduxStateProps { interface ReduxActionProps { submitForm: (name: string) => void; createAction: (values: RestAction) => void; - runAction: (id: string, paginationField: PaginationField) => void; + runAction: (id: string) => void; deleteAction: (id: string) => void; updateAction: (data: RestAction) => void; } @@ -57,8 +57,8 @@ class ApiEditor extends React.Component { handleDeleteClick = () => { this.props.deleteAction(this.props.match.params.apiId); }; - handleRunClick = (paginationField?: PaginationField) => { - this.props.runAction(this.props.match.params.apiId, paginationField); + handleRunClick = () => { + this.props.runAction(this.props.match.params.apiId); }; render() { @@ -112,8 +112,7 @@ const mapStateToProps = (state: AppState): ReduxStateProps => ({ const mapDispatchToProps = (dispatch: any): ReduxActionProps => ({ submitForm: (name: string) => dispatch(submit(name)), createAction: (action: RestAction) => dispatch(createActionRequest(action)), - runAction: (id: string, paginationField: PaginationField) => - dispatch(runApiAction(id, paginationField)), + runAction: (id: string) => dispatch(runApiAction(id)), deleteAction: (id: string) => dispatch(deleteAction({ id })), updateAction: (data: RestAction) => dispatch(updateAction({ data })), }); diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index ba77c1cd1e..48ec9c0c2e 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -25,7 +25,6 @@ import ActionAPI, { ExecuteActionRequest, Property, RestAction, - PaginationField, } from "api/ActionAPI"; import { AppState } from "reducers"; import _ from "lodash"; @@ -125,10 +124,7 @@ function* executeJSActionSaga(jsAction: ExecuteJSActionPayload) { }); } -export function* executeAPIQueryActionSaga( - apiAction: ActionPayload, - paginationField: PaginationField, -) { +export function* executeAPIQueryActionSaga(apiAction: ActionPayload) { try { const api: PageAction = yield select(getAction, apiAction.actionId); if (!api) { @@ -144,7 +140,6 @@ export function* executeAPIQueryActionSaga( const executeActionRequest: ExecuteActionRequest = { action: { id: apiAction.actionId }, params, - paginationField: paginationField, }; const response: ActionApiResponse = yield ActionAPI.executeAction( executeActionRequest, @@ -207,10 +202,7 @@ function validateActionPayload(actionPayload: ActionPayload) { return validation; } -export function* executeActionSaga( - actionPayloads: ActionPayload[], - paginationField: PaginationField, -): any { +export function* executeActionSaga(actionPayloads: ActionPayload[]): any { yield all( _.map(actionPayloads, (actionPayload: ActionPayload) => { const actionValidation = validateActionPayload(actionPayload); @@ -221,17 +213,9 @@ export function* executeActionSaga( switch (actionPayload.actionType) { case "API": - return call( - executeAPIQueryActionSaga, - actionPayload, - paginationField, - ); + return call(executeAPIQueryActionSaga, actionPayload); case "QUERY": - return call( - executeAPIQueryActionSaga, - actionPayload, - paginationField, - ); + return call(executeAPIQueryActionSaga, actionPayload); case "JS_FUNCTION": return call( executeJSActionSaga, @@ -244,17 +228,9 @@ export function* executeActionSaga( ); } -export function* executeReduxActionSaga( - action: ReduxAction<{ - actions: ActionPayload[]; - paginationField: PaginationField; - }>, -) { +export function* executeReduxActionSaga(action: ReduxAction) { if (!_.isNil(action.payload)) { - yield* executeActionSaga( - action.payload.actions, - action.payload.paginationField, - ); + yield* executeActionSaga(action.payload); } else { yield put( executeActionError({ @@ -355,22 +331,16 @@ export function* deleteActionSaga(actionPayload: ReduxAction<{ id: string }>) { } } -export function* runApiActionSaga( - reduxAction: ReduxAction<{ - id: string; - paginationField: PaginationField; - }>, -) { +export function* runApiActionSaga(action: ReduxAction) { try { const { values, dirty, valid, - }: { - values: RestAction; - dirty: boolean; - valid: boolean; - } = yield select(getFormData, API_EDITOR_FORM_NAME); + }: { values: RestAction; dirty: boolean; valid: boolean } = yield select( + getFormData, + API_EDITOR_FORM_NAME, + ); const actionObject: PageAction = yield select(getAction, values.id); let action: ExecuteActionRequest["action"] = { id: values.id }; let jsonPathKeys = actionObject.jsonPathKeys; @@ -379,8 +349,7 @@ export function* runApiActionSaga( return; } if (dirty) { - action = _.omit(transformRestAction(values), "id") as RestAction; - + action = _.omit(transformRestAction(values), "id"); const actionString = JSON.stringify(action); if (isDynamicValue(actionString)) { const { paths } = getDynamicBindings(actionString); @@ -390,13 +359,10 @@ export function* runApiActionSaga( jsonPathKeys = []; } } - const { paginationField } = reduxAction.payload; - const params = yield call(getActionParams, jsonPathKeys); const response: ActionApiResponse = yield ActionAPI.executeAction({ action, params, - paginationField, }); let payload = createActionResponse(response); if (response.responseMeta && response.responseMeta.error) { @@ -410,7 +376,7 @@ export function* runApiActionSaga( } catch (error) { yield put({ type: ReduxActionErrorTypes.RUN_API_ERROR, - payload: { error, id: reduxAction.payload }, + payload: { error, id: action.payload }, }); } } diff --git a/app/client/src/selectors/editorSelectors.tsx b/app/client/src/selectors/editorSelectors.tsx index 700ce7e390..7ad47b7d1b 100644 --- a/app/client/src/selectors/editorSelectors.tsx +++ b/app/client/src/selectors/editorSelectors.tsx @@ -18,7 +18,6 @@ import { OccupiedSpace } from "constants/editorConstants"; import { WidgetTypes } from "constants/WidgetConstants"; import { getParsedDataTree } from "./nameBindingsWithDataSelector"; import _ from "lodash"; -import { RestAction } from "api/ActionAPI"; const getEditorState = (state: AppState) => state.ui.editor; const getWidgetConfigs = (state: AppState) => state.entities.widgetConfig; @@ -172,29 +171,6 @@ const getOccupiedSpacesForContainer = ( }); }; -export const getPaginatedWidgets = ( - actions: RestAction[], - widgets: Record, -): string[] => { - const paginatedActions = actions.filter( - action => action.actionConfiguration.isPaginated, - ); - const paginatedWidgets: string[] = []; - Object.keys(widgets).forEach((key: string) => { - const widget = widgets[key]; - if (widget.dynamicBindings) { - Object.keys(widget.dynamicBindings).forEach(db => { - paginatedActions.forEach(pApi => { - if (widget[db].indexOf(pApi.name) !== -1) { - paginatedWidgets.push(widget.widgetId); - } - }); - }); - } - }); - return paginatedWidgets; -}; - export const getOccupiedSpaces = createSelector( getWidgets, ( diff --git a/app/client/src/widgets/BaseWidget.tsx b/app/client/src/widgets/BaseWidget.tsx index b514169dee..1c7ab155af 100644 --- a/app/client/src/widgets/BaseWidget.tsx +++ b/app/client/src/widgets/BaseWidget.tsx @@ -29,7 +29,6 @@ import { PositionTypes } from "constants/WidgetConstants"; import ErrorBoundary from "components/editorComponents/ErrorBoundry"; import { WidgetPropertyValidationType } from "utils/ValidationFactory"; import { DerivedPropertiesMap } from "utils/WidgetFactory"; -import { PaginationField } from "api/ActionAPI"; /*** * BaseWidget * @@ -83,14 +82,9 @@ abstract class BaseWidget< * Widgets can execute actions using this `executeAction` method. * Triggers may be specific to the widget */ - executeAction( - actionPayloads?: ActionPayload[], - paginationField?: PaginationField, - ): void { + executeAction(actionPayloads?: ActionPayload[]): void { const { executeAction } = this.context; - executeAction && - !_.isNil(actionPayloads) && - executeAction(actionPayloads, paginationField); + executeAction && !_.isNil(actionPayloads) && executeAction(actionPayloads); } disableDrag(disable: boolean) { diff --git a/app/client/src/widgets/TableWidget.tsx b/app/client/src/widgets/TableWidget.tsx index 653f82cb76..930800f9c5 100644 --- a/app/client/src/widgets/TableWidget.tsx +++ b/app/client/src/widgets/TableWidget.tsx @@ -45,10 +45,6 @@ class TableWidget extends BaseWidget { getPageView() { const { tableData } = this.props; const columns = constructColumns(tableData); - - const serverSidePaginationEnabled = this.context.paginatedWidgets.includes( - this.props.widgetId, - ); return ( { super.executeAction(onRowSelected); }} - serverSidePaginationEnabled={serverSidePaginationEnabled} - pageNo={1} - nextPageClick={() => { - super.executeAction(this.props.onPageChange, "NEXT"); - }} - prevPageClick={() => { - super.executeAction(this.props.onPageChange, "PREV"); - }} /> ); } + // componentDidUpdate(prevProps: TableWidgetProps) { + // super.componentDidUpdate(prevProps); + // if ( + // !_.isEqual(prevProps.tableData, this.props.tableData) && + // prevProps.selectedRow + // ) { + // this.updateSelectedRowProperty( + // this.props.tableData[prevProps.selectedRow.rowIndex], + // prevProps.selectedRow.rowIndex, + // ); + // } + // } onCommandClick = (actions: ActionPayload[]) => { super.executeAction(actions); };