From 627badaf69987c01811c477219fd943757a635f5 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (Christopher) (cl778h)" Date: Mon, 12 Jun 2017 09:49:00 -0400 Subject: [PORTAL-16 PORTAL-18] Widget ms; staging Remove staging repositories from poms. Add widget microservice code base. Add portal unit tests. Repair defects. Normalize line endings. Change-Id: Ia5e48da2a3141b352439ecd548cddf918f4df585 Signed-off-by: Christopher Lott (cl778h) --- .../contact-us-manage.controller.js | 404 ++++++++++----------- .../contact-us-manage.controller.less | 18 + .../contact-us-manage/contact-us-manage.html | 361 +++++++++--------- .../support/contact-us/contact-us.controller.js | 342 ++++++++--------- .../contact-us/contact-us.controller.spec.js | 38 +- .../views/support/contact-us/contact-us.tpl.html | 250 +++++++------ 6 files changed, 715 insertions(+), 698 deletions(-) (limited to 'ecomp-portal-FE-common/client/app/views/support/contact-us') diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js index 8413382e..8c76abc2 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js @@ -1,202 +1,202 @@ -/*- - * ================================================================================ - * ECOMP Portal - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed 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. - * ================================================================================ - */ -'use strict'; - -(function () { - class ContactUsManageController { - constructor($scope,$log, message, $q, $http, conf,contactUsService,confirmBoxService) { - $scope.contactUsList=[]; - $scope.contactUsAllAppList=[]; - $scope.errMsg=''; - $scope.newContactUs ={ - app:'', - name:'', - email:'', - url:'', - desc:'' - }; - /*Get the existing contact us first, then based on the existing, filter from all apps*/ - $scope.getContactUsList = function(){ - contactUsService.getContactUs().then(res=> { - // $log.info('getting getContactUs',res.response); - if(res!=null && res.response!=null){ - for(var i=0; i { - var tableData=[]; - $scope.contactUsAllAppListTemp=[]; - // $log.info('contactUsService::getListOfApp: getting res'); - var result = (typeof(res.data) != "undefined" && res.data!=null)?res.data:null; - // $log.info('contactUsService::getListOfApp: result',result); - var res1 = result; - var realAppIndex = 0; - $scope.contactUsAllAppList.length=0; - for (var i = 1; i <= res1.length; i++) { - if (!res1[i - 1].restrictedApp) { - var okToAdd = true; - for(var j =0; j<$scope.contactUsList.length;j++){ - if(res1[i - 1].title==$scope.contactUsList[j].appName) - okToAdd=false; - } - // not allowed to add(duplicate) another entry if the app is already available in the table - if(okToAdd){ - if(res1[i - 1].title){ - $scope.contactUsAllAppList.push({ - index: realAppIndex, - title: res1[i - 1].title, - value: res1[i - 1].index - }); - } - realAppIndex = realAppIndex + 1; - } - } else { - // $log.debug('contactUsService:getAvailableApps:: Restricted/URL only App will not be used = ' + res1[i - 1].title); - } - } - }).catch(err=> { - $log.error('contactUsService:error:: ', err); - - - }).finally(() => { - //this.isLoadingTable = false; - }); - }); - } - - $scope.getContactUsList(); - - $scope.closeDialog = function(){ - $scope.closeThisDialog( $scope.widgetData); - } - - /*Add new Contact Us*/ - $scope.newContactUsFun = function(){ - if($scope.newContactUs.app.title==null || $scope.newContactUs.app.title=='' ){ - confirmBoxService.showInformation('Please select an App to add').then(isConfirmed => { - return; - }); - } - - if($scope.newContactUs.url !=null && $scope.newContactUs.url != '' && !validateUrl($scope.newContactUs.url)){ - var warningMsg = "Please enter a valid URL"; - confirmBoxService.showInformation(warningMsg).then(isConfirmed => {return;}); - return; - } - - contactUsService.addContactUs($scope.newContactUs).then(res=> { - // $log.info('contactUsService: add ContactUs successfully'); - $scope.contactUsList.length=0; - // $log.info('contactUsService: refreshing the Contact US table'); - $scope.getContactUsList(); - $scope.errMsg=''; - /* confirmBoxService.showInformation('You have added a new Contact Us item').then(isConfirmed => { });*/ - var defaultSel={ - index: 0, - title: '', - value: '' - } - $scope.newContactUs ={ - app:defaultSel, - name:'', - email:'', - url:'', - desc:'' - }; - - }).catch(err=> { - $log.error('contactUsService: addContactUs error:: ', err); - // $scope.errMsg=err; - confirmBoxService.showInformation('Add Contact Us list failed: ' + err); - - }).finally(() => { - //this.isLoadingTable = false; - }); - } - /* Edit Contact Us*/ - $scope.editContactUsFun = function(contactObj){ - // $log.info('contactUsService: edit ContactUs save successfully', contactObj); - var contactUsObj={ - appId:contactObj.appId, - appName:contactObj.appName, - description:contactObj.description, - contactName:contactObj.contactName, - contactEmail:contactObj.contactEmail, - url:contactObj.url, - }; - - contactUsService.modifyContactUs(contactUsObj).then(res=> { - // $log.info('contactUsService: edit ContactUs successfully'); - // confirmBoxService.showInformation('You have saved the changes').then(isConfirmed => {}); - $scope.errMsg=''; - - }).catch(err=> { - $log.error('contactUsService: editContactUs error:: ', err); - confirmBoxService.showInformation('Edit Contact Us list failed: ' + err); - // $scope.errMsg=err; - }).finally(() => { - //this.isLoadingTable = false; - }); - - } - - $scope.$watch('newContactUs.app.value', (newVal, oldVal) => { - for(var i=0;i<$scope.contactUsAllAppList.length;i++){ - if($scope.contactUsAllAppList[i].value==newVal){ - $scope.newContactUs.app=angular.copy($scope.contactUsAllAppList[i]);; - } - } - }); - /*del Contact Us*/ - $scope.delContactUsFun = function(appObj){ - var confirmMsg = 'Are you sure you want to delete '+appObj.appName +' from the list?' + ' Press OK to delete.'; - confirmBoxService.confirm(confirmMsg).then(function (confirmed) { - if (confirmed == true) { - contactUsService.removeContactUs(appObj.appId).then(res=> { - // $log.info('delContactUsFun: delete ContactUs successfully',res); - $scope.errMsg=''; - $scope.contactUsList.length=0; - $scope.getContactUsList(); - confirmBoxService.showInformation('Item has been deleted').then(isConfirmed => {}); - }).catch(err=> { - $log.error('contactUsService: addContactUs error:: ', err); - confirmBoxService.showInformation('Deletion failed: ' + err); - // $scope.errMsg=err; - }).finally(() => { - //this.isLoadingTable = false; - }); - } - }); - - } - - } - } - ContactUsManageController.$inject = ['$scope','$log', 'message', '$q', '$http', 'conf','contactUsService','confirmBoxService']; - angular.module('ecompApp').controller('ContactUsManageController', ContactUsManageController); - - -})(); -function validateUrl(value){ - return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); - } +/*- + * ================================================================================ + * ECOMP Portal + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed 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. + * ================================================================================ + */ +'use strict'; + +(function () { + class ContactUsManageController { + constructor($scope,$log, message, $q, $http, conf,contactUsService,confirmBoxService) { + $scope.contactUsList=[]; + $scope.contactUsAllAppList=[]; + $scope.errMsg=''; + $scope.newContactUs ={ + app:'', + name:'', + email:'', + url:'', + desc:'' + }; + /*Get the existing contact us first, then based on the existing, filter from all apps*/ + $scope.getContactUsList = function(){ + contactUsService.getContactUs().then(res=> { + // $log.info('getting getContactUs',res.response); + if(res!=null && res.response!=null){ + for(var i=0; i { + var tableData=[]; + $scope.contactUsAllAppListTemp=[]; + // $log.info('contactUsService::getListOfApp: getting res'); + var result = (typeof(res.data) != "undefined" && res.data!=null)?res.data:null; + // $log.info('contactUsService::getListOfApp: result',result); + var res1 = result; + var realAppIndex = 0; + $scope.contactUsAllAppList.length=0; + for (var i = 1; i <= res1.length; i++) { + if (!res1[i - 1].restrictedApp) { + var okToAdd = true; + for(var j =0; j<$scope.contactUsList.length;j++){ + if(res1[i - 1].title==$scope.contactUsList[j].appName) + okToAdd=false; + } + // not allowed to add(duplicate) another entry if the app is already available in the table + if(okToAdd){ + if(res1[i - 1].title){ + $scope.contactUsAllAppList.push({ + index: realAppIndex, + title: res1[i - 1].title, + value: res1[i - 1].index + }); + } + realAppIndex = realAppIndex + 1; + } + } else { + // $log.debug('contactUsService:getAvailableApps:: Restricted/URL only App will not be used = ' + res1[i - 1].title); + } + } + }).catch(err=> { + $log.error('contactUsService:error:: ', err); + + + }).finally(() => { + //this.isLoadingTable = false; + }); + }); + } + + $scope.getContactUsList(); + + $scope.closeDialog = function(){ + $scope.closeThisDialog( $scope.widgetData); + } + + /*Add new Contact Us*/ + $scope.newContactUsFun = function(){ + if($scope.newContactUs.app.title==null || $scope.newContactUs.app.title=='' ){ + confirmBoxService.showInformation('Please select an App to add').then(isConfirmed => { + return; + }); + } + + if($scope.newContactUs.url !=null && $scope.newContactUs.url != '' && !validateUrl($scope.newContactUs.url)){ + var warningMsg = "Please enter a valid URL"; + confirmBoxService.showInformation(warningMsg).then(isConfirmed => {return;}); + return; + } + + contactUsService.addContactUs($scope.newContactUs).then(res=> { + // $log.info('contactUsService: add ContactUs successfully'); + $scope.contactUsList.length=0; + // $log.info('contactUsService: refreshing the Contact US table'); + $scope.getContactUsList(); + $scope.errMsg=''; + /* confirmBoxService.showInformation('You have added a new Contact Us item').then(isConfirmed => { });*/ + var defaultSel={ + index: 0, + title: '', + value: '' + } + $scope.newContactUs ={ + app:defaultSel, + name:'', + email:'', + url:'', + desc:'' + }; + + }).catch(err=> { + $log.error('contactUsService: addContactUs error:: ', err); + // $scope.errMsg=err; + confirmBoxService.showInformation('Add Contact Us list failed: ' + err); + + }).finally(() => { + //this.isLoadingTable = false; + }); + } + /* Edit Contact Us*/ + $scope.editContactUsFun = function(contactObj){ + // $log.info('contactUsService: edit ContactUs save successfully', contactObj); + var contactUsObj={ + appId:contactObj.appId, + appName:contactObj.appName, + description:contactObj.description, + contactName:contactObj.contactName, + contactEmail:contactObj.contactEmail, + url:contactObj.url, + }; + + contactUsService.modifyContactUs(contactUsObj).then(res=> { + // $log.info('contactUsService: edit ContactUs successfully'); + // confirmBoxService.showInformation('You have saved the changes').then(isConfirmed => {}); + $scope.errMsg=''; + + }).catch(err=> { + $log.error('contactUsService: editContactUs error:: ', err); + confirmBoxService.showInformation('Edit Contact Us list failed: ' + err); + // $scope.errMsg=err; + }).finally(() => { + //this.isLoadingTable = false; + }); + + } + + $scope.$watch('newContactUs.app.value', (newVal, oldVal) => { + for(var i=0;i<$scope.contactUsAllAppList.length;i++){ + if($scope.contactUsAllAppList[i].value==newVal){ + $scope.newContactUs.app=angular.copy($scope.contactUsAllAppList[i]);; + } + } + }); + /*del Contact Us*/ + $scope.delContactUsFun = function(appObj){ + var confirmMsg = 'Are you sure you want to delete '+appObj.appName +' from the list?' + ' Press OK to delete.'; + confirmBoxService.confirm(confirmMsg).then(function (confirmed) { + if (confirmed == true) { + contactUsService.removeContactUs(appObj.appId).then(res=> { + // $log.info('delContactUsFun: delete ContactUs successfully',res); + $scope.errMsg=''; + $scope.contactUsList.length=0; + $scope.getContactUsList(); + confirmBoxService.showInformation('Item has been deleted').then(isConfirmed => {}); + }).catch(err=> { + $log.error('contactUsService: addContactUs error:: ', err); + confirmBoxService.showInformation('Deletion failed: ' + err); + // $scope.errMsg=err; + }).finally(() => { + //this.isLoadingTable = false; + }); + } + }); + + } + + } + } + ContactUsManageController.$inject = ['$scope','$log', 'message', '$q', '$http', 'conf','contactUsService','confirmBoxService']; + angular.module('ecompApp').controller('ContactUsManageController', ContactUsManageController); + + +})(); +function validateUrl(value){ + return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); + } diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less index 905f9faa..2625f32c 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less @@ -138,6 +138,24 @@ background-color: transparent; border-color: slategrey !important; width:100%; } + .mandatory-categories{ + color: #cf2a2a; + font-size: 11px; + position:absolute; + + } + .error-container{ + position: absolute; + width: 220px; + display: block; + height: 12px; + line-height: 12px; + + .err-message{ + color: @funcRed; + font-size: 10px; + } + } .glyphicon { position: relative !important; line-height: 0 !important; diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html index c619a18a..4c8f6dee 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html @@ -1,180 +1,181 @@ - -
-
- -
-
Manage - Contact Us
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
App NameContact NameContact EmailContact URLDescriptionEditDelete
-
-
-
-
-
-
-
-
-
-
-
- -
Save - -
-
- -
-
-
- -
-
-
-

