Code Monkey home page Code Monkey logo

aurelia-notify's Introduction

aurelia-notify

Build Status Coverage Status Dependency Status devDependency Status npm Version

A simple notification plugin for Aurelia.

notification.info('A simple info notification');

Documentation

Dependencies

This plugin has no external library dependencies and is completely based on Aurelia.

Aurelia dependencies:

Used By

This library is an optional plugin and not used by the core framework.

Platform Support

This library can be used in the browser.

Building The Code

To build the code, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:
npm install
  1. Ensure that Gulp is installed. If you need to install it, use the following command:
npm install -g gulp
  1. To build the code, you can now run:
gulp build
  1. You will find the compiled code in the dist folder, available in three module formats: AMD, CommonJS and ES6.

  2. See gulpfile.js for other tasks related to generating the docs and linting.

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. Ensure that the Karma CLI is installed. If you need to install it, use the following command:
npm install -g karma-cli
  1. Ensure that jspm is installed. If you need to install it, use the following commnand:
npm install -g jspm
  1. Install the client-side dependencies with jspm:
jspm install
  1. Ensure that you have Chrome installed. Karma runs the test suite in Chrome.

  2. You can now run the tests with this command:

karma start

Running The Sample

To run the sample code using this plugin proceed with these additional steps:

  1. Go to the sample directory and install dependencies using jspm:
cd sample
jspm install
  1. Go back to the root of the project and use gulp to serve the sample project:
cd ..
gulp watch

aurelia-notify's People

Contributors

chrisjshelby avatar marcscheib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aurelia-notify's Issues

Fix Typescript Definitions

Hi,

First of all: Great work, thank you! =)

I encountered two problems working in Typescript:

  1. I installed aurelia-notify via jspm, but it did not download the "aurelia-notify.d.ts" file. I'm not really deep into jspm, so I'm not sure whether this is a general problem of jspm+github or sth fixable.
  2. After i got the definitions manually, the typescript compiler said that my calls to .danger(..), .info(..) etc. were missing a second parameter (settings). Are settings supposed to be obligatory or optional?

Add a "newest to bottom" option

Currently, new notifications are added to the top of the notification container.

Add an option which allows to revert the order.

`close()` in `NotificationController` does not return the inner `invokeLifecycle` promise

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request

Current behavior
The Notification controller close returns a Promise which is great. However shouldn't the second invokeLifecycle also be returned ? Otherwise the outer promise (created by the first invokeLifecycle) will conclude without waiting for the inner promise to complete.

Expected behavior
I would expect the inner promise to be returned. That is, instead of having
invokeLifecycle(this.viewModel, 'deactivate')
I would use
return invokeLifecycle(this.viewModel, 'deactivate')

Minimal reproduction of the problem with instructions
N/A - it would complex to report it here.

What is the motivation / use case for changing the behavior?
This is giving us problems because we have notifications in a modal, which we wish to remove before the modal itself closes. However the close()-returned promise ends before the animation is completed and the notification destroyed, hence the notification is still around (although hidden) the next time the modal is opened.

It would be useful to have the close() when the notification removal is complete.

Please tell us about your environment:
Windows 10, Webpack

  • Version:
    "aurelia-notify": "^0.7.0",

  • Browser: Chrome/Electron

  • Language: ES6

  • Node (for AoT issues): node --version = 6.9.1

typings model issue

Hi,

Basically a small question/request.

Im creating my own view/view-model, but when i want to use the notify method, i realise i can only send a string through. I would like to send my own model through as well.

I added the following overload to the typings : notify(object: any, settings?: any, level?: string): any;

but this will break if you make any updates.

Any suggestions?

Add "scroll-to-container" functionality

Add a configuration options which allows to specify whether to scroll to the notification container if a notification pops up. This is especially useful for forms which have the container in the beginning of the form.

Absolute positioned notification containers don't need scroll (+1 for configurable option).

Compatibility with aurelia rc-1.0.0

Could you please make this compatible with the recent version of aurelia (rc-1.0.0)? I'm getting

lifecycle.js:10 Uncaught (in promise) TypeError: Cannot read property 'canActivate' of undefined
    at invokeLifecycle (http://dev-local:8835/jspm_packages/github/MarcScheib/[email protected]/lifecycle.js:10:24)
    at http://dev-local:8835/jspm_packages/github/MarcScheib/[email protected]/notification-service.js:60:47

and

Uncaught (in promise) Error: BindingLanguage must implement inspectTextContent().
    at mi (http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:734:11)
    at BindingLanguage.inspectTextContent (http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:751:7)
    at ViewCompiler._compileNode (http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:2532:79)
    at ViewCompiler._compileNode (http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:2552:33)
    at ViewCompiler.compile (http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:2499:12)
    at http://dev-local:8835/jspm_packages/npm/[email protected]/aurelia-templating.js:3146:50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.