vault/ui/lib/replication/addon/components/replication-summary.js
Chelsea Shaw 349e449d49
UI: Glimmerize replication enable form (#26417)
* Glimmerize replication controllers

* Add enable-replication-form component with tests

* use EnableReplicationForm in index and mode routes

* clean up enable action from replication-actions mixin

* fix test failure for structuredClone

* stabilize tests, remove enable action from replication-actions and replication-summary

* Update ui/lib/replication/addon/controllers/replication-mode.js

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* address PR comments

* stabilize oidc test?

---------

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2024-04-15 15:30:33 -05:00

31 lines
841 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { service } from '@ember/service';
import { computed } from '@ember/object';
import Component from '@ember/component';
import ReplicationActions from 'core/mixins/replication-actions';
export default Component.extend(ReplicationActions, {
replicationMode: 'dr',
mode: 'primary',
version: service(),
rm: service('replication-mode'),
didReceiveAttrs() {
this._super(...arguments);
const initialReplicationMode = this.initialReplicationMode;
if (initialReplicationMode) {
this.set('replicationMode', initialReplicationMode);
}
},
showModeSummary: false,
initialReplicationMode: null,
cluster: null,
attrsForCurrentMode: computed('cluster', 'rm.mode', function () {
return this.cluster[this.rm.mode];
}),
});