From dd91ce33d62591b90dd3d845d1ad95127932711e Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 18 Jul 2019 14:29:30 +0100 Subject: [PATCH] ui: Show the correct message when a session has been removed from a KV (#6167) --- ui-v2/app/mixins/kv/with-actions.js | 2 +- ui-v2/app/templates/dc/kv/-notifications.hbs | 6 ++++++ ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui-v2/app/mixins/kv/with-actions.js b/ui-v2/app/mixins/kv/with-actions.js index b281ef2c51..ae099359b6 100644 --- a/ui-v2/app/mixins/kv/with-actions.js +++ b/ui-v2/app/mixins/kv/with-actions.js @@ -29,7 +29,7 @@ export default Mixin.create(WithBlockingActions, { delete item.Session; set(controller, 'session', null); }); - }, 'delete'); + }, 'deletesession'); }, }, }); diff --git a/ui-v2/app/templates/dc/kv/-notifications.hbs b/ui-v2/app/templates/dc/kv/-notifications.hbs index 7399dc2cdb..61bc051170 100644 --- a/ui-v2/app/templates/dc/kv/-notifications.hbs +++ b/ui-v2/app/templates/dc/kv/-notifications.hbs @@ -16,5 +16,11 @@ {{else}} There was an error deleting your key. {{/if}} +{{ else if (eq type 'deletesession')}} + {{#if (eq status 'success') }} + Your session was invalidated. + {{else}} + There was an error invalidating your session. + {{/if}} {{/if}} diff --git a/ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature b/ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature index 01cf8918d2..71d1875f85 100644 --- a/ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature +++ b/ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature @@ -21,12 +21,12 @@ Feature: dc / kvs / sessions / invalidate: Invalidate Lock Sessions And I click confirmDelete on the session Then the last PUT request was made to "/v1/session/destroy/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=datacenter" Then the url should be /datacenter/kv/key/edit - And "[data-notification]" has the "notification-delete" class + And "[data-notification]" has the "notification-deletesession" class And "[data-notification]" has the "success" class Scenario: Invalidating a lock session and receiving an error Given the url "/v1/session/destroy/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=datacenter" responds with a 500 status And I click delete on the session And I click confirmDelete on the session Then the url should be /datacenter/kv/key/edit - And "[data-notification]" has the "notification-delete" class + And "[data-notification]" has the "notification-deletesession" class And "[data-notification]" has the "error" class