Skip to content

Commit

Permalink
First working draft of $ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthropic committed Feb 19, 2017
1 parent e52a3f2 commit bd18295
Show file tree
Hide file tree
Showing 20 changed files with 2,756 additions and 307 deletions.
10 changes: 9 additions & 1 deletion .npmignore
@@ -1 +1,9 @@
**/.*
**/.*
**/*.js
**/webpack.*
/node_modules/
/bower_components/
/coverage/
/examples/
/src/
/test/
47 changes: 47 additions & 0 deletions CHANGELOG
@@ -1,3 +1,49 @@
v1.0.0-alpha.2
--------------
This is the second (of many) alpha and is **NOT ready for production** yet.

There is only one change in this alpha that needs user testing and feedback, the long awaited and much desired support for $ref.

## Changes

### Added
- $ref support for relative and local lookups based on [workaround example](https://github.com/json-schema-form/angular-schema-form/issues/69#issuecomment-176635926) provided by @AndreNel7

v1.0.0-alpha.1
--------------
## Changes

### Breaking
- Some add-ons will not be working yet, if an add-on is updated to use the new function it *should* work again, but there is more work to do here to make the upgrade seamless before a **beta** can be released.
- Decorators should be updated to use the `defineDecorator` syntax with builders prior to the 1.0.0 release.

### Added
- **23 test cases** added to ASF and a further **30 test cases** to json-schema-form-core
- Integration with **json-schema-form-core**, this is the main purpose of this release as we move as much code to plain Javascript es6+ as possible to re-use the code in an **Angular 2+** release
- #596 arrayIndices allows access to the current path for conditions in pr #742
- #560 All fields should now have classes, names and ids that match and can be used for easier test writing and scripting. The classes are provided with and without array indexes so they can be accessed as a group or individually, fixed in PR #578
- #748 New key, include all undefined schema fields in the form that are not already added with `[ '...' ]`

### Fixes
- Tests fixed and running
- Travis builds fixed and running
- #828 schemaFormValidate event doesn't trigger past v0.8.2
- #680 Pristine option was not behaving in pr #771
- Add support for templates with leading whitespaces in pr #725
- Improve sfNewArray Directive's titleMapValues Binding in pr #705
- #590 Problems with model binding when using nested Arrays in pr #672, #742
- Pass optional form name when broadcast error in in PR #656
- Fix for #121 to redraw with proper defaults in PR #647
- Revalidate model after successful custom validation event broadcasted in PR #642
- Fixed angular element children selector usage partially in PR #605
- Allow broadcasting of the formName to validate in PR #589
- Ensure key is set in fieldsets in PR #578

Special thanks to all the following people for their help in the last year preparing for the move to this version:
@AndreNel7 @apinnecke @blackmiaool @CatherineH @cepauskas @chargrove @donalmurtagh @edclements @elbunuelo @ErichBSchulz @jozefizso @illiano @kyse @LeonardoGentile @mathroc @plong0 @pvgnd @stanimoto @tisto @tomsowerby @zackbloom

Extra special thanks to @handrews @joelwkent @nicklasb for insight, ideas and support as we head toward version 1.0.0!

v0.8.13
-------
* Bugfix copy the initial form default on form redraw @stanimoto
Expand Down Expand Up @@ -85,6 +131,7 @@ v0.8.1


v0.8.0
------
Loads of stuff happened this release, so we're bumping version to 0.8.0.
Note as well that there is a small change to `tabsarray` type regarding its title, the title is now
interpolated instead of eval'd. So if you have any problems slap on a `{{ }}` around the tab title.
Expand Down
62 changes: 61 additions & 1 deletion CONTRIBUTING.md
@@ -1,5 +1,65 @@
Contributing
------------
============
- [How to setup to develop](#setup)
- [How to build the package](#build)
- [Working on the libraries](#work)
- [PR requirements](#requirements)

<a name="setup"></a>
## How to setup to develop
To get started clone all json-schema-form library repos into sibling folders.
json-schema-form-core
angular-schema-form
angular-schema-form-bootstrap
angular-schema-form-material

Once cloned each repo has npm commands for assisting development
```bash
# Run unit tests
npm run test

# Run the build
npm run build

# Run the build and minify
npm run dist # not in json-schema-form-core

# Run the build and watch for changes
npm run watch
```

<a name="build"></a>
## How to build the package
When working on `angular-schema-form` running the `npm build` will look for a sibling
folder when importing `json-schema-form-core`. This allows you to work on bugs or
issues that require work on both libraries simultaneously.

This is set up for bootstrap and material design decorators also.

The bootstrap repo is required to build `angular-schema-form` with the bootstrap
decorator bundle distribution.

<a name="work"></a>
## Working on the libraries
When I work on the libraries I use a multi-tab console tool like
Terminator (Linux) or ConEmu (Windows)

Run each of the following in a separate tab:
```bash
json-schema-form-core> npm run watch
json-schema-form-core> npm run test
angular-schema-form> npm run watch
angular-schema-form> npm run test
```
This will re-compile all the libraries after changes that affect them which
then runs the related tests.

A static file web server is required to run the examples, but the example
can be used to run saved gist of the example app. It can help to add a model
to one of the example app json files to test with.

<a name="requirements"></a>
## PR requirements
We love contributions!

**Please base any merge request on the *development* branch instead of *master*.**
Expand Down
30 changes: 17 additions & 13 deletions README.md
Expand Up @@ -94,16 +94,28 @@ Then load them into Schema Form using the `sfSchema`, `sfForm`, and `sfModel` di
Installation
------------

### NPM

```bash
npm i angular-schema-form@latest
```
For the latest pre-release (alpha)
```bash
npm i angular-schema-form@pre-release
```

### Bower

It's simplest to install Schema Form using [Bower](http://bower.io/).
If you use the bootstrap decorator use the one from the angular-schema-form-bootstrap repo

```bash
bower install angular-schema-form
bower install angular-schema-form angular-schema-form-bootstrap
bower install angular-schema-form angular-schema-form-bootstrap
```

This will install the latest release and basic dependencies. See
[dependecies section below](#dependencies).
[dependencies section below](#dependencies).

You can also load the files via [cdnjs.com](https://cdnjs.com/libraries/angular-schema-form).

Expand All @@ -115,34 +127,30 @@ You can also just download the contents of the `dist/` folder and add dependenci

Schema form has a lot of dependencies, most of which are optional. Schema Form depends on:

1. [AngularJS](https://angularjs.org/) version 1.3.x is recomended. Version 1.2.x
1. [AngularJS](https://angularjs.org/) version 1.3.x is recommended. Version 1.2.x
has some limitation. See [known limitations](docs/knownlimitations.md).
2. [angular-sanitize](https://docs.angularjs.org/api/ngSanitize)
3. [tv4](https://github.com/geraintluff/tv4)
4. [objectpath](https://github.com/mike-marcacci/objectpath)
5. [bootstrap 3](http://getbootstrap.com/)
4. [bootstrap 3](http://getbootstrap.com/)

If you install via bower you get all of the above except bootstrap since we
don't want to push a certain version or flavor on you. Also make
sure you got the angular version you actually want.


#### Additional dependecies
#### Additional dependencies

1. If you'd like to use drag-and-drop reordering of arrays, you'll also need [ui-sortable](https://github.com/angular-ui/ui-sortable) and its [jQueryUI](http://jqueryui.com/) dependencies. See the *ui-sortable* documentation for details about which parts of jQueryUI are needed. You can safely ignore these if you don't need reordering.
2. Schema Form provides tabbed arrays through the form type `tabarray`. Tab arrays default to tabs on the left side. For these to work, you'll need to include the CSS from [bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical-tabs). However, you won't need Bootstrap Vertical Tabs for horizontal tabs (the `tabType: "top"` option).

The minified files include templates - no need to load additional HTML files.


### Script Loading

Schema form is split into two main files, `dist/schema-form.min.js` and
`dist/bootstrap-decorator.min.js` and they need be loaded in that order. AngularJS,
[tv4](https://github.com/geraintluff/tv4) and [objectpath](https://github.com/mike-marcacci/objectpath)
also needs to be loaded *before* Schema Form.


```html
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
Expand Down Expand Up @@ -186,10 +194,6 @@ obviously need the same version!
### Add-on
To see how to make an **add-on** work I have now included the **calculate** add-on file within the **examples/add-on** directory.

## Yet to be migrated
Currently **copyValueTo** and some **array** related features are not working as expected and remain the highest priority to ensure backwards compatibility is maintained where possible.


## Tests
Unit tests are run with [karma](http://karma-runner.github.io) and written using
[mocha](http://visionmedia.github.io/mocha/), [chai](http://chaijs.com/) and
Expand Down
38 changes: 20 additions & 18 deletions dist/angular-schema-form-bootstrap.js
@@ -1,7 +1,7 @@
/*!
* angular-schema-form
* @version 1.0.0-alpha.1
* @date Sat, 04 Feb 2017 11:08:45 GMT
* @version 1.0.0-alpha.2
* @date Sun, 19 Feb 2017 13:13:18 GMT
* @link https://github.com/json-schema-form/angular-schema-form
* @license MIT
* Copyright (c) 2014-2017 JSON Schema Form
Expand Down Expand Up @@ -41,16 +41,18 @@
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;

/******/ // identity function for calling harmory imports with the correct context
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };

/******/ // define getter function for harmory exports
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };

/******/ // getDefaultExport function for compatibility with non-harmony modules
Expand All @@ -69,24 +71,24 @@
/******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 17);
/******/ return __webpack_require__(__webpack_require__.s = 20);
/******/ })
/************************************************************************/
/******/ ({

/***/ 17:
/***/ function(module, exports, __webpack_require__) {
/***/ 20:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(2);
module.exports = __webpack_require__(3);


/***/ },
/***/ }),

/***/ 2:
/***/ function(module, exports) {
/***/ 3:
/***/ (function(module, exports, __webpack_require__) {

"use strict";
'use strict';


/*!
* angular-schema-form-bootstrap
Expand Down Expand Up @@ -516,6 +518,6 @@ module.exports = __webpack_require__(2);
}
/******/]);

/***/ }
/***/ })

/******/ });
6 changes: 3 additions & 3 deletions dist/angular-schema-form-bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd18295

Please sign in to comment.