From aafbfa167cd3c6a2b6b2144c1a2854e3ecb9ca8e Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 9 Jun 2020 11:10:14 +0100 Subject: [PATCH] ui: ConsulKind explanatory tooltip panels (#8048) * ui: Add tooltip panels to ConsulKind --- ui-v2/app/components/consul-kind/index.hbs | 100 ++++++++++++++++-- .../app/components/hashicorp-consul/index.hbs | 2 +- ui-v2/app/components/menu-panel/index.hbs | 15 +++ ui-v2/app/components/menu-panel/index.js | 7 ++ ui-v2/app/components/popover-menu/index.hbs | 29 ++--- ui-v2/app/components/popover-menu/index.js | 4 + ui-v2/app/helpers/from-entries.js | 5 + .../styles/base/components/buttons/skin.scss | 1 + .../base/components/menu-panel/layout.scss | 13 ++- .../base/components/menu-panel/skin.scss | 10 +- .../styles/base/components/pill/layout.scss | 1 + .../base/components/popover-menu/index.scss | 1 + .../base/components/popover-menu/layout.scss | 2 +- .../styles/components/app-view/layout.scss | 2 + ui-v2/app/styles/components/index.scss | 2 + .../components/main-header-horizontal.scss | 2 +- .../components/main-nav-horizontal.scss | 9 ++ ui-v2/app/styles/components/menu-panel.scss | 3 + .../app/styles/components/tooltip-panel.scss | 4 + .../components/tooltip-panel/index.scss | 2 + .../components/tooltip-panel/layout.scss | 21 ++++ .../styles/components/tooltip-panel/skin.scss | 13 +++ ui-v2/app/templates/dc/services/instance.hbs | 2 +- ui-v2/app/templates/dc/services/show.hbs | 12 +-- 24 files changed, 220 insertions(+), 42 deletions(-) create mode 100644 ui-v2/app/components/menu-panel/index.hbs create mode 100644 ui-v2/app/components/menu-panel/index.js create mode 100644 ui-v2/app/helpers/from-entries.js create mode 100644 ui-v2/app/styles/components/menu-panel.scss create mode 100644 ui-v2/app/styles/components/tooltip-panel.scss create mode 100644 ui-v2/app/styles/components/tooltip-panel/index.scss create mode 100644 ui-v2/app/styles/components/tooltip-panel/layout.scss create mode 100644 ui-v2/app/styles/components/tooltip-panel/skin.scss diff --git a/ui-v2/app/components/consul-kind/index.hbs b/ui-v2/app/components/consul-kind/index.hbs index 2d7bbce76e..0b1b84a6c2 100644 --- a/ui-v2/app/components/consul-kind/index.hbs +++ b/ui-v2/app/components/consul-kind/index.hbs @@ -1,11 +1,93 @@ {{#if item.Kind}} - {{#if (has-block)}} - {{yield - (component 'consul-kind' item=item) - }} - {{else}} - - {{titleize (humanize item.Kind)}} - - {{/if}} + {{#let (titleize (humanize item.Kind)) as |Name|}} + {{#if (has-block)}} + {{yield + (component 'consul-kind' item=item withInfo=withInfo) + }} + {{else}} + {{#if withInfo}} +
+
+ + {{Name}} + +
+
+ + + {{#if (eq item.Kind 'ingress-gateway')}} + Ingress gateways enable ingress traffic from services outside the Consul service mesh to services inside the Consul service mesh. + {{else if (eq item.Kind 'terminating-gateway')}} + Terminating gateways allow connect-enabled services in Consul service mesh to communicate with services outside the service mesh. + {{else}} + Mesh gateways enable routing of Connect traffic between different Consul datacenters. + {{/if}} + + +
  • + {{#if (eq item.Kind 'ingress-gateway')}} + About Ingress gateways + {{else if (eq item.Kind 'terminating-gateway')}} + About Terminating gateways + {{else}} + About Mesh gateways + {{/if}} +
  • + {{#let (from-entries + (array 'ingress-gateway' '/consul/developer-mesh/ingress-gateways') + (array 'terminating-gateway' '/consul/developer-mesh/understand-terminating-gateways') + (array 'mesh-gateway' '/consul/developer-mesh/connect-gateways') + ) as |link|}} + + {{/let}} + {{#let (from-entries + (array 'ingress-gateway' '/connect/ingress_gateway.html') + (array 'terminating-gateway' '/connect/terminating_gateway.html') + (array 'mesh-gateway' '/connect/mesh_gateway.html') + ) as |link|}} + +
  • + Other gateway types +
  • + {{#if (not-eq item.Kind 'mesh-gateway')}} + + {{/if}} + {{#if (not-eq item.Kind 'terminating-gateway')}} + + {{/if}} + {{#if (not-eq item.Kind 'ingress-gateway')}} + + {{/if}} + {{/let}} +
    +
    +
    +
    + {{else}} + + {{Name}} + + {{/if}} + {{/if}} + {{/let}} {{/if}} diff --git a/ui-v2/app/components/hashicorp-consul/index.hbs b/ui-v2/app/components/hashicorp-consul/index.hbs index 8854661586..a41d1c15d1 100644 --- a/ui-v2/app/components/hashicorp-consul/index.hbs +++ b/ui-v2/app/components/hashicorp-consul/index.hbs @@ -13,7 +13,7 @@ {{#if dc}}