ui: Remove ghost healthcheck from the service instance healthcheck list (#9220)

* ui: Fixup service instance healthcheck list not to show ghost check

If the proxy is undefined, then an undefined vaule is appended to the
list of checks

* There are only 6 checks in the mocks so only expect 6
This commit is contained in:
John Cowen 2020-11-19 15:59:27 +00:00 committed by John Cowen
parent 02314a5047
commit efe29ed5e7
2 changed files with 5 additions and 3 deletions

View File

@ -1,9 +1,10 @@
<div class="tab-section"> <div class="tab-section">
<div role="tabpanel"> <div role="tabpanel">
{{#if (gt item.Checks.length 0) }} {{#let (append item.Checks (or proxy.Checks (array))) as |checks|}}
{{#if (gt checks.length 0) }}
<section data-test-checks> <section data-test-checks>
<HealthcheckList <HealthcheckList
@items={{sort-by (comparator 'check' 'Status:asc') (append item.Checks proxy.Checks)}} @items={{sort-by (comparator 'check' 'Status:asc') checks}}
@exposed={{proxyMeta.ServiceProxy.Expose.Checks}} @exposed={{proxyMeta.ServiceProxy.Expose.Checks}}
/> />
</section> </section>
@ -16,5 +17,6 @@
</BlockSlot> </BlockSlot>
</EmptyState> </EmptyState>
{{/if}} {{/if}}
{{/let}}
</div> </div>
</div> </div>

View File

@ -65,7 +65,7 @@ Feature: dc / services / instances / show: Show Service Instance
And I don't see upstreams on the tabs And I don't see upstreams on the tabs
And I see healthChecksIsSelected on the tabs And I see healthChecksIsSelected on the tabs
And I see 7 of the checks object And I see 6 of the checks object
When I click tags&Meta on the tabs When I click tags&Meta on the tabs
And I see tags&MetaIsSelected on the tabs And I see tags&MetaIsSelected on the tabs