Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BZ#1503287-Ensure we only fetch those services with display set to true #1112

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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