Add Application Contact - Information

- -
-
-
-
-
App - Name
- -
-
-
-
Contact - Name
- -
-
-
Contact - Email
- -
-
-
Contact - URL
- -
-
-
Description
- -
-
-
- Add - New -
-
- -
- Close -
- -
- -
- -
-
-
-
- - + +
+
+ +
+
Manage + Contact Us
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
App NameContact NameContact EmailContact URLDescriptionEditDelete
+
+
+
+
+
+
+
+
+
+
+
+ +
Save + +
+
+ +
+
+
+ +
+
+
+

Add Application Contact + Information

+ +
+
+
+
+
*App Name
+ +
+ App Name is Required +
+
+
+
+
Contact + Name
+ +
+
+
Contact + Email
+ +
+
+
Contact + URL
+ +
+
+
Description
+ +
+
+
+ Add + New +
+
+ +
+ Close +
+ +
+ +
+ +
+
+
+
+ + diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.js b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.js index 0d39a653..eddde0d9 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.js +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.js @@ -1,171 +1,171 @@ -/*- - * ================================================================================ - * ECOMP Portal - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed 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. - * ================================================================================ - */ -'use strict'; - -(function () { - - class ContactUsCtrl { - constructor($log, contactUsService, applicationsService, $modal, ngDialog, $state,$anchorScroll,$location) { - - contactUsService.getContactUSPortalDetails().then(res => { - // $log.info('ContactUsCtrl:: contactUsService getContactUSPortalDetails res',res); - // $log.info('getting res',res); - var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; - // $log.info('result',result); - // $log.info('done'); - var source = JSON.parse(result); - // $log.info(source); - this.ush_TicketInfoUrl = source.ush_ticket_url; - this.portalInfo_Address = source.feedback_email_address; - this.feedback_Url = source.portal_info_url; - }).catch(err=> { - $log.error('ContactUsCtrl:error:: ', err); - }).finally(() => { - }); - - let init = () => { - // $log.info('ecomp app::contact-us-controller::initializing...'); - this.appTable=[]; - this.functionalTableData=[]; - }; - init(); - - let updateContactUsTable = () => { - contactUsService.getAppsAndContacts().then(res=> { - // $log.info('ContactUsCtrl:: contactUsService getAppsAndContacts res',res); - var tableData=[]; - // $log.info('getting res',res); - var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; - // $log.info('result',result); - // $log.info('done'); - var source = result; - // $log.info(source); - // Drop Portal app, empty name entries - for(var i=0;i { - $log.error('ContactUsCtrl.updateContactUsTable:error:: ', err); - }) - }; - - contactUsService.getAppCategoryFunctions().then(res=> { - // $log.info('ContactUsCtrl:: contactUsService getAppCategoryFunctionsthen res',res); - var tablefunctionalData=[]; - // $log.info('getting res',res); - var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; - // $log.info('result',result); - // $log.info('done'); - var source = result; - // $log.info(source); - for(var i=0;i { - $log.error('ContactUsCtrl:error:: ', err); - }) - - updateContactUsTable(); - this.editContactUsModalPopup = () => { - // $log.debug('ContactUsCtrl::editContactUsModalPopup updating table data...'); - var modalInstance = ngDialog.open({ - templateUrl: 'app/views/support/contact-us/contact-us-manage/contact-us-manage.html', - controller: 'ContactUsManageController', - resolve: { - message: function message() { - var message = { - type: 'Contact', - }; - return message; - } - } - }).closePromise.then(needUpdate => { - updateContactUsTable(); - }); - }; - - this.goToSection = (id) => { - - var targetDiv = document.getElementById(id); - - var offSetHeight = 0; - for(var i=0;i d.showFlag = false); - // let index = this.appTable.findIndex(a => a.app_Id == id); - var index =-1; - for(var i=0; i -1) { - // setting the showFlag to true based on index comparing with the app_Id - this.appTable[index].showFlag = true; - $location.hash('appId'+index); - $anchorScroll(); - /* $('#contentId').animate({ - scrollTop: targetDiv.offsetTop-offSetHeight - }, 'fast');*/ - } - - }; - - // Take the user to the application on the get access page. - this.goGetAccess = (appName) => { - // $log.debug('ContactUsCtrl::goGetAccess received name ' + appName); - applicationsService.goGetAccessAppName = appName; - $state.go('root.getAccess'); - }; - - } - } - ContactUsCtrl.$inject = ['$log','contactUsService', 'applicationsService', '$modal', 'ngDialog', '$state','$anchorScroll','$location']; - angular.module('ecompApp').controller('ContactUsCtrl', ContactUsCtrl); -})(); +/*- + * ================================================================================ + * ECOMP Portal + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed 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. + * ================================================================================ + */ +'use strict'; + +(function () { + + class ContactUsCtrl { + constructor($log, contactUsService, applicationsService, $modal, ngDialog, $state,$anchorScroll,$location) { + + contactUsService.getContactUSPortalDetails().then(res => { + // $log.info('ContactUsCtrl:: contactUsService getContactUSPortalDetails res',res); + // $log.info('getting res',res); + var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; + // $log.info('result',result); + // $log.info('done'); + var source = JSON.parse(result); + // $log.info(source); + this.ush_TicketInfoUrl = source.ush_ticket_url; + this.portalInfo_Address = source.feedback_email_address; + this.feedback_Url = source.portal_info_url; + }).catch(err=> { + $log.error('ContactUsCtrl:error:: ', err); + }).finally(() => { + }); + + let init = () => { + // $log.info('ecomp app::contact-us-controller::initializing...'); + this.appTable=[]; + this.functionalTableData=[]; + }; + init(); + + let updateContactUsTable = () => { + contactUsService.getAppsAndContacts().then(res=> { + // $log.info('ContactUsCtrl:: contactUsService getAppsAndContacts res',res); + var tableData=[]; + // $log.info('getting res',res); + var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; + // $log.info('result',result); + // $log.info('done'); + var source = result; + // $log.info(source); + // Drop Portal app, empty name entries + for(var i=0;i { + $log.error('ContactUsCtrl.updateContactUsTable:error:: ', err); + }) + }; + + contactUsService.getAppCategoryFunctions().then(res=> { + // $log.info('ContactUsCtrl:: contactUsService getAppCategoryFunctionsthen res',res); + var tablefunctionalData=[]; + // $log.info('getting res',res); + var result = (typeof(res.response) != "undefined" && res.response!=null)?res.response:null; + // $log.info('result',result); + // $log.info('done'); + var source = result; + // $log.info(source); + for(var i=0;i { + $log.error('ContactUsCtrl:error:: ', err); + }) + + updateContactUsTable(); + this.editContactUsModalPopup = () => { + // $log.debug('ContactUsCtrl::editContactUsModalPopup updating table data...'); + var modalInstance = ngDialog.open({ + templateUrl: 'app/views/support/contact-us/contact-us-manage/contact-us-manage.html', + controller: 'ContactUsManageController', + resolve: { + message: function message() { + var message = { + type: 'Contact', + }; + return message; + } + } + }).closePromise.then(needUpdate => { + updateContactUsTable(); + }); + }; + + this.goToSection = (id) => { + + var targetDiv = document.getElementById(id); + + var offSetHeight = 0; + for(var i=0;i d.showFlag = false); + // let index = this.appTable.findIndex(a => a.app_Id == id); + var index =-1; + for(var i=0; i -1) { + // setting the showFlag to true based on index comparing with the app_Id + this.appTable[index].showFlag = true; + $location.hash('appId'+index); + $anchorScroll(); + /* $('#contentId').animate({ + scrollTop: targetDiv.offsetTop-offSetHeight + }, 'fast');*/ + } + + }; + + // Take the user to the application on the get access page. + this.goGetAccess = (appName) => { + // $log.debug('ContactUsCtrl::goGetAccess received name ' + appName); + applicationsService.goGetAccessAppName = appName; + $state.go('root.getAccess'); + }; + + } + } + ContactUsCtrl.$inject = ['$log','contactUsService', 'applicationsService', '$modal', 'ngDialog', '$state','$anchorScroll','$location']; + angular.module('ecompApp').controller('ContactUsCtrl', ContactUsCtrl); +})(); diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.spec.js b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.spec.js index 3841a2b3..32cc3a1f 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.spec.js +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.spec.js @@ -1,19 +1,19 @@ -/*- - * ================================================================================ - * ECOMP Portal - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed 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. - * ================================================================================ - */ +/*- + * ================================================================================ + * ECOMP Portal + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed 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. + * ================================================================================ + */ diff --git a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.tpl.html b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.tpl.html index 9e96b441..444a9820 100644 --- a/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.tpl.html +++ b/ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.tpl.html @@ -1,126 +1,124 @@ - -
-
-
-
-

Contact Us

- - -
- -
- -
Application Functions -
- - - - - - - - - - - - - - - - - -
CategoryECOMP FunctionsECOMP Application
-
-
-
-
-
- {{rowData.app_Name}} -
-
-
-
- -
-
All Applications -
-
-
-
-
-
- - - - Expand app contact section - App contact section - -
- -
-
- No application information is available. Please use the links above to contact the ECOMP Portal team. -
-
- - - - - - - - - - - - - - - - - - - - - -
Contact:{{rowData.contact_name}}
Email:{{rowData.contact_email}}
Info URL:{{rowData.url_Info}}
Description:{{rowData.desc}}
Get access:Click for application and role information
-
-
- -
-
-
-
-
- -
-
-
+ +
+
+
+
+

Contact Us

+ + +
+ +
+ +
Application Functions +
+ + + + + + + + + + + + + + + + + +
CategoryECOMP FunctionsECOMP Application
+
+
+
+
+
+ {{rowData.app_Name}} +
+
+
+
+ +
+
All Applications +
+
+
+
+
+
+ + + + + + +
+ +
+
+ No application information is available. Please use the links above to contact the ECOMP Portal team. +
+
+ + + + + + + + + + + + + + + + + + + + + +
Contact:{{rowData.contact_name}}
Email:{{rowData.contact_email}}
Info URL:{{rowData.url_Info}}
Description:{{rowData.desc}}
Get access:Click for application and role information
+
+
+ +
+
+
+
+
+ +
+
+
-- cgit 1.2.3-korg