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

feat: added messageStylePrefix variable #335

Merged
merged 10 commits into from
Dec 12, 2020

Conversation

Techn1x
Copy link
Contributor

@Techn1x Techn1x commented Oct 28, 2020

Enable the ability to not use the generic bootstrap or foundation class names, by adding flashTypePrefixmessageStylePrefix which provides a way for the user to specify the flash type class name prefix.

Backwards compatibility is maintained with messageStyle, but if flashTypePrefixmessageStylePrefix is set it will take priority.

{{#each flashMessages.queue as |flash|}}
  <FlashMessage @flash={{this.flash}} @messageStylePrefix="special-alert-" />
{{/each}}

would produce an element like

<div class="flash-message special-alert-success" > ... </div>

Rationale

I've been running a custom flash-message component for this addon for a while now, because;

  • the flash-message component in this addon was a bit old
  • the classes alert and alert-box are very overused and poorly scoped in our 15-20 frontend apps... we really needed to avoid using these class names, and this addon didn't provide a way to customize that (without resorting to a custom component)

I noticed that with v2.0.0 the component has been updated to be tagless, render modifiers etc so I thought I would contribute some of my workings back to the project, with the aim of being able to use the component in this addon again!

@Techn1x
Copy link
Contributor Author

Techn1x commented Oct 28, 2020

btw! I am participating in hacktoberfest this year so I would much appreciate it if this pull request could have the hacktoberfest-accepted label added to it, or if the repo could have hacktoberfest label/topic 💯

@Techn1x
Copy link
Contributor Author

Techn1x commented Dec 8, 2020

Any interest in merging this @sbatson5 ? It's a requirement for me to not need to use a custom flash component

Copy link
Collaborator

@sbatson5 sbatson5 left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long to get back to you. I thin this is a useful change. Just a couple comments around naming and quality of life

@Techn1x Techn1x changed the title feat: added flashTypePrefix variable feat: added messageStylePrefix variable Dec 11, 2020
@Techn1x
Copy link
Contributor Author

Techn1x commented Dec 11, 2020

Thanks @sbatson5 those are all great suggestions, implemented them all

EDIT: except for the dev warning

@Techn1x Techn1x requested a review from sbatson5 December 11, 2020 03:47
@sbatson5 sbatson5 merged commit 1fe0f7a into adopted-ember-addons:master Dec 12, 2020
@Techn1x Techn1x deleted the feat/flash-class-prefix branch December 13, 2020 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants