Skip to content

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

Configurable injection points

29 Mar 22:57

Choose a tag to compare

You can now choose which factories you want to inject the flash message service into, by setting this prop in the flashMessageDefaults prop in config/environment.

module.exports = function(environment) {
  var ENV = {
    flashMessageDefaults: {
      injectionFactories : [ 'route', 'controller', 'view:bar', 'component:foo' ]
    }
  }
}
Changelog
  • Injection points now configurable
  • Fixed broken overrides

[HOTFIX] Broken override

29 Mar 15:57

Choose a tag to compare

This hotfix addresses a bug where user defined overrides for default values wouldn't actually override the service defaults. Thanks to @charlatan154 for this.

Changelog
  • Fixed wrong order of merged defaults
  • Updated service test

[HOTFIX] Deprecation warnings from `registerTypes`

29 Mar 01:12

Choose a tag to compare

This minor hotfix addresses an issue where _registerTypes would fire off a deprecation warning from the incorrect use of registerType instead of _registerType. This contains no breaking changes.

Changelog
  • Updated addon description
  • Fixed deprecation warnings appearing from registerTypes

Global configuration for overridable defaults

28 Mar 17:27

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

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

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

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

Choose a tag to compare

Changelog
  • [HOTFIX] Fixed incorrect dependency for broccoli-babel-transpiler

Message styles

09 Mar 04:35

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

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