gfk-ba / meteor-notifications Goto Github PK
View Code? Open in Web Editor NEWAdd reactive notifications to your meteor application
Home Page: http://notifications-example.meteor.com/
License: MIT License
Add reactive notifications to your meteor application
Home Page: http://notifications-example.meteor.com/
License: MIT License
Users cannot see the messages if they have scrolled down.
What happened is my submit button is down the bottom, when the user clicked on it and he cannot see the message that the form has been submitted.
Testing slack integration
Each the page refresh my notification from the server shows up
Meteor's new package system shows this package as incompatible with Meteor v0.9.0 and later. I'm wondering if the package is actually broken, or can it still be installed and will work?
https://atmospherejs.com/mrt/notifications lists this package under mrt
, which makes it look pre-0.9. This should fix it:
meteor admin maintainers <your_username>:<your_package> --remove mrt
If you were originally the maintainer on the old package system, you can attach your Meteor Developer account at http://atmosphere.meteor.com/accounts, then ping tmeasday
to give you ownership of the old package.
the notifications are visible when they first show up, on the top left. then when I scroll down, I don't see them anymore.
here is a picture:
similarly, when the page is scrolled down and a notification appear, it is not displayed unless the page is scrolled back up. is there an option to control that? css maybe?
After a 'mrt update', app won't start up anymore giving the following error:
=> Errors prevented startup:
While building package `notifications`:
package.js:12:6: Object #<Object> has no method 'addFiles'
at configurePackage (package.js:12:6)
at Object.use (package.js:30:2)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:1630:29
at Array.forEach (native)
at Function._.each._.forEach (/home/chdallago/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11)
at _.extend.initFromPackageDir (/home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:1434:7)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/library.js:254:15
at Object.enterJob (/home/chdallago/.meteor/tools/cef2bcd356/tools/buildmessage.js:235:15)
at _.extend.get (/home/chdallago/.meteor/tools/cef2bcd356/tools/library.js:241:22)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:259:36
at Array.forEach (native)
at Function._.each._.forEach (/home/chdallago/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:258:9
at Array.forEach (native)
at Function._.each._.forEach (/home/chdallago/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11)
at _.extend.build (/home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:256:7)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:1140:13
at Array.forEach (native)
at Function._.each._.forEach (/home/chdallago/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11)
at _.extend.build (/home/chdallago/.meteor/tools/cef2bcd356/tools/packages.js:1139:7)
at _.extend.getForApp (/home/chdallago/.meteor/tools/cef2bcd356/tools/library.js:285:9)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/bundler.js:1732:25
at Object.capture (/home/chdallago/.meteor/tools/cef2bcd356/tools/buildmessage.js:191:5)
at Object.exports.bundle (/home/chdallago/.meteor/tools/cef2bcd356/tools/bundler.js:1667:31)
at _.extend._runOnce (/home/chdallago/.meteor/tools/cef2bcd356/tools/run-app.js:406:32)
at _.extend._fiber (/home/chdallago/.meteor/tools/cef2bcd356/tools/run-app.js:540:28)
at /home/chdallago/.meteor/tools/cef2bcd356/tools/run-app.js:348:12
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: '[email protected]'
Smart.json:
{
"packages": {
"iron-router": {},
"notifications": {},
"paginated-subscription": {},
"animation-helper-velocity": {},
"autocomplete": {},
"npm": {},
"collectionFS": {}
}
}
Hi,
I'm using notifications with a timer configured like this:
Meteor.startup ->
_.extend Notifications.defaultOptions,
timeout: 10000
I created this meteor method inside lib/transactions
updateTransaction: (id, values, action) ->
Transactions.update id,
$set: values
, (e, r) ->
if Meteor.isClient
console.log "Client!"
if e
Notifications.error e
else
Notifications.success 'Transaction updated!'
When I call this method, it generate this error in my chrome console:
Exception in delivering result of invoking '/transactions/update': Error: Can't set timers inside simulations
at withoutInvocation (http://localhost:3000/packages/meteor.js?7a66be7a03504cd2c18dd47b699e6233b60675ed:381:13)
at bindAndCatch (http://localhost:3000/packages/meteor.js?7a66be7a03504cd2c18dd47b699e6233b60675ed:389:33)
at Object._.extend.setTimeout (http://localhost:3000/packages/meteor.js?7a66be7a03504cd2c18dd47b699e6233b60675ed:398:23)
at Notifications._createTimeout (http://localhost:3000/packages/notifications.js?ae3bcb9e08ac3cbcaad716c65543173466bd4f05:279:48)
at Notifications._add (http://localhost:3000/packages/notifications.js?ae3bcb9e08ac3cbcaad716c65543173466bd4f05:251:22)
at Notifications.addNotification (http://localhost:3000/packages/notifications.js?ae3bcb9e08ac3cbcaad716c65543173466bd4f05:155:14)
at Notifications.success (http://localhost:3000/packages/notifications.js?ae3bcb9e08ac3cbcaad716c65543173466bd4f05:219:21)
at http://localhost:3000/models/transaction.coffee.js?c6a52873124126ab015781c5814c6bea2a6c7cf7:113:32
at CollectionHooks.defineAdvice.args.(anonymous function) (http://localhost:3000/packages/collection-hooks.js?3e5232f2e138e67956e336885073b86debc4374f:427:23)
at wrappedCallbackForParsingServerErrors (http://localhost:3000/packages/collection2.js?a02b3414237e62788542198aa82a2d2d9f41ead9:562:15)
I don't understand because this error message should be generated server side only but I added a if Meteor.isClient to avoid invocation on the server.
The stranger is that it runs correctly. My notifications are displayed with timer. Can you help?
Thanks and congratulations for the great work!
Hi there,
I was wondering if there was a way to time out notifications automatically after a few seconds built into this package?
Thanks!
Hi
Will this package be able to show notification in notification tray on android device??
Thanks
I'm not sure that there is a solution here, but I wanted to make an issue to get comments and then to help future people. I find I'm often creating a notification on error inside an autorun. Something like this might appear in a template's rendered function:
this.autorun(function() {
var status = doOperation();
if (!status) {
Notifications.error("Status failed");
}
});
The problem is that this is that the notification insert forces this method to rerun, which isn't desired. So instead I do this:
this.autorun(function() {
var status = doOperation();
if (!status) {
Tracker.nonreactive(function() {
Notifications.error("Status failed");
});
}
});
I'm not sure if the library could handle this case, but it would be nice for callers if it could. Maybe it's just a doc change?
How to clear all notifications?
Because I would like to clear all notifications, when I link to other router.
how to change position (top, bottom...)?
Current nightwatch shellscript and config only works on browser stack and runs on the meteor.com version of the example page. Create a version that runs locally.
Add option to prevent duplicate notification by testing if a notification with same message title or message reference is already shown.
Could you nudge me in the right direction,
or tell me where to edit to change the animations?
My notifications flicker before showing for some reason..
I'd like to have a "quick success" notification, but I don't want to add the options every time and or override the default options, so I did:
Meteor.startup(function() {
...
Notifications.quick = function(message, options){
options = options || {timeout:2000, userCloseable:false};
options.type = this.TYPES.SUCCESS;
return this.addNotification('', message, options);
};
});
Now I can use Notifications.quick('item inserted')
are there better ways to customize Notifications
without forking?
Can you please take out the {{#constant}} in notification.html?
Attempting to upgrade a project that uses this package to Meteor 1.2 results in the following error:
Update to release [email protected] is impossible:
While selecting package versions:
error: Conflict: Constraint [email protected] is not satisfied by less 2.5.0_2.
Constraints on package "less":
* less@=2.5.0_2 <- top level
* [email protected] <- gfk:notifications 1.1.3
Warning: Assigning helper with
Template.notifications.notifications = ...is deprecated. Use
Template.notifications.helpers(...) instead.
Just a reminder :)
When trying to set default settings the server gets an error: "Notifications is not defined". As in your example I put the code into the Meteor.startup(); Method but here it seems that Notification is not defined for server.
Example:
/server/env.js
Meteor.startup({
_.extend(Notifications.defaultOptions, {
timeout: 2500
});
});
I use info notifications for server communication. I sometimes put links in there. To make this work I need to change notification.html to have {{{message}}} instead of {{message}}. Also click anywhere to close is too easy to get wrong, so I just allow click on the X to close instead. I'm curious if others have used this library in this way and have thoughts around the best way to change it to support this case (or if it even should).
It wasn't clear to me from the documentation that the options.closed callback is invoked only when the notification is manually closed.
My usecase is to show a notification (e.g. 'saved successfully', and then when the notification expires to take a navigation action. So I would like to be able to get a callback both on a manual close of the notification and on its expiry and automatic close.
As a temporary kludge, I added a options.onExpires callback which gets called where the notifications are removed from the collection. I put the actual callback invocations on a Meteor.timeout because that seemed like the right timing. I'm sure there is a better way...
Is there a simple-ish way to push a notification from the server side to the client?
Testing slack integration
I'm trying to call a notification from the server and I'm getting the following error I take it it's not supported.
TypeError: Object [object Object] has no method 'success'
Calling Notifications.warn('title','message') as shown in the example does not work because options argument is required.
Need to fix it by adding options = options || {} to each type of the notification function like this:
Notifications.prototype.info = function (title, message, options) {
options = options || {};
options.type = this.TYPES.INFO;
return this.addNotification(title, message, options);
};
hi , Can i get other animation ? i want know ๐
As reported by @rgoomar
I just tried it again on Chrome on Mac OSX
Went to: http://notifications-example.meteor.com/ and put a timer of 10 and it did not disappear
When debug info is enabled i get the following error:
Exception in queued task: TypeError: Cannot read property 'hideAnimationProperties' of null
at Object.firstNode._uihooks.removeElement (http://localhost:3333/packages/notifications.js?9cda08b249239032320c7017e3b474270e9162ac:371:33)
at Function.DOMRange._removeNodeWithHooks (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:336:27)
at Function.DOMRange._remove (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:327:14)
at DOMRange.detach (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:473:16)
at Function.DOMRange._remove (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:325:7)
at DOMRange.detach (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:473:16)
at Function.DOMRange._remove (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:325:7)
at DOMRange.detach (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:473:16)
at DOMRange.setMembers (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:436:12)
at DOMRange.removeMember (http://localhost:3333/packages/blaze.js?309c2a3b573dca998c07c493ba4953d451b2c963:530:12) debug.js:41
This seems to be caused by a change in meteor 0.8.3 that changed how UI.getElementData works
This error happens after upgrade Meteor to 0.9.2.1
skozz@skozz (develop) $ meteor add gfk:notifications
Figuring out the best package versions to use. This may take a moment.
/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
throw(ex);
^
Error: Version string must look like semver (eg '1.2.3'), not 'v1.0.2'.
at throwVersionParserError (packages/package-version-parser/package-version-parser.js:144)
at Object.PV.getValidSemverVersion (packages/package-version-parser/package-version-parser.js:68)
at Object.PV.parseVersionConstraint (packages/package-version-parser/package-version-parser.js:49)
at new ConstraintSolver.Constraint (packages/constraint-solver/resolver.js:358)
at ConstraintSolver.Resolver.getConstraint (packages/constraint-solver/resolver.js:88)
at packages/constraint-solver/constraint-solver.js:122
at Function._.each._.forEach (packages/underscore/underscore.js:113)
at packages/constraint-solver/constraint-solver.js:115
at Function._.each._.forEach (packages/underscore/underscore.js:113)
at packages/constraint-solver/constraint-solver.js:114
at Array.forEach (native)
at Function._.each._.forEach (packages/underscore/underscore.js:105)
at ConstraintSolver.PackagesResolver._loadPackageInfo (packages/constraint-solver/constraint-solver.js:71)
at ConstraintSolver.PackagesResolver._ensurePackageInfoLoaded (packages/constraint-solver/constraint-solver.js:52)
at packages/constraint-solver/constraint-solver.js:179
at Array.forEach (native)
at Function._.each._.forEach (packages/underscore/underscore.js:105)
at ConstraintSolver.PackagesResolver.resolve (packages/constraint-solver/constraint-solver.js:178)
at _.extend.resolveConstraints (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/catalog.js:548:30)
at /Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/commands-packages.js:1849:38
at /Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:186:11
at _.extend.withValue (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at /Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:183:27
at _.extend.withValue (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at /Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:181:16
at _.extend.withValue (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/fiber-helpers.js:112:14)
at Object.capture (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/buildmessage.js:172:21)
at main.registerCommand.name [as func] (/Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/commands-packages.js:1842:33)
at /Users/skozz/.meteor/packages/meteor-tool/.1.0.30.qj6qeo++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/main.js:1225:23
http://notifications-example.meteor.com/ mentions "Meteorite"
Nice project, could you specify the license?
I want sent notification to one user when someone commented to his post and remove notification when user see.How can I do it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.