From 5ac19b164e0201cecaf17605c221bbf6a962a70f Mon Sep 17 00:00:00 2001 From: John Cowen Date: Fri, 22 Jun 2018 14:29:18 +0100 Subject: [PATCH] Change the appearance of `*` for intention listings 1. Use 'All Services (*)' as opposed to '*' 2. Set 'Destination' in teh same bold font as 'Source' 3. Ensure you can search for all services by using '*' or 'All Services (*)' --- ui-v2/app/controllers/dc/intentions/index.js | 14 +++++++------ .../app/styles/routes/dc/intention/index.scss | 7 +++++-- ui-v2/app/templates/dc/intentions/index.hbs | 20 ++++++++++++++----- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ui-v2/app/controllers/dc/intentions/index.js b/ui-v2/app/controllers/dc/intentions/index.js index 6e6291f41b..7b4ce3f17c 100644 --- a/ui-v2/app/controllers/dc/intentions/index.js +++ b/ui-v2/app/controllers/dc/intentions/index.js @@ -32,13 +32,15 @@ export default Controller.extend(WithFiltering, { }); }), filter: function(item, { s = '', action = '' }) { + const source = get(item, 'SourceName').toLowerCase(); + const destination = get(item, 'DestinationName').toLowerCase(); + const sLower = s.toLowerCase(); + const allLabel = 'All Services (*)'.toLowerCase(); return ( - (get(item, 'SourceName') - .toLowerCase() - .indexOf(s.toLowerCase()) !== -1 || - get(item, 'DestinationName') - .toLowerCase() - .indexOf(s.toLowerCase()) !== -1) && + (source.indexOf(sLower) !== -1 || + destination.indexOf(sLower) !== -1 || + (source === '*' && allLabel.indexOf(sLower) !== -1) || + (destination === '*' && allLabel.indexOf(sLower) !== -1)) && (action === '' || get(item, 'Action') === action) ); }, diff --git a/ui-v2/app/styles/routes/dc/intention/index.scss b/ui-v2/app/styles/routes/dc/intention/index.scss index 3776270e1e..61de303bd1 100644 --- a/ui-v2/app/styles/routes/dc/intention/index.scss +++ b/ui-v2/app/styles/routes/dc/intention/index.scss @@ -1,8 +1,11 @@ -td.intent-allow strong { +html.template-intention.template-list td.intent-allow strong { @extend %with-allow; visibility: hidden; } -td.intent-deny strong { +html.template-intention.template-list td.intent-deny strong { @extend %with-deny; visibility: hidden; } +html.template-intention.template-list td.destination { + font-weight: $weight-semibold; +} diff --git a/ui-v2/app/templates/dc/intentions/index.hbs b/ui-v2/app/templates/dc/intentions/index.hbs index 8334b5a5c6..60ed96a2fe 100644 --- a/ui-v2/app/templates/dc/intentions/index.hbs +++ b/ui-v2/app/templates/dc/intentions/index.hbs @@ -26,16 +26,26 @@ Precedence {{/block-slot}} {{#block-slot 'row'}} - - {{item.SourceName}} + + + {{#if (eq item.SourceName '*') }} + All Services (*) + {{else}} + {{item.SourceName}} + {{/if}} + {{item.Action}} - - {{item.DestinationName}} + + {{#if (eq item.DestinationName '*') }} + All Services (*) + {{else}} + {{item.DestinationName}} + {{/if}} - + {{item.Precedence}} {{/block-slot}}