Skip to content

Commit

Permalink
Merge pull request #267 from Availity/feature/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
robmcguinness committed Mar 1, 2017
2 parents e6aac61 + 2a600c0 commit 18c025c
Show file tree
Hide file tree
Showing 586 changed files with 24,648 additions and 29,078 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": ["es2015", "stage-0"],
"plugins": [
"transform-class-properties",
"transform-object-assign"
]
}
15 changes: 15 additions & 0 deletions .bookignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
lib/
less/
dev/
examples/
dist/
package.json
bower.json
.eslint*
.editorconfig
.babelrc
.gitattributes
.travis.yml
webpack*

karma*
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{html,js,rb,scss,xml,hbs}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
indent_size = 4
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/*
reports/*
lib/
15 changes: 15 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
#
# 0 - disable
# Rules that more harmful than useful, or just buggy.
#
# 1 - warning
# Rules that we didn't encounter yet. You can safely ignore them,
# but I'd like to know any interesting use-cases they forbid.
#
# 2 - error
# Rules that have proven to be useful, please follow them.


# https://github.com/Availity/eslint-config-availity
extends: eslint-config-availity
15 changes: 15 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
#
# 0 - disable
# Rules that more harmful than useful, or just buggy.
#
# 1 - warning
# Rules that we didn't encounter yet. You can safely ignore them,
# but I'd like to know any interesting use-cases they forbid.
#
# 2 - error
# Rules that have proven to be useful, please follow them.


# https://github.com/Availity/eslint-config-availity
extends: eslint-config-availity
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
.idea
npm-debug*.log
bower_components
node_modules
_book
reports
/.deprc

/dist/
/build/
.DS_Store
/npm-debug.log
/lib/
/coverage
/.vscode
40 changes: 0 additions & 40 deletions .jscsrc

This file was deleted.

2 changes: 0 additions & 2 deletions .jshintignore

This file was deleted.

29 changes: 0 additions & 29 deletions .jshintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
npm-debug*.log
node_modules
_book
reports
/build/
.DS_Store
/coverage
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '5'
- '6'
git:
depth: 10
env:
Expand All @@ -11,14 +11,10 @@ addons:
sauce_connect: true
notifications:
email: false
before_install:
- npm install --quiet -g bower
- npm install --quiet -g gulp
install:
- npm install --no-optional
- npm install
cache:
directories:
- node_modules
- bower_components
script:
- gulp test:sauce
- npm run test:ci
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 201 Availity, LLC
Copyright (c) 2016 Availity, LLC

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
142 changes: 13 additions & 129 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,174 +8,58 @@
[![Build](https://img.shields.io/travis/Availity/availity-angular.svg?style=flat-square&label=build)](https://travis-ci.org/Availity/availity-angular)

## Table of Contents

* [Intro](#intro)
* [Demo](#demo)
* [Supported Browsers](#supported-browsers)
* [Quickstart](#quickstart)
* [Upgrading](#upgrading)
* [Angular](#angular)
* [Acknowledgments](#acknowledgments)
* [Authors](#authors)
* [License](#license)


## Intro
##### Directory Layout

>
```
.
├── /dist/ # Assets ready for distribution
├── /node_modules/ # 3rd-party libraries and utilities
├── /docs/ # SDK documentation and samples
├── /gulp/ # Gulp tasks and utility classes
│── gulpfile.js # Configuration file for automated builds
│── bower.json # Bower list of 3rd party libraries
└── package.json # NPM list of 3rd party libraries and utilities

## Demo
[http://demo.availity.com/public/apps/availity-angular](http://demo.availity.com/public/apps/availity-angular)

[availity.github.io/availity-angular](http://availity.github.io/availity-angular/)

## Supported Browsers

* Internet Explorer 8 and newer
* Google Chrome (latest version)
* Mozilla Firefox (latest version)
* Internet Explorer 9 and newer
* Google Chrome
* Mozilla Firefox

> Other browsers should be supported as well but you may experience some issues.
## Quickstart
Install the Availity Angular SDK with Bower.
>
```bash
$ bower install availity-angular --save
```


## Angular
#### Core Module
Install the Availity Angular SDK with npm.

The module `availity` are Angular services and utilities for building web applications. These include:

+ [Factories](./lib/core/api) for creating REST service calls for the Availity API.
+ User [session management](./lib/core/session) services
+ [Validation framework](./lib/core/validation)

##### Asynchronous Requests & Responses

> Not all Availity Rest services support asynchronous requests/responses. Please check the documentation at https://developer.availity.com for support.
Angular API Rest services created from [api-factory.js](./lib/core/api/api-factory.js) have been enhanced to support Availity Rest asynchronous requests. In essence, if [api-factory.js](./lib/core/api/api-factory.js) detects an asynchronous response, it will automatically poll Availity Rest services for the real response for about 30 seconds. The default starting poll interval is 1 second with a decay factor of 1.2. If a proper response isn't received with in the max interval polling time the Angular ajax promise will get rejected. This behavior is transparent to users of Angular services that have been extended from [api-factory.js](./lib/core/api/api-factory.js).

As the contract changes between the client and server for async request/response, [api-factory.js](./lib/core/api/api-factory.js) will be updated accordingly.

##### Usage

* Create a new API Resource

>
```javascript
var restServiceResource = new AvApiResource('/some/rest/path');
```

* Server responds with asynchronous payload with `Status Code: 202 OK` with the location header set

>
```bash
access-control-allow-origin:*
cache-control:public, max-age=0
connection:keep-alive
content-encoding:gzip
content-type:application/json
date:Sat, 04 Apr 2015 14:16:13 GMT
etag:W/"b27-3834658027"
last-modified:Tue, 31 Mar 2015 17:54:52 GMT
transfer-encoding:chunked
vary:Origin, Accept-Encoding
# Aries rest response with # Header with ping URL
Location: http://localhost:3000/some/rest/path
$ npm install availity-angular --save
```

* Use the API service with optional notification callback

>
```javascript
restServiceResource.query().then(function(successResponse) {
// success code goes here :)
}, function(errorResponse){
// error code goes here :(
}, function(notifyResponse) {
// notification response contains the json data with poll information
});
```

* Override polling interval options per request

>
```javascript
restServiceResource.query({
pollingInterval: 2000,
pollingMaxInterval: 10,
pollingDecay: 1.8
}).then(function(successResponse) {
// success code goes here :)
}, function(errorResponse){
// error code goes here :(
}, function(notifyResponse) {
// notification response contains the json data with poll information
});
```

* Specify cache busting per request

>
```javascript
restServiceResource.query({
cacheBust: true
}).then(function(successResponse) {
// success code goes here :)
}, function(errorResponse){
// error code goes here :(
}, function(notifyResponse) {
// notification response contains the json data with poll information
});
```

#### UI Module

The module `availity.ui` is a set of Angular services and directive wrappers around jQuery plugins. These include:

+ [Select2 3.5.2](http://select2.github.io/select2/)
+ [Bootstrap Datepicker 1.3.1](https://github.com/eternicode/bootstrap-datepicker)


## Acknowledgments
The Availity Angular lib was heavily inspired by multiple open source frameworks. If for some reason a library could not be used directly (IE8 limitation), we've reused that projects code directly in this project. Please check out the libs below for some beautifully written code.

The Availity Angular lib was heavily inspired by multiple open source frameworks. If for some reason a library could not be used directly (IE9 limitation), we've reused that projects code directly in this project. Please check out the libs below for some beautifully written code.

+ [Angular Strap](https://github.com/mgcrea/angular-strap)
+ [Angular Bootstrap](https://github.com/angular-ui/bootstrap)
+ [Valdr](https://github.com/netceteragroup/valdr)
+ [ng-idle](https://github.com/HackedByChinese/ng-idle)


## Authors

**Robert McGuinness**
+ [rob.mcguinness@availity.com](rob.mcguinness@availity.com)

**Bobby Bennett**
+ [bbennett8609@gmail.com](bbennett8609@gmail.com)

**Javier Fernandez-Ivern**
+ [javier@ivern.org](javier@ivern.org)
+ [bobby.bennett@availity.com](bobby.bennett@availity.com)

**Danny Noler**
+ [danny.noler@availity.com](danny.noler@availity.com)



## License
Copyright (c) 2016 Availity, LLC

Copyright (c) 2017 Availity, LLC

0 comments on commit 18c025c

Please sign in to comment.