[ARVADOS-WORKBENCH2] created: 2.2.1-77-ge983d1cc

Git user git at public.arvados.org
Fri Sep 10 18:04:44 UTC 2021


        at  e983d1cc16a370a1cf0ab3dccc47049a34ef049d (commit)


commit e983d1cc16a370a1cf0ab3dccc47049a34ef049d
Author: Stephen Smith <stephen at curii.com>
Date:   Fri Sep 10 14:04:02 2021 -0400

    18029: Disable pagination next if list is empty
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index a38d0ed6..d272e870 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -134,6 +134,8 @@ export const DataExplorer = withStyles(styles)(
                             page={this.props.page}
                             onChangePage={this.changePage}
                             onChangeRowsPerPage={this.changeRowsPerPage}
+                            // Disable next button on empty lists since that's not default behavior
+                            nextIconButtonProps={(itemsAvailable > 0) ? {} : {disabled: true}}
                             component="div" /> : <Button
                                 variant="text"
                                 size="medium"

commit f1195b8035a81b011caf89f3aaca3caadd2e99ed
Author: Stephen Smith <stephen at curii.com>
Date:   Fri Sep 10 14:03:19 2021 -0400

    18029: Fix divide by zero on empty pagination by defaulting to 0
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/store/all-processes-panel/all-processes-panel-middleware-service.ts b/src/store/all-processes-panel/all-processes-panel-middleware-service.ts
index 88b64e62..05c8882d 100644
--- a/src/store/all-processes-panel/all-processes-panel-middleware-service.ts
+++ b/src/store/all-processes-panel/all-processes-panel-middleware-service.ts
@@ -45,7 +45,7 @@ export class AllProcessesPanelMiddlewareService extends DataExplorerMiddlewareSe
                 api.dispatch(allProcessesPanelActions.SET_ITEMS({
                     items: processItems.items.map((resource: any) => resource.uuid),
                     itemsAvailable: processItems.itemsAvailable,
-                    page: Math.floor(processItems.offset / processItems.limit),
+                    page: Math.floor(processItems.offset / processItems.limit) || 0,
                     rowsPerPage: processItems.limit
                 }));
             } catch {
diff --git a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
index 983b309a..42bb476b 100644
--- a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
+++ b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
@@ -112,7 +112,7 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl
                     api.dispatch(collectionsContentAddressActions.SET_ITEMS({
                         items: response.items.map((resource: any) => resource.uuid),
                         itemsAvailable: response.itemsAvailable,
-                        page: Math.floor(response.offset / response.limit),
+                        page: Math.floor(response.offset / response.limit) || 0,
                         rowsPerPage: response.limit
                     }));
                 }
diff --git a/src/store/favorite-panel/favorite-panel-middleware-service.ts b/src/store/favorite-panel/favorite-panel-middleware-service.ts
index f88f7b91..7177e5a7 100644
--- a/src/store/favorite-panel/favorite-panel-middleware-service.ts
+++ b/src/store/favorite-panel/favorite-panel-middleware-service.ts
@@ -103,7 +103,7 @@ export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
                 api.dispatch(favoritePanelActions.SET_ITEMS({
                     items: response.items.map((resource: any) => resource.uuid),
                     itemsAvailable: response.itemsAvailable,
-                    page: Math.floor(response.offset / response.limit),
+                    page: Math.floor(response.offset / response.limit) || 0,
                     rowsPerPage: response.limit
                 }));
                 api.dispatch<any>(updateFavorites(response.items.map((item: any) => item.uuid)));
diff --git a/src/store/public-favorites-panel/public-favorites-middleware-service.ts b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
index dd21a380..8a8876c1 100644
--- a/src/store/public-favorites-panel/public-favorites-middleware-service.ts
+++ b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
@@ -100,7 +100,7 @@ export class PublicFavoritesMiddlewareService extends DataExplorerMiddlewareServ
                 api.dispatch(publicFavoritePanelActions.SET_ITEMS({
                     items: response.items.map((resource: any) => resource.uuid),
                     itemsAvailable: response.itemsAvailable,
-                    page: Math.floor(response.offset / response.limit),
+                    page: Math.floor(response.offset / response.limit) || 0,
                     rowsPerPage: response.limit
                 }));
                 api.dispatch<any>(updatePublicFavorites(response.items.map((item: any) => item.uuid)));

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list