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

ui: Rename a model attribute to not be overwritten by ember-data #9524

Merged
merged 6 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion ui/packages/consul-ui/app/models/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class Proxy extends ServiceInstanceModel {
@attr('string') Namespace;
@attr('string') ServiceName;
@attr('string') ServiceID;
@attr('string') Node;
@attr('string') NodeName;
@attr('number') SyncTime;
@attr() ServiceProxy; // {}
}
2 changes: 1 addition & 1 deletion ui/packages/consul-ui/app/routes/dc/services/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class InstanceRoute extends Route {
if (typeof get(proxyMeta, 'ServiceID') !== 'undefined') {
const proxyParams = {
id: get(proxyMeta, 'ServiceID'),
node: get(proxyMeta, 'Node'),
node: get(proxyMeta, 'NodeName'),
name: get(proxyMeta, 'ServiceName'),
};
// Proxies have identical dc/nspace as their parent instance
Expand Down
3 changes: 3 additions & 0 deletions ui/packages/consul-ui/app/serializers/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/proxy';
export default class ProxySerializer extends Serializer {
primaryKey = PRIMARY_KEY;
slugKey = SLUG_KEY;
attrs = {
NodeName: 'Node',
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export default class ServiceInstanceService extends RepositoryService {
async findProxyBySlug(serviceId, node, service, dc, nspace, configuration = {}) {
const instance = await this.findBySlug(...arguments);
let proxy = this.store.peekRecord('proxy', instance.uid);
// Currently, we call the proxy endpoint before this endpoint
// therefore proxy is never undefined. If we ever call this endpoint
// first we'll need to do something like the following
// if(typeof proxy === 'undefined') {
// await proxyRepo.create({})
// }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@setupApplicationTest
Feature: dc / services / instances / navigation
Background:
Given 1 datacenter model with the value "dc-1"
And 2 instance models from yaml
---
- Service:
Service: service-0
ID: service-a
Node:
Node: node-0
- Service:
Service: service-0
ID: service-b
Node:
Node: another-node
---
// TODO: Improve mock data to get proper service instance data
@ignore
Scenario: Clicking a instance in the listing and back again
When I visit the service page for yaml
---
dc: dc-1
service: service-0
---
And I click instances on the tabs
Then the url should be /dc-1/services/service-0/instances
Then I see 2 instance models on the instanceList component
When I click instance on the instanceList.instances component
Then a GET request was made to "/v1/catalog/connect/service-0?dc=dc-1"
Then the url should be /dc-1/services/service-0/instances/node-0/service-a/health-checks
And I click "[data-test-back]"
Then the url should be /dc1/services/service-0/topology
Original file line number Diff line number Diff line change
@@ -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);
});
}