Skip to content

Commit

Permalink
return backend on the PKI model so that capabilities fetches work (#5824
Browse files Browse the repository at this point in the history
)
  • Loading branch information
meirish authored Nov 19, 2018
1 parent cd1eaf3 commit 47eb3f7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
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

0 comments on commit 47eb3f7

Please sign in to comment.