Re-add custom flash service so engines can extend cluster's template (#19963)

* Revert "UI: Remove custom service (#19925)"

This reverts commit b04751d22437b06947a84148c499c4728602b5e1.

* replace stickyInfo with options info

* revert replacing custom stickyInfo

* change flash message name to be consistent throughout application

* make service imports consistent for k8 engine

* replace stickyInfo with options info

* Revert "change flash message name to be consistent throughout application"

This reverts commit 17de49894de3976ed708fcf15f19f6f1eb1012a5.

* add comment

---------

Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com>
This commit is contained in:
claire bontempo 2023-04-03 13:13:59 -06:00 committed by GitHub
parent a2f457e10c
commit 5a59d2cebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 29 additions and 19 deletions

View File

@ -15,12 +15,12 @@ export default class App extends Application {
engines = {
openApiExplorer: {
dependencies: {
services: ['auth', 'namespace', 'router', 'version'],
services: ['auth', 'flash-messages', 'namespace', 'router', 'version'],
},
},
replication: {
dependencies: {
services: ['auth', 'namespace', 'replication-mode', 'router', 'store', 'version'],
services: ['auth', 'flash-messages', 'namespace', 'replication-mode', 'router', 'store', 'version'],
externalRoutes: {
replication: 'vault.cluster.replication.index',
},
@ -31,6 +31,7 @@ export default class App extends Application {
services: [
'auth',
'download',
'flash-messages',
'namespace',
'path-help',
'router',
@ -45,7 +46,7 @@ export default class App extends Application {
},
kubernetes: {
dependencies: {
services: ['router', 'store', 'secret-mount-path'],
services: ['router', 'store', 'secret-mount-path', 'flash-messages'],
externalRoutes: {
secrets: 'vault.cluster.secrets.backends',
},
@ -56,6 +57,7 @@ export default class App extends Application {
services: [
'auth',
'download',
'flash-messages',
'namespace',
'path-help',
'router',

View File

@ -0,0 +1,13 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import FlashMessages from 'ember-cli-flash/services/flash-messages';
/*
we extend the ember-cli-flash service here so each ember engine can
import 'flash-messages' as a dependency giving it access to the
<FlashMessage> template in the main app's cluster.hbs file
*/
export default class FlashMessageService extends FlashMessages {}

View File

@ -6,7 +6,6 @@
],
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-flash": "*",
"ember-cli-babel": "*"
},
"ember-addon": {

View File

@ -16,7 +16,7 @@ export default class KubernetesEngine extends Engine {
modulePrefix = modulePrefix;
Resolver = Resolver;
dependencies = {
services: ['router', 'store', 'secret-mount-path', 'flashMessages'],
services: ['router', 'store', 'secret-mount-path', 'flash-messages'],
externalRoutes: ['secrets'],
};
}

View File

@ -7,7 +7,6 @@
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*",
"ember-cli-flash": "*",
"ember-concurrency": "*",
"@ember/test-waiters": "*",
"ember-inflector": "*"

View File

@ -7,7 +7,6 @@
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-babel": "*",
"ember-cli-flash": "*",
"ember-auto-import": "*",
"swagger-ui-dist": "*"
},

View File

@ -9,7 +9,7 @@ import { action } from '@ember/object';
import { task } from 'ember-concurrency';
import { waitFor } from '@ember/test-waiters';
import errorMessage from 'vault/utils/error-message';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import DownloadService from 'vault/services/download';
import PkiCertificateBaseModel from 'vault/models/pki/certificate/base';

View File

@ -9,7 +9,7 @@ import { tracked } from '@glimmer/tracking';
// TYPES
import Store from '@ember-data/store';
import Router from '@ember/routing/router';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import PkiActionModel from 'vault/models/pki/action';
import { Breadcrumb } from 'vault/vault/app-types';

View File

@ -11,7 +11,7 @@ import { task } from 'ember-concurrency';
import { waitFor } from '@ember/test-waiters';
import errorMessage from 'vault/utils/error-message';
import RouterService from '@ember/routing/router-service';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import PkiIssuerModel from 'vault/models/pki/issuer';
interface Args {

View File

@ -6,7 +6,7 @@
import { action } from '@ember/object';
import Component from '@glimmer/component';
import RouterService from '@ember/routing/router-service';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import { inject as service } from '@ember/service';
import errorMessage from 'vault/utils/error-message';
import PkiKeyModel from 'vault/models/pki/key';

View File

@ -6,7 +6,7 @@
import { action } from '@ember/object';
import RouterService from '@ember/routing/router-service';
import Component from '@glimmer/component';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import SecretMountPath from 'vault/services/secret-mount-path';
import { inject as service } from '@ember/service';
import errorMessage from 'vault/utils/error-message';

View File

@ -10,7 +10,7 @@ import { action } from '@ember/object';
import { task } from 'ember-concurrency';
import { waitFor } from '@ember/test-waiters';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import PkiActionModel from 'vault/models/pki/action';
import errorMessage from 'vault/utils/error-message';

View File

@ -12,7 +12,7 @@ import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';
import PkiActionModel from 'vault/models/pki/action';
import PkiUrlsModel from 'vault/models/pki/urls';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import errorMessage from 'vault/utils/error-message';
import { parsedParameters } from 'vault/utils/parse-pki-cert-oids';

View File

@ -5,7 +5,7 @@
import { action } from '@ember/object';
import Component from '@glimmer/component';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import { tracked } from '@glimmer/tracking';

View File

@ -11,7 +11,7 @@ import Router from '@ember/routing/router';
import Store from '@ember-data/store';
import { tracked } from '@glimmer/tracking';
import errorMessage from 'vault/utils/error-message';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import DownloadService from 'vault/services/download';
import PkiCertificateGenerateModel from 'vault/models/pki/certificate/generate';
import PkiCertificateSignModel from 'vault/models/pki/certificate/sign';

View File

@ -10,7 +10,7 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';
import PkiCertificateSignIntermediate from 'vault/models/pki/certificate/sign-intermediate';
import FlashMessageService from 'ember-cli-flash/services/flash-messages';
import FlashMessageService from 'vault/services/flash-messages';
import errorMessage from 'vault/utils/error-message';
interface Args {

View File

@ -7,7 +7,6 @@
"dependencies": {
"ember-cli-babel": "*",
"ember-cli-htmlbars": "*",
"ember-cli-flash": "*",
"ember-cli-typescript": "*",
"@types/ember": "latest",
"@types/ember-data": "latest",

View File

@ -6,7 +6,6 @@
],
"dependencies": {
"ember-cli-htmlbars": "*",
"ember-cli-flash": "*",
"ember-cli-babel": "*"
},
"ember-addon": {