Skip to content

Commit bd18295

Browse files
committed
First working draft of $ref
1 parent e52a3f2 commit bd18295

20 files changed

+2756
-307
lines changed

.npmignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
**/.*
1+
**/.*
2+
**/*.js
3+
**/webpack.*
4+
/node_modules/
5+
/bower_components/
6+
/coverage/
7+
/examples/
8+
/src/
9+
/test/

CHANGELOG

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
v1.0.0-alpha.2
2+
--------------
3+
This is the second (of many) alpha and is **NOT ready for production** yet.
4+
5+
There is only one change in this alpha that needs user testing and feedback, the long awaited and much desired support for $ref.
6+
7+
## Changes
8+
9+
### Added
10+
- $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
11+
12+
v1.0.0-alpha.1
13+
--------------
14+
## Changes
15+
16+
### Breaking
17+
- 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.
18+
- Decorators should be updated to use the `defineDecorator` syntax with builders prior to the 1.0.0 release.
19+
20+
### Added
21+
- **23 test cases** added to ASF and a further **30 test cases** to json-schema-form-core
22+
- 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
23+
- #596 arrayIndices allows access to the current path for conditions in pr #742
24+
- #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
25+
- #748 New key, include all undefined schema fields in the form that are not already added with `[ '...' ]`
26+
27+
### Fixes
28+
- Tests fixed and running
29+
- Travis builds fixed and running
30+
- #828 schemaFormValidate event doesn't trigger past v0.8.2
31+
- #680 Pristine option was not behaving in pr #771
32+
- Add support for templates with leading whitespaces in pr #725
33+
- Improve sfNewArray Directive's titleMapValues Binding in pr #705
34+
- #590 Problems with model binding when using nested Arrays in pr #672, #742
35+
- Pass optional form name when broadcast error in in PR #656
36+
- Fix for #121 to redraw with proper defaults in PR #647
37+
- Revalidate model after successful custom validation event broadcasted in PR #642
38+
- Fixed angular element children selector usage partially in PR #605
39+
- Allow broadcasting of the formName to validate in PR #589
40+
- Ensure key is set in fieldsets in PR #578
41+
42+
Special thanks to all the following people for their help in the last year preparing for the move to this version:
43+
@AndreNel7 @apinnecke @blackmiaool @CatherineH @cepauskas @chargrove @donalmurtagh @edclements @elbunuelo @ErichBSchulz @jozefizso @illiano @kyse @LeonardoGentile @mathroc @plong0 @pvgnd @stanimoto @tisto @tomsowerby @zackbloom
44+
45+
Extra special thanks to @handrews @joelwkent @nicklasb for insight, ideas and support as we head toward version 1.0.0!
46+
147
v0.8.13
248
-------
349
* Bugfix copy the initial form default on form redraw @stanimoto
@@ -85,6 +131,7 @@ v0.8.1
85131

86132

87133
v0.8.0
134+
------
88135
Loads of stuff happened this release, so we're bumping version to 0.8.0.
89136
Note as well that there is a small change to `tabsarray` type regarding its title, the title is now
90137
interpolated instead of eval'd. So if you have any problems slap on a `{{ }}` around the tab title.

