From 76017b69b583db3cca982c0a67530105f9969719 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 20 Jun 2018 13:44:36 +0100 Subject: [PATCH 1/5] Make sure the colon doesn't wrap with lots of tags --- ui-v2/app/styles/routes/dc/service/index.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ui-v2/app/styles/routes/dc/service/index.scss b/ui-v2/app/styles/routes/dc/service/index.scss index 975da4ad7a..214b129370 100644 --- a/ui-v2/app/styles/routes/dc/service/index.scss +++ b/ui-v2/app/styles/routes/dc/service/index.scss @@ -4,6 +4,5 @@ html.template-service.template-show main dl { } html.template-service.template-show main dt::after { content: ':'; - display: inline-block; margin-right: 0.2em; } From d2d501a4a47ac210c20c91f13927a6e642047bb0 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 20 Jun 2018 14:01:42 +0100 Subject: [PATCH 2/5] Add a reusable %tag and use it for the ACL 'tags' ready to use elsewhere --- ui-v2/app/styles/components/table.scss | 11 +++++------ ui-v2/app/styles/components/tag.scss | 5 +++++ ui-v2/app/styles/routes/dc/service/index.scss | 11 ++++++++--- ui-v2/app/templates/dc/services/show.hbs | 4 +++- 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 ui-v2/app/styles/components/tag.scss diff --git a/ui-v2/app/styles/components/table.scss b/ui-v2/app/styles/components/table.scss index 49578096e3..c78786af28 100644 --- a/ui-v2/app/styles/components/table.scss +++ b/ui-v2/app/styles/components/table.scss @@ -1,4 +1,9 @@ @import './icons'; +@import './tag'; +td strong { + @extend %tag; + background-color: $gray; +} th { color: $text-light !important; } @@ -53,12 +58,6 @@ table td a { tbody { overflow-x: visible !important; } -td strong { - display: inline-block; - background-color: $gray; - padding: 1px 5px; - border-radius: $radius-small; -} th, td:not(.actions), td:not(.actions) a { diff --git a/ui-v2/app/styles/components/tag.scss b/ui-v2/app/styles/components/tag.scss new file mode 100644 index 0000000000..f31eb7be8c --- /dev/null +++ b/ui-v2/app/styles/components/tag.scss @@ -0,0 +1,5 @@ +%tag { + display: inline-block; + padding: 1px 5px; + border-radius: $radius-small; +} diff --git a/ui-v2/app/styles/routes/dc/service/index.scss b/ui-v2/app/styles/routes/dc/service/index.scss index 214b129370..e8883041cd 100644 --- a/ui-v2/app/styles/routes/dc/service/index.scss +++ b/ui-v2/app/styles/routes/dc/service/index.scss @@ -1,8 +1,13 @@ +@import '../../../components/tag'; html.template-service.template-show main dl { display: flex; margin-bottom: 1.4em; } -html.template-service.template-show main dt::after { - content: ':'; - margin-right: 0.2em; +html.template-service.template-show main dt { + display: none; +} +html.template-service.template-show main dd span { + @extend %tag; + background-color: $gray; + margin-bottom: 0.5em; } diff --git a/ui-v2/app/templates/dc/services/show.hbs b/ui-v2/app/templates/dc/services/show.hbs index 23dc23af95..acccf34684 100644 --- a/ui-v2/app/templates/dc/services/show.hbs +++ b/ui-v2/app/templates/dc/services/show.hbs @@ -19,7 +19,9 @@
Tags
- {{join ', ' item.Tags}} + {{#each item.Tags as |item|}} + {{item}} + {{/each}}
{{/if}} From 0ad1d562db78ae0476396ecf95dd17e96ad64ffc Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 20 Jun 2018 15:14:16 +0100 Subject: [PATCH 3/5] Use the pill styling elsewhere... TODO: Probably change the %tag to %pill now I've remembered the word I was looking for! --- ui-v2/app/styles/app.scss | 1 + ui-v2/app/styles/routes/dc/service/index.scss | 2 ++ ui-v2/app/templates/dc/nodes/-services.hbs | 6 ++++-- ui-v2/app/templates/dc/services/index.hbs | 6 ++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ui-v2/app/styles/app.scss b/ui-v2/app/styles/app.scss index cebc321f17..9fa550d5f8 100644 --- a/ui-v2/app/styles/app.scss +++ b/ui-v2/app/styles/app.scss @@ -45,6 +45,7 @@ @import 'components/notice'; @import 'routes/dc/service/index'; +@import 'routes/dc/nodes/index'; @import 'routes/dc/kv/index'; main a { diff --git a/ui-v2/app/styles/routes/dc/service/index.scss b/ui-v2/app/styles/routes/dc/service/index.scss index e8883041cd..d60c5c77a0 100644 --- a/ui-v2/app/styles/routes/dc/service/index.scss +++ b/ui-v2/app/styles/routes/dc/service/index.scss @@ -6,6 +6,8 @@ html.template-service.template-show main dl { html.template-service.template-show main dt { display: none; } +// TODO: Generalize this, also see nodes/index +html.template-service.template-list td.tags span, html.template-service.template-show main dd span { @extend %tag; background-color: $gray; diff --git a/ui-v2/app/templates/dc/nodes/-services.hbs b/ui-v2/app/templates/dc/nodes/-services.hbs index 185875f3ce..1aeaa01be3 100644 --- a/ui-v2/app/templates/dc/nodes/-services.hbs +++ b/ui-v2/app/templates/dc/nodes/-services.hbs @@ -20,9 +20,11 @@ {{item.Port}} - + {{#if (gt item.Tags.length 0)}} - {{join ', ' item.Tags}} + {{#each item.Tags as |item|}} + {{item}} + {{/each}} {{/if}} {{/block-slot}} diff --git a/ui-v2/app/templates/dc/services/index.hbs b/ui-v2/app/templates/dc/services/index.hbs index 067c63107c..5267078b6c 100644 --- a/ui-v2/app/templates/dc/services/index.hbs +++ b/ui-v2/app/templates/dc/services/index.hbs @@ -35,9 +35,11 @@
{{format_number item.ChecksCritical}}
- + {{#if (gt item.Tags.length 0)}} - {{join ', ' item.Tags}} + {{#each item.Tags as |item|}} + {{item}} + {{/each}} {{/if}} {{/block-slot}} From 3161cf0c7d93c012782fc35bf41ac1e90b0e7eef Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 20 Jun 2018 15:26:22 +0100 Subject: [PATCH 4/5] Make sure the updated tag view doesn't break the tests --- ui-v2/tests/acceptance/dc/services/show.feature | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-v2/tests/acceptance/dc/services/show.feature b/ui-v2/tests/acceptance/dc/services/show.feature index 29daba7b64..78e2554a35 100644 --- a/ui-v2/tests/acceptance/dc/services/show.feature +++ b/ui-v2/tests/acceptance/dc/services/show.feature @@ -17,6 +17,8 @@ Feature: dc / services / show: Show Service dc: dc1 service: service-0 --- - Then I see the text "Tag1, Tag2, Tag3" in "[data-test-tags]" - Then ok + Then I see the text "Tag1" in "[data-test-tags] span:nth-child(1)" + Then I see the text "Tag2" in "[data-test-tags] span:nth-child(2)" + Then I see the text "Tag3" in "[data-test-tags] span:nth-child(3)" + Then pause for 5000 From 3f0560d098d9c84c5350dd62099bc6bd88caa826 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 20 Jun 2018 15:26:55 +0100 Subject: [PATCH 5/5] Add missing scss file --- ui-v2/app/styles/routes/dc/nodes/index.scss | 6 ++++++ ui-v2/tests/acceptance/dc/services/show.feature | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 ui-v2/app/styles/routes/dc/nodes/index.scss diff --git a/ui-v2/app/styles/routes/dc/nodes/index.scss b/ui-v2/app/styles/routes/dc/nodes/index.scss new file mode 100644 index 0000000000..f7c3003bea --- /dev/null +++ b/ui-v2/app/styles/routes/dc/nodes/index.scss @@ -0,0 +1,6 @@ +// TODO: Generalize this, also see services/index +html.template-node.template-show td.tags span { + @extend %tag; + background-color: $gray; + margin-bottom: 0.5em; +} diff --git a/ui-v2/tests/acceptance/dc/services/show.feature b/ui-v2/tests/acceptance/dc/services/show.feature index 78e2554a35..bf64a5d5b5 100644 --- a/ui-v2/tests/acceptance/dc/services/show.feature +++ b/ui-v2/tests/acceptance/dc/services/show.feature @@ -20,5 +20,4 @@ Feature: dc / services / show: Show Service Then I see the text "Tag1" in "[data-test-tags] span:nth-child(1)" Then I see the text "Tag2" in "[data-test-tags] span:nth-child(2)" Then I see the text "Tag3" in "[data-test-tags] span:nth-child(3)" - Then pause for 5000