Skip to content

Commit

Permalink
UI ember engines (#6718)
Browse files Browse the repository at this point in the history
Adds replication engine and core in-repo addon
  • Loading branch information
meirish authored May 13, 2019
1 parent 377064c commit 6d273dc
Show file tree
Hide file tree
Showing 478 changed files with 2,526 additions and 1,554 deletions.
4 changes: 3 additions & 1 deletion ui/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<meta name="vault/config/environment" content="%7B%22modulePrefix%22%3A%22vault%22%2C%22environment%22%3A%22development%22%2C%22rootURL%22%3A%22/ui/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22POLLING_URLS%22%3A%5B%22sys/health%22%2C%22sys/replication/status%22%2C%22sys/seal-status%22%5D%2C%22NAMESPACE_ROOT_URLS%22%3A%5B%22sys/health%22%2C%22sys/seal-status%22%2C%22sys/license/features%22%5D%2C%22DEFAULT_PAGE_SIZE%22%3A15%2C%22LOG_TRANSITIONS%22%3Atrue%7D%2C%22flashMessageDefaults%22%3A%7B%22timeout%22%3A7000%2C%22sticky%22%3Afalse%2C%22preventDuplicates%22%3Atrue%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy%22%2C%22contentSecurityPolicyMeta%22%3Atrue%2C%22contentSecurityPolicy%22%3A%7B%22connect-src%22%3A%5B%22%27self%27%22%5D%2C%22img-src%22%3A%5B%22%27self%27%22%2C%22data%3A%22%5D%2C%22form-action%22%3A%5B%22%27none%27%22%5D%2C%22script-src%22%3A%5B%22%27self%27%22%5D%2C%22style-src%22%3A%5B%22%27unsafe-inline%27%22%2C%22%27self%27%22%5D%2C%22default-src%22%3A%5B%22%27none%27%22%5D%2C%22font-src%22%3A%5B%22%27self%27%22%5D%2C%22media-src%22%3A%5B%22%27self%27%22%5D%7D%2C%22emberData%22%3A%7B%22enableRecordDataRFCBuild%22%3Afalse%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
<meta name="vault/config/environment" content="%7B%22modulePrefix%22%3A%22vault%22%2C%22environment%22%3A%22development%22%2C%22rootURL%22%3A%22/ui/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22POLLING_URLS%22%3A%5B%22sys/health%22%2C%22sys/replication/status%22%2C%22sys/seal-status%22%5D%2C%22NAMESPACE_ROOT_URLS%22%3A%5B%22sys/health%22%2C%22sys/seal-status%22%2C%22sys/license/features%22%5D%2C%22DEFAULT_PAGE_SIZE%22%3A15%2C%22LOG_TRANSITIONS%22%3Atrue%7D%2C%22flashMessageDefaults%22%3A%7B%22timeout%22%3A7000%2C%22sticky%22%3Afalse%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy%22%2C%22contentSecurityPolicyMeta%22%3Atrue%2C%22contentSecurityPolicy%22%3A%7B%22connect-src%22%3A%5B%22%27self%27%22%5D%2C%22img-src%22%3A%5B%22%27self%27%22%2C%22data%3A%22%5D%2C%22form-action%22%3A%5B%22%27none%27%22%5D%2C%22script-src%22%3A%5B%22%27self%27%22%5D%2C%22style-src%22%3A%5B%22%27unsafe-inline%27%22%2C%22%27self%27%22%5D%2C%22default-src%22%3A%5B%22%27none%27%22%5D%2C%22font-src%22%3A%5B%22%27self%27%22%5D%2C%22media-src%22%3A%5B%22%27self%27%22%5D%7D%2C%22emberData%22%3A%7B%22enableRecordDataRFCBuild%22%3Afalse%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
<meta name="replication/config/environment" content="%7B%22modulePrefix%22%3A%22replication%22%2C%22environment%22%3A%22development%22%7D" />
<meta name="vault/config/asset-manifest" content="%7B%22bundles%22%3A%7B%22replication%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%7D%7D" />
<link rel="stylesheet" href="/assets/vendor.css" />
<link rel="stylesheet" href="/assets/vault.css" />
<link rel="icon" href="/favicon.png" />
Expand Down
17 changes: 17 additions & 0 deletions ui/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@ defineModifier();

let App;

/* eslint-disable ember/avoid-leaking-state-in-ember-objects */
App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
engines: {
replication: {
dependencies: {
services: [
'auth',
'flash-messages',
'namespace',
'replication-mode',
'router',
'store',
'version',
'wizard',
],
},
},
},
});

