ui: ServiceInstance.Name should be the Service.Name, never the Service.ID (#9316)

* ui: ServiceInstance.Name should be the Service.Name, never the ID

The ServiceInstance.ID should try Service.ID and fallback to
Service.Name, not ServiceInstance.Name. ServiceInstance.Name is just an
alias to Service.Name which is always set.
This commit is contained in:
John Cowen 2020-12-03 09:14:59 +00:00 committed by GitHub
parent 24130f4f09
commit 1a05bba216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -19,7 +19,11 @@ export default class ServiceInstance extends Model {
@attr('number') SyncTime;
@attr() meta;
@or('Service.ID', 'Service.Service') Name;
// The name is the Name of the Service (the grouping of instances)
@alias('Service.Service') Name;
// If the ID is blank fallback to the Service.Service (the Name)
@or('Service.ID', 'Service.Service') ID;
@or('Service.Address', 'Node.Service') Address;
@alias('Service.Tags') Tags;

View File

@ -112,4 +112,5 @@ Feature: dc / services / show: Show Service
dc: dc1
service: service-0
---
And I see href on the metricsAnchor like "https://example.com?service-0-with-id&dc1"
# The Metrics dashboard should use the Service.Name not the ID
And I see href on the metricsAnchor like "https://example.com?service-0&dc1"