[UI] Browser back button doesn't go back to the correct tab on the node details page

Bug #1732788 reported by Lee Trager
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Medium
Unassigned

Bug Description

To fix LP:1731298 I allowed the node-details page to accept an optional parameter in the URL to set the tab displayed. This allowed the back link on the results page to work. I tried creating a watch to inject the URL into the browser history. This allows the browser back button to always return to the correct tab, no matter the link. I added the following code to src/maasserver/static/js/angular/controllers/node_details.js

$scope.$watch("section.area", function() {
    var url = "#/node/" + $scope.type_name + "/" +
        $scope.node.system_id + "?area=" + $scope.section.area;
    history.pushState({}, $scope.node.fqdn, url);
});

This works however it causes an infinite digest loop[1]. This may be related to upstream Angular bugs [2] or [3]

[1] https://docs.angularjs.org/error/$rootScope/infdig?p0=10&p1=%5B%5B%22fn:%20$locationWatch;%20newVal:%207;%20oldVal:%206%22,%22!loaded;%20newVal:%20true;%20oldVal:%20undefined%22,%22loaded;%20newVal:%20false;%20oldVal:%20undefined%22%5D,%5B%22fn:%20$locationWatch;%20newVal:%208;%20oldVal:%207%22,%22!loaded;%20newVal:%20true;%20oldVal:%20undefined%22,%22loaded;%20newVal:%20false;%20oldVal:%20undefined%22%5D,%5B%22fn:%20$locationWatch;%20newVal:%209;%20oldVal:%208%22,%22!loaded;%20newVal:%20true;%20oldVal:%20undefined%22,%22loaded;%20newVal:%20false;%20oldVal:%20undefined%22%5D,%5B%22fn:%20$locationWatch;%20newVal:%2010;%20oldVal:%209%22,%22!loaded;%20newVal:%20true;%20oldVal:%20undefined%22,%22loaded;%20newVal:%20false;%20oldVal:%20undefined%22%5D,%5B%22fn:%20$locationWatch;%20newVal:%2011;%20oldVal:%2010%22,%22!loaded;%20newVal:%20true;%20oldVal:%20undefined%22,%22loaded;%20newVal:%20false;%20oldVal:%20undefined%22%5D%5D
[2] https://github.com/angular/angular.js/issues/6976
[3] https://github.com/angular/angular.js/issues/3924

Tags: ui
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.