summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms/common-widgets/events-widget/js
diff options
context:
space:
mode:
authorChristopher Lott (cl778h) <clott@research.att.com>2017-08-23 18:27:19 -0400
committerChristopher Lott (cl778h) <clott@research.att.com>2017-08-23 21:12:56 -0400
commit978dbcf0a196acbafad72fe1e2478ec0e384f02f (patch)
tree17e1ceaa4a12a599320cbb317947e990bf1a5383 /ecomp-portal-widget-ms/common-widgets/events-widget/js
parentbc7350dce5b7b1dcd1c472a3922b42c4ea99809d (diff)
Deliver centralized role management feature
Repair multiple defects also. Revise deployment to use docker-compose. Remove all zip archives. Issue: PORTAL-21, PORTAL-25, PORTAL-28, PORTAL-52, PORTAL-69, PORTAL-74, PORTAL-76, PORTAL-80, PORTAL-82 Change-Id: Ie72fec7d35ba78beb162bba6ed27b2caee340c61 Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-portal-widget-ms/common-widgets/events-widget/js')
-rw-r--r--ecomp-portal-widget-ms/common-widgets/events-widget/js/controller.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/ecomp-portal-widget-ms/common-widgets/events-widget/js/controller.js b/ecomp-portal-widget-ms/common-widgets/events-widget/js/controller.js
new file mode 100644
index 00000000..8ccebeee
--- /dev/null
+++ b/ecomp-portal-widget-ms/common-widgets/events-widget/js/controller.js
@@ -0,0 +1,64 @@
+function EventsCtrl($rootScope, applicationsService , $log,
+ $window, userProfileService, $scope, $cookies, $timeout, $interval,
+ $uibModal, dashboardService, ngDialog) {
+ var _this = this;
+
+ //activate spinner
+ this.isLoading = true;
+ $scope.getUserAppsIsDone = false;
+ this.userProfileService = userProfileService;
+ $scope.demoNum = 1;
+ $scope.event_content_show = false;
+ $scope.widgetData = [];
+
+ $scope.editWidgetModalPopup = function(availableData, resourceType) {
+
+ $scope.editData = JSON.stringify(availableData);
+ $scope.availableDataTemp = $scope.availableData;
+ ngDialog.open({
+ templateUrl : 'app/views/dashboard/dashboard-widget-manage.html',
+ controller : 'CommonWidgetController',
+ resolve : {
+ message : function message() {
+ var message = {
+ type : resourceType,
+ availableData : $scope.editData
+ };
+ return message;
+ }
+ }
+ }).closePromise.then(needUpdate => {
+ if(resourceType=='NEWS'){
+ $scope.updateNews();
+ }else if(resourceType=='EVENTS'){
+ $scope.updateEvents();
+ }else if(resourceType=='IMPORTANTRESOURCES'){
+ $scope.updateImportRes();
+ }
+ });
+ };
+ /*Setting News data*/
+ $scope.eventData = [];
+ $scope.updateEvents = function() {
+
+ $scope.eventData.length=0;
+ //dashboardService.getCommonWidgetData('EVENTS').then(function(res) {
+ var eventDataJsonArray = res.response.items;
+ for (var i = 0; i < eventDataJsonArray.length; i++) {
+ if(eventDataJsonArray[i].eventDate !=null) {
+ // yyyy-mm-dd
+ eventDataJsonArray[i].year = eventDataJsonArray[i].eventDate.substring(2,4);
+ eventDataJsonArray[i].mon = eventDataJsonArray[i].eventDate.substring(5,7);
+ eventDataJsonArray[i].day = eventDataJsonArray[i].eventDate.substring(8,10);
+ }
+ $scope.eventData.push(eventDataJsonArray[i]);
+ }
+ //})['catch'](function(err) {
+ // $log.error('dashboard controller: failed to get Events list', err);
+ // _this.isLoading = false;
+ //});
+ }
+ $scope.updateEvents();
+
+
+ }