mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Fixed Position] Expose view proxy
Expose view proxy as selection state from the Fixed Position controller, to make Add button available under generalized selection mechanism, WTD-929.
This commit is contained in:
parent
6364296967
commit
3ce1064c4e
@ -208,9 +208,14 @@ define(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track current selection state
|
// Track current selection state
|
||||||
selection = $scope.selection;
|
selection = $scope.selection;
|
||||||
|
|
||||||
|
// Expose the view's selection proxy
|
||||||
|
if (selection) {
|
||||||
|
selection.proxy(new FixedProxy(addElement, $q, dialogService));
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh list of elements whenever model changes
|
// Refresh list of elements whenever model changes
|
||||||
$scope.$watch("model.modified", refreshElements);
|
$scope.$watch("model.modified", refreshElements);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ define(
|
|||||||
mockScope.configuration = testConfiguration;
|
mockScope.configuration = testConfiguration;
|
||||||
mockScope.selection = jasmine.createSpyObj(
|
mockScope.selection = jasmine.createSpyObj(
|
||||||
'selection',
|
'selection',
|
||||||
[ 'select', 'get', 'selected', 'deselect' ]
|
[ 'select', 'get', 'selected', 'deselect', 'proxy' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
controller = new FixedController(
|
controller = new FixedController(
|
||||||
@ -297,6 +297,12 @@ define(
|
|||||||
// elements to size SVGs appropriately
|
// elements to size SVGs appropriately
|
||||||
expect(controller.getGridSize()).toEqual(testGrid);
|
expect(controller.getGridSize()).toEqual(testGrid);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("exposes a view-level selection proxy", function () {
|
||||||
|
expect(mockScope.selection.proxy).toHaveBeenCalledWith(
|
||||||
|
jasmine.any(Object)
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
Reference in New Issue
Block a user