You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2018/07/26 10:50:28 UTC
[11/28] brooklyn-ui git commit: This adds the contributed
brooklyn-ui-angular code in the folder new/.
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/app/views/catalog/catalog.template.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/app/views/catalog/catalog.template.html b/new/ui-modules/catalog/app/views/catalog/catalog.template.html
new file mode 100644
index 0000000..5a726fa
--- /dev/null
+++ b/new/ui-modules/catalog/app/views/catalog/catalog.template.html
@@ -0,0 +1,188 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<section class="container">
+ <div class="row">
+ <div class="col-sm-8 col-xs-6">
+ <input ng-model="state.search.$" type="text" placeholder="Search for bundles or types" class="form-control" />
+ </div>
+ <div class="col-sm-3 col-sm-offset-1 col-xs-6 text-right">
+ <button class="btn btn-success" ng-click="launchCatalogUploader()">
+ <i class="fa fa-fw fa-upload"></i>
+ Upload to catalog
+ </button>
+ </div>
+ </div>
+ <div class="row" ng-if="isNonEmpty(state.search)">
+ <div class="col-md-12 clear-search" ng-click="clearSearchFilters()">
+ <i class="fa fa-fw fa-window-close"></i> Clear current search query, filters, and sorts
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
+ <header class="row filters">
+ <div class="col-sm-6">
+ <div class="btn-group btn-group-sm" role="group" aria-label="View switcher">
+ <button ng-model="state.view" uib-btn-radio="'bundles'" type="button" class="btn btn-default" ng-class="{'btn-primary': state.view === 'bundles'}">Bundles</button>
+ <button ng-model="state.view" uib-btn-radio="'types'" type="button" class="btn btn-default" ng-class="{'btn-primary': state.view === 'types'}">Types</button>
+ </div>
+ </div>
+ <div class="col-sm-6 text-right">
+ <div class="btn-group" uib-dropdown>
+ <button type="button" class="btn btn-link" uib-dropdown-toggle>
+ Version <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
+ <li ng-repeat="version in config.versions | orderBy:'-' track by $index" ng-class="{'active': state.search.version === version}">
+ <a ng-click="state.search.version = version">{{version}}</a>
+ </li>
+ </ul>
+ </div>
+ <div class="btn-group" uib-dropdown>
+ <button type="button" class="btn btn-link" uib-dropdown-toggle>
+ Sort <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
+ <li ng-repeat="orderBy in config.orderBy track by orderBy.id" ng-class="{'active': state.orderBy === orderBy}">
+ <a ng-click="state.orderBy = orderBy">{{orderBy.label}}</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </header>
+ </div>
+
+ <div class="col-md-12">
+ <ul class="list-group list-group-bundles" ng-show="state.view === 'bundles'">
+ <li ng-repeat="bundle in bundles | filter:state.search | orderBy:state.orderBy.id as filteredBundles track by (bundle.symbolicName + bundle.version)"
+ ng-class="{'expanded': !isCollapsed, 'is-expandable': bundle.types.length > 0}"
+ class="list-group-item bundles-list">
+ <div class="media bundle-top-region" ng-init="isCollapsed = true" ng-click="isCollapsed = bundle.types.length > 0 ? !isCollapsed : true">
+ <div class="media-left">
+ <a ui-sref="bundle({bundleId: bundle.symbolicName, bundleVersion: bundle.version})">
+ <img ng-src="{{::bundle | iconGeneratorPipe:'symbolicName'}}" class="media-object" alt="{{::bundle.symbolicName}}'s logo" />
+ </a>
+ </div>
+ <div class="media-body catalog-item-body">
+ <div class="pull-right highlights" ng-bind-html="::bundle | bundleHighlights"></div>
+ <h4 class="media-heading">
+ <a ui-sref="bundle({bundleId: bundle.symbolicName, bundleVersion: bundle.version})" class="list-group-item-heading">
+ {{bundle | bundleName}}
+ </a>
+ <span class="label label-default">{{::bundle.version}}</span>
+ </h4>
+ <p class="media-auto-wrap text-muted" ng-if="bundle.symbolicName.startsWith('brooklyn-catalog-bom')"><small>
+ <i class="fa fa-fw fa-exclamation-circle"></i> This bundle comes from a BOM file that does not declare a bundle name
+ </small></p>
+ <p class="media-auto-wrap text-muted" ng-if="bundle.types.length == 0"><small>
+ <i class="fa fa-fw fa-exclamation-circle"></i> No registered types in this bundle
+ </small></p>
+ <p class="media-description">{{bundle | bundleDescription}}</p>
+ </div>
+ </div>
+
+ <div class="extra" uib-collapse="isCollapsed">
+ <div ng-init="filteredEntities = (bundle.types | bundleTypeFilter:'org.apache.brooklyn.api.entity.Entity' | filter:state.search)" ng-show="::filteredEntities.length > 0">
+ <ul class="list-group list-group-types">
+ <li class="list-group-item typed-group-table-header">
+ <ng-pluralize count="::filteredEntities.length"
+ when="{'one': 'Entity', 'other': 'Entities'}">
+ </ng-pluralize>
+ </li>
+ <li ng-repeat="entity in filteredEntities track by (entity.containingBundle + entity.symbolicName + entity.version)"
+ ng-class="{'deprecated': entity.deprecated, 'disabled': entity.disabled}"
+ class="list-group-item">
+ <type-item bundle="bundle" type="entity"></type-item>
+ </li>
+ </ul>
+ </div>
+ <div ng-init="filteredPolicies = (bundle.types | bundleTypeFilter:'org.apache.brooklyn.api.policy.Policy' | filter:state.search)" ng-show="::filteredPolicies.length > 0">
+ <ul class="list-group list-group-types">
+ <li class="list-group-item typed-group-table-header">
+ <ng-pluralize count="::filteredPolicies.length"
+ when="{'one': 'Policy', 'other': 'Policies'}">
+ </ng-pluralize>
+ </li>
+ <li ng-repeat="policy in filteredPolicies track by (policy.containingBundle + policy.symbolicName + policy.version)"
+ ng-class="{'deprecated': policy.deprecated, 'disabled': policy.disabled}"
+ class="list-group-item">
+ <type-item bundle="bundle" type="policy"></type-item>
+ </li>
+ </ul>
+ </div>
+ <div ng-init="filteredEnrichers = (bundle.types | bundleTypeFilter:'org.apache.brooklyn.api.sensor.Enricher' | filter:state.search)" ng-show="::filteredEnrichers.length > 0">
+ <ul class="list-group list-group-types">
+ <li class="list-group-item typed-group-table-header">
+ <ng-pluralize count="::filteredEnrichers.length"
+ when="{'one': 'Enricher', 'other': 'Enrichers'}">
+ </ng-pluralize>
+ </li>
+ <li ng-repeat="enricher in filteredEnrichers track by (enricher.containingBundle + enricher.symbolicName + enricher.version)"
+ ng-class="{'deprecated': enricher.deprecated, 'disabled': enricher.disabled}"
+ class="list-group-item">
+ <type-item bundle="bundle" type="enricher"></type-item>
+ </li>
+ </ul>
+ </div>
+ <h5 ng-init="additionalTypes = bundle.types.length - filteredEntities.length - filteredPolicies.length - filteredEnrichers.length"
+ ng-show="additionalTypes > 0"
+ class="text-info">
+ <i class="fa fa-fw fa-info-circle"></i>
+ There <ng-pluralize count="::additionalTypes" when="{'one': 'is {} type', 'other': 'are {} types'}"></ng-pluralize> in this bundle
+ <span ng-if="additionalTypes < bundle.types.length"> in addition to the
+ above<span ng-if="isNonEmpty(state.search)"> not matching the search criteria</span>.</span>
+ <span ng-if="additionalTypes == bundle.types.length"> but no entities, enrichers or
+ policies<span ng-if="isNonEmpty(state.search)"> matching the search criteria</span>.</span>
+ </h5>
+ </div>
+ </li>
+
+ <li ng-show="!bundles" class="list-group-item loading">
+ <h4>Loading bundles</h4>
+ </li>
+ <li ng-show="bundle.types.length === 0" class="list-group-item empty">
+ <h4>There is no items in the catalog</h4>
+ <button class="btn btn-primary" ng-click="launchCatalogUploader()">Upload some</button>
+ </li>
+ <li ng-show="bundle.types.length > 0 && filteredBundles.length === 0" class="list-group-item no-results">
+ <h4>No results matching current filters</h4>
+ </li>
+ </ul>
+
+ <ul class="list-group list-group-types" ng-show="state.view === 'types'">
+ <li ng-repeat="type in types | filter:state.search | orderBy:state.orderBy.id as filteredTypes track by (type.containingBundle + type.symbolicName + type.version)"
+ ng-class="{'deprecated': type.deprecated, 'disabled': type.disabled}"
+ class="list-group-item">
+ <type-item bundle="type.bundle" type="type" show-bundle="true" show-type="true"></type-item>
+ </li>
+
+ <li ng-show="!types" class="list-group-item loading">
+ <h4>Loading types</h4>
+ </li>
+ <li ng-show="types.length === 0" class="list-group-item empty">
+ <h4>There is no items in the catalog</h4>
+ <button class="btn btn-primary" ng-click="launchCatalogUploader()">Upload some</button>
+ </li>
+ <li ng-show="filteredTypes.length === 0" class="list-group-item no-results">
+ <h4>No results matching current filters</h4>
+ </li>
+ </ul>
+ </div>
+ </div>
+</section>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/config/build/webpack.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/config/build/webpack.config.js b/new/ui-modules/catalog/config/build/webpack.config.js
new file mode 100644
index 0000000..a050fa9
--- /dev/null
+++ b/new/ui-modules/catalog/config/build/webpack.config.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+eval(require('fs').readFileSync('../shared/config/build/webpack.config.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/config/server.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/config/server.js b/new/ui-modules/catalog/config/server.js
new file mode 100644
index 0000000..dfba7dc
--- /dev/null
+++ b/new/ui-modules/catalog/config/server.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+eval(require('fs').readFileSync('../shared/config/server.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/config/test/karma.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/config/test/karma.config.js b/new/ui-modules/catalog/config/test/karma.config.js
new file mode 100644
index 0000000..6fc6558
--- /dev/null
+++ b/new/ui-modules/catalog/config/test/karma.config.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+const PRODUCTION_BUILD = process.env.NODE_ENV === 'production';
+const webpackConfig = require('./../build/webpack.config.js');
+
+module.exports = function (config) {
+ const conf = {
+ basePath: '',
+ frameworks: ['jasmine'],
+ files: [
+ {pattern: './karma.test.shim.js', watched: false}
+ ],
+ preprocessors: {
+ './karma.test.shim.js': ['webpack', 'sourcemap']
+ },
+ webpack: Object.assign({}, webpackConfig, {entry: undefined, plugins: undefined}),
+ webpackMiddleware: {
+ stats: 'errors-only'
+ },
+ webpackServer: {
+ noInfo: true
+ },
+ exclude: [],
+ colors: !PRODUCTION_BUILD,
+ logLevel: config.LOG_INFO,
+ autoWatch: !PRODUCTION_BUILD,
+ singleRun: PRODUCTION_BUILD,
+ reporters: ['progress'],
+ browsers: ['PhantomJS'],
+ plugins: [
+ require('karma-webpack'),
+ require('karma-sourcemap-loader'),
+ 'karma-jasmine',
+ 'karma-phantomjs-launcher'
+ ],
+ failOnEmptyTestSuite: false
+ };
+ config.set(conf);
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/config/test/karma.test.shim.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/config/test/karma.test.shim.js b/new/ui-modules/catalog/config/test/karma.test.shim.js
new file mode 100644
index 0000000..3d926c0
--- /dev/null
+++ b/new/ui-modules/catalog/config/test/karma.test.shim.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+Error.stackTraceLimit = Infinity;
+
+require('angular');
+require('angular-mocks');
+require('babel-polyfill');
+
+var testsContext = require.context('./../../app', true, /\.spec\.js$/);
+testsContext.keys().forEach(testsContext);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/config/test/protractor.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/config/test/protractor.config.js b/new/ui-modules/catalog/config/test/protractor.config.js
new file mode 100644
index 0000000..5274c81
--- /dev/null
+++ b/new/ui-modules/catalog/config/test/protractor.config.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+exports.config = {
+ framework: 'jasmine2',
+ seleniumAddress: 'http://localhost:4444/wd/hub',
+ specs: ['../../app/**/*.e2e-spec.js'],
+ baseUrl: 'http://admin:password@localhost:8080',
+ capabilities: {
+ 'browserName': 'chrome',
+ 'chromeOptions': {
+ 'args': ['--window-size=1440,1000']
+ }
+ },
+ onPrepare: function () {
+ require('babel-register');
+ },
+ jasmineNodeOpts: {
+ // If true, print colors to the terminal.
+ showColors: true,
+ // Default time to wait in ms before a test fails.
+ defaultTimeoutInterval: 30000
+ }
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/package.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/package.json b/new/ui-modules/catalog/package.json
new file mode 100644
index 0000000..799b47f
--- /dev/null
+++ b/new/ui-modules/catalog/package.json
@@ -0,0 +1,103 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you under the Apache License, Version 2.0 (the",
+ "\"License\"); you may not use this file except in compliance",
+ "with the License. You may obtain a copy of the License at",
+ " http://www.apache.org/licenses/LICENSE-2.0",
+ "Unless required by applicable law or agreed to in writing,",
+ "software distributed under the License is distributed on an",
+ "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
+ "KIND, either express or implied. See the License for the",
+ "specific language governing permissions and limitations",
+ "under the License."
+ ],
+ "name": "brooklyn-ui-catalog",
+ "versionBuildNote": "BROOKLYN_VERSION_BELOW this exists so scripts update this automatically",
+ "version": "1.0.0-SNAPSHOT",
+ "description": "Brooklyn UI :: Modules - Catalog",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/brooklyn-ui.git"
+ },
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "rimraf dist && webpack --config ./config/build/webpack.config.js --bail",
+ "start": "node ./config/server.js",
+ "test": "karma start ./config/test/karma.config.js",
+ "lint": "./node_modules/.bin/eslint app/**/*.js",
+ "e2e": "protractor ./config/test/protractor.config.js"
+ },
+ "engines": {
+ "node": ">=8.0.0",
+ "npm": ">=5.0.0"
+ },
+ "brooklyn": {
+ "appname": "Catalog"
+ },
+ "dependencies": {
+ "brooklyn-ui-utils": "file:../utils",
+ "angular": "^1.6.1",
+ "angular-animate": "^1.6.1",
+ "angular-cookies": "^1.6.1",
+ "angular-resource": "^1.6.1",
+ "angular-ui-bootstrap": "^2.5.0",
+ "angular-ui-router": "^0.3.1",
+ "bootstrap": "^3.3.7",
+ "es6-promise": "^4.0.5",
+ "font-awesome": "^4.6.3",
+ "isomorphic-fetch": "^2.2.1",
+ "lodash": "^4.16.4",
+ "normalizr": "^2.2.1"
+ },
+ "devDependencies": {
+ "angular-mocks": "^1.6.1",
+ "autoprefixer": "^6.5.1",
+ "babel-core": "^6.17.0",
+ "babel-loader": "^6.2.5",
+ "babel-polyfill": "^6.20.0",
+ "babel-preset-env": "^1.6.0",
+ "babel-preset-stage-0": "^6.16.0",
+ "css-loader": "^0.25.0",
+ "dotenv": "^2.0.0",
+ "ejs": "^2.5.2",
+ "ejs-html-loader": "^2.0.2",
+ "ejs-loader": "^0.3.0",
+ "eslint": "^3.8.1",
+ "exports-loader": "^0.6.3",
+ "expose-loader": "^0.7.1",
+ "express": "^4.14.0",
+ "extract-text-webpack-plugin": "^1.0.1",
+ "file-loader": "^0.9.0",
+ "html-loader": "^0.4.4",
+ "html-webpack-plugin": "^2.22.0",
+ "image-webpack-loader": "^3.0.0",
+ "imports-loader": "^0.6.5",
+ "jasmine-core": "^2.5.2",
+ "karma": "^1.3.0",
+ "karma-jasmine": "^1.0.2",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sourcemap-loader": "^0.3.7",
+ "karma-webpack": "^1.8.0",
+ "less": "^2.7.1",
+ "less-loader": "^2.2.3",
+ "less-vars-to-js": "^1.1.2",
+ "phantomjs-prebuilt": "^2.1.13",
+ "postcss-loader": "^1.0.0",
+ "properties-reader": "0.0.15",
+ "proxy-middleware": "^0.15.0",
+ "raw-loader": "^0.5.1",
+ "resolve-url-loader": "^1.6.0",
+ "rimraf": "^2.5.4",
+ "style-loader": "^0.13.1",
+ "url": "^0.11.0",
+ "url-loader": "^0.5.7",
+ "webpack": "^1.13.2",
+ "webpack-dev-middleware": "^1.8.4",
+ "webpack-hot-middleware": "^2.13.0"
+ }
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/pom.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/pom.xml b/new/ui-modules/catalog/pom.xml
new file mode 100644
index 0000000..015240a
--- /dev/null
+++ b/new/ui-modules/catalog/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>brooklyn-ui-modules-parent</artifactId>
+ <groupId>org.apache.brooklyn.ui.modules</groupId>
+ <version>${revision}</version>
+ </parent>
+
+ <artifactId>brooklyn-ui-catalog</artifactId>
+ <packaging>war</packaging>
+ <name>Brooklyn UI :: Modules - Catalog</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>dist</directory>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <!-- here the phase you need -->
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/${project.artifactId}-${project.version}
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/dist</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <!-- configure plugin to generate MANIFEST.MF
+ adapted from http://blog.knowhowlab.org/2010/06/osgi-tutorial-from-project-structure-to.html -->
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <supportedProjectTypes>
+ <supportedProjectType>war</supportedProjectType>
+ <supportedProjectType>jar</supportedProjectType>
+ <supportedProjectType>bundle</supportedProjectType>
+ </supportedProjectTypes>
+ <instructions>
+ <Bundle-ManifestVersion>${project.version}</Bundle-ManifestVersion>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ org.apache.brooklyn.ui.modularity.module.api,
+ org.eclipse.jetty.servlets,
+ *
+ </Import-Package>
+ <Export-Package>
+ !*
+ </Export-Package>
+ <Web-ContextPath>/${project.artifactId}</Web-ContextPath>
+ <_wab>app</_wab>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/src/main/resources/ui-module/config.yaml
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/src/main/resources/ui-module/config.yaml b/new/ui-modules/catalog/src/main/resources/ui-module/config.yaml
new file mode 100644
index 0000000..73f5ace
--- /dev/null
+++ b/new/ui-modules/catalog/src/main/resources/ui-module/config.yaml
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name: Catalog
+slug: ${project.artifactId}
+icon: fa-book
+types:
+- home-ui-module
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/catalog/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/catalog/src/main/webapp/WEB-INF/web.xml b/new/ui-modules/catalog/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..2ff2d15
--- /dev/null
+++ b/new/ui-modules/catalog/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,64 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <description>Brooklyn Catalog</description>
+ <display-name>Brooklyn Catalog</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <listener>
+ <listener-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleListener</listener-class>
+ </listener>
+
+ <!--FILTERS :: START-->
+ <filter>
+ <filter-name>ui-module-filter</filter-name>
+ <filter-class>org.apache.brooklyn.ui.modularity.module.api.UiModuleFilter</filter-class>
+ <init-param>
+ <param-name>Cache-Control</param-name>
+ <param-value>public, max-age=604800</param-value><!--Cache static content for 1 week-->
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>GzipFilter</filter-name>
+ <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
+ <init-param>
+ <param-name>mimeTypes</param-name>
+ <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,image/svg+xml</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ui-module-filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>GzipFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!--FILTERS :: END-->
+
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/features/README.md
----------------------------------------------------------------------
diff --git a/new/ui-modules/features/README.md b/new/ui-modules/features/README.md
new file mode 100644
index 0000000..0b295d0
--- /dev/null
+++ b/new/ui-modules/features/README.md
@@ -0,0 +1,28 @@
+This builds a KAR archive for simplified installation into a Karaf container (Brooklyn).
+Simply copy the resulting `target/*.kar` file to the `deploy/` folder of Brooklyn.
+Alternatively in a Karaf shell, run `kar:install URL` pointing at the KAR.
+
+(All the above assume `noAutoRefreshBundles=true` is set in `etc/org.apache.karaf.kar.cfg`.)
+
+The file can be copied to `deploy/` prior to launch, with the result ZIPped up again to
+make a redistributable Brooklyn bundle containing preferred branding. If using RPM or DEB
+you may need to make an additional package or step to install this KAR file.)
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/features/pom.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/features/pom.xml b/new/ui-modules/features/pom.xml
new file mode 100644
index 0000000..d8b5aa2
--- /dev/null
+++ b/new/ui-modules/features/pom.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>brooklyn-ui-modules-parent</artifactId>
+ <groupId>org.apache.brooklyn.ui.modules</groupId>
+ <version>${revision}</version>
+ </parent>
+
+ <artifactId>brooklyn-ui-modules-features</artifactId>
+ <packaging>kar</packaging>
+ <name>Brooklyn UI :: Modules - Features</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.karaf.features</groupId>
+ <artifactId>framework</artifactId>
+ <version>${karaf.version}</version>
+ <type>kar</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.features</groupId>
+ <artifactId>standard</artifactId>
+ <classifier>features</classifier>
+ <version>${karaf.version}</version>
+ <type>xml</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.brooklyn</groupId>
+ <artifactId>brooklyn-features</artifactId>
+ <version>${brooklyn.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.brooklyn.ui.modularity</groupId>
+ <artifactId>brooklyn-ui-modularity-features</artifactId>
+ <version>${brooklyn.ui.modularity.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.karaf.tooling</groupId>
+ <artifactId>karaf-maven-plugin</artifactId>
+ <configuration>
+ <startLevel>100</startLevel>
+ <aggregateFeatures>true</aggregateFeatures>
+ <resolver>(obr)</resolver>
+ </configuration>
+ <executions>
+ <execution>
+ <id>verify-brooklyn-ui-modules-feature</id>
+ <phase>test</phase>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <distribution>org.apache.karaf.features:framework</distribution>
+ <framework><!--REQUIRED FEATURES-->
+ <feature>framework</feature>
+ <feature>aries-blueprint</feature>
+ <feature>config</feature>
+ <feature>feature</feature>
+ <feature>service</feature>
+ <feature>ssh</feature>
+ <feature>system</feature>
+ <feature>wrap</feature>
+ <feature>brooklyn-osgi-launcher</feature>
+ <feature>brooklyn-rest-resources</feature>
+ <feature>brooklyn-ui-modularity</feature>
+ </framework>
+ <features><!--FEATURES TO VERIFY-->
+ <feature>brooklyn-ui-modules</feature>
+ </features>
+ <descriptors>
+ <descriptor>mvn:org.apache.karaf.features/framework/${karaf.version}/xml/features</descriptor>
+ <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
+ <descriptor>mvn:org.apache.brooklyn/brooklyn-features/${brooklyn.version}/xml/features</descriptor>
+ <descriptor>file:${project.basedir}/../../modularity-server/features/target/feature/feature.xml</descriptor>
+ <descriptor>file:${project.build.directory}/feature/feature.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/features/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/new/ui-modules/features/src/main/feature/feature.xml b/new/ui-modules/features/src/main/feature/feature.xml
new file mode 100644
index 0000000..bed9aff
--- /dev/null
+++ b/new/ui-modules/features/src/main/feature/feature.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="org.apache.brooklyn.ui.modules.brooklyn-ui-modules-${project.version}">
+
+ <!-- do NOT set the repo; it forces other items to come from this version, which we don't want
+ if are installing a custom KAR for the UI Modules (wars) on top of a release version of Brooklyn;
+ instead rely on `brooklyn-ui-features/` to load the dependent features from here so they can be installed
+ <repository>mvn:${project.groupId}/brooklyn-ui-modularity-features/${project.version}/xml/features</repository>
+ -->
+
+ <feature name="brooklyn-ui-modules" version="${project.version}">
+ <feature>brooklyn-ui-home</feature>
+ <feature>brooklyn-ui-logout</feature>
+
+ <feature>brooklyn-ui-app-inspector</feature>
+ <feature>brooklyn-ui-blueprint-composer</feature>
+ <feature>brooklyn-ui-blueprint-importer</feature>
+ <feature>brooklyn-ui-catalog</feature>
+ <feature>brooklyn-ui-groovy-console</feature>
+ <feature>brooklyn-ui-location-manager</feature>
+ <feature>brooklyn-ui-rest-api-docs</feature>
+ </feature>
+
+ <feature name="brooklyn-ui-home" version="${project.version}">
+ <feature dependency="true">brooklyn-ui-moularity</feature>
+ <bundle>mvn:${project.groupId}/brooklyn-ui-home/${project.version}/war</bundle>
+ </feature>
+
+ <feature name="brooklyn-ui-logout" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-logout/${project.version}/war</bundle>
+ </feature>
+
+ <feature name="brooklyn-ui-app-inspector" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-app-inspector/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-blueprint-composer" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-blueprint-composer/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-blueprint-importer" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-blueprint-importer/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-catalog" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-catalog/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-groovy-console" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-groovy-console/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-location-manager" version="${project.version}">
+ <feature dependency="true">brooklyn-ui-location-metadata</feature>
+ <bundle>mvn:${project.groupId}/brooklyn-ui-location-manager/${project.version}/war</bundle>
+ </feature>
+ <feature name="brooklyn-ui-rest-api-docs" version="${project.version}">
+ <bundle>mvn:${project.groupId}/brooklyn-ui-rest-api-docs/${project.version}/war</bundle>
+ </feature>
+
+</features>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/.babelrc
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/.babelrc b/new/ui-modules/groovy-console/.babelrc
new file mode 100644
index 0000000..222c2ba
--- /dev/null
+++ b/new/ui-modules/groovy-console/.babelrc
@@ -0,0 +1,6 @@
+{
+ "presets": [
+ "env",
+ "stage-0"
+ ]
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/.eslintrc.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/.eslintrc.json b/new/ui-modules/groovy-console/.eslintrc.json
new file mode 100644
index 0000000..c4fe470
--- /dev/null
+++ b/new/ui-modules/groovy-console/.eslintrc.json
@@ -0,0 +1,52 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you under the Apache License, Version 2.0 (the",
+ "\"License\"); you may not use this file except in compliance",
+ "with the License. You may obtain a copy of the License at",
+
+ " http://www.apache.org/licenses/LICENSE-2.0",
+
+ "Unless required by applicable law or agreed to in writing,",
+ "software distributed under the License is distributed on an",
+ "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
+ "KIND, either express or implied. See the License for the",
+ "specific language governing permissions and limitations",
+ "under the License."
+ ],
+ "extends": "google",
+ "rules": {
+ "indent": [
+ "error",
+ 4
+ ],
+ "max-len": [
+ "warn",
+ 120
+ ],
+ "space-before-function-paren": [
+ "error",
+ "always"
+ ],
+ "sort-imports": [
+ "error",
+ {
+ "ignoreCase": false,
+ "ignoreMemberSort": false,
+ "memberSyntaxSortOrder": [
+ "none",
+ "all",
+ "multiple",
+ "single"
+ ]
+ }
+ ],
+ "quotes": [
+ "error",
+ "single"
+ ]
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/.npmrc
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/.npmrc b/new/ui-modules/groovy-console/.npmrc
new file mode 100644
index 0000000..c595d19
--- /dev/null
+++ b/new/ui-modules/groovy-console/.npmrc
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+package-lock=false
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/Makefile
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/Makefile b/new/ui-modules/groovy-console/Makefile
new file mode 100755
index 0000000..c7cb424
--- /dev/null
+++ b/new/ui-modules/groovy-console/Makefile
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+default: dev
+
+build:
+ @echo "Building production bundle..."
+ NODE_ENV="production" npm run build
+
+clean:
+ @echo "Cleaning modules..."
+ @rm -rf ./node_modules
+
+dev:
+ @echo "Starting dev web server..."
+ @npm start
+
+server: build
+ @echo "Starting api proxy server..."
+ NODE_ENV="production" npm start
+
+install:
+ @echo "Installing npm modules..."
+ @npm install
+
+test:
+ @echo "Running tests..."
+ @npm test
+
+setup: clean install
+
+war:
+ @mvn clean install
+
+.PHONY: build clean deploy dev install server setup test war
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/index.e2e-spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/index.e2e-spec.js b/new/ui-modules/groovy-console/app/index.e2e-spec.js
new file mode 100644
index 0000000..7c63466
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/index.e2e-spec.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+const request = require('request');
+
+const APP_NAME = 'Groovy console';
+
+describe('App Shell', ()=> {
+ browser.get('./');
+ browser.waitForAngular();
+
+ describe('metadata', ()=> {
+ it('should have the correct title', ()=> {
+ expect(browser.getTitle()).toEqual('Brooklyn - ' + APP_NAME);
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/index.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/index.html b/new/ui-modules/groovy-console/app/index.html
new file mode 100644
index 0000000..f2bdf4c
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/index.html
@@ -0,0 +1,39 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8"/>
+ <meta http-equiv="x-ua-compatible" content="ie=edge"/>
+ <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>
+ <link rel="icon" type="image/png" href="${require('!!file-loader!<%= brand.product.favicon %>')}"/>
+ <title><%= getBrandedText('product.name') %> - <%= app.appname %></title>
+ </head>
+ <body ng-app="app" br-server-status ng-strict-di>
+ ${require('ejs-html!brooklyn-shared/partials/header.html')}
+
+ <main class="page-main-area" id="main-content" ui-view ng-cloak></main>
+
+ ${require('ejs-html!brooklyn-shared/partials/footer.html')}
+
+ <br-interstitial-spinner event-count="1">
+ ${require('ejs-html!brooklyn-shared/partials/interstitial.html')}
+ </br-interstitial-spinner>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/index.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/index.js b/new/ui-modules/groovy-console/app/index.js
new file mode 100644
index 0000000..c3c3f67
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/index.js
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import angular from 'angular';
+import ngAnimate from 'angular-animate';
+import ngCookies from 'angular-cookies';
+import uiRouter from 'angular-ui-router';
+
+import brCore from 'brooklyn-ui-utils/br-core/br-core';
+
+import brServerStatus from 'brooklyn-ui-utils/server-status/server-status';
+import brInterstitialSpinner from 'brooklyn-ui-utils/interstitial-spinner/interstitial-spinner';
+import brooklynModuleLinks from 'brooklyn-ui-utils/module-links/module-links';
+import brooklynUserManagement from 'brooklyn-ui-utils/user-management/user-management';
+
+import mainState from 'views/main/main.controller';
+
+const IS_PRODUCTION = process.env.NODE_ENV === 'production' || false;
+
+angular.module('app', [ngAnimate, ngCookies, uiRouter, brCore, brServerStatus, brInterstitialSpinner, brooklynModuleLinks, brooklynUserManagement, mainState])
+ .config(['$logProvider', '$compileProvider', appConfig])
+ .config(['$urlRouterProvider', '$stateProvider', routerConfig])
+ .run(['$rootScope', '$state', 'brSnackbar', errorHandler])
+ .run(['$http', httpConfig]);
+
+function appConfig($logProvider, $compileProvider) {
+ $logProvider.debugEnabled(!IS_PRODUCTION);
+ $compileProvider.debugInfoEnabled(!IS_PRODUCTION);
+}
+
+function routerConfig($urlRouterProvider) {
+ $urlRouterProvider.otherwise('/');
+}
+
+function errorHandler($rootScope, $state, brSnackbar) {
+ $rootScope.$on('$stateChangeError', (event, toState, toParams, fromState, fromParams, error) => {
+ // Add error handling here
+ });
+}
+
+function httpConfig($http) {
+ $http.defaults.headers.common['X-Csrf-Token-Required-For-Requests'] = 'write'; //Enables XSRF
+ // Add further $http config here
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/index.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/index.less b/new/ui-modules/groovy-console/app/index.less
new file mode 100644
index 0000000..8e43522
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/index.less
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+@import '~brooklyn-shared/style/first.less';
+
+// Add project less files here
+@import "views/main/main.less";
+
+// Load last so that these style rules and var values trump others
+@import "~brooklyn-shared/style/last.less";
+
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/index.spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/index.spec.js b/new/ui-modules/groovy-console/app/index.spec.js
new file mode 100644
index 0000000..b3ca4a1
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/index.spec.js
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+describe('Groovy console module', () => {
+ it('has a dummy unit test', () => {
+ expect(true).toBeTruthy();
+ });
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/views/main/main.controller.e2e-spec.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/views/main/main.controller.e2e-spec.js b/new/ui-modules/groovy-console/app/views/main/main.controller.e2e-spec.js
new file mode 100644
index 0000000..a7500ba
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/views/main/main.controller.e2e-spec.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+describe('Brooklyn brooklyn-ui-groovy :: groovyview view', ()=> {
+ let EC = protractor.ExpectedConditions;
+ let appLoadCondition = EC.stalenessOf(element(by.tagName('interstitial-spinner')));
+
+ describe('should do', ()=> {
+ browser.get('./');
+ browser.waitForAngular();
+ browser.wait(appLoadCondition, 5000);
+
+ it('something really useful', ()=> {
+ // This is an example of e2e test. It uses jasmine (http://jasmine.github.io/) syntax to define all tests to run.
+ });
+ })
+});
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/views/main/main.controller.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/views/main/main.controller.js b/new/ui-modules/groovy-console/app/views/main/main.controller.js
new file mode 100644
index 0000000..552e648
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/views/main/main.controller.js
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import angular from 'angular';
+import groovyEditor from 'brooklyn-ui-utils/groovy-editor/groovy-editor.directive';
+import scriptApi from 'brooklyn-ui-utils/api/brooklyn/script';
+import uiRouter from 'angular-ui-router';
+import {HIDE_INTERSTITIAL_SPINNER_EVENT} from 'brooklyn-ui-utils/interstitial-spinner/interstitial-spinner';
+import template from './main.template.html';
+
+const MODULE_NAME = 'states.groovy-view';
+
+angular.module(MODULE_NAME, [groovyEditor, scriptApi, uiRouter])
+ .config(['$stateProvider', mainStateConfig]);
+
+export default MODULE_NAME;
+
+export const mainState = {
+ name: 'main',
+ url: '/',
+ template: template,
+ controller: ['$scope', 'scriptApi', mainStateController],
+ controllerAs: 'vm'
+};
+
+export function mainStateConfig($stateProvider) {
+ $stateProvider.state(mainState);
+}
+
+export function mainStateController($scope, scriptApi) {
+ $scope.$emit(HIDE_INTERSTITIAL_SPINNER_EVENT);
+ // Controller code goes here
+
+ $scope.loadExample = loadExample;
+ $scope.submitCode = submitCode;
+ $scope.codeToRun = "";
+ $scope.problemText = "";
+ $scope.resultText = "";
+ $scope.stdout = "";
+ $scope.stderr = "";
+ $scope.hideResults = true;
+ $scope.disableSubmit = false;
+
+ function loadExample() {
+ $scope.codeToRun =
+ 'import static org.apache.brooklyn.core.entity.Entities.*\n' +
+ '\n' +
+ 'println "Last result: "+last\n' +
+ 'data.exampleRunCount = (data.exampleRunCount ?: 0) + 1\n' +
+ 'println "Example run count: ${data.exampleRunCount}"\n' +
+ '\n' +
+ 'println "Application count: ${mgmt.applications.size()}\\n"\n' +
+ '\n' +
+ 'mgmt.applications.each { dumpInfo(it) }\n' +
+ '\n' +
+ 'return mgmt.applications\n';
+ $scope.hideResults = true;
+ $scope.disableSubmit = false;
+ }
+
+ function submitCode() {
+ $scope.hideResults = true;
+ $scope.disableSubmit = true;
+ scriptApi.runGroovyScript($scope.codeToRun).then(function (success) {
+ $scope.resultText = success.result || "";
+ $scope.problemText = success.problem || "";
+ $scope.stdout = success.stdout || "";
+ $scope.stderr = success.stderr || "";
+ }, function (error) {
+ $scope.resultText = error.status || "no status";
+ $scope.problemText = error.error || "no error message";
+ $scope.stdout = "";
+ $scope.stderr = "";
+ }).finally(() => {
+ $scope.hideResults = false;
+ $scope.disableSubmit = false;
+ });
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/views/main/main.less
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/views/main/main.less b/new/ui-modules/groovy-console/app/views/main/main.less
new file mode 100644
index 0000000..831d55c
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/views/main/main.less
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+@import "~codemirror/lib/codemirror.css";
+
+.groovy-card {
+ color: @brand-primary;
+
+ .groovy-title {
+ padding: 10px;
+ font-size: 24px;
+ }
+ .groovy-description {
+ padding: 10px;
+ font-size: 18px;
+ }
+ .groovy-link {
+ padding: 10px;
+ .link-name {
+ font-size: 16px;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ }
+ .groovy-text {
+ margin: 10px;
+ padding: 10px;
+ min-width: 80%;
+ min-height: 100px;
+ font-family: 'DejaVu Sans Mono', monospace;
+ }
+
+ .groovy-button {
+ margin: 10px;
+ }
+}
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/app/views/main/main.template.html
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/app/views/main/main.template.html b/new/ui-modules/groovy-console/app/views/main/main.template.html
new file mode 100644
index 0000000..87e524e
--- /dev/null
+++ b/new/ui-modules/groovy-console/app/views/main/main.template.html
@@ -0,0 +1,43 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<div class="groovy-card">
+ <p class="groovy-title">Instructions</p>
+ <p class="groovy-description">Enter Groovy/Java code to run on the server.</p>
+ <ul>
+ <li><code>mgmt</code> is the management context</li>
+ <li><code>last</code> is the result of your last successful script</li>
+ <li><code>data</code> is user-session map for storing your data</li>
+ </ul>
+ <a class="groovy-link" ng-click="loadExample()">Click to load an example.</a>
+ <div class="groovy-text"><groovy-editor value="codeToRun" ng-click="hideResults = true;"></groovy-editor></div>
+ <br-button class="btn-primary groovy-button" on-click="submitCode()" ng-disabled="disableSubmit">Submit</br-button>
+</div>
+<div class="groovy-card" ng-hide="hideResults">
+ <p class="groovy-description">Error:</p>
+ <textarea class="groovy-text" readonly="readonly" placeholder="no details available">{{problemText}}</textarea>
+
+ <p class="groovy-description">Result:</p>
+ <textarea class="groovy-text" readonly="readonly" placeholder="no details available">{{resultText}}</textarea>
+
+ <p class="groovy-description">Output (stdout):</p>
+ <textarea class="groovy-text" readonly="readonly" placeholder="no output available">{{stdout}}</textarea>
+
+ <p class="groovy-description">Output (stderr):</p>
+ <textarea class="groovy-text" readonly="readonly" placeholder="no output available">{{stderr}}</textarea>
+</div>
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/config/build/webpack.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/config/build/webpack.config.js b/new/ui-modules/groovy-console/config/build/webpack.config.js
new file mode 100644
index 0000000..a050fa9
--- /dev/null
+++ b/new/ui-modules/groovy-console/config/build/webpack.config.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+eval(require('fs').readFileSync('../shared/config/build/webpack.config.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/config/server.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/config/server.js b/new/ui-modules/groovy-console/config/server.js
new file mode 100644
index 0000000..dfba7dc
--- /dev/null
+++ b/new/ui-modules/groovy-console/config/server.js
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+eval(require('fs').readFileSync('../shared/config/server.js')+'');
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/config/test/karma.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/config/test/karma.config.js b/new/ui-modules/groovy-console/config/test/karma.config.js
new file mode 100644
index 0000000..80375c8
--- /dev/null
+++ b/new/ui-modules/groovy-console/config/test/karma.config.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+const PRODUCTION_BUILD = process.env.NODE_ENV === 'production';
+const webpackConfig = require('./../build/webpack.config.js');
+
+module.exports = function (config) {
+ const conf = {
+ basePath: '',
+ frameworks: ['jasmine'],
+ files: [
+ {pattern: './karma.test.shim.js', watched: false}
+ ],
+ preprocessors: {
+ './karma.test.shim.js': ['webpack', 'sourcemap']
+ },
+ webpack: Object.assign({}, webpackConfig, {entry: undefined, plugins: undefined}),
+ webpackMiddleware: {
+ stats: 'errors-only'
+ },
+ webpackServer: {
+ noInfo: true
+ },
+ exclude: [],
+ colors: !PRODUCTION_BUILD,
+ logLevel: config.LOG_INFO,
+ autoWatch: !PRODUCTION_BUILD,
+ singleRun: PRODUCTION_BUILD,
+ reporters: ['progress'],
+ browsers: ['PhantomJS'],
+ plugins: [
+ require('karma-webpack'),
+ require('karma-sourcemap-loader'),
+ 'karma-jasmine',
+ 'karma-phantomjs-launcher'
+ ],
+ failOnEmptyTestSuite: false
+ };
+ config.set(conf);
+};
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/config/test/karma.test.shim.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/config/test/karma.test.shim.js b/new/ui-modules/groovy-console/config/test/karma.test.shim.js
new file mode 100644
index 0000000..3d926c0
--- /dev/null
+++ b/new/ui-modules/groovy-console/config/test/karma.test.shim.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+Error.stackTraceLimit = Infinity;
+
+require('angular');
+require('angular-mocks');
+require('babel-polyfill');
+
+var testsContext = require.context('./../../app', true, /\.spec\.js$/);
+testsContext.keys().forEach(testsContext);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/config/test/protractor.config.js
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/config/test/protractor.config.js b/new/ui-modules/groovy-console/config/test/protractor.config.js
new file mode 100644
index 0000000..5274c81
--- /dev/null
+++ b/new/ui-modules/groovy-console/config/test/protractor.config.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+exports.config = {
+ framework: 'jasmine2',
+ seleniumAddress: 'http://localhost:4444/wd/hub',
+ specs: ['../../app/**/*.e2e-spec.js'],
+ baseUrl: 'http://admin:password@localhost:8080',
+ capabilities: {
+ 'browserName': 'chrome',
+ 'chromeOptions': {
+ 'args': ['--window-size=1440,1000']
+ }
+ },
+ onPrepare: function () {
+ require('babel-register');
+ },
+ jasmineNodeOpts: {
+ // If true, print colors to the terminal.
+ showColors: true,
+ // Default time to wait in ms before a test fails.
+ defaultTimeoutInterval: 30000
+ }
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/29927b73/new/ui-modules/groovy-console/package.json
----------------------------------------------------------------------
diff --git a/new/ui-modules/groovy-console/package.json b/new/ui-modules/groovy-console/package.json
new file mode 100644
index 0000000..d67072a
--- /dev/null
+++ b/new/ui-modules/groovy-console/package.json
@@ -0,0 +1,103 @@
+{
+ "__license__": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you under the Apache License, Version 2.0 (the",
+ "\"License\"); you may not use this file except in compliance",
+ "with the License. You may obtain a copy of the License at",
+ " http://www.apache.org/licenses/LICENSE-2.0",
+ "Unless required by applicable law or agreed to in writing,",
+ "software distributed under the License is distributed on an",
+ "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
+ "KIND, either express or implied. See the License for the",
+ "specific language governing permissions and limitations",
+ "under the License."
+ ],
+ "name": "brooklyn-ui-groovy-console",
+ "versionBuildNote": "BROOKLYN_VERSION_BELOW this exists so scripts update this automatically",
+ "version": "1.0.0-SNAPSHOT",
+ "description": "Brooklyn UI :: Modules - Groovy console",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/brooklyn-ui.git"
+ },
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0",
+ "scripts": {
+ "build": "rimraf dist && webpack --config ./config/build/webpack.config.js --bail",
+ "start": "node ./config/server.js",
+ "test": "karma start ./config/test/karma.config.js",
+ "lint": "./node_modules/.bin/eslint app/**/*.js",
+ "e2e": "protractor ./config/test/protractor.config.js"
+ },
+ "engines": {
+ "node": ">=8.0.0",
+ "npm": ">=5.0.0"
+ },
+ "brooklyn": {
+ "appname": "Groovy console"
+ },
+ "dependencies": {
+ "brooklyn-ui-utils": "file:../utils",
+ "angular": "^1.6.1",
+ "angular-animate": "^1.6.1",
+ "angular-cookies": "^1.6.1",
+ "angular-ui-bootstrap": "^2.5.0",
+ "angular-ui-router": "^0.3.1",
+ "bootstrap": "^3.3.7",
+ "codemirror": "^5.24.2",
+ "es6-promise": "^4.0.5",
+ "font-awesome": "^4.6.3",
+ "isomorphic-fetch": "^2.2.1",
+ "lodash": "^4.16.4",
+ "normalizr": "^2.2.1"
+ },
+ "devDependencies": {
+ "angular-mocks": "^1.6.1",
+ "autoprefixer": "^6.5.1",
+ "babel-core": "^6.17.0",
+ "babel-loader": "^6.2.5",
+ "babel-polyfill": "^6.20.0",
+ "babel-preset-env": "^1.6.0",
+ "babel-preset-stage-0": "^6.16.0",
+ "css-loader": "^0.25.0",
+ "dotenv": "^2.0.0",
+ "ejs": "^2.5.2",
+ "ejs-html-loader": "^2.0.2",
+ "ejs-loader": "^0.3.0",
+ "eslint": "^3.8.1",
+ "exports-loader": "^0.6.3",
+ "expose-loader": "^0.7.1",
+ "express": "^4.14.0",
+ "extract-text-webpack-plugin": "^1.0.1",
+ "file-loader": "^0.9.0",
+ "html-loader": "^0.4.4",
+ "html-webpack-plugin": "^2.22.0",
+ "image-webpack-loader": "^3.0.0",
+ "imports-loader": "^0.6.5",
+ "jasmine-core": "^2.5.2",
+ "karma": "^1.3.0",
+ "karma-jasmine": "^1.0.2",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sourcemap-loader": "^0.3.7",
+ "karma-webpack": "^1.8.0",
+ "less": "^2.7.1",
+ "less-loader": "^2.2.3",
+ "less-vars-to-js": "^1.1.2",
+ "phantomjs-prebuilt": "^2.1.13",
+ "postcss-loader": "^1.0.0",
+ "properties-reader": "0.0.15",
+ "proxy-middleware": "^0.15.0",
+ "raw-loader": "^0.5.1",
+ "resolve-url-loader": "^1.6.0",
+ "rimraf": "^2.5.4",
+ "style-loader": "^0.13.1",
+ "url": "^0.11.0",
+ "url-loader": "^0.5.7",
+ "webpack": "^1.13.2",
+ "webpack-dev-middleware": "^1.8.4",
+ "webpack-hot-middleware": "^2.13.0"
+ }
+}