Releases: adopted-ember-addons/ember-cli-flash
[HOTFIX] Deprecation warnings from `registerTypes`
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
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 in1.0.0
- The service, object and component are now exposed to the app
Progress bars
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
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
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
Message styles
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
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