Skip to content

Commit

Permalink
Implement #336, see issue for info on what to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Jun 18, 2013
1 parent ea5efec commit dd99e10
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 130 deletions.
92 changes: 92 additions & 0 deletions hawtio-web/GruntFile.js
@@ -0,0 +1,92 @@
module.exports = function (grunt) {

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-type');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-reload');

/*
grunt.loadNpmTasks('grunt-typescript');
*/

// Project configuration.
var port = grunt.option('webapp_port');
if (!port) {
port = 8181;
}

var appFiles = ['src/main/d.ts/**/*.ts', 'src/main/webapp/app/**/*.ts'];

grunt.initConfig({
test:{
files:['src/test/js/**/*.js']
},
type:{
compile:{
files: [
{
src: appFiles,
dest: "<%= grunt.option('webapp_outdir') %>/app/app.js"
}
],
options:{
sourcemap: true,
target: 'es5',
//module:'amd',
style:'eqeqeq;bitwise'
}
}
},
copy:{
dist: {
files: [
{
expand: true,
cwd: "src/main/webapp/",
src: ["./**"],
dest: "<%= grunt.option('webapp_outdir') %>/"
}
]
},
test: {
files: [
{
expand: true,
cwd: "<%= grunt.option('webapp_outdir') %>/",
src: ["./**"],
dest: "src/test/unit/"
}]
}
},
concat: {
main: {
src: ["target/schema/js/*.js", "src/main/webapp/app/**/*.js", "<%= grunt.option('webapp_outdir') %>/app/app.js"],
dest: "<%= grunt.option('webapp_outdir') %>/app/app.js"
}
},
reload: {
port: 35729,
liveReload: {},
proxy: {
host: 'localhost',
port: port
}
},
watch: {
app: {
files: ["src/main/webapp/**", "target/schema/js/*.js"],
tasks: ['type', 'concat', 'copy', 'reload']
}
}
});


// Default task.
grunt.registerTask('default', ['type', 'concat', 'copy']);

// watch source for changes
grunt.registerTask('watchSrc', ['type', 'concat', 'copy', 'reload', 'watch']);

};
77 changes: 0 additions & 77 deletions hawtio-web/grunt.js

This file was deleted.

