Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Apr 3, 2023

Our test suite hasn't been up and running on github the last week which caused some breaking changes to be merged accidentally.

#19925 was opened to resolve the flash message service not calling our custom stickyInfo method (more details in this comment)

However, this PR introduced new errors because we missed removing the flash-message service from the individual engine dependancies and updating an import file path that was merged in from a separate branch.

To address these I opened #19950 but then discovered none of the flash messages in the engines were rendering because each ember engine needs its own <FlashMessage> template to render since it no longer had access to the FlashMessage template in cluster.hbs (see closing comment here)

This PR keeps the removal of stickyInfo from #19925 (because I couldn't reproduce the original error and didn't want to trust renaming resolved it) but will open a draft with the rest of the changes if we decided to add ember-cli-flash as a dependency to each engine.

Aforementioned draft: #19969

@hellobontempo hellobontempo added this to the 1.14 milestone Apr 3, 2023
@hellobontempo hellobontempo changed the title Revert "UI: Remove custom service (#19925)" Remove stickyInfo and pass custom options directly to flash service Apr 3, 2023
@hellobontempo hellobontempo changed the title Remove stickyInfo and pass custom options directly to flash service Revert removing custom flash service Apr 3, 2023
@hellobontempo hellobontempo marked this pull request as ready for review April 3, 2023 17:49
@@ -46,7 +46,7 @@ export default class App extends Application {
},
kubernetes: {
dependencies: {
services: ['router', 'store', 'secret-mount-path', 'flashMessages'],
services: ['router', 'store', 'secret-mount-path', 'flash-messages'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this!

Copy link
Contributor Author

@hellobontempo hellobontempo Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original original file: https://github.com/hashicorp/vault/pull/19925/files#diff-5ebd44ba5909c95c331fd105e463a0332fa06bfc2f1244a4324d2518c29d9e59

(still not using stickyInfo anywhere)

import FlashMessages from 'ember-cli-flash/services/flash-messages';

export default class FlashMessageService extends FlashMessages {
  stickyInfo(message: string) {
    return this.info(message, {
      sticky: true,
      priority: 300,
    });
  }
}

@@ -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';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anytime we see FlashMessageService we know it refers to the custom service file

@hellobontempo hellobontempo changed the title Revert removing custom flash service Re-add custom flash service so engines can extend cluster's template Apr 3, 2023
@@ -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'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opted to make syntax the same across the app

Copy link
Contributor

@kiannaquach kiannaquach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!! tysm for reverting these changes :)

@hellobontempo hellobontempo merged commit e973716 into main Apr 3, 2023
@hellobontempo hellobontempo deleted the revert-19925/ui/remove-flashmessage-custom-service branch April 3, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants