+{{/if}}
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/pki-configure-form.ts b/ui/lib/pki/addon/components/page/pki-configure-create.ts
similarity index 81%
rename from ui/lib/pki/addon/components/pki-configure-form.ts
rename to ui/lib/pki/addon/components/page/pki-configure-create.ts
index 19e21a368..94c859a81 100644
--- a/ui/lib/pki/addon/components/pki-configure-form.ts
+++ b/ui/lib/pki/addon/components/page/pki-configure-create.ts
@@ -5,28 +5,34 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
+import { tracked } from '@glimmer/tracking';
// TYPES
import Store from '@ember-data/store';
import Router from '@ember/routing/router';
import FlashMessageService from 'vault/services/flash-messages';
import PkiActionModel from 'vault/models/pki/action';
+import { Breadcrumb } from 'vault/vault/app-types';
interface Args {
config: PkiActionModel;
+ onCancel: CallableFunction;
+ breadcrumbs: Breadcrumb;
}
/**
- * @module PkiConfigureForm
- * PkiConfigureForm component is used to configure a PKI engine mount.
+ * @module PkiConfigureCreate
+ * Page::PkiConfigureCreate component is used to configure a PKI engine mount.
* The component shows three options for configuration and which form
* is shown. The sub-forms rendered handle rendering the form itself
* and form submission and cancel actions.
*/
-export default class PkiConfigureForm extends Component {
+export default class PkiConfigureCreate extends Component {
@service declare readonly store: Store;
@service declare readonly router: Router;
@service declare readonly flashMessages: FlashMessageService;
+ @tracked title = 'Configure PKI';
+
get configTypes() {
return [
{
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.hbs b/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.hbs
new file mode 100644
index 000000000..ace909dcf
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.hbs
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ {{this.title}}
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.js b/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.js
new file mode 100644
index 000000000..50bdb871b
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-generate-intermediate.js
@@ -0,0 +1,6 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+
+export default class PagePkiIssuerGenerateIntermediateComponent extends Component {
+ @tracked title = 'Generate intermediate CSR';
+}
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-generate-root.hbs b/ui/lib/pki/addon/components/page/pki-issuer-generate-root.hbs
new file mode 100644
index 000000000..a12d8b6e5
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-generate-root.hbs
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ {{this.title}}
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-generate-root.js b/ui/lib/pki/addon/components/page/pki-issuer-generate-root.js
new file mode 100644
index 000000000..58bb6de42
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-generate-root.js
@@ -0,0 +1,6 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+
+export default class PagePkiIssuerGenerateRootComponent extends Component {
+ @tracked title = 'Generate root';
+}
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-import.hbs b/ui/lib/pki/addon/components/page/pki-issuer-import.hbs
new file mode 100644
index 000000000..457158987
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-import.hbs
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ {{this.title}}
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-import.js b/ui/lib/pki/addon/components/page/pki-issuer-import.js
new file mode 100644
index 000000000..8a5b7c444
--- /dev/null
+++ b/ui/lib/pki/addon/components/page/pki-issuer-import.js
@@ -0,0 +1,6 @@
+import Component from '@glimmer/component';
+import { tracked } from '@glimmer/tracking';
+
+export default class PagePkiIssuerImportComponent extends Component {
+ @tracked title = 'Import a CA';
+}
diff --git a/ui/lib/pki/addon/components/pki-configure-form.hbs b/ui/lib/pki/addon/components/pki-configure-form.hbs
deleted file mode 100644
index 7e472c961..000000000
--- a/ui/lib/pki/addon/components/pki-configure-form.hbs
+++ /dev/null
@@ -1,69 +0,0 @@
-
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/pki-generate-csr.ts b/ui/lib/pki/addon/components/pki-generate-csr.ts
index e8fc40a15..b92985264 100644
--- a/ui/lib/pki/addon/components/pki-generate-csr.ts
+++ b/ui/lib/pki/addon/components/pki-generate-csr.ts
@@ -19,8 +19,28 @@ interface Args {
useIssuer: boolean;
onComplete: CallableFunction;
onCancel: CallableFunction;
+ onSave?: CallableFunction;
}
+/**
+ * @module PkiGenerateCsrComponent
+ * PkiGenerateCsr shows only the fields valid for the generate CSR endpoint.
+ * This component renders the form, handles the model save and rollback actions,
+ * and shows the resulting data on success. onCancel is required for the cancel
+ * transition, and if onSave is provided it will call that after save for any
+ * side effects in the parent.
+ *
+ * @example
+ * ```js
+ *
+ * ```
+ *
+ * @param {Object} model - pki/action model.
+ * @callback onCancel - Callback triggered when cancel button is clicked, after model is unloaded
+ * @callback onSave - Optional - Callback triggered after model is saved, as a side effect. Results are shown on the same component
+ * @callback onComplete - Callback triggered when "Done" button clicked, on results view
+ * @param {Object} adapterOptions - object passed as adapterOptions on the model.save method
+ */
export default class PkiGenerateCsrComponent extends Component {
@service declare readonly flashMessages: FlashMessageService;
@@ -64,12 +84,15 @@ export default class PkiGenerateCsrComponent extends Component {
*save(event: Event): Generator> {
event.preventDefault();
try {
- const { model } = this.args;
+ const { model, onSave } = this.args;
const { isValid, state, invalidFormMessage } = model.validate();
if (isValid) {
const useIssuer = yield this.getCapability();
yield model.save({ adapterOptions: { actionType: 'generate-csr', useIssuer } });
this.flashMessages.success('Successfully generated CSR.');
+ if (onSave) {
+ onSave();
+ }
} else {
this.modelValidations = state;
this.alert = invalidFormMessage;
diff --git a/ui/lib/pki/addon/components/pki-generate-root.hbs b/ui/lib/pki/addon/components/pki-generate-root.hbs
index 5200c691f..be875f0d9 100644
--- a/ui/lib/pki/addon/components/pki-generate-root.hbs
+++ b/ui/lib/pki/addon/components/pki-generate-root.hbs
@@ -1,69 +1,126 @@
-