You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by mw...@apache.org on 2016/07/25 09:36:59 UTC
[22/47] incubator-eagle git commit: EAGLE-316 Feature topology should
not be added into an application add global mark to the topology which avoid
add step in application
EAGLE-316 Feature topology should not be added into an application
add global mark to the topology which avoid add step in application
https://issues.apache.org/jira/browse/EAGLE-316
Author: @zombiej
Reviewer: @qingwen220
Closes #203
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/0a76242d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/0a76242d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/0a76242d
Branch: refs/heads/master
Commit: 0a76242d13c3163acc830877459a89dc20d16f42
Parents: 4ad4b5c
Author: jiljiang <ji...@ebay.com>
Authored: Fri May 27 14:02:39 2016 +0800
Committer: jiljiang <ji...@ebay.com>
Committed: Fri May 27 14:02:39 2016 +0800
----------------------------------------------------------------------
.../webapp/app/public/feature/topology/controller.js | 4 +++-
eagle-webservice/src/main/webapp/app/public/js/app.js | 13 +++++++++----
.../app/public/js/ctrl/configurationController.js | 4 +++-
3 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0a76242d/eagle-webservice/src/main/webapp/app/public/feature/topology/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/topology/controller.js b/eagle-webservice/src/main/webapp/app/public/feature/topology/controller.js
index 776edf7..5504a77 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/topology/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/topology/controller.js
@@ -20,7 +20,9 @@
'use strict';
var featureControllers = angular.module('featureControllers');
- var feature = featureControllers.register("topology");
+ var feature = featureControllers.register("topology", {
+ global: true // Global Feature needn't add to applications
+ });
// ==============================================================
// = Initialization =
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0a76242d/eagle-webservice/src/main/webapp/app/public/js/app.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/app.js b/eagle-webservice/src/main/webapp/app/public/js/app.js
index a31219b..70b4afe 100644
--- a/eagle-webservice/src/main/webapp/app/public/js/app.js
+++ b/eagle-webservice/src/main/webapp/app/public/js/app.js
@@ -51,9 +51,9 @@ var app = {};
var _features = {};
var _services = {};
- var Feature = function(name, version) {
+ var Feature = function(name, config) {
this.name = name;
- this.version = version;
+ this.config = config || {};
this.features = {};
};
@@ -199,8 +199,8 @@ var app = {};
};
// Register
- featureControllers.register = Feature.register = function(featureName) {
- _features[featureName] = _features[featureName] || new Feature(featureName);
+ featureControllers.register = Feature.register = function(featureName, config) {
+ _features[featureName] = _features[featureName] || new Feature(featureName, config);
return _features[featureName];
};
@@ -220,6 +220,11 @@ var app = {};
}
};
+ // Get feature by name
+ Feature.get = function (featureName) {
+ return _features[featureName];
+ };
+
return Feature;
});
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0a76242d/eagle-webservice/src/main/webapp/app/public/js/ctrl/configurationController.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/js/ctrl/configurationController.js b/eagle-webservice/src/main/webapp/app/public/js/ctrl/configurationController.js
index a321ffe..e59198d 100644
--- a/eagle-webservice/src/main/webapp/app/public/js/ctrl/configurationController.js
+++ b/eagle-webservice/src/main/webapp/app/public/js/ctrl/configurationController.js
@@ -111,7 +111,7 @@
});
// ======================== Application ========================
- eagleControllers.controller('configApplicationCtrl', function ($scope, $timeout, PageConfig, Application, Entities, UI) {
+ eagleControllers.controller('configApplicationCtrl', function ($scope, $timeout, PageConfig, Application, Entities, Feature, UI) {
PageConfig.hideApplication = true;
PageConfig.hideSite = true;
$scope._pageLock = false;
@@ -132,6 +132,8 @@
$.each(Application.list, function(i, application) {
var _application = $scope.applications[application.tags.application] = $.extend({}, application, {features: application.features.slice()}, true);
_application.optionalFeatures = $.map(Application.featureList, function(feature) {
+ var featurePlugin = Feature.get(feature.tags.feature);
+ if(featurePlugin.config.global) return null;
if(!common.array.find(feature.tags.feature, _application.features)) {
return feature.tags.feature;
}