mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
move replication-actions into core addon so that secondary recovery works (#7226)
* move replication-actions component into core addon so that secondary recovery works * move the rest of replication action components
This commit is contained in:
parent
020a8aa0c6
commit
a32c1ddad9
@ -0,0 +1,6 @@
|
||||
import Actions from 'core/components/replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-demote';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import Actions from 'core/components/replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-disable';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import Actions from './replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-promote';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import Actions from 'core/components/replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-recover';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import Actions from 'core/components/replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-reindex';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import Actions from './replication-actions-single';
|
||||
import layout from '../templates/components/replication-action-update-primary';
|
||||
|
||||
export default Actions.extend({
|
||||
layout,
|
||||
});
|
||||
@ -1,7 +1,8 @@
|
||||
import { alias } from '@ember/object/computed';
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
import ReplicationActions from 'replication/mixins/replication-actions';
|
||||
import ReplicationActions from 'core/mixins/replication-actions';
|
||||
import layout from '../templates/components/replication-actions';
|
||||
|
||||
const DEFAULTS = {
|
||||
token: null,
|
||||
@ -14,14 +15,11 @@ const DEFAULTS = {
|
||||
};
|
||||
|
||||
export default Component.extend(ReplicationActions, DEFAULTS, {
|
||||
layout,
|
||||
replicationMode: null,
|
||||
model: null,
|
||||
cluster: alias('model'),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
},
|
||||
|
||||
reset() {
|
||||
if (!this || this.isDestroyed || this.isDestroying) {
|
||||
return;
|
||||
@ -0,0 +1,15 @@
|
||||
{{#if loading}}
|
||||
<LayoutLoading />
|
||||
{{else}}
|
||||
<MessageError @errors={{errors}} />
|
||||
{{#each (if selectedAction (array selectedAction) (replication-action-for-mode replicationMode model.replicationAttrs.modeForUrl)) as |replicationAction index|}}
|
||||
<div class="box is-fullwidth is-marginless {{if (gt index 0) 'is-bottomless' 'is-shadowless'}}">
|
||||
{{component (concat 'replication-action-' replicationAction)
|
||||
onSubmit=(action "onSubmit")
|
||||
replicationMode=replicationMode
|
||||
model=model
|
||||
replicationDisplayMode=replicationDisplayMode
|
||||
}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
1
ui/lib/core/app/components/replication-action-demote.js
Normal file
1
ui/lib/core/app/components/replication-action-demote.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-demote';
|
||||
1
ui/lib/core/app/components/replication-action-disable.js
Normal file
1
ui/lib/core/app/components/replication-action-disable.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-disable';
|
||||
1
ui/lib/core/app/components/replication-action-promote.js
Normal file
1
ui/lib/core/app/components/replication-action-promote.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-promote';
|
||||
1
ui/lib/core/app/components/replication-action-recover.js
Normal file
1
ui/lib/core/app/components/replication-action-recover.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-recover';
|
||||
1
ui/lib/core/app/components/replication-action-reindex.js
Normal file
1
ui/lib/core/app/components/replication-action-reindex.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-reindex';
|
||||
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-action-update-primary';
|
||||
1
ui/lib/core/app/components/replication-actions-single.js
Normal file
1
ui/lib/core/app/components/replication-actions-single.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-actions-single';
|
||||
1
ui/lib/core/app/components/replication-actions.js
Normal file
1
ui/lib/core/app/components/replication-actions.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/components/replication-actions';
|
||||
1
ui/lib/core/app/helpers/replication-action-for-mode.js
Normal file
1
ui/lib/core/app/helpers/replication-action-for-mode.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/helpers/replication-action-for-mode';
|
||||
1
ui/lib/core/app/mixins/replication-actions.js
Normal file
1
ui/lib/core/app/mixins/replication-actions.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from 'core/mixins/replication-actions';
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -1,3 +0,0 @@
|
||||
import Actions from './replication-actions-single';
|
||||
|
||||
export default Actions.extend();
|
||||
@ -3,7 +3,7 @@ import { alias } from '@ember/object/computed';
|
||||
import { get, computed } from '@ember/object';
|
||||
import Component from '@ember/component';
|
||||
import decodeConfigFromJWT from 'replication/utils/decode-config-from-jwt';
|
||||
import ReplicationActions from 'replication/mixins/replication-actions';
|
||||
import ReplicationActions from 'core/mixins/replication-actions';
|
||||
import { task } from 'ember-concurrency';
|
||||
|
||||
const DEFAULTS = {
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
{{#if loading}}
|
||||
<LayoutLoading />
|
||||
{{else}}
|
||||
<MessageError @errors={{errors}} />
|
||||
{{#each (if selectedAction (array selectedAction) (replication-action-for-mode replicationMode model.replicationAttrs.modeForUrl)) as |replicationAction index|}}
|
||||
{{#if (get model (concat 'can' (camelize replicationAction)))}}
|
||||
<div class="box is-fullwidth is-marginless {{if (gt index 0) 'is-bottomless' 'is-shadowless'}}">
|
||||
{{component (concat 'replication-action-' replicationAction)
|
||||
onSubmit=(action "onSubmit")
|
||||
replicationMode=replicationMode
|
||||
model=model
|
||||
replicationDisplayMode=replicationDisplayMode
|
||||
}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
@ -4,14 +4,9 @@ import Service from '@ember/service';
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { click, fillIn, blur, render, find } from '@ember/test-helpers';
|
||||
import { camelize } from '@ember/string';
|
||||
import engineResolverFor from 'ember-engines/test-support/engine-resolver-for';
|
||||
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
import sinon from 'sinon';
|
||||
|
||||
const resolver = engineResolverFor('replication');
|
||||
|
||||
const storeStub = Service.extend({
|
||||
callArgs: null,
|
||||
adapterFor() {
|
||||
@ -32,7 +27,7 @@ const routerService = Service.extend({
|
||||
});
|
||||
|
||||
module('Integration | Component | replication actions', function(hooks) {
|
||||
setupRenderingTest(hooks, { resolver });
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
hooks.beforeEach(function() {
|
||||
run(() => {
|
||||
@ -99,7 +94,6 @@ module('Integration | Component | replication actions', function(hooks) {
|
||||
mode: clusterMode,
|
||||
modeForUrl: clusterMode,
|
||||
},
|
||||
[`can${camelize(action)}`]: true,
|
||||
reload() {
|
||||
return resolve();
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user