UI: Remove Wizard (#19220)

* Remove UI Wizard temporarily [GH-19000]
This commit is contained in:
Chelsea Shaw
2023-02-16 16:44:33 -06:00
committed by GitHub
parent b3bc654249
commit 63e6150f54
45 changed files with 37 additions and 310 deletions

3
changelog/19220.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
ui: remove wizard
```

View File

@@ -15,16 +15,7 @@ export default class App extends Application {
}, },
replication: { replication: {
dependencies: { dependencies: {
services: [ services: ['auth', 'flash-messages', 'namespace', 'replication-mode', 'router', 'store', 'version'],
'auth',
'flash-messages',
'namespace',
'replication-mode',
'router',
'store',
'version',
'wizard',
],
externalRoutes: { externalRoutes: {
replication: 'vault.cluster.replication.index', replication: 'vault.cluster.replication.index',
}, },
@@ -41,7 +32,6 @@ export default class App extends Application {
'router', 'router',
'store', 'store',
'version', 'version',
'wizard',
'secret-mount-path', 'secret-mount-path',
], ],
externalRoutes: { externalRoutes: {
@@ -69,7 +59,6 @@ export default class App extends Application {
'secret-mount-path', 'secret-mount-path',
'store', 'store',
'version', 'version',
'wizard',
], ],
externalRoutes: { externalRoutes: {
secrets: 'vault.cluster.secrets.backends', secrets: 'vault.cluster.secrets.backends',

View File

@@ -23,7 +23,6 @@ const AuthConfigBase = Component.extend({
flashMessages: service(), flashMessages: service(),
router: service(), router: service(),
wizard: service(),
saveModel: task( saveModel: task(
waitFor(function* () { waitFor(function* () {
try { try {
@@ -36,9 +35,6 @@ const AuthConfigBase = Component.extend({
} }
return; return;
} }
if (this.wizard.currentMachine === 'authentication' && this.wizard.featureState === 'config') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE');
}
this.router.transitionTo('vault.cluster.access.methods').followRedirects(); this.router.transitionTo('vault.cluster.access.methods').followRedirects();
this.flashMessages.success('The configuration was saved successfully.'); this.flashMessages.success('The configuration was saved successfully.');
}) })

View File

@@ -20,7 +20,6 @@ import { waitFor } from '@ember/test-waiters';
export default AuthConfigComponent.extend({ export default AuthConfigComponent.extend({
flashMessages: service(), flashMessages: service(),
router: service(), router: service(),
wizard: service(),
saveModel: task( saveModel: task(
waitFor(function* () { waitFor(function* () {
@@ -49,9 +48,6 @@ export default AuthConfigComponent.extend({
} }
return; return;
} }
if (this.wizard.currentMachine === 'authentication' && this.wizard.featureState === 'config') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE');
}
this.router.transitionTo('vault.cluster.access.methods').followRedirects(); this.router.transitionTo('vault.cluster.access.methods').followRedirects();
this.flashMessages.success('The configuration was saved successfully.'); this.flashMessages.success('The configuration was saved successfully.');
}) })

View File

@@ -17,7 +17,6 @@ import { tracked } from '@glimmer/tracking';
*/ */
export default class AuthInfoComponent extends Component { export default class AuthInfoComponent extends Component {
@service auth; @service auth;
@service wizard;
@service router; @service router;
@tracked fakeRenew = false; @tracked fakeRenew = false;
@@ -36,11 +35,6 @@ export default class AuthInfoComponent extends Component {
this.router.transitionTo(...arguments); this.router.transitionTo(...arguments);
} }
@action
restartGuide() {
this.wizard.restartGuide();
}
@action @action
renewToken() { renewToken() {
this.fakeRenew = true; this.fakeRenew = true;

View File

@@ -19,7 +19,6 @@ export default class DatabaseConnectionEdit extends Component {
@service store; @service store;
@service router; @service router;
@service flashMessages; @service flashMessages;
@service wizard;
@tracked @tracked
showPasswordField = false; // used for edit mode showPasswordField = false; // used for edit mode
@@ -27,13 +26,6 @@ export default class DatabaseConnectionEdit extends Component {
@tracked @tracked
showSaveModal = false; // used for create mode showSaveModal = false; // used for create mode
constructor() {
super(...arguments);
if (this.wizard.featureState === 'details' || this.wizard.featureState === 'connection') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', 'database');
}
}
rotateCredentials(backend, name) { rotateCredentials(backend, name) {
const adapter = this.store.adapterFor('database/connection'); const adapter = this.store.adapterFor('database/connection');
return adapter.rotateRootCredentials(backend, name); return adapter.rotateRootCredentials(backend, name);

View File

@@ -9,17 +9,10 @@ const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';
export default class DatabaseRoleEdit extends Component { export default class DatabaseRoleEdit extends Component {
@service router; @service router;
@service flashMessages; @service flashMessages;
@service wizard;
@service store; @service store;
constructor() { constructor() {
super(...arguments); super(...arguments);
if (
this.wizard.featureState === 'displayConnection' ||
this.wizard.featureState === 'displayRoleDatabase'
) {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', 'database');
}
if (this.args.initialKey) { if (this.args.initialKey) {
this.args.model.database = [this.args.initialKey]; this.args.model.database = [this.args.initialKey];
} }

View File

@@ -26,7 +26,6 @@ const MODEL_TYPES = {
}; };
export default Component.extend({ export default Component.extend({
wizard: service(),
store: service(), store: service(),
router: service(), router: service(),
// set on the component // set on the component
@@ -58,13 +57,6 @@ export default Component.extend({
this.createOrReplaceModel(); this.createOrReplaceModel();
}, },
didReceiveAttrs() {
this._super();
if (this.wizard.featureState === 'displayRole') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', this.backendType);
}
},
willDestroy() { willDestroy() {
if (!this.model.isDestroyed && !this.model.isDestroying) { if (!this.model.isDestroyed && !this.model.isDestroying) {
this.model.unloadRecord(); this.model.unloadRecord();
@@ -98,17 +90,10 @@ export default Component.extend({
create() { create() {
const model = this.model; const model = this.model;
this.set('loading', true); this.set('loading', true);
this.model this.model.save().finally(() => {
.save() model.set('hasGenerated', true);
.catch(() => { this.set('loading', false);
if (this.wizard.featureState === 'credentials') { });
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'ERROR', this.backendType);
}
})
.finally(() => {
model.set('hasGenerated', true);
this.set('loading', false);
});
}, },
codemirrorUpdated(attr, val, codemirror) { codemirrorUpdated(attr, val, codemirror) {

View File

@@ -35,7 +35,6 @@ export default class KeymgmtDistribute extends Component {
@service store; @service store;
@service flashMessages; @service flashMessages;
@service router; @service router;
@service wizard;
@tracked keyModel; @tracked keyModel;
@tracked isNewKey = false; @tracked isNewKey = false;
@@ -57,14 +56,6 @@ export default class KeymgmtDistribute extends Component {
this.getKeyInfo(this.args.key); this.getKeyInfo(this.args.key);
} }
this.formData.operations = []; this.formData.operations = [];
this.updateWizard('nextStep');
}
updateWizard(key) {
// wizard will pause unless we manually continue it -- verify that keymgmt tutorial is in progress
if (this.wizard[key] === 'distribute') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', 'keymgmt');
}
} }
get keyTypes() { get keyTypes() {
@@ -198,8 +189,6 @@ export default class KeymgmtDistribute extends Component {
this.store.clearDataset('keymgmt/key'); this.store.clearDataset('keymgmt/key');
const providerModel = this.store.peekRecord('keymgmt/provider', provider); const providerModel = this.store.peekRecord('keymgmt/provider', provider);
providerModel.fetchKeys(providerModel.keys?.meta?.currentPage || 1); providerModel.fetchKeys(providerModel.keys?.meta?.currentPage || 1);
// move wizard forward if tutorial is in progress
this.updateWizard('featureState');
this.args.onClose(); this.args.onClose();
}) })
.catch((e) => { .catch((e) => {

View File

@@ -21,7 +21,6 @@ import { methods } from 'vault/helpers/mountable-auth-methods';
export default class MountBackendForm extends Component { export default class MountBackendForm extends Component {
@service store; @service store;
@service wizard;
@service flashMessages; @service flashMessages;
// validation related properties // validation related properties
@@ -139,22 +138,9 @@ export default class MountBackendForm extends Component {
this.args.mountModel[name] = value; this.args.mountModel[name] = value;
} }
@action
onTypeChange(path, value) {
if (path === 'type') {
this.wizard.set('componentState', value);
}
}
@action @action
setMountType(value) { setMountType(value) {
this.args.mountModel.type = value; this.args.mountModel.type = value;
this.checkPathChange(value); this.checkPathChange(value);
if (value) {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', this.args.mountModel.type);
} else if (this.wizard.featureState === 'idle') {
// resets wizard
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'RESET', this.args.mountModel.type);
}
} }
} }

View File

@@ -12,7 +12,6 @@ const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';
export default Component.extend(FocusOnInsertMixin, { export default Component.extend(FocusOnInsertMixin, {
router: service(), router: service(),
wizard: service(),
mode: null, mode: null,
emptyData: '{\n}', emptyData: '{\n}',
@@ -21,19 +20,6 @@ export default Component.extend(FocusOnInsertMixin, {
model: null, model: null,
requestInFlight: or('model.isLoading', 'model.isReloading', 'model.isSaving'), requestInFlight: or('model.isLoading', 'model.isReloading', 'model.isSaving'),
didReceiveAttrs() {
this._super(...arguments);
if (
(this.wizard.featureState === 'details' && this.mode === 'create') ||
(this.wizard.featureState === 'role' && this.mode === 'show')
) {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', this.backendType);
}
if (this.wizard.featureState === 'displayRole') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'NOOP', this.backendType);
}
},
willDestroyElement() { willDestroyElement() {
this._super(...arguments); this._super(...arguments);
if (this.model && this.model.isError) { if (this.model && this.model.isError) {
@@ -69,9 +55,6 @@ export default Component.extend(FocusOnInsertMixin, {
const model = this.model; const model = this.model;
return model[method]().then(() => { return model[method]().then(() => {
if (!model.isError) { if (!model.isError) {
if (this.wizard.featureState === 'role') {
this.wizard.transitionFeatureMachine('role', 'CONTINUE', this.backendType);
}
successCallback(model); successCallback(model);
} }
}); });

View File

@@ -48,7 +48,6 @@ export default class SecretCreateOrUpdate extends Component {
@service controlGroup; @service controlGroup;
@service router; @service router;
@service store; @service store;
@service wizard;
@action @action
setup(elem, [secretData, model, mode]) { setup(elem, [secretData, model, mode]) {
@@ -164,9 +163,6 @@ export default class SecretCreateOrUpdate extends Component {
}); });
} }
saveComplete(callback, key) { saveComplete(callback, key) {
if (this.wizard.featureState === 'secret') {
this.wizard.transitionFeatureMachine('secret', 'CONTINUE');
}
callback(key); callback(key);
} }
transitionToRoute() { transitionToRoute() {

View File

@@ -27,7 +27,6 @@ import { maybeQueryRecord } from 'vault/macros/maybe-query-record';
import { alias, or } from '@ember/object/computed'; import { alias, or } from '@ember/object/computed';
export default class SecretEdit extends Component { export default class SecretEdit extends Component {
@service wizard;
@service store; @service store;
@tracked secretData = null; @tracked secretData = null;
@@ -43,10 +42,6 @@ export default class SecretEdit extends Component {
} }
this.secretData = KVObject.create({ content: [] }).fromJSON(model.secretData); this.secretData = KVObject.create({ content: [] }).fromJSON(model.secretData);
this.codemirrorString = this.secretData.toJSONString(); this.codemirrorString = this.secretData.toJSONString();
if (this.wizard.featureState === 'details' && this.args.mode === 'create') {
const engine = model.backend.includes('kv') ? 'kv' : model.backend;
this.wizard.transitionFeatureMachine('details', 'CONTINUE', engine);
}
} }
@maybeQueryRecord( @maybeQueryRecord(

View File

@@ -9,7 +9,7 @@
* content here * content here
* </SplashPage * </SplashPage
* ``` * ```
* @param {boolean} [hasAltContent] - boolean to bypass the UiWizard. * @param {boolean} [hasAltContent] - boolean to bypass container styling
* @param {boolean} [showTruncatedNavBar = true] - boolean to hide or show the navBar. By default this is true. * @param {boolean} [showTruncatedNavBar = true] - boolean to hide or show the navBar. By default this is true.
* *
*/ */

View File

@@ -26,7 +26,6 @@ const WRAPPING_ENDPOINTS = ['lookup', 'wrap', 'unwrap', 'rewrap'];
export default Component.extend(DEFAULTS, { export default Component.extend(DEFAULTS, {
store: service(), store: service(),
wizard: service(),
// putting these attrs here so they don't get reset when you click back // putting these attrs here so they don't get reset when you click back
//random //random
bytes: 32, bytes: 32,
@@ -93,9 +92,6 @@ export default Component.extend(DEFAULTS, {
const keyName = action === 'rewrap' ? 'rewrap_token' : 'token'; const keyName = action === 'rewrap' ? 'rewrap_token' : 'token';
props = assign({}, props, { [keyName]: resp.wrap_info.token }); props = assign({}, props, { [keyName]: resp.wrap_info.token });
} }
if (props.token || props.rewrap_token || props.unwrap_data || action === 'lookup') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE');
}
setProperties(this, props); setProperties(this, props);
}, },

View File

@@ -13,7 +13,6 @@ const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';
export default Component.extend(FocusOnInsertMixin, { export default Component.extend(FocusOnInsertMixin, {
router: service(), router: service(),
wizard: service(),
mode: null, mode: null,
onDataChange() {}, onDataChange() {},
onRefresh() {}, onRefresh() {},
@@ -56,13 +55,6 @@ export default Component.extend(FocusOnInsertMixin, {
const key = this.key; const key = this.key;
return key[method]().then(() => { return key[method]().then(() => {
if (!key.isError) { if (!key.isError) {
if (this.wizard.featureState === 'secret') {
this.wizard.transitionFeatureMachine('secret', 'CONTINUE');
} else {
if (this.wizard.featureState === 'encryption') {
this.wizard.transitionFeatureMachine('encryption', 'CONTINUE', 'transit');
}
}
successCallback(key); successCallback(key);
} }
}); });

View File

@@ -1,5 +1,4 @@
import { computed } from '@ember/object'; import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import Controller from '@ember/controller'; import Controller from '@ember/controller';
const DEFAULTS = { const DEFAULTS = {
@@ -12,8 +11,6 @@ const DEFAULTS = {
}; };
export default Controller.extend(DEFAULTS, { export default Controller.extend(DEFAULTS, {
wizard: service(),
reset() { reset() {
this.setProperties(DEFAULTS); this.setProperties(DEFAULTS);
}, },
@@ -22,8 +19,6 @@ export default Controller.extend(DEFAULTS, {
this.set('loading', false); this.set('loading', false);
this.set('keyData', resp); this.set('keyData', resp);
this.model.reload(); this.model.reload();
this.wizard.set('initEvent', 'SAVE');
this.wizard.transitionTutorialMachine(this.wizard.currentState, 'TOSAVE');
}, },
initError(e) { initError(e) {

View File

@@ -4,7 +4,6 @@ import Controller from '@ember/controller';
export default Controller.extend({ export default Controller.extend({
flashMessages: service(), flashMessages: service(),
wizard: service(),
queryParams: { queryParams: {
page: 'page', page: 'page',
@@ -58,9 +57,6 @@ export default Controller.extend({
// this will clear the dataset cache on the store // this will clear the dataset cache on the store
this.send('reload'); this.send('reload');
flash.success(`${policyType.toUpperCase()} policy "${name}" was successfully deleted.`); flash.success(`${policyType.toUpperCase()} policy "${name}" was successfully deleted.`);
if (this.wizard.featureState === 'delete') {
this.wizard.transitionFeatureMachine('delete', 'CONTINUE', policyType);
}
}) })
.catch((e) => { .catch((e) => {
const errors = e.errors ? e.errors.join('') : e.message; const errors = e.errors ? e.errors.join('') : e.message;

View File

@@ -5,7 +5,6 @@ import { inject as service } from '@ember/service';
export default class PolicyEditController extends Controller { export default class PolicyEditController extends Controller {
@service router; @service router;
@service flashMessages; @service flashMessages;
@service wizard;
@action @action
async deletePolicy() { async deletePolicy() {
@@ -14,9 +13,6 @@ export default class PolicyEditController extends Controller {
await this.model.destroyRecord(); await this.model.destroyRecord();
this.flashMessages.success(`${policyType.toUpperCase()} policy "${name}" was successfully deleted.`); this.flashMessages.success(`${policyType.toUpperCase()} policy "${name}" was successfully deleted.`);
this.router.transitionTo('vault.cluster.policies', policyType); this.router.transitionTo('vault.cluster.policies', policyType);
if (this.wizard.featureState === 'delete') {
this.wizard.transitionFeatureMachine('delete', 'CONTINUE', policyType);
}
} catch (error) { } catch (error) {
this.model.rollbackAttributes(); this.model.rollbackAttributes();
const errors = error.errors ? error.errors.join('. ') : error.message; const errors = error.errors ? error.errors.join('. ') : error.message;

View File

@@ -1,11 +1,8 @@
import { inject as service } from '@ember/service';
import Controller from '@ember/controller'; import Controller from '@ember/controller';
export default Controller.extend({ export default Controller.extend({
wizard: service(),
actions: { actions: {
onMountSuccess: function (type, path) { onMountSuccess: function (type, path) {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', type);
const transition = this.transitionToRoute('vault.cluster.settings.auth.configure', path); const transition = this.transitionToRoute('vault.cluster.settings.auth.configure', path);
return transition.followRedirects(); return transition.followRedirects();
}, },

View File

@@ -7,7 +7,6 @@ import { action } from '@ember/object';
const SUPPORTED_BACKENDS = supportedSecretBackends(); const SUPPORTED_BACKENDS = supportedSecretBackends();
export default class MountSecretBackendController extends Controller { export default class MountSecretBackendController extends Controller {
@service wizard;
@service router; @service router;
@action @action
@@ -27,8 +26,6 @@ export default class MountSecretBackendController extends Controller {
} else { } else {
transition = this.router.transitionTo('vault.cluster.secrets.backends'); transition = this.router.transitionTo('vault.cluster.secrets.backends');
} }
return transition.followRedirects().then(() => { return transition.followRedirects();
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', type);
});
} }
} }

View File

@@ -1,22 +1,15 @@
import { inject as service } from '@ember/service';
import Controller from '@ember/controller'; import Controller from '@ember/controller';
export default Controller.extend({ export default Controller.extend({
wizard: service(),
showLicenseError: false, showLicenseError: false,
actions: { actions: {
transitionToCluster(resp) { transitionToCluster() {
return this.model.reload().then(() => { return this.model.reload().then(() => {
this.wizard.transitionTutorialMachine(this.wizard.currentState, 'CONTINUE', resp);
return this.transitionToRoute('vault.cluster', this.model.name); return this.transitionToRoute('vault.cluster', this.model.name);
}); });
}, },
setUnsealState(resp) {
this.wizard.set('componentState', resp);
},
isUnsealed(data) { isUnsealed(data) {
return data.sealed === false; return data.sealed === false;
}, },

View File

@@ -1,12 +1,10 @@
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
import { next } from '@ember/runloop';
import Route from '@ember/routing/route'; import Route from '@ember/routing/route';
import ControlGroupError from 'vault/lib/control-group-error'; import ControlGroupError from 'vault/lib/control-group-error';
export default Route.extend({ export default Route.extend({
controlGroup: service(), controlGroup: service(),
routing: service('router'), routing: service('router'),
wizard: service(),
namespaceService: service('namespace'), namespaceService: service('namespace'),
featureFlagService: service('featureFlag'), featureFlagService: service('featureFlag'),
@@ -60,28 +58,6 @@ export default Route.extend({
return true; return true;
}, },
didTransition() {
const wizard = this.wizard;
if (wizard.get('currentState') !== 'active.feature') {
return true;
}
next(() => {
const applicationURL = this.routing.currentURL;
const activeRoute = this.routing.currentRouteName;
if (this.wizard.setURLAfterTransition) {
this.set('wizard.setURLAfterTransition', false);
this.set('wizard.expectedURL', applicationURL);
this.set('wizard.expectedRouteName', activeRoute);
}
const expectedRouteName = this.wizard.expectedRouteName;
if (this.routing.isActive(expectedRouteName) === false) {
wizard.transitionTutorialMachine(wizard.get('currentState'), 'PAUSE');
}
});
return true;
},
}, },
async beforeModel() { async beforeModel() {

View File

@@ -3,7 +3,6 @@ import Route from '@ember/routing/route';
import { singularize } from 'ember-inflector'; import { singularize } from 'ember-inflector';
export default Route.extend({ export default Route.extend({
wizard: service(),
pathHelp: service('path-help'), pathHelp: service('path-help'),
beforeModel() { beforeModel() {

View File

@@ -5,7 +5,6 @@ import ListRoute from 'vault/mixins/list-route';
export default Route.extend(ListRoute, { export default Route.extend(ListRoute, {
store: service(), store: service(),
wizard: service(),
pathHelp: service('path-help'), pathHelp: service('path-help'),
getMethodAndModelInfo() { getMethodAndModelInfo() {

View File

@@ -1,11 +1,8 @@
import AdapterError from '@ember-data/adapter/error'; import AdapterError from '@ember-data/adapter/error';
import { set } from '@ember/object'; import { set } from '@ember/object';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route'; import Route from '@ember/routing/route';
export default Route.extend({ export default Route.extend({
wizard: service(),
model(params) { model(params) {
const { section_name: section } = params; const { section_name: section } = params;
if (section !== 'configuration') { if (section !== 'configuration') {
@@ -13,9 +10,7 @@ export default Route.extend({
set(error, 'httpStatus', 404); set(error, 'httpStatus', 404);
throw error; throw error;
} }
const backend = this.modelFor('vault.cluster.access.method'); return this.modelFor('vault.cluster.access.method');
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'DETAILS', backend.type);
return backend;
}, },
setupController(controller) { setupController(controller) {

View File

@@ -10,7 +10,6 @@ export default ClusterRouteBase.extend({
}, },
flashMessages: service(), flashMessages: service(),
version: service(), version: service(),
wizard: service(),
beforeModel() { beforeModel() {
return this._super().then(() => { return this._super().then(() => {
return this.version.fetchFeatures(); return this.version.fetchFeatures();
@@ -30,15 +29,4 @@ export default ClusterRouteBase.extend({
this.flashMessages.stickyInfo(config.welcomeMessage); this.flashMessages.stickyInfo(config.welcomeMessage);
} }
}, },
activate() {
this.wizard.set('initEvent', 'LOGIN');
this.wizard.transitionTutorialMachine(this.wizard.currentState, 'TOLOGIN');
},
actions: {
willTransition(transition) {
if (transition.targetName !== this.routeName) {
this.wizard.transitionTutorialMachine(this.wizard.currentState, 'INITDONE');
}
},
},
}); });

View File

@@ -1,12 +1,3 @@
import { inject as service } from '@ember/service';
import ClusterRoute from './cluster-route-base'; import ClusterRoute from './cluster-route-base';
export default ClusterRoute.extend({ export default ClusterRoute.extend({});
wizard: service(),
activate() {
// always start from idle instead of using the current state
this.wizard.transitionTutorialMachine('idle', 'INIT');
this.wizard.set('initEvent', 'START');
},
});

View File

@@ -6,17 +6,9 @@ import UnsavedModelRoute from 'vault/mixins/unsaved-model-route';
export default Route.extend(UnloadModelRoute, UnsavedModelRoute, { export default Route.extend(UnloadModelRoute, UnsavedModelRoute, {
store: service(), store: service(),
version: service(), version: service(),
wizard: service(),
model() { model() {
const policyType = this.policyType(); const policyType = this.policyType();
if (
policyType === 'acl' &&
this.wizard.currentMachine === 'policies' &&
this.wizard.featureState === 'idle'
) {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE');
}
if (!this.version.hasSentinel && policyType !== 'acl') { if (!this.version.hasSentinel && policyType !== 'acl') {
return this.transitionTo('vault.cluster.policies', policyType); return this.transitionTo('vault.cluster.policies', policyType);
} }

View File

@@ -6,13 +6,6 @@ import ListRoute from 'core/mixins/list-route';
export default Route.extend(ClusterRoute, ListRoute, { export default Route.extend(ClusterRoute, ListRoute, {
store: service(), store: service(),
version: service(), version: service(),
wizard: service(),
activate() {
if (this.wizard.featureState === 'details') {
this.wizard.transitionFeatureMachine('details', 'CONTINUE', this.policyType());
}
},
shouldReturnEmptyModel(policyType, version) { shouldReturnEmptyModel(policyType, version) {
return policyType !== 'acl' && (version.get('isOSS') || !version.get('hasSentinel')); return policyType !== 'acl' && (version.get('isOSS') || !version.get('hasSentinel'));

View File

@@ -1,13 +1,4 @@
import UnsavedModelRoute from 'vault/mixins/unsaved-model-route'; import UnsavedModelRoute from 'vault/mixins/unsaved-model-route';
import ShowRoute from './show'; import ShowRoute from './show';
import { inject as service } from '@ember/service';
export default ShowRoute.extend(UnsavedModelRoute, { export default ShowRoute.extend(UnsavedModelRoute, {});
wizard: service(),
activate() {
if (this.wizard.featureState === 'details') {
this.wizard.transitionFeatureMachine('details', 'CONTINUE', this.policyType());
}
},
});

View File

@@ -5,13 +5,6 @@ import { inject as service } from '@ember/service';
export default Route.extend(UnloadModelRoute, { export default Route.extend(UnloadModelRoute, {
store: service(), store: service(),
wizard: service(),
activate() {
if (this.wizard.featureState === 'create') {
this.wizard.transitionFeatureMachine('create', 'CONTINUE', this.policyType());
}
},
beforeModel() { beforeModel() {
const params = this.paramsFor(this.routeName); const params = this.paramsFor(this.routeName);

View File

@@ -2,13 +2,9 @@ import { inject as service } from '@ember/service';
import Route from '@ember/routing/route'; import Route from '@ember/routing/route';
export default Route.extend({ export default Route.extend({
wizard: service(),
store: service(), store: service(),
async model() { async model() {
const backend = this.modelFor('vault.cluster.secrets.backend'); const backend = this.modelFor('vault.cluster.secrets.backend');
if (this.wizard.featureState === 'list') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', backend.get('type'));
}
if (backend.isV2KV) { if (backend.isV2KV) {
const canRead = await this.store const canRead = await this.store
.findRecord('capabilities', `${backend.id}/config`) .findRecord('capabilities', `${backend.id}/config`)

View File

@@ -29,7 +29,6 @@ const transformModel = (queryParams) => {
export default EditBase.extend({ export default EditBase.extend({
store: service(), store: service(),
wizard: service(),
createModel(transition) { createModel(transition) {
const { backend } = this.paramsFor('vault.cluster.secrets.backend'); const { backend } = this.paramsFor('vault.cluster.secrets.backend');
@@ -44,9 +43,6 @@ export default EditBase.extend({
modelType = 'database/role'; modelType = 'database/role';
} }
if (modelType !== 'secret' && modelType !== 'secret-v2') { if (modelType !== 'secret' && modelType !== 'secret-v2') {
if (this.wizard.featureState === 'details' && this.wizard.componentState === 'transit') {
this.wizard.transitionFeatureMachine('details', 'CONTINUE', 'transit');
}
return this.store.createRecord(modelType); return this.store.createRecord(modelType);
} }
// create record in capabilities that checks for access to create metadata // create record in capabilities that checks for access to create metadata
@@ -59,10 +55,6 @@ export default EditBase.extend({
}, },
model(params, transition) { model(params, transition) {
// wizard will pause unless we manually continue it -- verify that keymgmt tutorial is in progress
if (params.itemType === 'provider' && this.wizard.nextStep === 'provider') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', 'keymgmt');
}
return hash({ return hash({
secret: this.createModel(transition), secret: this.createModel(transition),
capabilities: {}, capabilities: {},

View File

@@ -1,10 +1,7 @@
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route'; import Route from '@ember/routing/route';
import { toolsActions } from 'vault/helpers/tools-actions'; import { toolsActions } from 'vault/helpers/tools-actions';
export default Route.extend({ export default Route.extend({
wizard: service(),
beforeModel(transition) { beforeModel(transition) {
const supportedActions = toolsActions(); const supportedActions = toolsActions();
const { selected_action: selectedAction } = this.paramsFor(this.routeName); const { selected_action: selectedAction } = this.paramsFor(this.routeName);
@@ -26,9 +23,6 @@ export default Route.extend({
actions: { actions: {
didTransition() { didTransition() {
const params = this.paramsFor(this.routeName); const params = this.paramsFor(this.routeName);
if (this.wizard.currentMachine === 'tools') {
this.wizard.transitionFeatureMachine(this.wizard.featureState, params.selected_action.toUpperCase());
}
/* eslint-disable-next-line ember/no-controller-access-in-routes */ /* eslint-disable-next-line ember/no-controller-access-in-routes */
this.controller.setProperties(params); this.controller.setProperties(params);
return true; return true;

View File

@@ -1,11 +1,3 @@
import { inject as service } from '@ember/service';
import ClusterRoute from './cluster-route-base'; import ClusterRoute from './cluster-route-base';
export default ClusterRoute.extend({ export default ClusterRoute.extend({});
wizard: service(),
activate() {
this.wizard.set('initEvent', 'UNSEAL');
this.wizard.transitionTutorialMachine(this.wizard.currentState, 'TOUNSEAL');
},
});

View File

@@ -23,11 +23,6 @@
</LinkTo> </LinkTo>
</li> </li>
{{/if}} {{/if}}
<li class="action">
<button type="button" class="link" onclick={{action "restartGuide"}}>
Restart guide
</button>
</li>
<li class="action"> <li class="action">
<CopyButton <CopyButton
@clipboardText={{this.auth.currentToken}} @clipboardText={{this.auth.currentToken}}

View File

@@ -27,7 +27,6 @@
<FormFieldGroups <FormFieldGroups
@model={{@mountModel}} @model={{@mountModel}}
@renderGroup="default" @renderGroup="default"
@onChange={{this.onTypeChange}}
@modelValidations={{this.modelValidations}} @modelValidations={{this.modelValidations}}
@onKeyUp={{this.onKeyUp}} @onKeyUp={{this.onKeyUp}}
/> />

View File

@@ -12,26 +12,24 @@
</Nav.items> </Nav.items>
</NavHeader> </NavHeader>
{{/if}} {{/if}}
{{! bypass UiWizard and container styling }} {{! bypass container styling }}
{{#if @hasAltContent}} {{#if @hasAltContent}}
{{yield (hash altContent=(component "splash-page/splash-content"))}} {{yield (hash altContent=(component "splash-page/splash-content"))}}
{{else}} {{else}}
<UiWizard> <div class="splash-page-container section is-flex-v-centered-tablet is-flex-1 is-fullwidth">
<div class="splash-page-container section is-flex-v-centered-tablet is-flex-1 is-fullwidth"> <div class="columns is-centered is-gapless is-fullwidth">
<div class="columns is-centered is-gapless is-fullwidth"> <div class="column is-4-desktop is-6-tablet">
<div class="column is-4-desktop is-6-tablet"> <div class="splash-page-header">
<div class="splash-page-header"> {{yield (hash header=(component "splash-page/splash-header"))}}
{{yield (hash header=(component "splash-page/splash-header"))}}
</div>
<div class="splash-page-sub-header">
{{yield (hash sub-header=(component "splash-page/splash-header"))}}
</div>
<div class="login-form box is-paddingless is-relative">
{{yield (hash content=(component "splash-page/splash-content"))}}
</div>
{{yield (hash footer=(component "splash-page/splash-content"))}}
</div> </div>
<div class="splash-page-sub-header">
{{yield (hash sub-header=(component "splash-page/splash-header"))}}
</div>
<div class="login-form box is-paddingless is-relative">
{{yield (hash content=(component "splash-page/splash-content"))}}
</div>
{{yield (hash footer=(component "splash-page/splash-content"))}}
</div> </div>
</div> </div>
</UiWizard> </div>
{{/if}} {{/if}}

View File

@@ -132,15 +132,13 @@
<LogoSplash /> <LogoSplash />
{{else}} {{else}}
{{#if this.showNav}} {{#if this.showNav}}
<UiWizard> <section class="section">
<section class="section"> <div class="container is-widescreen">
<div class="container is-widescreen"> <TokenExpireWarning @expirationDate={{this.auth.tokenExpirationDate}}>
<TokenExpireWarning @expirationDate={{this.auth.tokenExpirationDate}}> {{outlet}}
{{outlet}} </TokenExpireWarning>
</TokenExpireWarning> </div>
</div> </section>
</section>
</UiWizard>
{{else}} {{else}}
{{outlet}} {{outlet}}
{{/if}} {{/if}}

View File

@@ -50,7 +50,6 @@
</div> </div>
<ShamirFlow <ShamirFlow
@action="unseal" @action="unseal"
@onUpdate={{action "setUnsealState"}}
@onLicenseError={{action "handleLicenseError"}} @onLicenseError={{action "handleLicenseError"}}
@onShamirSuccess={{action "transitionToCluster"}} @onShamirSuccess={{action "transitionToCluster"}}
@buttonText="Unseal" @buttonText="Unseal"

View File

@@ -18,7 +18,6 @@ const Eng = Engine.extend({
'router', 'router',
'store', 'store',
'version', 'version',
'wizard',
'secret-mount-path', 'secret-mount-path',
], ],
externalRoutes: ['secrets'], externalRoutes: ['secrets'],

View File

@@ -21,7 +21,6 @@ export default class PkiEngine extends Engine {
'secret-mount-path', 'secret-mount-path',
'store', 'store',
'version', 'version',
'wizard',
], ],
externalRoutes: ['secrets', 'secretsListRoot', 'secretsListRootConfiguration', 'externalMountIssuer'], externalRoutes: ['secrets', 'secretsListRoot', 'secretsListRootConfiguration', 'externalMountIssuer'],
}; };

View File

@@ -21,7 +21,6 @@ const DEFAULTS = {
export default Component.extend(ReplicationActions, DEFAULTS, { export default Component.extend(ReplicationActions, DEFAULTS, {
replicationMode: 'dr', replicationMode: 'dr',
mode: 'primary', mode: 'primary',
wizard: service(),
version: service(), version: service(),
didReceiveAttrs() { didReceiveAttrs() {
this._super(...arguments); this._super(...arguments);

View File

@@ -9,16 +9,7 @@ const Eng = Engine.extend({
modulePrefix, modulePrefix,
Resolver, Resolver,
dependencies: { dependencies: {
services: [ services: ['auth', 'flash-messages', 'namespace', 'replication-mode', 'router', 'store', 'version'],
'auth',
'flash-messages',
'namespace',
'replication-mode',
'router',
'store',
'version',
'wizard',
],
externalRoutes: ['replication'], externalRoutes: ['replication'],
}, },
}); });