Skip to content

Commit

Permalink
Merge adf9dd8 into 9a95309
Browse files Browse the repository at this point in the history
  • Loading branch information
eneufeld committed Jun 23, 2016
2 parents 9a95309 + adf9dd8 commit 428d583
Show file tree
Hide file tree
Showing 49 changed files with 944 additions and 926 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ properties of a aliased controller named `vm`:

```html
<div class="jsf">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"/
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"/
</div>
```

Expand Down
3 changes: 1 addition & 2 deletions examples/app/arrays/arrays.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>JSONForms generated Forms</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>

Expand All @@ -15,4 +15,3 @@ <h3>Bound data</h3>
<pre>{{vm.formattedData()}}</pre>
</div>
</div>

2 changes: 1 addition & 1 deletion examples/app/custom/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>JSONForms generated Forms</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion examples/app/default-ui/defaultui.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>JSONForms generated default Forms</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>
<div class="panel">
Expand Down
2 changes: 1 addition & 1 deletion examples/app/default/default-schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>JSONForms generated default schema and default forms</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion examples/app/editor/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="row">
<form role="form" class="jsf-form">
<jsonforms id="editor" schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms id="editor" schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</form>
</div>

4 changes: 2 additions & 2 deletions examples/app/person/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>Basic controls</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>

Expand All @@ -12,7 +12,7 @@ <h3>Basic controls</h3>
<h3>Master/Detail control</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.usersSchema" ui-schema="vm.usersUiSchema" data="vm.users"></jsonforms>
<jsonforms schema="vm.usersSchema" uischema="vm.usersUiSchema" data="vm.users"></jsonforms>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions examples/app/placeholder/placeholder-comments.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1>Comments</h1>
<div ng-if="vm.id">
<jsonforms schema="vm.commentSchema" ui-schema="vm.commentUiSchema" data="vm.CommentDataProvider"></jsonforms>
<jsonforms schema="vm.commentSchema" uischema="vm.commentUiSchema" data="vm.CommentDataProvider"></jsonforms>
</div>
<div ng-if="!vm.id">
<jsonforms schema="vm.commentsSchema" ui-schema="vm.commentsUiSchema" data="vm.CommentDataProvider"></jsonforms>
<jsonforms schema="vm.commentsSchema" uischema="vm.commentsUiSchema" data="vm.CommentDataProvider"></jsonforms>
</div>

2 changes: 1 addition & 1 deletion examples/app/placeholder/placeholder-posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h2>Posts</h2>
<jsonforms schema="vm.postSchema" data="vm.PostsDataProvider"></jsonforms>
</div>
<div ng-if="!vm.id">
<jsonforms schema="vm.postsSchema" ui-schema="vm.postsUiSchema" data="vm.PostsDataProvider"></jsonforms>
<jsonforms schema="vm.postsSchema" uischema="vm.postsUiSchema" data="vm.PostsDataProvider"></jsonforms>
</div>


4 changes: 2 additions & 2 deletions examples/app/placeholder/placeholder-users.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h1>Users</h1>
<div ng-if="vm.id">
<jsonforms schema="vm.userSchema" ui-schema="vm.userUiSchema" data="vm.UserDataProvider"></jsonforms>
<jsonforms schema="vm.userSchema" uischema="vm.userUiSchema" data="vm.UserDataProvider"></jsonforms>
</div>
<div ng-if="!vm.id">
<jsonforms schema="vm.usersSchema" ui-schema="vm.usersUiSchema" data="vm.UserDataProvider"></jsonforms>
<jsonforms schema="vm.usersSchema" uischema="vm.usersUiSchema" data="vm.UserDataProvider"></jsonforms>
</div>


2 changes: 1 addition & 1 deletion examples/app/polymer/polymer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<jsonforms data="vm.data" ui-schema="vm.uiSchema" schema="vm.schema"></jsonforms>
<jsonforms data="vm.data" uischema="vm.uiSchema" schema="vm.schema"></jsonforms>
<div class="panel">
<div class="panel-heading">
<h3>Bound data</h3>
Expand Down
2 changes: 1 addition & 1 deletion examples/app/resolve/resolve.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>Basic controls</h3>
</div>
<div class="panel-body">
<jsonforms schema="vm.schema" ui-schema="vm.uiSchema" data="vm.data"></jsonforms>
<jsonforms schema="vm.schema" uischema="vm.uiSchema" data="vm.data"></jsonforms>
</div>
</div>
<div class="panel">
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/layouts/categories/categorization.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
select="vm.changeSelectedCategory(category)">
<fieldset ng-if="vm.selectedCategory===category">
<jsonforms-inner ng-repeat="child in category.elements"
ui-schema="child" >
uischema="child" >
</jsonforms-inner>
</fieldset>
</uib-tab>
Expand Down
54 changes: 27 additions & 27 deletions src/bootstrap/layouts/categories/categorization.spec.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
import "angular"
import "angular-mocks"
import "../../jsonforms_bootstrap.ts"
import 'angular';
import 'angular-mocks';
import '../../jsonforms_bootstrap.ts';

