PKI Redesign: setup Ember Engine (#16925)

* setup PKI Ember engine

* clean up SecretListHeader and add documentation.

* move secret-list-header to addon folder

* move options-for-backend helper

* fix all for SecretListHeader to work

* use secretListHeaderTab by moving to adodn.

* add overview empty state

* clean up

* remove secret-list-header and secret-list-header-tab changes to move to another pr

* more cleanup

* update syntax with newer guides

* good idea jordan
This commit is contained in:
Angel Garbarino 2022-09-02 11:17:13 -07:00 committed by GitHub
parent b93d6e44e0
commit bfccb2155f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 102 additions and 0 deletions

View File

@ -48,6 +48,24 @@ export default class App extends Application {
},
},
},
pki: {
dependencies: {
services: [
'auth',
'flash-messages',
'namespace',
'path-help',
'router',
'store',
'version',
'wizard',
'secret-mount-path',
],
externalRoutes: {
secrets: 'vault.cluster.secrets.backends',
},
},
},
};
}

View File

@ -114,6 +114,9 @@ Router.map(function () {
this.route('backends', { path: '/' });
this.route('backend', { path: '/:backend' }, function () {
this.mount('kmip');
if (config.environment !== 'production') {
this.mount('pki');
}
this.route('index', { path: '/' });
this.route('configuration');
// because globs / params can't be empty,

View File

@ -0,0 +1,29 @@
import Engine from '@ember/engine';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import config from './config/environment';
const { modulePrefix } = config;
export default class PkiEngine extends Engine {
modulePrefix = modulePrefix;
Resolver = Resolver;
dependencies = {
services: [
'auth',
'flash-messages',
'namespace',
'path-help',
'router',
'store',
'version',
'wizard',
'secret-mount-path',
],
externalRoutes: ['secrets'],
};
}
loadInitializers(PkiEngine, modulePrefix);

View File

@ -0,0 +1,5 @@
import buildRoutes from 'ember-engines/routes';
export default buildRoutes(function () {
this.route('overview');
});

View File

@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class OverviewRoute extends Route {}

View File

@ -0,0 +1 @@
{{outlet}}

View File

@ -0,0 +1 @@
Overview WIP

View File

@ -0,0 +1 @@
export { default } from 'pki/routes/overview';

View File

@ -0,0 +1 @@
export { default } from 'pki/templates/overview';

View File

@ -0,0 +1,11 @@
/* eslint-env node */
'use strict';
module.exports = function (environment) {
let ENV = {
modulePrefix: 'pki',
environment,
};
return ENV;
};

12
ui/lib/pki/index.js Normal file
View File

@ -0,0 +1,12 @@
/* eslint-disable node/no-extraneous-require */
const { buildEngine } = require('ember-engines/lib/engine-addon');
module.exports = buildEngine({
name: 'pki',
lazyLoading: {
enabled: false,
},
isDevelopingAddon() {
return true;
},
});

16
ui/lib/pki/package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "pki",
"keywords": [
"ember-addon",
"ember-engine"
],
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*"
},
"ember-addon": {
"paths": [
"../core"
]
}
}

View File

@ -213,6 +213,7 @@
"lib/css",
"lib/kmip",
"lib/open-api-explorer",
"lib/pki",
"lib/replication",
"lib/service-worker-authenticated-download"
]