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

Backport of Bug Fix for Kymgmt keyType on default into release/1.11.x #17417

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
3 changes: 3 additions & 0 deletions changelog/17407.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui/keymgmt: Sets the defaultValue for type when creating a key.
```
1 change: 1 addition & 0 deletions ui/app/models/keymgmt/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class KeymgmtKeyModel extends Model {
@attr('string', {
subText: 'The type of cryptographic key that will be created.',
possibleValues: KEY_TYPES,
defaultValue: 'rsa-2048',
})
type;

Expand Down
9 changes: 9 additions & 0 deletions ui/tests/integration/components/keymgmt/key-edit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,13 @@ module('Integration | Component | keymgmt/key-edit', function (hooks) {
assert.dom('[data-test-tab="Details"]').doesNotExist('Details tab does not exist');
assert.dom('[data-test-tab="Versions"]').doesNotExist('Versions tab does not exist');
});

test('it defaults to keyType rsa-2048', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
this.model = store.createRecord('keymgmt/key');
this.set('mode', 'create');
await render(hbs`<Keymgmt::KeyEdit @model={{model}} @mode={{mode}} /><div id="modal-wormhole" />`);
assert.dom('[data-test-input="type"]').hasValue('rsa-2048', 'Has type rsa-2048 by default');
});
});