mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 22:34:55 +00:00
c706089c9f
* Adds conditional in route to not make discovery-chain request if service kind is equal to `connect-proxy` or `mesh-gateway` * Adds conditional in template to not show Routing tab if `chain` returns as null * Creates a new acceptance test to test the Routing tab not being displayed for a service proxy * Adds `tabs` to the services/show page object
36 lines
1015 B
JavaScript
36 lines
1015 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
import { hash } from 'rsvp';
|
|
import { get } from '@ember/object';
|
|
|
|
export default Route.extend({
|
|
repo: service('repository/service'),
|
|
chainRepo: service('repository/discovery-chain'),
|
|
settings: service('settings'),
|
|
queryParams: {
|
|
s: {
|
|
as: 'filter',
|
|
replace: true,
|
|
},
|
|
},
|
|
model: function(params) {
|
|
const dc = this.modelFor('dc').dc.Name;
|
|
const nspace = this.modelFor('nspace').nspace.substr(1);
|
|
return hash({
|
|
item: this.repo.findBySlug(params.name, dc, nspace),
|
|
urls: this.settings.findBySlug('urls'),
|
|
dc: dc,
|
|
}).then(model => {
|
|
return hash({
|
|
chain: ['connect-proxy', 'mesh-gateway'].includes(get(model, 'item.Service.Kind'))
|
|
? null
|
|
: this.chainRepo.findBySlug(params.name, dc, nspace),
|
|
...model,
|
|
});
|
|
});
|
|
},
|
|
setupController: function(controller, model) {
|
|
controller.setProperties(model);
|
|
},
|
|
});
|