CONTRIBUTING.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
Contributing
2-
------------
2+
============
3+
- [How to setup to develop](#setup)
4+
- [How to build the package](#build)
5+
- [Working on the libraries](#work)
6+
- [PR requirements](#requirements)
7+
8+
<a name="setup"></a>
9+
## How to setup to develop
10+
To get started clone all json-schema-form library repos into sibling folders.
11+
json-schema-form-core
12+
angular-schema-form
13+
angular-schema-form-bootstrap
14+
angular-schema-form-material
15+
16+
Once cloned each repo has npm commands for assisting development
17+
```bash
18+
# Run unit tests
19+
npm run test
20+
21+
# Run the build
22+
npm run build
23+
24+
# Run the build and minify
25+
npm run dist # not in json-schema-form-core
26+
27+
# Run the build and watch for changes
28+
npm run watch
29+
```
30+
31+
<a name="build"></a>
32+
## How to build the package
33+
When working on `angular-schema-form` running the `npm build` will look for a sibling
34+
folder when importing `json-schema-form-core`. This allows you to work on bugs or
35+
issues that require work on both libraries simultaneously.
36+
37+
This is set up for bootstrap and material design decorators also.
38+
39+
The bootstrap repo is required to build `angular-schema-form` with the bootstrap
40+
decorator bundle distribution.
41+
42+
<a name="work"></a>
43+
## Working on the libraries
44+
When I work on the libraries I use a multi-tab console tool like
45+
Terminator (Linux) or ConEmu (Windows)
46+
47+
Run each of the following in a separate tab:
48+
```bash
49+
json-schema-form-core> npm run watch
50+
json-schema-form-core> npm run test
51+
angular-schema-form> npm run watch
52+
angular-schema-form> npm run test
53+
```
54+
This will re-compile all the libraries after changes that affect them which
55+
then runs the related tests.
56+
57+
A static file web server is required to run the examples, but the example
58+
can be used to run saved gist of the example app. It can help to add a model
59+
to one of the example app json files to test with.
60+
61+
<a name="requirements"></a>
62+
## PR requirements
363
We love contributions!
464

565
**Please base any merge request on the *development* branch instead of *master*.**

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,28 @@ Then load them into Schema Form using the `sfSchema`, `sfForm`, and `sfModel` di
9494
Installation
9595
------------
9696

97+
### NPM
98+
99+
```bash
100+
npm i angular-schema-form@latest
101+
```
102+
For the latest pre-release (alpha)
103+
```bash
104+
npm i angular-schema-form@pre-release
105+
```
106+
97107
### Bower
98108

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

101112
```bash
102-
bower install angular-schema-form
113+
bower install angular-schema-form angular-schema-form-bootstrap
114+
bower install angular-schema-form angular-schema-form-bootstrap
103115
```
104116

105117
This will install the latest release and basic dependencies. See
106-
[dependecies section below](#dependencies).
118+
[dependencies section below](#dependencies).
107119

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

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

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

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

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

129-
130-
#### Additional dependecies
140+
#### Additional dependencies
131141

132142
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.
133143
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).
134144

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

137-
138147
### Script Loading
139148

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

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

189-
## Yet to be migrated
190-
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.
191-
192-
193197
## Tests
194198
Unit tests are run with [karma](http://karma-runner.github.io) and written using
195199
[mocha](http://visionmedia.github.io/mocha/), [chai](http://chaijs.com/) and

dist/angular-schema-form-bootstrap.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* angular-schema-form
3-
* @version 1.0.0-alpha.1
4-
* @date Sat, 04 Feb 2017 11:08:45 GMT
3+
* @version 1.0.0-alpha.2
4+
* @date Sun, 19 Feb 2017 13:13:18 GMT
55
* @link https://github.com/json-schema-form/angular-schema-form
66
* @license MIT
77
* Copyright (c) 2014-2017 JSON Schema Form
@@ -41,16 +41,18 @@
4141
/******/ // expose the module cache
4242
/******/ __webpack_require__.c = installedModules;
4343

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

47-
/******/ // define getter function for harmory exports
47+
/******/ // define getter function for harmony exports
4848
/******/ __webpack_require__.d = function(exports, name, getter) {
49-
/******/ Object.defineProperty(exports, name, {
50-
/******/ configurable: false,
51-
/******/ enumerable: true,
52-
/******/ get: getter
53-
/******/ });
49+
/******/ if(!__webpack_require__.o(exports, name)) {
50+
/******/ Object.defineProperty(exports, name, {
51+
/******/ configurable: false,
52+
/******/ enumerable: true,
53+
/******/ get: getter
54+
/******/ });
55+
/******/ }
5456
/******/ };
5557

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

7173
/******/ // Load entry module and return exports
72-
/******/ return __webpack_require__(__webpack_require__.s = 17);
74+
/******/ return __webpack_require__(__webpack_require__.s = 20);
7375
/******/ })
7476
/************************************************************************/
7577
/******/ ({
7678

77-
/***/ 17:
78-
/***/ function(module, exports, __webpack_require__) {
79+
/***/ 20:
80+
/***/ (function(module, exports, __webpack_require__) {
7981

80-
module.exports = __webpack_require__(2);
82+
module.exports = __webpack_require__(3);
8183

8284

83-
/***/ },
85+
/***/ }),
8486

85-
/***/ 2:
86-
/***/ function(module, exports) {
87+
/***/ 3:
88+
/***/ (function(module, exports, __webpack_require__) {
8789

8890
"use strict";
89-
'use strict';
91+
9092

9193
/*!
9294
* angular-schema-form-bootstrap
@@ -516,6 +518,6 @@ module.exports = __webpack_require__(2);
516518
}
517519
/******/]);
518520

519-
/***/ }
521+
/***/ })
520522

521523
/******/ });

dist/angular-schema-form-bootstrap.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)