Skip to content

Releases: adopted-ember-addons/ember-cli-flash

Global configuration for overridable defaults

28 Mar 17:27
Compare
Choose a tag to compare

You can now override defaults and specify your own, by adding a flashMessageDefaults option to config/environment:

module.exports = function(environment) {
  var ENV = {
    // ...

    flashMessageDefaults: {
      timeout      : 10000,
      priority     : 200,
      sticky       : true,
      showProgress : true,
      type         : 'foobar',
      types        : [ 'warning', 'notice', 'foobar' ]
    },

    // ...
  }
}

This lets you override defaults for various options – most notably, you can specify exactly what types you need, which means in the above example, you can do Ember.get('flashes').{warning,notice,foobar}.

Thanks to @johnotander for this feature.

Changelog
  • Removed bundled CSS in favour of keeping things minimal
  • Added ability to override defaults
  • [DEPRECATE] registerType is now a private method and will be deprecated in 1.0.0
  • The service, object and component are now exposed to the app

Progress bars

15 Mar 11:25
Compare
Choose a tag to compare

You can now add a progress bar to flash messages. The progress bar has a transition-duration CSS style property set to its element, with the duration being the flash message's timeout value. Essentially this will animate the progress bar smoothly until the timeout elapses.

To use:

Ember.get(this, 'flashes').success('Great success', { showProgress: true });
Changelog
  • Added ability to add progress bar to flash message
  • Simplified bundled style
  • Reduced test defaultTimeout to speed up tests
  • Updated missing contexts in component block helper
  • Included iojs to .travis.yml
  • Reduced some test complexity and duplication

Sticky messages

14 Mar 13:22
Compare
Choose a tag to compare

You can now make a message sticky by setting sticky to true in the flash message options. For example:

Ember.get(this, 'flashes').add({
  message : 'Brown and sticky',
  type    : 'joke',
  sticky  : true
});

addMessage is now deprecated in favour of add, and will be removed in 1.0.0.

Changelog
  • Added deprecation warning for addMessage
  • Reduced testTimerDuration in flash object test
  • Fixed a bug where sometimes flash messages would not be removed

Type registration

12 Mar 11:59
Compare
Choose a tag to compare

If you find yourself creating many custom messages with the same custom type, you can register it with the service and use that method instead.

Ember.get(this, 'flashes').registerType('birthday');
Ember.get(this, 'flashes').birthday("Hey shawty, it's your birthday");
Changelog
  • [FEATURE] Added ability to register new types

Hotfix

09 Mar 06:48
Compare
Choose a tag to compare
Changelog
  • [HOTFIX] Fixed incorrect dependency for broccoli-babel-transpiler

Message styles

09 Mar 04:35
Compare
Choose a tag to compare

This update has NO breaking API changes. The main update is to add the ability to specify message styles (Foundation or Bootstrap).

Changelog
  • [FEATURE] Added message style to flash message component
  • Switched over addon syntax to ES2015+
  • Updated ember-cli to 0.2.0

Sortable by priority

08 Mar 00:41
Compare
Choose a tag to compare

This update has breaking API changes, please read the read me to see what's different.

Changelog
  • [BREAKING] API changes for all public methods
  • [FEATURE] Added priority to flash messages, and a sorted queue in which you can display messages arranged by priority
  • Updated ember-cli to 0.2.0-beta.1