mirror of https://github.com/status-im/consul.git
ui: Quote service names when filtering for intentions (#7888)
* ui: Quote service names for intention filtering * ui: return null if we ever get an error with anything else
This commit is contained in:
parent
07487220a5
commit
2f7c4cbf86
|
@ -25,7 +25,11 @@ export default Route.extend({
|
|||
)
|
||||
? model
|
||||
: hash({
|
||||
intentions: this.intentionRepo.findByService(params.name, dc, nspace),
|
||||
intentions: this.intentionRepo
|
||||
.findByService(params.name, dc, nspace)
|
||||
.catch(function() {
|
||||
return null;
|
||||
}),
|
||||
chain: this.chainRepo.findBySlug(params.name, dc, nspace).catch(function(e) {
|
||||
const code = get(e, 'errors.firstObject.status');
|
||||
// Currently we are specifically catching a 500, but we return null
|
||||
|
|
|
@ -12,7 +12,7 @@ export default RepositoryService.extend({
|
|||
const query = {
|
||||
dc: dc,
|
||||
nspace: nspace,
|
||||
filter: `SourceName == ${slug} or DestinationName == ${slug}`,
|
||||
filter: `SourceName == "${slug}" or DestinationName == "${slug}"`,
|
||||
};
|
||||
if (typeof configuration.cursor !== 'undefined') {
|
||||
query.index = configuration.cursor;
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
@setupApplicationTest
|
||||
Feature: dc / services / intentions-error: An error with intentions doesn't 500 the page
|
||||
Scenario:
|
||||
Given 1 datacenter model with the value "dc1"
|
||||
And 1 node model
|
||||
And 1 service model from yaml
|
||||
---
|
||||
- Service:
|
||||
Kind: ~
|
||||
Name: service-0
|
||||
ID: service-0-with-id
|
||||
---
|
||||
And the url "/v1/connect/intentions" responds with a 500 status
|
||||
When I visit the service page for yaml
|
||||
---
|
||||
dc: dc1
|
||||
service: service-0
|
||||
---
|
||||
And the title should be "service-0 - Consul"
|
||||
And I see 1 instance model
|
|
@ -0,0 +1,10 @@
|
|||
import steps from '../../../steps';
|
||||
|
||||
// step definitions that are shared between features should be moved to the
|
||||
// tests/acceptance/steps/steps.js file
|
||||
|
||||
export default function(assert) {
|
||||
return steps(assert).then('I should find a file', function() {
|
||||
assert.ok(true, this.step);
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue