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 (community) 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
=== modified file 'src/maasserver/static/js/angular/controllers/subnet_details.js'
--- src/maasserver/static/js/angular/controllers/subnet_details.js 2016-06-16 14:49:55 +0000
+++ src/maasserver/static/js/angular/controllers/subnet_details.js 2016-10-05 20:42:25 +0000
@@ -244,6 +244,8 @@
244 $scope.ipRangeConfirmDelete = function() {244 $scope.ipRangeConfirmDelete = function() {
245 IPRangesManager.deleteItem($scope.deleteIPRange).then(function() {245 IPRangesManager.deleteItem($scope.deleteIPRange).then(function() {
246 $scope.deleteIPRange = null;246 $scope.deleteIPRange = null;
247 // Reload the subnet after deleting the IP range.
248 $scope.subnet = SubnetsManager.getItem($scope.subnet.id);
247 });249 });
248 };250 };
249251
250252
=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js'
--- src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js 2016-06-16 14:49:55 +0000
+++ src/maasserver/static/js/angular/controllers/tests/test_subnet_details.js 2016-10-05 20:42:25 +0000
@@ -601,12 +601,15 @@
601601
602 it("calls deleteItem and clears deleteIPRange on resolve", function() {602 it("calls deleteItem and clears deleteIPRange on resolve", function() {
603 var controller = makeController();603 var controller = makeController();
604 var subnet = makeSubnet();
604 var range = {};605 var range = {};
606 $scope.subnet = subnet;
605 $scope.deleteIPRange = range;607 $scope.deleteIPRange = range;
606608
607 var defer = $q.defer();609 var defer = $q.defer();
608 spyOn(IPRangesManager, "deleteItem").and.returnValue(610 spyOn(IPRangesManager, "deleteItem").and.returnValue(
609 defer.promise);611 defer.promise);
612 spyOn(SubnetsManager, "getItem");
610 $scope.ipRangeConfirmDelete();613 $scope.ipRangeConfirmDelete();
611614
612 expect(IPRangesManager.deleteItem).toHaveBeenCalledWith(range);615 expect(IPRangesManager.deleteItem).toHaveBeenCalledWith(range);
@@ -614,6 +617,7 @@
614 $scope.$digest();617 $scope.$digest();
615618
616 expect($scope.deleteIPRange).toBeNull();619 expect($scope.deleteIPRange).toBeNull();
620 expect(SubnetsManager.getItem).toHaveBeenCalledWith(subnet.id);
617 });621 });
618 });622 });
619});623});

Subscribers

People subscribed via source and target branches

to all changes: