ui: Show the correct message when a session has been removed from a KV (#6167)

This commit is contained in:
John Cowen 2019-07-18 14:29:30 +01:00 committed by John Cowen
parent d01ef7225a
commit dd91ce33d6
3 changed files with 9 additions and 3 deletions

View File

@ -29,7 +29,7 @@ export default Mixin.create(WithBlockingActions, {
delete item.Session; delete item.Session;
set(controller, 'session', null); set(controller, 'session', null);
}); });
}, 'delete'); }, 'deletesession');
}, },
}, },
}); });

View File

@ -16,5 +16,11 @@
{{else}} {{else}}
There was an error deleting your key. There was an error deleting your key.
{{/if}} {{/if}}
{{ else if (eq type 'deletesession')}}
{{#if (eq status 'success') }}
Your session was invalidated.
{{else}}
There was an error invalidating your session.
{{/if}}
{{/if}} {{/if}}

View File

@ -21,12 +21,12 @@ Feature: dc / kvs / sessions / invalidate: Invalidate Lock Sessions
And I click confirmDelete on the session 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 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 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 And "[data-notification]" has the "success" class
Scenario: Invalidating a lock session and receiving an error 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 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 delete on the session
And I click confirmDelete on the session And I click confirmDelete on the session
Then the url should be /datacenter/kv/key/edit 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 And "[data-notification]" has the "error" class