describe('CategorizationBootstrap', () => {

// load all necessary modules and templates
beforeEach(angular.mock.module('jsonforms.form'));

xit("should be rendered",
xit('should be rendered',
angular.mock.inject(($rootScope, $compile) => {

let scope = $rootScope.$new();
scope.schema = {
"properties": {
"name": {
"type": "string"
'properties': {
'name': {
'type': 'string'
}
}
};
scope.uiSchema = {
"type": "Categorization",
"elements": [
'type': 'Categorization',
'elements': [
{
"type": "Category",
"label":"Tab1",
"elements": [
'type': 'Category',
'label': 'Tab1',
'elements': [
{
"type": "Control",
"label": "Name",
"scope": {
"$ref": "#/properties/name"
'type': 'Control',
'label': 'Name',
'scope': {
'$ref': '#/properties/name'
}
},
]
},
{
"type": "Category",
"label":"MyTab2",
"elements": [
'type': 'Category',
'label': 'MyTab2',
'elements': [
{
"type": "Control",
"label": "Name",
"scope": {
"$ref": "#/properties/name"
'type': 'Control',
'label': 'Name',
'scope': {
'$ref': '#/properties/name'
}
},
]
},
]
};
scope.data = { "name": "John Doe "};
let el = $compile('<jsonforms schema="schema" ui-schema="uiSchema" data="data"/>')(scope);
scope.data = { 'name': 'John Doe '};
let el = $compile('<jsonforms schema="schema" uischema="uiSchema" data="data"/>')(scope);
scope.$digest();
expect(el.html()).toContain("</uib-tabset>"); //this is not resolved completly
expect(el.html()).toContain("</uib-tab>"); //this is not resolved completly
expect(el.html()).toContain('</uib-tabset>'); // this is not resolved completly
expect(el.html()).toContain('</uib-tab>'); // this is not resolved completly
expect(el.html()).toContain('heading="Tab1"');
expect(el.html()).toContain('heading="MyTab2"');
}));
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/layouts/group/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<fieldset class="row">
<legend ng-if="vm.label">{{vm.label}}</legend>
<jsonforms-inner ng-repeat="child in vm.uiSchema.elements"
ui-schema="child"
uischema="child"
class="col-sm-100">
</jsonforms-inner>
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/layouts/horizontal/horizontal.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="jsf-horizontal-layout">
<fieldset class="row">
<div ng-repeat="child in vm.uiSchema.elements" class="col-sm-{{vm.childSize}}">
<jsonforms-inner ui-schema="child"></jsonforms-inner>
<jsonforms-inner uischema="child"></jsonforms-inner>
</div>
</fieldset>
</div>
Expand Down
75 changes: 37 additions & 38 deletions src/bootstrap/layouts/masterdetail/masterdetail.spec.ts
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
import "angular"
import "angular-mocks"
import "../../jsonforms_bootstrap.ts"
import 'angular';
import 'angular-mocks';
import '../../jsonforms_bootstrap.ts';

describe('MasterDetailBootstrap', () => {

// load all necessary modules and templates
beforeEach(angular.mock.module('jsonforms.form'));

xit("should be rendered",
xit('should be rendered',
angular.mock.inject(($rootScope, $compile) => {

let scope = $rootScope.$new();
scope.schema = {
"type": "object",
"properties": {
"a":{
"type": "array",
"items": {
"type":"object",
"properties":{
"name": {
"type": "string"
'type': 'object',
'properties': {
'a': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'name': {
'type': 'string'
},
}
},
},
"c":{
"type": "array",
"items": {
"type":"object",
"properties":{
"name": {
"type": "string"
'c': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'name': {
'type': 'string'
},
}
}
},
}
};
scope.uiSchema = {
"type":"MasterDetailLayout",
"scope": {
"$ref": "#"
'type': 'MasterDetailLayout',
'scope': {
'$ref': '#'
},
};
scope.data = {
"a":
[
{"name":"x_1"},
{"name":"x_2"}
'a': [
{'name': 'x_1'},
{'name': 'x_2'}
],
"c":[
{"name":"y_1"},
{"name":"y_2"}
'c': [
{'name': 'y_1'},
{'name': 'y_2'}
]
};
let el = $compile('<jsonforms schema="schema" ui-schema="uiSchema" data="data"/>')(scope);
let el = $compile('<jsonforms schema="schema" uischema="uiSchema" data="data"/>')(scope);
scope.$digest();
expect(el.html()).toContain("<!-- Master -->"); //this is not resolved completly
expect(el.html()).toContain("<!-- Detail -->"); //this is not resolved completly
expect(el.html()).toContain('<!-- Master -->'); // this is not resolved completly
expect(el.html()).toContain('<!-- Detail -->'); // this is not resolved completly
expect(el.html()).toContain('a');
expect(el.html()).toContain('x_1');
expect(el.html()).toContain('x_2');
expect(el.html()).toContain('c');
expect(el.html()).toContain('y_1');
expect(el.html()).toContain('y_2');

let nameInput_empty = el[0].querySelector("#\\#\\/properties\\/name");
let nameInput_empty = el[0].querySelector('#\\#\\/properties\\/name');
expect(nameInput_empty).toBeNull();

let x1 = el[0].querySelector("uib-accordion uib-accordion uib-accordion-heading span");
angular.element(x1).triggerHandler("click");
expect(el.html()).toContain("<label");
let nameInput = el[0].querySelector("#\\#\\/properties\\/name");
let x1 = el[0].querySelector('uib-accordion uib-accordion uib-accordion-heading span');
angular.element(x1).triggerHandler('click');
expect(el.html()).toContain('<label');
let nameInput = el[0].querySelector('#\\#\\/properties\\/name');
expect(nameInput).not.toBeNull();
}));
});
2 changes: 1 addition & 1 deletion src/bootstrap/layouts/vertical/vertical.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<jsonforms-layout>
<div class="jsf-vertical-layout">
<fieldset class="row">
<jsonforms-inner ng-repeat="child in vm.uiSchema.elements" ui-schema="child" class="col-sm-100"></jsonforms-inner>
<jsonforms-inner ng-repeat="child in vm.uiSchema.elements" uischema="child" class="col-sm-100"></jsonforms-inner>
</fieldset>
</div>
</jsonforms-layout>
Loading

0 comments on commit 428d583

Please sign in to comment.