Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui-v2/app/mixins/kv/with-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default Mixin.create(WithBlockingActions, {
delete item.Session;
set(controller, 'session', null);
});
}, 'delete');
}, 'deletesession');
},
},
});
6 changes: 6 additions & 0 deletions ui-v2/app/templates/dc/kv/-notifications.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

4 changes: 2 additions & 2 deletions ui-v2/tests/acceptance/dc/kvs/sessions/invalidate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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