From 1118fa766d977c7d0ec6e673abf7c5e7c781b900 Mon Sep 17 00:00:00 2001 From: Neha Gupta Date: Mon, 17 Sep 2018 12:16:13 +0900 Subject: [PATCH] Replaced with the new context selectore Bugzilla: 1629520 tendrl-github-id: https://github.com/Tendrl/ui/issues/1065 --- gulpfile.js | 7 +- package.json | 2 +- src/commons/js/index.js | 4 +- src/commons/services/utils.js | 10 +- src/commons/stores/cluster-store.js | 6 +- src/index.html | 4 +- src/modules/base/header/header.html | 15 +-- src/modules/base/header/header.js | 98 ++++++++++--------- src/modules/base/header/header.scss | 2 +- .../clusters/cluster-hosts/cluster-hosts.js | 4 +- src/modules/hosts/host-list/host-list.js | 1 + .../global-task-detail.html | 2 +- .../global-task-detail/global-task-detail.js | 6 +- src/modules/users/user-list/users.js | 53 +++++----- 14 files changed, 117 insertions(+), 97 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4c7ce605..9ce0a8f0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -94,7 +94,6 @@ gulp.task("jsLibraries", function() { "node_modules/jquery/dist/jquery.min.js", "node_modules/bootstrap/dist/js/bootstrap.min.js", // For dropdown : temporary "node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js", - "node_modules/bootstrap-select/dist/js/bootstrap-select.js", "node_modules/angular/angular.js", "node_modules/angular-ui-bootstrap/dist/ui-bootstrap.min.js", "node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js", @@ -110,7 +109,8 @@ gulp.task("jsLibraries", function() { "node_modules/angular-bootstrap-switch/dist/angular-bootstrap-switch.min.js", "node_modules/angular-patternfly/node_modules/angular-drag-and-drop-lists/angular-drag-and-drop-lists.js", "node_modules/datatables/media/js/jquery.dataTables.js", - "node_modules/angular-patternfly/node_modules/angularjs-datatables/dist/angular-datatables.js" + "node_modules/angular-patternfly/node_modules/angularjs-datatables/dist/angular-datatables.js", + "node_modules/bootstrap-select/dist/js/bootstrap-select.js" ]) .pipe(uglify()) .pipe(concat("libraries.js")) @@ -121,9 +121,8 @@ gulp.task("jsLibraries", function() { gulp.task("cssLibraries", function() { return gulp.src([ "node_modules/patternfly/dist/css/patternfly.css", - "node_modules/patternfly/dist/css/patternfly-additions.css", "node_modules/angular-patternfly/styles/angular-patternfly.css", - "node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" + "node_modules/patternfly/dist/css/patternfly-additions.css" ]) .pipe(postCss([autoprefixer({ browsers: browsers })])) .pipe(buildMode === "dev" ? noop() : minifyCSS()) diff --git a/package.json b/package.json index 4da84056..ba6e0394 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "angular-ui-bootstrap": "~2.2.0", "bootstrap": "^3.3.7", "bootstrap-datepicker": "~1.6.4", - "bootstrap-select": "^1.12.4", + "bootstrap-select": "1.12.2", "bootstrap-tooltip": "~3.1.1", "c3": "~0.4.11", "c3-angular": "git://github.com/jettro/c3-angular-directive#1.3.1", diff --git a/src/commons/js/index.js b/src/commons/js/index.js index fbeee206..6be67184 100755 --- a/src/commons/js/index.js +++ b/src/commons/js/index.js @@ -1,8 +1,8 @@ //# sourceURL=storage-management-plugin.js (function() { - var storageModule = angular.module("TendrlModule", ["ui.router", "ui.bootstrap", "frapontillo.bootstrap-switch", "gridshore.c3js.chart", "patternfly.charts", "patternfly.card", "patternfly.form", "patternfly.notification", "patternfly.table", "patternfly.filters", "patternfly.modals"]); - + var storageModule = angular.module("TendrlModule", ["ui.router", "ui.bootstrap", "frapontillo.bootstrap-switch", "patternfly.charts", "patternfly.card", "patternfly.form", "patternfly.notification", "patternfly.table", "patternfly.filters", "patternfly.modals"]); + /* Setting up provider for getting config data */ storageModule.provider("config", function() { diff --git a/src/commons/services/utils.js b/src/commons/services/utils.js index de9000b0..e42c6cb6 100644 --- a/src/commons/services/utils.js +++ b/src/commons/services/utils.js @@ -6,7 +6,7 @@ .service("utils", utils); /*@ngInject*/ - function utils($http, $rootScope, $state, $filter, config, AuthManager, $location) { + function utils($http, $rootScope, $state, $filter, $timeout, $location, config, AuthManager) { /* Cache the reference to this pointer */ var vm = this, @@ -309,5 +309,13 @@ } }; + + vm.refershSelector = function() { + $timeout(function() { + //This will refersh the selectpicker in order to select the correct options + //TODO: Find an alternate way to do it + $(".selectpicker").selectpicker("refresh"); + }); + } }; })(); \ No newline at end of file diff --git a/src/commons/stores/cluster-store.js b/src/commons/stores/cluster-store.js index e3590e8e..199a6b66 100644 --- a/src/commons/stores/cluster-store.js +++ b/src/commons/stores/cluster-store.js @@ -23,6 +23,10 @@ clusterFactory.getClusterList() .then(function(data) { $rootScope.clusterData = store.formatClusterData(data.clusters); + + //Required to make the event listen in header.js file + $rootScope.$broadcast("GotClusterData", $rootScope.clusterData); + deferred.resolve($rootScope.clusterData); }).catch(function(e) { deferred.reject(e); @@ -328,4 +332,4 @@ } } -})(); +})(); \ No newline at end of file diff --git a/src/index.html b/src/index.html index e6e44979..ef9b5cce 100755 --- a/src/index.html +++ b/src/index.html @@ -8,8 +8,6 @@ Tendrl - - @@ -38,4 +36,4 @@

Tendrl API is not reachable.

--> - + \ No newline at end of file diff --git a/src/modules/base/header/header.html b/src/modules/base/header/header.html index 1de482f9..f98ea542 100644 --- a/src/modules/base/header/header.html +++ b/src/modules/base/header/header.html @@ -1,4 +1,4 @@ -