Skip to content

Commit

Permalink
UI: VAULT-13782 VAULT-13794 pki ui improvements for phase two (#19312)
Browse files Browse the repository at this point in the history
* VAULT-13782 move keys tab next to issuers

* VAULT-13794 move private_key_format to key paramter toggle

* Fix failing tests!

* Move format and private key format out

* Address feedback and fix not valid after spacing

* Add more spacing and code cleanup

* Remove engines stylesheet

* Remove class conditional logic
  • Loading branch information
kiannaquach authored Mar 1, 2023
1 parent 94406d1 commit ef9d6a4
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 21 deletions.
5 changes: 1 addition & 4 deletions ui/app/models/pki/certificate/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PkiCertificateBaseModel from './base';

const generateFromRole = [
{
default: ['commonName', 'customTtl'],
default: ['commonName', 'customTtl', 'format', 'privateKeyFormat'],
},
{
'Subject Alternative Name (SAN) Options': [
Expand All @@ -15,9 +15,6 @@ const generateFromRole = [
'otherSans',
],
},
{
'More Options': ['format', 'privateKeyFormat'],
},
];
@withFormFields(null, generateFromRole)
export default class PkiCertificateGenerateModel extends PkiCertificateBaseModel {
Expand Down
1 change: 0 additions & 1 deletion ui/app/styles/app.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import 'ember-basic-dropdown';
@import 'ember-power-select';
@import './core';
@import './engines';

@mixin font-face($name) {
@font-face {
Expand Down
9 changes: 9 additions & 0 deletions ui/app/styles/core/helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@
.has-padding-m {
padding: $spacing-m;
}
.has-padding-xs {
padding: $spacing-xs;
}
.has-padding-xxs {
padding: $spacing-xxs;
}
.has-top-bottom-margin {
margin: 1.25rem 0rem;
}
Expand Down Expand Up @@ -219,6 +225,9 @@
font-size: $size-8;
text-transform: lowercase;
}
.has-top-padding-xxs {
padding-top: $spacing-xxs;
}
.has-top-padding-s {
padding-top: $spacing-s;
}
Expand Down
2 changes: 0 additions & 2 deletions ui/app/styles/engines.scss

This file was deleted.

3 changes: 0 additions & 3 deletions ui/app/styles/pki/pki-not-valid-after-form.scss

This file was deleted.

8 changes: 4 additions & 4 deletions ui/lib/core/addon/helpers/options-for-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const PKI_ENGINE_BACKEND = {
label: 'Issuers',
link: 'issuers',
},
{
label: 'Certificates',
link: 'certificates',
},
{
label: 'Keys',
link: 'keys',
},
{
label: 'Certificates',
link: 'certificates',
},
{
label: 'Configuration',
link: 'configuration',
Expand Down
1 change: 0 additions & 1 deletion ui/lib/pki/addon/components/pki-generate-csr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default class PkiGenerateCsrComponent extends Component<Args> {
'commonName',
'excludeCnFromSans',
'format',
'privateKeyFormat',
'serialNumber',
'addBasicConstraints',
]);
Expand Down
1 change: 0 additions & 1 deletion ui/lib/pki/addon/components/pki-generate-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default class PkiGenerateRootComponent extends Component {
'customTtl',
'notBeforeDuration',
'format',
'privateKeyFormat',
'permittedDnsDomains',
'maxPathLength',
];
Expand Down
6 changes: 4 additions & 2 deletions ui/lib/pki/addon/components/pki-not-valid-after-form.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="column is-narrow is-flex-center has-text-grey has-right-margin-s has-top-margin-negative-s pki-radiogroup-label">
<div class="column is-narrow is-flex-align-baseline has-text-grey has-right-margin-s has-padding-xs">
<RadioButton
id="ttlType"
class="radio"
Expand Down Expand Up @@ -27,7 +27,9 @@
{{/if}}
</div>
</div>
<div class="column is-narrow is-flex-center has-text-grey has-right-margin-s pki-radiogroup-label">
<div
class="column is-narrow is-flex-align-baseline has-text-grey has-right-margin-s has-top-margin-negative-s has-padding-xs"
>
<RadioButton
id="dateType"
class="radio"
Expand Down
1 change: 0 additions & 1 deletion ui/lib/pki/addon/components/pki-role-generate.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@groupName="formFieldGroups"
@showHelpText={{false}}
/>
<FormFieldGroups @model={{@model}} @renderGroup="More Options" @groupName="formFieldGroups" />
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
Expand Down
2 changes: 2 additions & 0 deletions ui/lib/pki/addon/utils/action-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export function keyParamsByType(type) {
fields = ['keyRef'];
} else if (type === 'kms') {
fields = ['keyName', 'managedKeyName', 'managedKeyId'];
} else if (type === 'exported') {
fields = [...fields, 'privateKeyFormat'];
}
return fields;
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module('Integration | Component | pki-generate-root', function (hooks) {
assert.strictEqual(this.model.type, this.type);
assert
.dom(`[data-test-group="Key parameters"] ${SELECTORS.formField}`)
.exists({ count: 3 }, '3 form fields under keyParams toggle');
.exists({ count: 4 }, '4 form fields under keyParams toggle');
assert.dom(SELECTORS.fieldByName('keyName')).exists(`Key name field shown when type=${this.type}`);
assert.dom(SELECTORS.fieldByName('keyType')).exists(`Key type field shown when type=${this.type}`);
assert.dom(SELECTORS.fieldByName('keyBits')).exists(`Key bits field shown when type=${this.type}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module('Integration | Component | PkiGenerateToggleGroups', function (hooks) {
'Placeholder renders for key params when type is not selected'
);
const fields = {
exported: ['keyName', 'keyType', 'keyBits'],
exported: ['keyName', 'keyType', 'keyBits', 'privateKeyFormat'],
internal: ['keyName', 'keyType', 'keyBits'],
existing: ['keyRef'],
kms: ['keyName', 'managedKeyName', 'managedKeyId'],
Expand Down

0 comments on commit ef9d6a4

Please sign in to comment.