From 7e9b7f4143d2b3a11598a326b85ca073da481442 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 30 Nov 2020 17:22:43 +0000 Subject: [PATCH] ui: Moves healthcheck list to Glimmer template-only consul component (#9293) --- .../health-check/list}/index.hbs | 11 +++++--- .../consul/health-check/list/index.scss | 5 ++++ .../consul/health-check/list}/layout.scss | 0 .../consul/health-check/list}/skin.scss | 0 .../app/components/healthcheck-list/index.js | 5 ---- .../consul-ui/app/styles/components.scss | 2 +- .../styles/components/healthcheck-output.scss | 4 --- .../components/healthcheck-output/index.scss | 2 -- .../templates/dc/nodes/show/healthchecks.hbs | 2 +- .../dc/services/instance/healthchecks.hbs | 2 +- .../components/healthcheck-list-test.js | 25 ------------------- 11 files changed, 15 insertions(+), 43 deletions(-) rename ui/packages/consul-ui/app/components/{healthcheck-list => consul/health-check/list}/index.hbs (83%) create mode 100644 ui/packages/consul-ui/app/components/consul/health-check/list/index.scss rename ui/packages/consul-ui/app/{styles/components/healthcheck-output => components/consul/health-check/list}/layout.scss (100%) rename ui/packages/consul-ui/app/{styles/components/healthcheck-output => components/consul/health-check/list}/skin.scss (100%) delete mode 100644 ui/packages/consul-ui/app/components/healthcheck-list/index.js delete mode 100644 ui/packages/consul-ui/app/styles/components/healthcheck-output.scss delete mode 100644 ui/packages/consul-ui/app/styles/components/healthcheck-output/index.scss delete mode 100644 ui/packages/consul-ui/tests/integration/components/healthcheck-list-test.js diff --git a/ui/packages/consul-ui/app/components/healthcheck-list/index.hbs b/ui/packages/consul-ui/app/components/consul/health-check/list/index.hbs similarity index 83% rename from ui/packages/consul-ui/app/components/healthcheck-list/index.hbs rename to ui/packages/consul-ui/app/components/consul/health-check/list/index.hbs index 502e51bc8..0c5fd6309 100644 --- a/ui/packages/consul-ui/app/components/healthcheck-list/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/health-check/list/index.hbs @@ -1,7 +1,10 @@ -
+
    -{{#each items as |item| }} -
  • +{{#each @items as |item|}} +
  • {{item.Name}}

    @@ -23,7 +26,7 @@
    Type
    {{item.Type}} - {{#if (and exposed (contains item.Type (array 'http' 'grpc')))}} + {{#if (and @exposed (contains item.Type (array 'http' 'grpc')))}}
    {{#if (gt item.Checks.length 0) }} - + {{else}} diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs index edf2ac0c3..00ec73080 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs @@ -3,7 +3,7 @@ {{#let (append item.Checks (or proxy.Checks (array))) as |checks|}} {{#if (gt checks.length 0) }}
    - diff --git a/ui/packages/consul-ui/tests/integration/components/healthcheck-list-test.js b/ui/packages/consul-ui/tests/integration/components/healthcheck-list-test.js deleted file mode 100644 index d5c4715bd..000000000 --- a/ui/packages/consul-ui/tests/integration/components/healthcheck-list-test.js +++ /dev/null @@ -1,25 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; - -module('Integration | Component | healthcheck list', function(hooks) { - setupRenderingTest(hooks); - - test('it renders', async function(assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.on('myAction', function(val) { ... }); - - await render(hbs`{{healthcheck-list}}`); - - assert.dom('ul').exists({ count: 1 }); - - // Template block usage: - await render(hbs` - {{#healthcheck-list}} - {{/healthcheck-list}} - `); - - assert.dom('ul').exists({ count: 1 }); - }); -});