Skip to content
This repository was archived by the owner on Jun 25, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ module.exports = function (grunt) {
commit: {
cmd: './commit.sh',
args: ['<%= grunt.option("msg") %>']
},
upload: {
cmd: './upload.sh'
}
},
remapIstanbul: {
Expand Down Expand Up @@ -345,6 +348,11 @@ module.exports = function (grunt) {
'run:deploy'
]);

grunt.registerTask('upload', [
'dist',
'run:upload'
]);

/**
* The index.html template includes the stylesheet and javascript sources
* based on dynamic names calculated in this Gruntfile. This task assembles
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Checkout [JsonForms](http://github.eclipsesource.com/jsonforms) for further info
[![Build Status](https://travis-ci.org/eclipsesource/JsonFormsEditor.svg?branch=master)](https://travis-ci.org/eclipsesource/JsonFormsEditor)[![Coverage Status](https://coveralls.io/repos/github/pancho111203/JsonFormsEditor/badge.svg?branch=master)](https://coveralls.io/github/pancho111203/JsonFormsEditor?branch=master)

## Demo
Watch JSONForms Editor in action on the [demo page](https://jsonformseditor.herokuapp.com/).
Watch JSONForms Editor in action on the [demo page](https://jsonforms-editor.herokuapp.com/).

## Working with TypeScript
#### Definitely Typed
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/src/components/toolbox/toolbox.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ module app.toolbox {
}
}

canBeRemoved(element: ControlToolboxElement): boolean{
return this.toolboxService.canBeRemoved(element);
canBeRemoved(element: ControlToolboxElement, node:any): boolean{
return !node.$nodeScope.selected && this.toolboxService.canBeRemoved(element);
}
isParentFolder(){
return this.toolboxService.currentPath.length == 0;
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/toolbox/toolbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<md-icon ng-if="!element.isObject()" class="material-icons">{{element.getIcon()}}
</md-icon>
<span ng-if="!element.isObject()" style="overflow:hidden;" class="left-margin">{{element.getLabel()}}</span>
<a class="pull-right left-margin" ng-hide="!toolbox.canBeRemoved(element)"
<a class="pull-right left-margin" ng-hide="!toolbox.canBeRemoved(element, this)"
ng-click="toolbox.removeDataElement(element)">
<md-icon class="btn material-icons">delete</md-icon>
</a>
Expand Down
20 changes: 13 additions & 7 deletions app/src/components/tree/tree.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,23 @@ module app.tree {
beforeDrag: (sourceNodeScope) => {
var dragElement:TreeElement = sourceNodeScope.$modelValue;
return !dragElement['root'];
},
removed: (node) => {
var treeElement:TreeElement = node.$modelValue;
this.treeService.notifyObservers(new PreviewUpdateEvent(null, JSON.parse(this.treeService.exportUISchemaAsJSON())));
this.decreasePlacedTimesOfChilds(treeElement);
treeService.modifiedTree();
}
};

Profiler.getInstance().watch('detailLoader', function(timeTaken){
console.log("Time to execute: " + timeTaken);
});
}

/**
* Removes the element from the tree.
* @param scope Scope Element from ui.tree.
*/
remove(scope):void {
var treeElement:TreeElement = scope.$nodeScope.$modelValue;
this.treeService.notifyObservers(new PreviewUpdateEvent(null, JSON.parse(this.treeService.exportUISchemaAsJSON())));
this.decreasePlacedTimesOfChilds(treeElement);
this.treeService.modifiedTree();
this.undoService.snapshot();
scope.removeNode(scope);
}
Expand All @@ -74,7 +76,11 @@ module app.tree {
* @param node
*/
showDetails(node:TreeElement):void {
this.detailService.setElement(node);

Profiler.getInstance().startMeasure('detailLoader');
this.detailService.setElement(node).then(function(){
Profiler.getInstance().endMeasure('detailLoader');
});
}

/**
Expand Down
39 changes: 39 additions & 0 deletions app/src/shared/profiler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module app {
export class Profiler {

watching:any = [];

static profiler: Profiler;

static getInstance():Profiler{
if(!this.profiler){
this.profiler = new Profiler();
}

return this.profiler;
}

watch(ident:string, report:any){
this.watching[ident] = {
report: report,
startTime: 0
};

}

startMeasure(ident:string){
if(this.watching[ident]){
this.watching[ident].startTime = performance.now();
}
}

endMeasure(ident:string){
if(this.watching[ident]){
var timeNow = performance.now();
var timeTaken = timeNow - this.watching[ident].startTime;

this.watching[ident].report(timeTaken);
}
}
}
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsonforms-editor",
"description": "An editor for jsonforms",
"version": "0.0.10",
"version": "0.0.11",
"homepage": "https://github.com/eclipsesource/JsonFormsEditor",
"license": "MIT",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ git tag -a "v${rev}" -m "Created tag v${rev}"
git push upstream "v${rev}"

git remote remove heroku
heroku git:remote -a jsonformseditor
heroku git:remote -a jsonforms-editor
heroku config:set NPM_CONFIG_PRODUCTION=false
git push heroku master
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsonforms-editor",
"private": true,
"version": "0.0.10",
"version": "0.0.11",
"description": "An editor for jsonforms",
"repository": "https://github.com/eclipsesource/JsonFormsEditor",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

git remote remove heroku
heroku git:remote -a jsonforms-editor-staging
heroku config:set NPM_CONFIG_PRODUCTION=false
git push heroku master