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 - fix PKI context menu #5824

Merged
merged 1 commit into from
Nov 19, 2018
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
14 changes: 13 additions & 1 deletion ui/app/serializers/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
extractLazyPaginatedData(payload) {
let ret;

if (payload.zero_address_roles) {
payload.zero_address_roles.forEach(role => {
// mutate key_info object to add zero_address info
payload.data.key_info[role].zero_address = true;
});
}
if (!payload.data.key_info) return payload.data.keys;
if (!payload.data.key_info) {
return payload.data.keys.map(key => {
let model = {
id: key,
};
if (payload.backend) {
model.backend = payload.backend;
}
return model;
});
}

ret = payload.data.keys.map(key => {
let model = {
id: key,
Expand Down
3 changes: 3 additions & 0 deletions ui/tests/acceptance/secrets/backend/pki/role-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ module('Acceptance | secrets/pki/create', function(hooks) {

await listPage.visitRoot({ backend: path });
assert.equal(listPage.secrets.length, 1, 'shows role in the list');
let secret = listPage.secrets.objectAt(0);
await secret.menuToggle();
assert.ok(listPage.menuItems.length > 0, 'shows links in the menu');
});

test('it deletes a role', async function(assert) {
Expand Down
7 changes: 6 additions & 1 deletion ui/tests/pages/secrets/backend/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export default create({
configureIsPresent: isPresent('[data-test-secret-backend-configure]'),

tabs: collection('[data-test-tab]'),
secrets: collection('[data-test-secret-link]'),
secrets: collection('[data-test-secret-link]', {
menuToggle: clickable('[data-test-popup-menu-trigger]'),
}),
menuItems: collection('.ember-basic-dropdown-content li', {
testContainer: '#ember-testing',
}),

backendIsEmpty: getter(function() {
return this.secrets.length === 0;
Expand Down