[arvados-workbench2] created: 2.6.3-51-g940cbe92

git repository hosting git at public.arvados.org
Mon Aug 14 20:45:15 UTC 2023


        at  940cbe92c1688e52c8741f8cb85bea4c3ced6756 (commit)


commit 940cbe92c1688e52c8741f8cb85bea4c3ced6756
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Aug 14 16:40:32 2023 -0400

    19793: Make browser back button work on nav to PDH
    
    When navigating to a collection by PDH, if there is only one match, it
    the portable data hash page automatically directs the user to the
    appropriate collection page.  However, if the user pushes the back
    button, they go back to portable data hash page which automatically
    takes them to the collection page again.  This effectively breaks the
    back button.
    
    This fixes the bug by replacing (instead of "pushing") the top of the
    location history with the collection page, so that the back button
    from the collection page takes the user to their previous page without
    revisiting the portable data hash page (so they are not endlessly
    redirected).
    
    This commit message is longer than the actual code fix.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

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 18023aff..56255860 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
@@ -21,6 +21,8 @@ import { ResourceKind, extractUuidKind } from 'models/resource';
 import { ownerNameActions } from 'store/owner-name/owner-name-actions';
 import { getUserDisplayName } from 'models/user';
 import { CollectionResource } from 'models/collection';
+import { replace } from "react-router-redux";
+import { getNavUrl } from 'routes/routes';
 
 export class CollectionsWithSameContentAddressMiddlewareService extends DataExplorerMiddlewareService {
     constructor(private services: ServiceRepository, id: string) {
@@ -89,7 +91,7 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl
                 api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
                 api.dispatch<any>(updatePublicFavorites(response.items.map(item => item.uuid)));
                 if (response.itemsAvailable === 1) {
-                    api.dispatch<any>(navigateTo(response.items[0].uuid));
+                    api.dispatch<any>(replace(getNavUrl(response.items[0].uuid, api.getState().auth)));
                     api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId()));
                 } else {
                     api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId()));

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list