You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ne...@apache.org on 2022/09/21 22:28:23 UTC

[pinot] branch master updated: fix(ui): table only displaying first 10 results when not explicitly paginated (#9404)

This is an automated email from the ASF dual-hosted git repository.

nehapawar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new fa2328e4aa fix(ui): table only displaying first 10 results when not explicitly paginated (#9404)
fa2328e4aa is described below

commit fa2328e4aa64114ae60f38976486eb6ba60555b4
Author: Jayesh Choudhary <ja...@gmail.com>
AuthorDate: Thu Sep 22 03:58:15 2022 +0530

    fix(ui): table only displaying first 10 results when not explicitly paginated (#9404)
    
    * fix(ui): table only displaying first 10 results when not explicitly paginated
    
    * show pagination by default when the table rows are greater than 10
---
 .../main/resources/app/components/Homepage/ClusterConfig.tsx   |  1 -
 .../main/resources/app/components/Homepage/InstanceTable.tsx   |  1 -
 .../main/resources/app/components/Homepage/TenantsListing.tsx  |  1 -
 .../resources/app/components/Homepage/useTaskTypesTable.tsx    |  1 -
 .../src/main/resources/app/components/Query/QuerySideBar.tsx   |  4 ----
 pinot-controller/src/main/resources/app/components/Table.tsx   | 10 ++++------
 .../src/main/resources/app/components/usePeriodicTasks.tsx     |  1 -
 .../src/main/resources/app/components/useTaskListing.tsx       |  1 -
 .../src/main/resources/app/pages/InstanceDetails.tsx           |  1 -
 pinot-controller/src/main/resources/app/pages/Query.tsx        |  1 -
 .../src/main/resources/app/pages/SchemaPageDetails.tsx         |  2 --
 .../src/main/resources/app/pages/SegmentDetails.tsx            |  2 --
 .../src/main/resources/app/pages/TablesListingPage.tsx         |  2 --
 pinot-controller/src/main/resources/app/pages/TaskDetail.tsx   |  1 -
 pinot-controller/src/main/resources/app/pages/TaskQueue.tsx    |  1 -
 .../src/main/resources/app/pages/TenantDetails.tsx             |  5 -----
 pinot-controller/src/main/resources/app/pages/Tenants.tsx      |  3 ---
 17 files changed, 4 insertions(+), 34 deletions(-)

diff --git a/pinot-controller/src/main/resources/app/components/Homepage/ClusterConfig.tsx b/pinot-controller/src/main/resources/app/components/Homepage/ClusterConfig.tsx
index deec86cf05..1b5217c713 100644
--- a/pinot-controller/src/main/resources/app/components/Homepage/ClusterConfig.tsx
+++ b/pinot-controller/src/main/resources/app/components/Homepage/ClusterConfig.tsx
@@ -47,7 +47,6 @@ const ClusterConfig = () => {
       data={tableData}
       showSearchBox={true}
       inAccordionFormat={true}
-      isPagination={false}
     />
   );
 };
diff --git a/pinot-controller/src/main/resources/app/components/Homepage/InstanceTable.tsx b/pinot-controller/src/main/resources/app/components/Homepage/InstanceTable.tsx
index 7df9518843..24b45dbeed 100644
--- a/pinot-controller/src/main/resources/app/components/Homepage/InstanceTable.tsx
+++ b/pinot-controller/src/main/resources/app/components/Homepage/InstanceTable.tsx
@@ -65,7 +65,6 @@ const InstanceTable = ({ name, instances, clusterName }: Props) => {
       inAccordionFormat={true}
       addLinks
       baseURL="/instance/"
-      isPagination
     />
   );
 };
diff --git a/pinot-controller/src/main/resources/app/components/Homepage/TenantsListing.tsx b/pinot-controller/src/main/resources/app/components/Homepage/TenantsListing.tsx
index d711109bc1..40f7aa868a 100644
--- a/pinot-controller/src/main/resources/app/components/Homepage/TenantsListing.tsx
+++ b/pinot-controller/src/main/resources/app/components/Homepage/TenantsListing.tsx
@@ -27,7 +27,6 @@ const TenantsTable = ({tenantsData}) => {
       title="Tenants"
       data={tenantsData}
       addLinks
-      isPagination
       baseURL="/tenants/"
       showSearchBox={true}
       inAccordionFormat={true}
diff --git a/pinot-controller/src/main/resources/app/components/Homepage/useTaskTypesTable.tsx b/pinot-controller/src/main/resources/app/components/Homepage/useTaskTypesTable.tsx
index 13e4dfa745..71fa4de85d 100644
--- a/pinot-controller/src/main/resources/app/components/Homepage/useTaskTypesTable.tsx
+++ b/pinot-controller/src/main/resources/app/components/Homepage/useTaskTypesTable.tsx
@@ -44,7 +44,6 @@ const useTaskTypesTable = () => {
         data={taskTypes}
         showSearchBox={true}
         inAccordionFormat={true}
-        isPagination={false}
         addLinks
         baseURL='/task-queue/'
       />
diff --git a/pinot-controller/src/main/resources/app/components/Query/QuerySideBar.tsx b/pinot-controller/src/main/resources/app/components/Query/QuerySideBar.tsx
index 4aee93f135..6da726db10 100644
--- a/pinot-controller/src/main/resources/app/components/Query/QuerySideBar.tsx
+++ b/pinot-controller/src/main/resources/app/components/Query/QuerySideBar.tsx
@@ -98,8 +98,6 @@ const Sidebar = ({ tableList, fetchSQLData, tableSchema, selectedTable, queryLoa
             <CustomizedTables
               title="Tables"
               data={tableList}
-              isPagination={false}
-              noOfRows={tableList.records.length}
               cellClickCallback={fetchSQLData}
               isCellClickable
               showSearchBox={false}
@@ -109,8 +107,6 @@ const Sidebar = ({ tableList, fetchSQLData, tableSchema, selectedTable, queryLoa
               <CustomizedTables
                 title={`${selectedTable} schema`}
                 data={tableSchema}
-                isPagination={false}
-                noOfRows={tableSchema.records.length}
                 highlightBackground
                 showSearchBox={false}
               />
diff --git a/pinot-controller/src/main/resources/app/components/Table.tsx b/pinot-controller/src/main/resources/app/components/Table.tsx
index 70d98cd7dd..f59ffc722e 100644
--- a/pinot-controller/src/main/resources/app/components/Table.tsx
+++ b/pinot-controller/src/main/resources/app/components/Table.tsx
@@ -53,9 +53,8 @@ import SimpleAccordion from './SimpleAccordion';
 type Props = {
   title?: string,
   data: TableData,
-  noOfRows?: number,
+  defaultRowsPerPage?: number,
   addLinks?: boolean,
-  isPagination?: boolean,
   cellClickCallback?: Function,
   isCellClickable?: boolean,
   highlightBackground?: boolean,
@@ -257,9 +256,8 @@ TablePaginationActions.propTypes = {
 export default function CustomizedTables({
   title,
   data,
-  noOfRows,
+  defaultRowsPerPage,
   addLinks,
-  isPagination,
   cellClickCallback,
   isCellClickable,
   highlightBackground,
@@ -278,7 +276,7 @@ export default function CustomizedTables({
   const [columnClicked, setColumnClicked] = React.useState('');
 
   const classes = useStyles();
-  const [rowsPerPage, setRowsPerPage] = React.useState(noOfRows || 10);
+  const [rowsPerPage, setRowsPerPage] = React.useState(defaultRowsPerPage || 10);
   const [page, setPage] = React.useState(0);
 
   const handleChangeRowsPerPage = (
@@ -529,7 +527,7 @@ export default function CustomizedTables({
             </TableBody>
           </Table>
         </TableContainer>
-        {isPagination && finalData.length > 10 ? (
+        {finalData.length > 10 ? (
           <TablePagination
             rowsPerPageOptions={[5, 10, 25]}
             component="div"
diff --git a/pinot-controller/src/main/resources/app/components/usePeriodicTasks.tsx b/pinot-controller/src/main/resources/app/components/usePeriodicTasks.tsx
index 7f70c8ae31..66dd7e47c8 100644
--- a/pinot-controller/src/main/resources/app/components/usePeriodicTasks.tsx
+++ b/pinot-controller/src/main/resources/app/components/usePeriodicTasks.tsx
@@ -29,7 +29,6 @@ const PeriodicTaskTable = ({ tableData }) => {
       data={tableData}
       showSearchBox={true}
       inAccordionFormat={true}
-      isPagination={false}
     />
   );
 };
diff --git a/pinot-controller/src/main/resources/app/components/useTaskListing.tsx b/pinot-controller/src/main/resources/app/components/useTaskListing.tsx
index fb22e868e4..97d43f7650 100644
--- a/pinot-controller/src/main/resources/app/components/useTaskListing.tsx
+++ b/pinot-controller/src/main/resources/app/components/useTaskListing.tsx
@@ -47,7 +47,6 @@ export default function useTaskListing(props) {
         data={tasks}
         showSearchBox={true}
         inAccordionFormat={true}
-        isPagination={false}
         addLinks
         baseURL={`/task-queue/${taskType}/tables/${tableName}/task/`}
       />
diff --git a/pinot-controller/src/main/resources/app/pages/InstanceDetails.tsx b/pinot-controller/src/main/resources/app/pages/InstanceDetails.tsx
index bbb84f1ee4..744751f36e 100644
--- a/pinot-controller/src/main/resources/app/pages/InstanceDetails.tsx
+++ b/pinot-controller/src/main/resources/app/pages/InstanceDetails.tsx
@@ -382,7 +382,6 @@ const InstanceDetails = ({ match }: RouteComponentProps<Props>) => {
         <CustomizedTables
           title="Tables"
           data={tableData}
-          isPagination
           addLinks
           baseURL={`/instance/${instanceName}/table/`}
           showSearchBox={true}
diff --git a/pinot-controller/src/main/resources/app/pages/Query.tsx b/pinot-controller/src/main/resources/app/pages/Query.tsx
index 4a6d3f3993..1974be4376 100644
--- a/pinot-controller/src/main/resources/app/pages/Query.tsx
+++ b/pinot-controller/src/main/resources/app/pages/Query.tsx
@@ -618,7 +618,6 @@ const QueryPage = () => {
                             <CustomizedTables
                               title="Query Result"
                               data={resultData}
-                              isPagination
                               isSticky={true}
                               showSearchBox={true}
                               inAccordionFormat={true}
diff --git a/pinot-controller/src/main/resources/app/pages/SchemaPageDetails.tsx b/pinot-controller/src/main/resources/app/pages/SchemaPageDetails.tsx
index a104727044..d1e183da4a 100644
--- a/pinot-controller/src/main/resources/app/pages/SchemaPageDetails.tsx
+++ b/pinot-controller/src/main/resources/app/pages/SchemaPageDetails.tsx
@@ -258,8 +258,6 @@ const SchemaPageDetails = ({ match }: RouteComponentProps<Props>) => {
             <CustomizedTables
               title="Table Schema"
               data={tableSchema}
-              isPagination={false}
-              noOfRows={tableSchema.records.length}
               showSearchBox={true}
             />
           :
diff --git a/pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx b/pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx
index 6a322ed084..1caddabc37 100644
--- a/pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx
+++ b/pinot-controller/src/main/resources/app/pages/SegmentDetails.tsx
@@ -235,7 +235,6 @@ const SegmentDetails = ({ match }: RouteComponentProps<Props>) => {
           <CustomizedTables
             title="Replica Set"
             data={replica}
-            isPagination={true}
             showSearchBox={true}
             inAccordionFormat={true}
           />
@@ -262,7 +261,6 @@ const SegmentDetails = ({ match }: RouteComponentProps<Props>) => {
                 <CustomizedTables
                   title="Indexes"
                   data={indexes}
-                  isPagination={true}
                   showSearchBox={true}
                   inAccordionFormat={true}
                 />
diff --git a/pinot-controller/src/main/resources/app/pages/TablesListingPage.tsx b/pinot-controller/src/main/resources/app/pages/TablesListingPage.tsx
index 9fe7d0a07d..981077633a 100644
--- a/pinot-controller/src/main/resources/app/pages/TablesListingPage.tsx
+++ b/pinot-controller/src/main/resources/app/pages/TablesListingPage.tsx
@@ -122,7 +122,6 @@ const TablesListingPage = () => {
       <CustomizedTables
         title="Tables"
         data={tableData}
-        isPagination
         addLinks
         baseURL="/tenants/table/"
         showSearchBox={true}
@@ -132,7 +131,6 @@ const TablesListingPage = () => {
       <CustomizedTables
           title="Schemas"
           data={schemaDetails}
-          isPagination
           showSearchBox={true}
           inAccordionFormat={true}
           addLinks
diff --git a/pinot-controller/src/main/resources/app/pages/TaskDetail.tsx b/pinot-controller/src/main/resources/app/pages/TaskDetail.tsx
index ce6680d96b..70fbff989a 100644
--- a/pinot-controller/src/main/resources/app/pages/TaskDetail.tsx
+++ b/pinot-controller/src/main/resources/app/pages/TaskDetail.tsx
@@ -119,7 +119,6 @@ const TaskDetail = (props) => {
               data={subtaskTableData}
               showSearchBox={true}
               inAccordionFormat={true}
-              isPagination={false}
               addLinks
               baseURL={`/task-queue/${taskType}/tables/${queueTableName}/task/${taskID}/sub-task/`}
             />
diff --git a/pinot-controller/src/main/resources/app/pages/TaskQueue.tsx b/pinot-controller/src/main/resources/app/pages/TaskQueue.tsx
index b3bc4a9dab..0c9fe5d45c 100644
--- a/pinot-controller/src/main/resources/app/pages/TaskQueue.tsx
+++ b/pinot-controller/src/main/resources/app/pages/TaskQueue.tsx
@@ -184,7 +184,6 @@ const TaskQueue = (props) => {
           data={tables}
           showSearchBox={true}
           inAccordionFormat={true}
-          isPagination={false}
           addLinks
           baseURL={`/task-queue/${taskType}/tables/`}
         />
diff --git a/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx b/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
index e3a265b06f..c72f9eda15 100644
--- a/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
+++ b/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
@@ -499,7 +499,6 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
           <CustomizedTables
             title={"Segments - " + segmentList.records.length}
             data={segmentList}
-            isPagination={true}
             baseURL={
               tenantName && `/tenants/${tenantName}/table/${tableName}/` ||
               instanceName && `/instance/${instanceName}/table/${tableName}/` ||
@@ -515,8 +514,6 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
             <CustomizedTables
               title="Table Schema"
               data={tableSchema}
-              isPagination={false}
-              noOfRows={tableSchema.records.length}
               showSearchBox={true}
               inAccordionFormat={true}
               accordionToggleObject={{
@@ -548,8 +545,6 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
           <CustomizedTables
             title={"Instance Count - " + instanceCountData.records.length}
             data={instanceCountData}
-            isPagination={false}
-            noOfRows={instanceCountData.records.length}
             showSearchBox={true}
             inAccordionFormat={true}
           />
diff --git a/pinot-controller/src/main/resources/app/pages/Tenants.tsx b/pinot-controller/src/main/resources/app/pages/Tenants.tsx
index 394e01a51c..dd39b9a8e7 100644
--- a/pinot-controller/src/main/resources/app/pages/Tenants.tsx
+++ b/pinot-controller/src/main/resources/app/pages/Tenants.tsx
@@ -108,7 +108,6 @@ const TenantPage = ({ match }: RouteComponentProps<Props>) => {
         title={tenantName}
         data={tableData}
         tooltipData={TableTooltipData}
-        isPagination
         addLinks
         baseURL={`/tenants/${tenantName}/table/`}
         showSearchBox={true}
@@ -122,7 +121,6 @@ const TenantPage = ({ match }: RouteComponentProps<Props>) => {
               columns: ['Instance Name'],
               records: brokerData.length > 0 ? brokerData : []
             }}
-            isPagination
             addLinks
             baseURL="/instance/"
             showSearchBox={true}
@@ -136,7 +134,6 @@ const TenantPage = ({ match }: RouteComponentProps<Props>) => {
               columns: ['Instance Name'],
               records: serverData.length > 0 ? serverData : []
             }}
-            isPagination
             addLinks
             baseURL="/instance/"
             showSearchBox={true}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org