loadInitializers(App, config.modulePrefix);
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/download-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { computed } from '@ember/object';
import hbs from 'htmlbars-inline-precompile';

export default Component.extend({
layout: hbs`{{#if hasBlock}} {{yield}} {{else}} {{actionText}} {{/if}}`,
layout: hbs`{{#if (has-block)}} {{yield}} {{else}} {{actionText}} {{/if}}`,
tagName: 'a',
role: 'button',
attributeBindings: ['role', 'download', 'href'],
Expand Down
6 changes: 0 additions & 6 deletions ui/app/components/empty-state.js

This file was deleted.

84 changes: 0 additions & 84 deletions ui/app/components/i-con.js

This file was deleted.

34 changes: 0 additions & 34 deletions ui/app/components/info-table-row.js

This file was deleted.

5 changes: 0 additions & 5 deletions ui/app/components/popup-menu.js

This file was deleted.

50 changes: 0 additions & 50 deletions ui/app/components/secret-form-header.js

This file was deleted.

2 changes: 1 addition & 1 deletion ui/app/components/status-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default Component.extend({
glyphName: computed('type', function() {
const glyphs = {
cluster: 'status-indicator',
user: 'person',
user: 'user-square-outline',
};
return glyphs[this.type];
}),
Expand Down
3 changes: 0 additions & 3 deletions ui/app/components/toolbar-actions.js

This file was deleted.

6 changes: 0 additions & 6 deletions ui/app/components/toolbar.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions ui/app/helpers/includes.js

This file was deleted.

17 changes: 0 additions & 17 deletions ui/app/helpers/reduce-to-array.js

This file was deleted.

13 changes: 13 additions & 0 deletions ui/app/initializers/enable-engines.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import config from '../config/environment';

export function initialize(/* application */) {
// attach mount hooks to the environment config
// context will be the router DSL
config.addRootMounts = function() {
this.mount('replication');
};
}

export default {
initialize,
};
3 changes: 2 additions & 1 deletion ui/app/mixins/cluster-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { INIT, UNSEAL, AUTH, CLUSTER, DR_REPLICATION_SECONDARY };

export default Mixin.create({
auth: service(),
store: service(),

transitionToTargetRoute(transition) {
const targetRoute = this.targetRouteName(transition);
Expand All @@ -28,7 +29,7 @@ export default Mixin.create({
},

clusterModel() {
return this.modelFor(CLUSTER);
return this.modelFor(CLUSTER) || this.store.peekRecord('cluster', 'vault');
},

authToken() {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/models/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default DS.Model.extend({
}),

stateGlyph(state) {
const glyph = 'checkmark-circled-outline';
const glyph = 'check-circled-outline';

const glyphs = {
'stream-wals': 'android-sync',
Expand Down
19 changes: 3 additions & 16 deletions ui/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,9 @@ Router.map(function() {
this.route('edit', { path: '/:policy_name/edit' });
});
this.route('replication-dr-promote');
this.route('replication', function() {
this.route('index', { path: '/' });
this.route('mode', { path: '/:replication_mode' }, function() {
//details
this.route('index', { path: '/' });
this.route('manage');
this.route('secondaries', function() {
this.route('add', { path: '/add' });
this.route('revoke', { path: '/revoke' });
this.route('config-show', { path: '/config/show/:secondary_id' });
this.route('config-edit', { path: '/config/edit/:secondary_id' });
this.route('config-create', { path: '/config/create/:secondary_id' });
});
});
});

if (config.addRootMounts) {
config.addRootMounts.call(this);
}
this.route('not-found', { path: '/*path' });
});
this.route('not-found', { path: '/*path' });
Expand Down
13 changes: 0 additions & 13 deletions ui/app/routes/vault/cluster/replication/mode/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion ui/app/styles/components/console-ui-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
margin-left: calc(#{$console-spacing} - 0.33rem);
position: relative;

.icon {
.hs-icon {
position: absolute;
left: 0;
top: 0;
Expand Down
Loading

0 comments on commit 6d273dc

Please sign in to comment.