11 changes: 7 additions & 4 deletions hawtio-web/package.json
Expand Up @@ -31,14 +31,17 @@
"test": "grunt test"
},
"dependencies" : {
"grunt-contrib-copy": "~0.3.2",
"grunt-contrib-copy": "~0.4",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-watch": "~0.4.4",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-reload": "~0.2.0",
"grunt-type": "~0.8.1"
"grunt-type": "~0.9.0"
},
"analyze": true,
"devDependencies": {
"grunt": "~0.3.17",
"typescript": "~0.8.1",
"grunt": "~0.4.1",
"typescript-dev": "~0.9.0",
"phantomjs": "1.9.0-1"
},
"bundledDependencies": [
Expand Down
9 changes: 1 addition & 8 deletions hawtio-web/pom.xml
Expand Up @@ -573,9 +573,6 @@
<configuration>
<executable>${grunt-executable}</executable>
<arguments>
<argument>copy</argument>
<argument>type</argument>
<argument>concat</argument>
<argument>--webapp_outdir</argument>
<argument>${webapp-outdir}</argument>
<argument>--webapp_port</argument>
Expand Down Expand Up @@ -611,11 +608,7 @@
<configuration>
<executable>${grunt-executable}</executable>
<arguments>
<argument>copy</argument>
<argument>type</argument>
<argument>concat</argument>
<argument>reload</argument>
<argument>watch</argument>
<argument>watchSrc</argument>
<argument>--webapp_outdir</argument>
<argument>${webapp-outdir}</argument>
<argument>--webapp_port</argument>
Expand Down
4 changes: 2 additions & 2 deletions hawtio-web/src/main/d.ts/angular-1.0.d.ts
Expand Up @@ -11,7 +11,7 @@ declare var angular: ng.IAngularStatic;
///////////////////////////////////////////////////////////////////////////////
// ng module (angular.js)
///////////////////////////////////////////////////////////////////////////////
module ng {
declare module ng {

// For the sake of simplicity, let's assume jQuery is always preferred
interface IJQLiteOrBetter extends JQuery { }
Expand Down Expand Up @@ -646,4 +646,4 @@ module ng {

}

}
}
2 changes: 1 addition & 1 deletion hawtio-web/src/main/d.ts/angular-resource-1.0.d.ts
Expand Up @@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////////
// ngResource module (angular-resource.js)
///////////////////////////////////////////////////////////////////////////////
module ng.resource {
declare module ng.resource {

///////////////////////////////////////////////////////////////////////////
// ResourceService
Expand Down
2 changes: 1 addition & 1 deletion hawtio-web/src/main/d.ts/bootstrap-2.1.d.ts
Expand Up @@ -4,7 +4,7 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped


/// <reference path="../jquery/jquery-1.8.d.ts"/>
/// <reference path="./jquery-1.8.d.ts"/>

interface ModalOptions {
backdrop?: bool;
Expand Down
10 changes: 5 additions & 5 deletions hawtio-web/src/main/webapp/app/camel/js/profile.ts
Expand Up @@ -185,9 +185,9 @@ module Camel {
messageData.min = message.getAttribute("minProcessingTime");
messageData.max = message.getAttribute("maxProcessingTime");
// total time for processors is pre calculated as accumulated from Camel 2.11 onwards
var total = message.getAttribute("accumulatedProcessingTime");
if (total) {
messageData.total = total;
var apt = message.getAttribute("accumulatedProcessingTime");
if (apt) {
messageData.total = apt;
} else {
messageData.total = "0"
}
Expand All @@ -213,7 +213,7 @@ module Camel {
});

var accTotal = 0;
updatedData.reverse().forEach((data, idx) => {
updatedData.reverse().forEach((data:any, idx) => {
// update accTotal with self time
if (idx < updatedData.length - 1) {
// each processor should have the total updated with the accumulated total
Expand Down Expand Up @@ -324,4 +324,4 @@ module Camel {
}

}
}
}
7 changes: 4 additions & 3 deletions hawtio-web/src/main/webapp/app/core/js/workspace.ts
Expand Up @@ -253,11 +253,12 @@ class Workspace {
};

var lastPath = paths.pop();
paths.forEach(value => {
folder = this.folderGetOrElse(folder, value);
var ws = this
paths.each((value) => {
folder = ws.folderGetOrElse(folder, value);
if (folder) {
folderNames.push(value);
angular.bind(this, configureFolder, folder, value)();
angular.bind(ws, configureFolder, folder, value)();
}
});
var key = rootId + separator + folderNames.join(separator) + separator + lastPath;
Expand Down
20 changes: 10 additions & 10 deletions hawtio-web/src/main/webapp/app/forms/js/baseDirectives.ts
Expand Up @@ -58,15 +58,15 @@ module Forms {

public link: (scope, element, attrs) => any;

constructor(private workspace, public $compile) {
constructor(public workspace, public $compile) {
// necessary to ensure 'this' is this object <sigh>
this.link = (scope, element, attrs) => {
return this.doLink(scope, element, attrs);
}

}

private doLink(scope, element, attrs) {
public doLink(scope, element, attrs) {
var config = new InputBaseConfig
config = configure(config, null, attrs);
config.scope = scope;
Expand Down Expand Up @@ -114,7 +114,7 @@ module Forms {

public type = "text";

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand Down Expand Up @@ -143,7 +143,7 @@ module Forms {

public type = "hidden";

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand All @@ -166,7 +166,7 @@ module Forms {

public type = "password";

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand All @@ -175,7 +175,7 @@ module Forms {

export class CustomInput extends InputBase {

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand All @@ -198,7 +198,7 @@ module Forms {

export class SelectInput extends InputBase {

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand Down Expand Up @@ -250,7 +250,7 @@ module Forms {

export class NumberInput extends InputBase {

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand Down Expand Up @@ -286,7 +286,7 @@ module Forms {

export class ArrayInput extends InputBase {

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand Down Expand Up @@ -358,7 +358,7 @@ module Forms {

export class BooleanInput extends InputBase {

constructor(private workspace, private $compile) {
constructor(public workspace, public $compile) {
super(workspace, $compile);
}

Expand Down

0 comments on commit dd99e10

Please sign in to comment.