Merge lp:~newell-jensen/maas/2.0-fix-1619262 into lp:maas/2.0

Proposed by Newell Jensen on 2016-10-05
Status: Merged
Approved by: Newell Jensen on 2016-10-06
Approved revision: 5196
Merged at revision: 5196
Proposed branch: lp:~newell-jensen/maas/2.0-fix-1619262
Merge into: lp:maas/2.0
Diff against target: 40 lines (+6/-0)
2 files modified
src/maasserver/static/js/angular/controllers/subnet_details.js (+2/-0)
src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js (+4/-0)
To merge this branch: bzr merge lp:~newell-jensen/maas/2.0-fix-1619262
Reviewer Review Type Date Requested Status
Newell Jensen Approve on 2016-10-05
Review via email: mp+307764@code.launchpad.net

Commit message

Backport r5451: Reload the subnet when an IP range is deleted.

To post a comment you must log in.
Newell Jensen (newell-jensen) wrote :

Self approved backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/js/angular/controllers/subnet_details.js'
2--- src/maasserver/static/js/angular/controllers/subnet_details.js 2016-06-16 14:49:55 +0000
3+++ src/maasserver/static/js/angular/controllers/subnet_details.js 2016-10-05 20:42:25 +0000
4@@ -244,6 +244,8 @@
5 $scope.ipRangeConfirmDelete = function() {
6 IPRangesManager.deleteItem($scope.deleteIPRange).then(function() {
7 $scope.deleteIPRange = null;
8+ // Reload the subnet after deleting the IP range.
9+ $scope.subnet = SubnetsManager.getItem($scope.subnet.id);
10 });
11 };
12
13
14=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js'
15--- src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js 2016-06-16 14:49:55 +0000
16+++ src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js 2016-10-05 20:42:25 +0000
17@@ -601,12 +601,15 @@
18
19 it("calls deleteItem and clears deleteIPRange on resolve", function() {
20 var controller = makeController();
21+ var subnet = makeSubnet();
22 var range = {};
23+ $scope.subnet = subnet;
24 $scope.deleteIPRange = range;
25
26 var defer = $q.defer();
27 spyOn(IPRangesManager, "deleteItem").and.returnValue(
28 defer.promise);
29+ spyOn(SubnetsManager, "getItem");
30 $scope.ipRangeConfirmDelete();
31
32 expect(IPRangesManager.deleteItem).toHaveBeenCalledWith(range);
33@@ -614,6 +617,7 @@
34 $scope.$digest();
35
36 expect($scope.deleteIPRange).toBeNull();
37+ expect(SubnetsManager.getItem).toHaveBeenCalledWith(subnet.id);
38 });
39 });
40 });

Subscribers

People subscribed via source and target branches

to all changes: