Skip to content

Commit

Permalink
Ensure we only fetch those services with display set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenBW committed Oct 19, 2017
1 parent 58f0c0a commit 06a6001
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Component: serviceExplorer', () => {
it('should make a query for services', () => {
collectionsApiMock
.expects('query')
.withArgs('services', {filter: ['ancestry=null']})
.withArgs('services', {filter: ['ancestry=null', 'display=true']})
.returns(Promise.resolve())

ctrl.resolveServices(20, 0)
Expand Down
2 changes: 1 addition & 1 deletion client/app/services/services-state.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function ServicesStateFactory (ListConfiguration, CollectionsApi, RBAC) {

// Private
function getQueryFilters (filters = []) {
const queryFilters = ['ancestry=null']
const queryFilters = ['ancestry=null', 'display=true']

filters.forEach((nextFilter) => {
if (nextFilter.id === 'name') {
Expand Down
4 changes: 2 additions & 2 deletions client/app/services/services-state.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Services-state Service', function () {
it('should be able to get a record count', () => {
const collectionsApiSpy = sinon.stub(CollectionsApi, 'query').returns(Promise.resolve(successResponse));
ServicesState.getServicesMinimal();
expect(collectionsApiSpy).to.have.been.calledWith('services', {filter: ['ancestry=null']});
expect(collectionsApiSpy).to.have.been.calledWith('services', {filter: ['ancestry=null', 'display=true']});
});
it('should be able to get service credentials', () => {
const collectionsApiSpy = sinon.stub(CollectionsApi, 'get').returns(Promise.resolve(successResponse));
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('Services-state Service', function () {
attributes: ["picture", "picture.image_href", "chargeback_report", "evm_owner.userid", "v_total_vms", "power_state", "all_service_children", "tags"],
auto_refresh: false,
expand: "resources",
filter: ["ancestry=null"],
filter: ["ancestry=null", 'display=true'],
limit: 5,
offset: "0",
sort_by: "name",
Expand Down

0 comments on commit 06a6001

Please sign in to comment.