diff --git a/client/cat3/main.html b/client/cat3/main.html index 47e20ce9d..da9406da0 100644 --- a/client/cat3/main.html +++ b/client/cat3/main.html @@ -112,7 +112,6 @@ - diff --git a/client/cat3/src/clientRoutes.js b/client/cat3/src/clientRoutes.js index 527ec017d..fca4c6c1e 100644 --- a/client/cat3/src/clientRoutes.js +++ b/client/cat3/src/clientRoutes.js @@ -36,6 +36,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe url: "/workzone", templateUrl: "src/partials/sections/dashboard/workzone/workzone.html", controller: "workzoneCtrl", + params:{filterView:{workzone:true}}, onEnter: function () { }, onExit: function () { @@ -57,6 +58,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe url: "/design", templateUrl: "src/partials/sections/dashboard/design/design.html", controller: "designCtrl as desCtrl", + params:{filterView:{design:true}}, resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); @@ -74,6 +76,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe url: "/analytics/", templateUrl: "src/partials/sections/dashboard/analytics/analytics.html", controller: "analyticsCtrl as analytic", + params:{filterView:{analytics:true}}, resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); @@ -92,6 +95,7 @@ function routeConfig($stateProvider, $urlRouterProvider, $httpProvider, modulePe url: "/bots", templateUrl: "src/partials/sections/dashboard/bots/bots.html", controller: "botsCtrl as bts", + params:{filterView:{bots:true}}, resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); diff --git a/client/cat3/src/main.js b/client/cat3/src/main.js index ae79ed6fd..55ec51ab8 100644 --- a/client/cat3/src/main.js +++ b/client/cat3/src/main.js @@ -101,6 +101,9 @@ angularApp.controller('HeadNavigatorCtrl', ['$scope', '$rootScope', '$http', '$l $rootScope.analyticsBool = _permSet.analyticsBool; $rootScope.serviceBool = _permSet.serviceBool; }); + $scope.$watch(function() { + $rootScope.moduleSelection = $state.params; + }); $rootScope.$emit('SET_HEADER', $rootScope.appDetails); $scope.showLogoutConfirmationSection = false; $scope.logoutConfirmation = function () { diff --git a/client/cat3/src/partials/globals/header/header.scss b/client/cat3/src/partials/globals/header/header.scss index 481632dd3..e52098f80 100755 --- a/client/cat3/src/partials/globals/header/header.scss +++ b/client/cat3/src/partials/globals/header/header.scss @@ -18,6 +18,10 @@ .cursor { cursor:pointer; } + + .header-selected-item { + color: #40BAF1; + } .header-logo-image { height: 40px; diff --git a/client/cat3/src/partials/globals/header/headerDashboard.html b/client/cat3/src/partials/globals/header/headerDashboard.html index 012caee01..25c5f30bc 100644 --- a/client/cat3/src/partials/globals/header/headerDashboard.html +++ b/client/cat3/src/partials/globals/header/headerDashboard.html @@ -16,13 +16,13 @@
  • - WORKZONE + WORKZONE
  • - DESIGN + DESIGN
  • @@ -35,12 +35,12 @@
  • - ANALYTICS + ANALYTICS
  • - BOTS + BOTS
  • diff --git a/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js index 34b9e2b0a..1249a53f6 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js @@ -13,7 +13,7 @@ url: "/library", templateUrl: "src/partials/sections/dashboard/bots/view/library.html", controller: "libraryCtrl as libr", - params:{filterView:{library:true}}, + parameters:{filterView:{library:true}}, resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); @@ -31,7 +31,7 @@ url: "/audittrail", templateUrl: "src/partials/sections/dashboard/bots/view/audittrail.html", controller: "audittrailCtrl as audit", - params:{filterView:{audittrail:true}}, + parameters:{filterView:{audittrail:true}}, resolve: { auth: ["$q", function ($q) { var deferred = $q.defer(); @@ -49,6 +49,8 @@ }]) .controller('botsCtrl',['$scope', '$rootScope', '$state', function ($scope, $rootScope, $state) { $state.go('dashboard.bots.library'); - $rootScope.stateItems = $state.params; + $scope.$watch(function() { + $rootScope.stateItems = $state.current.name; + }); }]); })(angular); \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/audittrailCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/audittrailCtrl.js index 3ea895ba0..fa65efd2d 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/audittrailCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/audittrailCtrl.js @@ -10,7 +10,7 @@ angular.module('dashboard.bots') .controller('audittrailCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'workzoneServices', 'toastr', 'workzoneUIUtils', '$modal', function ($scope, $rootScope, $state, genSevs, confirmbox, workzoneServices, toastr, workzoneUIUtils, $modal) { - var treeNames = ['Bots','Audit Trail']; + var treeNames = ['BOTs','Audit Trail']; $rootScope.$emit('treeNameUpdate', treeNames); var audit=this; audit.gridOptions={ @@ -30,7 +30,7 @@ 'row.entity.taskType'+ 'row.entity.auditTrailConfig.executionType'+ 'row.entity.botType',cellTooltip: true}, - { name: 'BOT Name',displayName: 'BOT Name',field:'auditTrailConfig.name'}, + { name: 'BOT Name',displayName: 'BOT Name',field:'auditTrailConfig.name',cellTooltip: true}, { name: 'Status',field:'status', cellTemplate:'' + '' + diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js index 2ffd2c656..e93bb2371 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -9,7 +9,7 @@ "use strict"; angular.module('dashboard.bots') .controller('libraryCtrl',['$scope', '$rootScope', '$state', 'genericServices', 'confirmbox', 'toastr', 'workzoneUIUtils', '$modal', function ($scope, $rootScope, $state, genSevs, confirmbox, toastr, workzoneUIUtils, $modal) { - var treeNames = ['Bots','Library']; + var treeNames = ['BOTs','Library']; $rootScope.$emit('treeNameUpdate', treeNames); var lib=this; $scope.totalBotsSelected = true; @@ -25,16 +25,18 @@ 'row.entity.taskType'+ 'row.entity.taskType'+ 'row.entity.botType',cellTooltip: true}, - { name: 'BOT Type',displayName: 'BOT Type',field:'botType'}, - { name: 'BOT Name',displayName: 'BOT Name',field:'name'}, - { name: 'Category',field:'botCategory'}, - { name: 'description',field:'shortDesc'}, + { name: 'BOT Type',displayName: 'BOT Type',field:'botType',cellTooltip: true}, + { name: 'BOT Name',displayName: 'BOT Name',field:'name',cellTooltip: true}, + { name: 'Category',field:'botCategory',cellTooltip: true}, + { name: 'description',field:'shortDesc',cellTooltip: true}, { name: 'Total Runs',field:'executionCount'}, { name: 'BOT History',displayName: 'BOT History',cellTemplate:'NA'+ ''}, { name: 'BOT Info',displayName: 'BOT Info',cellTemplate: ''}, - { name: 'BOT Action',displayName: 'BOT Action',cellTemplate:'' + + { name: 'BOT Action',displayName: 'BOT Action',cellTemplate: + '' + + '' + '' + '' } @@ -72,6 +74,46 @@ console.log('Modal Dismissed at ' + new Date()); }); }; + $scope.botSchedule = function() { + $modal.open({ + templateUrl: 'src/partials/sections/dashboard/bots/view/botSchedule.html', + controller: 'botScheduleCtrl', + backdrop: 'static', + keyboard: false, + resolve: { + items: function () { + return { + chefJenkScriptTaskObj:$scope.chefJenkScriptTaskObj, + type:$scope.type + } + } + } + }).result.then(function (chefEventDetails) { + $scope.isEventAvailable = true; + $scope.chefJenkScriptTaskObj = chefEventDetails; + var startTimeMinute,startTimeHour,dayOfWeek,selectedDayOfTheMonth,selectedMonth; + startTimeMinute = $scope.chefJenkScriptTaskObj.startTimeMinute; + startTimeHour = $scope.chefJenkScriptTaskObj.startTime; + dayOfWeek = $scope.chefJenkScriptTaskObj.dayOfWeek; + selectedDayOfTheMonth = $scope.chefJenkScriptTaskObj.selectedDayOfTheMonth; + selectedMonth = $scope.chefJenkScriptTaskObj.monthOfYear; + $scope.type = 'edit'; + $scope._isEventSelected = true; + + $scope.repeatPattern = 'Repeat Every -' + $scope.chefJenkScriptTaskObj.repeats; + $scope.cronDetails = { + cronStartOn : $scope.chefJenkScriptTaskObj.cronStart, + cronEndOn : $scope.chefJenkScriptTaskObj.cronEnd, + cronRepeatEvery : $scope.chefJenkScriptTaskObj.repeatBy, + cronFrequency: $scope.chefJenkScriptTaskObj.repeats, + cronTime: typeof startTimeHour !=='undefined'? startTimeHour : new Date().getHours() + ':' + typeof startTimeMinute !=='undefined'? startTimeMinute:new Date().getMinutes(), + cronDays: $scope.chefJenkScriptTaskObj.dayOfWeek, + cronMonth: $scope.chefJenkScriptTaskObj.monthOfYear + } + }, function () { + console.log('Dismiss time is ' + new Date()); + }); + }; $scope.deleteBotTask = function(task) { var modalOptions = { closeButtonText: 'Cancel', @@ -215,5 +257,92 @@ $scope.cancel= function() { $modalInstance.dismiss('cancel'); }; + }]).controller('botScheduleCtrl',['$scope', '$rootScope', 'genericServices', 'workzoneServices', 'toastr', '$modalInstance', 'items', '$timeout', function ($scope, $rootScope, genSevs, workzoneServices, toastr, $modalInstance, items, $timeout) { + console.log(items); + $scope.defaultSelection = function() { + $scope.repeatsType = 'Minutes';//default selection. + $scope.schedulerStartOn=moment(new Date()).format('MM/DD/YYYY'); + $scope.schedulerEndOn=moment(new Date()).format('MM/DD/YYYY'); + }; + if(items.type !== 'new'){ + if(items.chefJenkScriptTaskObj !==undefined){ + if(items.chefJenkScriptTaskObj.cronStartOn && items.chefJenkScriptTaskObj.cronEndOn) { + var newStartOn = parseInt(items.chefJenkScriptTaskObj.cronStartOn); + var newDate = new Date(newStartOn).toLocaleDateString(); + var datearray = newDate.split("/"); + var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2]; + $scope.schedulerStartOn = newdate; + var newEndOn = parseInt(items.chefJenkScriptTaskObj.cronEndOn); + var newEndData = new Date(newEndOn).toLocaleDateString(); + var datearrayNew = newEndData.split("/"); + var newdateEnd = datearrayNew[1] + '/' + datearrayNew[0] + '/' + datearrayNew[2]; + $scope.schedulerEndOn = newdateEnd; + } else { + $scope.schedulerStartOn = items.chefJenkScriptTaskObj.cronStart; + $scope.schedulerEndOn = items.chefJenkScriptTaskObj.cronEnd; + } + + $scope.repeatBy = items.chefJenkScriptTaskObj.repeatBy || items.chefJenkScriptTaskObj.cronRepeatEvery.toString(); + $scope.repeatsType = items.chefJenkScriptTaskObj.repeats || items.chefJenkScriptTaskObj.cronFrequency; + $scope.timeEventType = items.chefJenkScriptTaskObj.startTime; + $scope.timeEventMinute = items.chefJenkScriptTaskObj.startTimeMinute; + $scope.weekOfTheDay = items.chefJenkScriptTaskObj.dayOfWeek; + $scope.currentDate = items.chefJenkScriptTaskObj.startDate; + $scope.selectedDayOfTheMonth = items.chefJenkScriptTaskObj.selectedDayOfTheMonth; + $scope.selectedMonth = items.chefJenkScriptTaskObj.monthOfYear; + } else { + $scope.defaultSelection(); + } + } else { + $scope.defaultSelection(); + } + + $scope.dateChange= function () { + var startDate = Date.parse($scope.schedulerStartOn); + var endDate = Date.parse($scope.schedulerEndOn); + if(startDate > endDate){ + $scope.validDateRange=true; + } else { + $scope.validDateRange=false; + } + + }; + + $scope.repeatCount = function(max, step) { + step = step || 1; + var input = []; + for (var i = 1; i <= max; i += step) { + input.push(i); + } + return input; + }; + $scope.isDaySelected = { + flag:true + } + + $scope.daysOfWeek = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; + + $scope.monthOfYear = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; + $scope.cancel = function() { + $modalInstance.dismiss('cancel'); + }; + $scope.ok=function(){ + $scope.eventParams = { + repeats: $scope.repeatsType, + repeatBy: $scope.repeatBy, + cronStart: $scope.schedulerStartOn, + cronEnd: $scope.schedulerEndOn, + startTime: $scope.timeEventType, + startTimeMinute: $scope.timeEventMinute, + dayOfWeek: $scope.weekOfTheDay, + selectedDayOfTheMonth: $scope.selectedDayOfTheMonth, + monthOfYear: $scope.selectedMonth + }; + $modalInstance.close($scope.eventParams); + }; + + $scope.cancel = function() { + $modalInstance.dismiss('cancel'); + }; }]); })(angular); \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html b/client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html index b16ae05ce..a82e48010 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html +++ b/client/cat3/src/partials/sections/dashboard/bots/view/botInfo.html @@ -22,12 +22,23 @@
  • @@ -26,7 +26,7 @@
    Audit Trail - +
    @@ -38,4 +38,4 @@ - + \ No newline at end of file diff --git a/client/cat3/src/partials/sections/dashboard/bots/view/editParams.html b/client/cat3/src/partials/sections/dashboard/bots/view/editParams.html index 60d344947..ce379adb3 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/view/editParams.html +++ b/client/cat3/src/partials/sections/dashboard/bots/view/editParams.html @@ -3,7 +3,7 @@
    - Add More +
    diff --git a/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html b/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html index 9e7e8d3f0..886049f3c 100755 --- a/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html +++ b/client/cat3/src/partials/sections/dashboard/design/view/blueprintCreate.html @@ -256,7 +256,7 @@
    -
    -