From b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 Mon Sep 17 00:00:00 2001 From: st782s Date: Thu, 4 May 2017 07:48:42 -0400 Subject: [PORTAL-7] Rebase This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8 Signed-off-by: st782s --- .../client/app/services/admins/admins.service.js | 176 ----------- .../services/applications/applications.service.js | 346 --------------------- .../client/app/services/catalog/catalog.service.js | 95 ------ .../services/confirm-box/confirm-box.service.js | 153 --------- .../app/services/contact-us/contact-us.service.js | 247 --------------- .../app/services/dashboard/dashboard.service.js | 185 ----------- .../error-messages/error-messages.service.js | 23 -- .../functionalMenu/functionalMenu.service.js | 253 --------------- .../services/global-constants/global-constants.js | 21 -- .../kpi-dashboard/kpi-dashboard.service.js | 185 ----------- .../app/services/manifest/manifest.service.js | 64 ---- .../client/app/services/menus/menus.service.js | 145 --------- .../portal-admins/portal-admins.service.js | 107 ------- .../support/getAccess/get-access.service.js | 61 ---- .../services/support/session/session.service.js | 56 ---- .../services/userProfile/userProfile.service.js | 240 -------------- .../app/services/userbar/userbar.update.service.js | 97 ------ .../client/app/services/users/users.service.js | 161 ---------- .../client/app/services/utils/utils.service.js | 57 ---- .../client/app/services/widgets/widgets.service.js | 178 ----------- 20 files changed, 2850 deletions(-) delete mode 100644 ecomp-portal-FE/client/app/services/admins/admins.service.js delete mode 100644 ecomp-portal-FE/client/app/services/applications/applications.service.js delete mode 100644 ecomp-portal-FE/client/app/services/catalog/catalog.service.js delete mode 100644 ecomp-portal-FE/client/app/services/confirm-box/confirm-box.service.js delete mode 100644 ecomp-portal-FE/client/app/services/contact-us/contact-us.service.js delete mode 100644 ecomp-portal-FE/client/app/services/dashboard/dashboard.service.js delete mode 100644 ecomp-portal-FE/client/app/services/error-messages/error-messages.service.js delete mode 100644 ecomp-portal-FE/client/app/services/functionalMenu/functionalMenu.service.js delete mode 100644 ecomp-portal-FE/client/app/services/global-constants/global-constants.js delete mode 100644 ecomp-portal-FE/client/app/services/kpi-dashboard/kpi-dashboard.service.js delete mode 100644 ecomp-portal-FE/client/app/services/manifest/manifest.service.js delete mode 100644 ecomp-portal-FE/client/app/services/menus/menus.service.js delete mode 100644 ecomp-portal-FE/client/app/services/portal-admins/portal-admins.service.js delete mode 100644 ecomp-portal-FE/client/app/services/support/getAccess/get-access.service.js delete mode 100644 ecomp-portal-FE/client/app/services/support/session/session.service.js delete mode 100644 ecomp-portal-FE/client/app/services/userProfile/userProfile.service.js delete mode 100644 ecomp-portal-FE/client/app/services/userbar/userbar.update.service.js delete mode 100644 ecomp-portal-FE/client/app/services/users/users.service.js delete mode 100644 ecomp-portal-FE/client/app/services/utils/utils.service.js delete mode 100644 ecomp-portal-FE/client/app/services/widgets/widgets.service.js (limited to 'ecomp-portal-FE/client/app/services') diff --git a/ecomp-portal-FE/client/app/services/admins/admins.service.js b/ecomp-portal-FE/client/app/services/admins/admins.service.js deleted file mode 100644 index ee742af8..00000000 --- a/ecomp-portal-FE/client/app/services/admins/admins.service.js +++ /dev/null @@ -1,176 +0,0 @@ -/*- - * ================================================================================ - * 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 AdminsService { - constructor($q, $log, $http, conf,uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - getAccountAdmins() { - let deferred = this.$q.defer(); - this.$log.info('AdminsService::get all applications admins list'); - this.$http({ - method: "GET", - cache: false, - url: this.conf.api.accountAdmins, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("AdminsService::getAccountAdmins Failed"); - } else { - this.$log.info('AdminsService::getAccountAdmins Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - getAdminAppsRoles(orgUserId) { - let deferred = this.$q.defer(); - this.$log.info('AdminsService::getAdminAppsRoles.adminAppsRoles'); - - this.$http({ - method: "GET", - url: this.conf.api.adminAppsRoles, - params: {orgUserId: orgUserId}, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("AdminsService::getAdminAppsRoles.adminAppsRoles Failed"); - } else { - this.$log.info('AdminsService::getAdminAppsRoles.adminAppsRoles Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - updateAdminAppsRoles(newAdminAppRoles) { - let deferred = this.$q.defer(); - this.$log.info('AdminsService::updateAdminAppsRoles'); - this.$http({ - method: "PUT", - url: this.conf.api.adminAppsRoles, - data: newAdminAppRoles, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - deferred.resolve(res.data); - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - addNewUser(newUser,checkDuplicate) { - // this.$log.info(newContactUs) - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService:: add Contact Us' + JSON.stringify(newContactUs)); - - var newUserObj={ - firstName:newUser.firstName, - middleInitial:newUser.middleName, - lastName:newUser.lastName, - email:newUser.emailAddress, - loginId:newUser.loginId, - loginPwd:newUser.loginPwd, - }; - this.$http({ - url: this.conf.api.saveNewUser + "?isCheck=" + checkDuplicate, - method: 'POST', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - }, - data: newUserObj - }).then(res => { - // this.$log.info('ContactUsService:: add Contact Us res' ,res); - // If response comes back as a redirected HTML page which IS NOT a success - if (res==null || Object.keys(res.data).length == 0 || res.data.message == 'failure') { - deferred.reject("Add new User failed"); - this.$log.error('adminService:: add New User failed'); - } else { - deferred.resolve(res.data); - } - }).catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - /** - * Tests the specified password against complexity requirements. - * Returns an explanation message if the test fails; null if it passes. - */ - isComplexPassword(str) { - let minLength = 8; - let message = 'Password is too simple. Minimum length is '+ minLength + ', ' - + 'and it must use letters, digits and special characters.'; - if (str == null) - return message; - - let hasLetter = false; - let hasDigit = false; - let hasSpecial = false; - var code, i, len; - for (i = 0, len = str.length; i < len; i++) { - code = str.charCodeAt(i); - if (code > 47 && code < 58) // numeric (0-9) - hasDigit = true; - else if ((code > 64 && code < 91) || (code > 96 && code < 123)) // A-Z, a-z - hasLetter = true; - else - hasSpecial = true; - } // for - - if (str.length < minLength || !hasLetter || !hasDigit || !hasSpecial) - return message; - - // All is well. - return null; - } - - } - AdminsService.$inject = ['$q', '$log', '$http', 'conf','uuid4']; - angular.module('ecompApp').service('adminsService', AdminsService) -})(); diff --git a/ecomp-portal-FE/client/app/services/applications/applications.service.js b/ecomp-portal-FE/client/app/services/applications/applications.service.js deleted file mode 100644 index 38cfd650..00000000 --- a/ecomp-portal-FE/client/app/services/applications/applications.service.js +++ /dev/null @@ -1,346 +0,0 @@ -/*- - * ================================================================================ - * 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 ApplicationsService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - getPersUserApps() { - let deferred = this.$q.defer(); - // this.$log.info('ApplicationsService::getPersUserApps'); - this.$http.get(this.conf.api.persUserApps, - { - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - // But don't declare an empty list to be an error. - if (res == null || res.data == null) { - deferred.reject("ApplicationsService::getPersUserApps Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getUserApps(){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getUserApps'); - this.$http.get(this.conf.api.userApps, - { - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::getUserApps Failed"); - } else { - this.$log.info('ApplicationsService::getUserApps Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - getAvailableApps() { - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getAvailableApps'); - this.$http( - { - method: "GET", - url: this.conf.api.availableApps, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::getAvailableApps Failed"); - } else { - this.$log.info('ApplicationsService::getAvailableApps Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - getAdminApps(){ - let canceller = this.$q.defer(); - let isActive = false; - - let cancel = () => { - if(isActive){ - this.$log.debug('ApplicationsService::getAdminApps: canceling the request'); - canceller.resolve(); - } - }; - - let promise = () => { - isActive = true; - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getAdminApps: starting'); - this.$http({method: "GET", - url: this.conf.api.adminApps, - cache: false, - timeout: canceller.promise, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - isActive = false; - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::adminApps Failed"); - } else { - this.$log.info('ApplicationsService::adminApps Succeeded'); - deferred.resolve(res.data); - } - }) - .catch(status => { - isActive = false; - deferred.reject(status); - }); - return deferred.promise; - }; - - return { - cancel: cancel, - promise: promise - }; - } - - getAppsForSuperAdminAndAccountAdmin(){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin'); - this.$http({method: "GET", - url: this.conf.api.appsForSuperAdminAndAccountAdmin, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::getAppsForSuperAdminAndAccountAdmin Failed"); - } else { - this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin Succeeded'); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getAdminAppsSimpler(){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getAdminApps'); - this.$http({method: "GET", - url: this.conf.api.adminApps, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::getAdminApps Failed"); - } else { - this.$log.info('ApplicationsService::getAdminApps Succeeded'); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getOnboardingApps(){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::getOnboardingApps'); - - this.$http.get(this.conf.api.onboardingApps, - { - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::getOnboardingApps Failed"); - } else { - this.$log.info('ApplicationsService::getOnboardingApps Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - - addOnboardingApp(newApp){ - let deferred = this.$q.defer(); - this.$log.info('applications-service::addOnboardingApp'); - this.$log.debug('applications-service::addOnboardingApp with:', newApp); - - this.$http({ - method: "POST", - url: this.conf.api.onboardingApps, - data: newApp, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::addOnboardingApp Failed"); - } else { - this.$log.info('ApplicationsService::addOnboardingApp Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - updateOnboardingApp(appData){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::addOnboardingApp'); - if(!appData.id){ - this.$log.error('ApplicationsService::addOnboardingApp: App id not found!'); - return deferred.reject('App id not found'); - } - - this.$http({ - method: "PUT", - url: this.conf.api.onboardingApps, - data: appData, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("ApplicationsService::updateOnboardingApp Failed"); - } else { - this.$log.info('ApplicationsService::updateOnboardingApp Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - deleteOnboardingApp(appId) { - let deferred = this.$q.defer(); - let url = this.conf.api.onboardingApps + '/' + appId; - - this.$log.info('applications.service::deleteOnboardingApp' +appId); - - this.$http({ - method: "DELETE", - url: url, - cache: false, - data:'', - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("applications.service::deleteOnboardingApp Failed"); - } else { - this.$log.info('applications.service::deleteOnboardingApp succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - getTopMenuData(selectedApp) { - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService:getTopMenuData'); - this.$log.debug('ApplicationsService:getTopMenuData with:', selectedApp); - - } - - ping(){ - let deferred = this.$q.defer(); - this.$log.info('ApplicationsService::ping: '); - - this.$http.get(this.conf.api.ping, - { - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .success( res => { - if (Object.keys(res).length == 0) { - deferred.reject("ApplicationsService::ping: Failed"); - } else { - this.$log.info('ApplicationsService::ping: Succeeded'); - deferred.resolve(res); - } - }) - .error( status => { - deferred.reject(status); - }); - - return deferred.promise; - } - } - ApplicationsService.$inject = ['$q', '$log', '$http', 'conf','uuid4']; - angular.module('ecompApp').service('applicationsService', ApplicationsService) -})(); diff --git a/ecomp-portal-FE/client/app/services/catalog/catalog.service.js b/ecomp-portal-FE/client/app/services/catalog/catalog.service.js deleted file mode 100644 index 2ad594a2..00000000 --- a/ecomp-portal-FE/client/app/services/catalog/catalog.service.js +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ================================================================================ - * 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 CatalogService { - - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - getAppCatalog() { - let deferred = this.$q.defer(); - this.$http( - { - method: "GET", - url: this.conf.api.appCatalog, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - // Detect non-JSON - if (res == null || res.data == null) { - deferred.reject("CatalogService::getAppCatalog Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch( status => { - this.$log.error('CatalogService:getAppCatalog failed: ' + status); - deferred.reject(status); - }); - return deferred.promise; - } - - // Expects an object with fields matching model class AppCatalogSelection: - // appId (number), select (boolean), pending (boolean). - updateAppCatalog(appData) { - let deferred = this.$q.defer(); - // Validate the request, maybe this is overkill - if (appData == null || appData.appId == null || appData.select == null) { - var msg = 'CatalogService::updateAppCatalog: field appId and/or select not found'; - this.$log.error(msg); - return deferred.reject(msg); - } - this.$http({ - method: "PUT", - url: this.conf.api.appCatalog, - data: appData, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - // Detect non-JSON - if (res == null || res.data == null) { - deferred.reject("CatalogService::updateAppCatalog Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch( status => { - this.$log.error('CatalogService:updateAppCatalog failed: ' + status); - deferred.reject(status); - }); - return deferred.promise; - } - - } - - CatalogService.$inject = ['$q', '$log', '$http', 'conf','uuid4']; - angular.module('ecompApp').service('catalogService', CatalogService) -})(); diff --git a/ecomp-portal-FE/client/app/services/confirm-box/confirm-box.service.js b/ecomp-portal-FE/client/app/services/confirm-box/confirm-box.service.js deleted file mode 100644 index affc6d3f..00000000 --- a/ecomp-portal-FE/client/app/services/confirm-box/confirm-box.service.js +++ /dev/null @@ -1,153 +0,0 @@ -/*- - * ================================================================================ - * 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 ConfirmBoxService { - constructor($q, $log, ngDialog) { - this.$q = $q; - this.$log = $log; - this.ngDialog = ngDialog; - } - - showInformation(message) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: 'app/views/confirmation-box/information-box.tpl.html', - controller: 'ConfirmationBoxCtrl', - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - message: message - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - confirm(message) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html', - controller: 'ConfirmationBoxCtrl', - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - message: message - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - - showDynamicInformation(message, templatePath, controller) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: templatePath, - controller: controller, - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - message: message - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - deleteItem(item) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html', - controller: 'ConfirmationBoxCtrl', - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - item: item, - title: 'Functional Menu - Delete' - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - moveMenuItem(message) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: 'app/views/confirmation-box/dragdrop-confirmation-box.tpl.html', - controller: 'ConfirmationBoxCtrl', - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - message: message, - title:'Functional Menu - Move' - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - makeAdminChanges(message) { - let deferred = this.$q.defer(); - this.ngDialog.open({ - templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html', - controller: 'ConfirmationBoxCtrl', - controllerAs: 'confirmBox', - className: 'confirm-box ngdialog-theme-default', - showClose: false, - data: { - message: message, - title: 'Admin Update' - } - }).closePromise.then(confirmed => { - deferred.resolve(confirmed.value); - }).catch(err => { - deferred.reject(err); - }); - return deferred.promise; - }; - - - } - ConfirmBoxService.$inject = ['$q', '$log', 'ngDialog']; - angular.module('ecompApp').service('confirmBoxService', ConfirmBoxService) -})(); diff --git a/ecomp-portal-FE/client/app/services/contact-us/contact-us.service.js b/ecomp-portal-FE/client/app/services/contact-us/contact-us.service.js deleted file mode 100644 index 241a12ab..00000000 --- a/ecomp-portal-FE/client/app/services/contact-us/contact-us.service.js +++ /dev/null @@ -1,247 +0,0 @@ -/*- - * ================================================================================ - * 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. - * ================================================================================ - */ -/** - * Created by robertlo on 10/10/2016. - */ -'use strict'; - -(function () { - class ContactUsService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - getListOfApp() { - // this.$log.info('ContactUsService::getListOfavailableApps: get all app list'); - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService::getListOfavailableApps: ', this.conf.api.listOfApp); - this.$http({ - method: "GET", - url: this.conf.api.availableApps, - cache: false - }).then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - // this.$log.info('ContactUsService::getListOfavailableApps availableApps response: ', res); - if (Object.keys(res).length == 0) { - deferred.reject("ContactUsService::getListOfavailableApps: Failed"); - } else { - // this.$log.debug('ContactUsService::getListOfavailableApps: Succeeded results: ', res); - deferred.resolve(res); - } - }).catch( status => { - this.$log.error('ContactUsService::getListOfavailableApps: query error: ',status); - deferred.reject(status); - }); - return deferred.promise; - } - - getContactUs() { - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService::get all Contact Us list'); - this.$http({ - url: this.conf.api.getContactUS, - method: 'GET', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ContactUsService::getContactUs Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getAppsAndContacts() { - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService::getAppsAndContacts'); - this.$http({ - url: this.conf.api.getAppsAndContacts, - method: 'GET', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ContactUsService::getAppsAndContacts Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getContactUSPortalDetails(){ - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService::get all Contact Us Portal Details'); - this.$http({ - url: this.conf.api.getContactUSPortalDetails, - method: 'GET', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ContactUsService::getContactUSPortalDetails Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getAppCategoryFunctions(){ - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService::get all App Category Functions'); - this.$http({ - url: this.conf.api.getAppCategoryFunctions, - method: 'GET', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ContactUsService::getAppCategoryFunctions Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - addContactUs(newContactUs) { - // this.$log.info('ContactUsService::add a new Contact Us'); - // this.$log.info(newContactUs) - let deferred = this.$q.defer(); - // this.$log.info('ContactUsService:: add Contact Us' + JSON.stringify(newContactUs)); - - var contactUsObj={ - appId:newContactUs.app.value, - appName:newContactUs.app.title, - description:newContactUs.desc, - contactName:newContactUs.name, - contactEmail:newContactUs.email, - url:newContactUs.url, - }; - this.$http({ - url: this.conf.api.saveContactUS, - method: 'POST', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - }, - data: contactUsObj - }).then(res => { - // this.$log.info('ContactUsService:: add Contact Us res' ,res); - // If response comes back as a redirected HTML page which IS NOT a success - if (res==null || Object.keys(res.data).length == 0 || res.data.message == 'failure') { - deferred.reject("Add Contact Us failed"); - this.$log.error('ContactUsService:: add Contact Us failed'); - } else { - deferred.resolve(res.data); - } - }).catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - modifyContactUs(contactUsObj) { - // this.$log.info('ContactUsService::edit Contact Us',contactUsObj); - let deferred = this.$q.defer(); - this.$http({ - url: this.conf.api.saveContactUS, - method: 'POST', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - }, - data: contactUsObj - }).then(res => { - // this.$log.info('ContactUsService:: edit Contact Us res' ,res); - // If response comes back as a redirected HTML page which IS NOT a success - if (res==null || Object.keys(res.data).length == 0 || res.data.message == 'failure') { - deferred.reject("Edit Contact Us failed"); - this.$log.error('ContactUsService:: edit Contact Us failed'); - } else { - deferred.resolve(res.data); - } - }).catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - removeContactUs(id) { - let deferred = this.$q.defer(); - let url = this.conf.api.deleteContactUS + '/' + id; - // this.$log.info('ContactUsService:: remove Contact Us'); - this.$http({ - url: url, - method: 'POST', - cache: false, - data: '', - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - // If response comes back as a redirected HTML page which IS NOT a success - // this.$log.info("ContactUsService::removeContactUs res",res); - deferred.resolve(res.data); - if (Object.keys(res.data).length == 0) { - deferred.reject("ContactUsService::removeContactUs Failed"); - } else { - deferred.resolve(res.data); - } - }).catch(errRes => { - deferred.reject(errRes); - }); - - return deferred.promise; - } - } - ContactUsService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4']; - angular.module('ecompApp').service('contactUsService', ContactUsService) -})(); \ No newline at end of file diff --git a/ecomp-portal-FE/client/app/services/dashboard/dashboard.service.js b/ecomp-portal-FE/client/app/services/dashboard/dashboard.service.js deleted file mode 100644 index bc9c9cee..00000000 --- a/ecomp-portal-FE/client/app/services/dashboard/dashboard.service.js +++ /dev/null @@ -1,185 +0,0 @@ -/*- - * ================================================================================ - * 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. - * ================================================================================ - */ -/** - * Created by robertlo on 09/26/2016. - */ -'use strict'; - -(function () { - class DashboardService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.dashboardService = null; - this.uuid = uuid; - } - - getCommonWidgetData(widgetType) { - // this.$log.info('ecomp::dashboard-service::getting news data'); - let deferred = this.$q.defer(); - let url = this.conf.api.commonWidget + '?resourceType=' + widgetType; - - this.$http({ - method: "GET", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }) - .then( res => { - // this.$log.info('ecomp::dashboard-service::getting news data',res); - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0 || Object.keys(res.data.response) ==null || Object.keys(res.data.response.items) ==null) { - deferred.reject("ecomp::dashboard-service::getNewsData Failed"); - } else { - this.userProfile = res.data; - // this.$log.info('ecomp::dashboard-service::getNewsData Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - saveCommonWidgetData(newData){ - let deferred = this.$q.defer(); - //this.$log.info('ecomp::dashboard-service::saveCommonWidgetData'); - //this.$log.debug('ecomp::dashboard-service::saveCommonWidgetData with:', newData); - - this.$http({ - method: "POST", - url: this.conf.api.commonWidget, - data: newData, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - // this.$log.info(res.data); - if (Object.keys(res.data).length == 0) { - deferred.reject("ecomp::dashboard-service::saveCommonWidgetData Failed"); - } else { - // this.$log.info('ecomp::dashboard-service::saveCommonWidgetData Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - - - removeCommonWidgetData(widgetToRemove){ - let deferred = this.$q.defer(); - // this.$log.info('ecomp::dashboard-service::removeCommonWidgetData'); - // this.$log.debug('ecomp::dashboard-service::removeCommonWidgetData with:', widgetToRemove); - this.$http({ - method: "POST", - url: this.conf.api.deleteCommonWidget, - data: widgetToRemove, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - // this.$log.info(res.data); - if (Object.keys(res.data).length == 0) { - deferred.reject("ecomp::dashboard-service::saveCommonWidgetData Failed"); - } else { - // this.$log.info('ecomp::dashboard-service::saveCommonWidgetData Succeeded'); - deferred.resolve(res.data); - } - }) - .catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getSearchAllByStringResults(searchStr) { - // this.$log.info('ecomp::getSearchAllByStringResults::getting search by string results'); - let deferred = this.$q.defer(); - let url = this.conf.api.getSearchAllByStringResults; - - this.$http({ - method: "GET", - url : url, - params : { - 'searchString' : searchStr - }, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ecomp::dashboard-service::getSearchAllByStringResults Failed"); - } else { - //this.searchResults = res.data; - // this.$log.info('ecomp::dashboard-service::getSearchAllByStringResults Succeeded'); - deferred.resolve(res.data.response); - } - }).catch( status => { - this.$log.error('ecomp::getSearchAllByStringResults error'); - deferred.reject(status); - }); - return deferred.promise; - - } - - getOnlineUserUpdateRate() { - let deferred = this.$q.defer(); - let url = this.conf.api.onlineUserUpdateRate; - this.$http({ - method: "GET", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - // If response comes back as a redirected HTML page which IS NOT a success - if (Object.keys(res.data).length == 0) { - deferred.reject("ecomp::dashboard-service::getOnlineUserUpdateRate Failed"); - } else { - this.$log.info('ecomp::dashboard-service::getOnlineUserUpdateRate Succeeded',res); - deferred.resolve(res.data); - } - }).catch( status => { - deferred.reject(status); - }); - return deferred.promise; - } - - } - - DashboardService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4']; - angular.module('ecompApp').service('dashboardService', DashboardService) -})(); diff --git a/ecomp-portal-FE/client/app/services/error-messages/error-messages.service.js b/ecomp-portal-FE/client/app/services/error-messages/error-messages.service.js deleted file mode 100644 index 032fb803..00000000 --- a/ecomp-portal-FE/client/app/services/error-messages/error-messages.service.js +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * ================================================================================ - * 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'; -let errorMessageByCode = {1201: 'Value already exists'}; -angular.module('ecompApp').constant('errorMessageByCode', errorMessageByCode); diff --git a/ecomp-portal-FE/client/app/services/functionalMenu/functionalMenu.service.js b/ecomp-portal-FE/client/app/services/functionalMenu/functionalMenu.service.js deleted file mode 100644 index ec3bd387..00000000 --- a/ecomp-portal-FE/client/app/services/functionalMenu/functionalMenu.service.js +++ /dev/null @@ -1,253 +0,0 @@ -/*- - * ================================================================================ - * 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 FunctionalMenuService { - constructor($q, $log, $http, conf,uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - - getManagedRolesMenu( appId ) - { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::getManagedRolesMenu'); - let url = this.conf.api.appRoles.replace(':appId', appId); - this.$log.info("FunctionalMenuService::getManagedRolesMenu url: "+url); - - this.$http({ - method: "GET", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("functionalMenu.service::getManagedRolesMenu Failed"); - } else { - this.$log.info('functionalMenu.service::getManagedRolesMenu succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getAvailableApplications() - { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::getManagedRolesMenu:getAvailableApplications'); - - this.$http({ - method: "GET", -// url: this.conf.api.availableApps, - url: this.conf.api.allAvailableApps, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::getManagedRolesMenu:getAvailableApplications Failed"); - } else { - this.$log.info('FunctionalMenuService::getManagedRolesMenu:getAvailableApplications succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - getMenuDetails( menuId ) - { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::getMenuDetails:getMenuDetails'); - let url = this.conf.api.functionalMenuItemDetails.replace(':menuId',menuId); - this.$log.info("FunctionalMenuService::getMenuDetails url: "+url); - - this.$http({ - method: "GET", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::getMenuDetails:getMenuDetails Failed"); - } else { - this.$log.info('FunctionalMenuService::getMenuDetails:getMenuDetails succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - - getManagedFunctionalMenu() { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::getMenuDetails:getManagedFunctionalMenu'); - - this.$http({ - method: "GET", - url: this.conf.api.functionalMenuForEditing, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::getManagedFunctionalMenu Failed"); - } else { - this.$log.info('FunctionalMenuService::getManagedFunctionalMenu succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - regenerateFunctionalMenuAncestors() { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::regenerateFunctionalMenuAncestors'); - - this.$http({ - method: "GET", - url: this.conf.api.regenerateFunctionalMenuAncestors, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::regenerateFunctionalMenuAncestors Failed"); - } else { - this.$log.info('FunctionalMenuService::regenerateFunctionalMenuAncestors succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - saveEditedMenuItem(menuData) { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::saveEditedMenuItem: ' + menuData); - - let url = this.conf.api.functionalMenuItem; - this.$http({ - method: "PUT", - url: url, - cache: false, - data: menuData, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::saveEditedMenuItem Failed"); - } else { - this.$log.info('FunctionalMenuService::saveEditedMenuItem succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - saveMenuItem(menuData) { - let deferred = this.$q.defer(); - this.$log.info('FunctionalMenuService::saveMenuItem: ' + JSON.stringify(menuData)); - - let url = this.conf.api.functionalMenuItem; - this.$http({ - method: "POST", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - }, - data: menuData - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::saveMenuItem: Failed"); - } else { - this.$log.info('FunctionalMenuService::saveMenuItem: succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - - deleteMenuItem(menuId) { - let deferred = this.$q.defer(); - let url = this.conf.api.functionalMenuItem + '/' + menuId; - - this.$log.info('FunctionalMenuService::deleteMenuItem: ' +menuId); - - this.$http({ - method: "DELETE", - url: url, - cache: false, - data:'', - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("FunctionalMenuService::deleteMenuItem Failed"); - } else { - this.$log.info('FunctionalMenuService::deleteMenuItem succeeded: '); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - -} - FunctionalMenuService.$inject = ['$q', '$log', '$http', 'conf','uuid4']; - angular.module('ecompApp').service('functionalMenuService', FunctionalMenuService) -})(); diff --git a/ecomp-portal-FE/client/app/services/global-constants/global-constants.js b/ecomp-portal-FE/client/app/services/global-constants/global-constants.js deleted file mode 100644 index fa13dae4..00000000 --- a/ecomp-portal-FE/client/app/services/global-constants/global-constants.js +++ /dev/null @@ -1,21 +0,0 @@ -/*- - * ================================================================================ - * 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. - * ================================================================================ - */ - -angular.module('ecompApp').value('ECOMP_URL_REGEX', /^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i); diff --git a/ecomp-portal-FE/client/app/services/kpi-dashboard/kpi-dashboard.service.js b/ecomp-portal-FE/client/app/services/kpi-dashboard/kpi-dashboard.service.js deleted file mode 100644 index ff9b66b8..00000000 --- a/ecomp-portal-FE/client/app/services/kpi-dashboard/kpi-dashboard.service.js +++ /dev/null @@ -1,185 +0,0 @@ -/*- - * ================================================================================ - * 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 KpiDashboardService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - this.applicationsHomeUrl = 'kpidash'; - } - - kpiApiCall(ApiName) { - let deferred = this.$q.defer(); - this.$log.info('KpiDashboardService::kpiApiCall: '+ApiName); - this.$http({ - method: 'GET', - url: this.conf.api[ApiName], - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - this.$log.debug("KpiDashboardService::kpiApiCall: response successfully retrieved"); - if (Object.keys(res.data).length == 0) { - deferred.reject("KpiDashboardService::kpiApiCall: "+ ApiName+ " Failed"); - } else { - deferred.resolve(res); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - getKpiUserStoriesStats(){ - return this.kpiApiCall("getKpiDashUserStoriesStats"); - } - getKpiUserApiStats(){ - return this.kpiApiCall("getKpiDashUserApiStats"); - } - getKpiLocStats(){ - return this.kpiApiCall("getKpiDashLocStats"); - } - getKpiLocStatsCat(){ - return this.kpiApiCall("getKpiDashLocStatsCat"); - } - getKpiServiceSupported(){ - return this.kpiApiCall("getKpiDashServiceSupported"); - } - getKpiPublishedDelivered(){ - return this.kpiApiCall("getKpiDashPublishedDelivered"); - } - getKpiFeedStats(){ - return this.kpiApiCall("getKpiDashFeedStats"); - } - getKpiUserApis(){ - return this.kpiApiCall("getKpiDashUserApis"); - } - getKpiGeoMapUrl(){ - return this.kpiApiCall("getKpiDashGeoMapUrl"); - } - getKpiRCloudAUrl(){ - return this.kpiApiCall("getKpiDashRCloudAUrl"); - } - getKpiGeoMapApiUrl(){ - return this.kpiApiCall("getKpiDashGeoMapApiUrl"); - } - - getToplevelgTabs1() { - var toplevelgTabs1=[{ - title : 'eCOMP', - id : 'ECOMP', - url : this.applicationsHomeUrl, - state : 'root.kpidash_ECOMP' - }] - return toplevelgTabs1; - } - - getToplevelgTabs2() { - var toplevelgTabs2 = [ { - title : 'A&AI', - id : 'A&AI', - url : this.applicationsHomeUrl, - state : 'root.kpidash_AAI' - }, { - title : 'APP-C', - id : 'APP-C', - url : this.applicationsHomeUrl, - state : 'root.kpidash_APPC' - }, { - title : 'ASDC', - id : 'ASDC', - url : this.applicationsHomeUrl, - state : 'root.kpidash_ASDC' - }, { - title : 'DCAE', - id : 'DCAE', - url : this.applicationsHomeUrl, - state : 'root.kpidash_DCAE' - }, { - title : 'OpenECOMP Portal', - id : 'OpenECOMP Portal', - url : this.applicationsHomeUrl, - state : 'root.kpidash_ECOMP_Portal' - }, { - title : 'i-Portal', - id : 'i-Portal', - url : this.applicationsHomeUrl, - state : 'root.kpidash_InfrastructurePortal' - }, { - title : 'MSO', - id : 'MSO', - url : this.applicationsHomeUrl, - state : 'root.kpidash_MSO' - }, { - title : 'Policy', - id : 'Policy', - url : this.applicationsHomeUrl, - state : 'root.kpidash_Policy' - }]; - return toplevelgTabs2; - } - - getToplevelgTabs3() { - var toplevelgTabs3 = [ { - title : 'Closed Loop', - id : 'Closedloop', - url : this.applicationsHomeUrl, - state : 'root.kpidash_Closedloop' - }, { - title : 'eDMaaP', - id : 'DMaaP', - url : this.applicationsHomeUrl, - state : 'root.kpidash_DMaaP' - } ]; - return toplevelgTabs3; - } - - getGenericTabs(activeTab) { - var gTabs = [ { - title : 'KPI', - id : 'KPI', - url : this.applicationsHomeUrl, - state : 'root.kpidash_'+activeTab+'_KPI' - }, { - title : 'User Defined KPI', - id : 'User Defined KPI', - url : this.applicationsHomeUrl, - state : 'root.kpidash_'+activeTab+'_UserDefinedKPI' - }, { - title : 'Metrics', - id : 'Metrics', - url : this.applicationsHomeUrl, - state : 'root.kpidash_'+activeTab+'_Metrics' - } ]; - return gTabs; - } - } - - KpiDashboardService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4']; - angular.module('ecompApp').service('KpiDashboardService', KpiDashboardService) -})(); diff --git a/ecomp-portal-FE/client/app/services/manifest/manifest.service.js b/ecomp-portal-FE/client/app/services/manifest/manifest.service.js deleted file mode 100644 index 4341a138..00000000 --- a/ecomp-portal-FE/client/app/services/manifest/manifest.service.js +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * ================================================================================ - * 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. - * ================================================================================ - */ -/** - * Created by mlittle on 9/9/2016. - */ -'use strict'; - -(function () { - class ManifestService { - constructor($q, $log, $http, conf, uuid, utilsService) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - this.utilsService = utilsService; - } - - getManifest() { - let deferred = this.$q.defer(); - this.$http({ - method: "GET", - url: this.conf.api.getManifest, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (this.utilsService.isValidJSON(res)== false) { - this.$log.error('ManifestService.getManifest failed: '); - deferred.reject('ManifestService.getManifest: response.data null or not object'); - } else { - // this.$log.info('ManifestService.getManifest Succeeded'); - // this.$log.debug('ManifestService.getManifest: ', JSON.stringify(res)) - deferred.resolve(res.data); - } - }).catch( status => { - this.$log.error('ManifestService.getManifest failed: ' + status.data); - deferred.reject(status); - }); - return deferred.promise; - } - - } - ManifestService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4', 'utilsService']; - angular.module('ecompApp').service('manifestService', ManifestService) -})(); diff --git a/ecomp-portal-FE/client/app/services/menus/menus.service.js b/ecomp-portal-FE/client/app/services/menus/menus.service.js deleted file mode 100644 index 19bb385b..00000000 --- a/ecomp-portal-FE/client/app/services/menus/menus.service.js +++ /dev/null @@ -1,145 +0,0 @@ -/*- - * ================================================================================ - * 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 MenusService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - GetFunctionalMenuForUser() { - let deferred = this.$q.defer(); - // this.$log.info('MenusService::GetFunctionalMenuForUser via REST API'); - this.$http({ - method: "GET", - url: this.conf.api.functionalMenuForAuthUser, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("MenusService::GetFunctionalMenuForUser Failed"); - } else { - this.$log.info('MenusService::GetFunctionalMenuForUser success:'); - deferred.resolve(res.data); - } - }) - .catch( status => { - this.$log.info('MenusService::rejection:' + status); - deferred.reject(status); - }); - - - return deferred.promise; - } - - getFavoriteItems() { - let deferred = this.$q.defer(); - // this.$log.info('MenusService::getFavoriteItems via REST API'); - this.$http({ - method: "GET", - url: this.conf.api.getFavoriteItems +"?date="+new Date().getTime(), - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then( res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("MenusService::getFavoriteItems Failed"); - } else { - this.$log.info('MenusService::getFavoriteItems success:'); - deferred.resolve(res.data); - } - }) - .catch( status => { - this.$log.error('MenusService::getFavoriteItems rejection:' + status); - deferred.reject(status); - }); - - - return deferred.promise; - } - - setFavoriteItem(menuId) { - let deferred = this.$q.defer(); - // this.$log.info('menus-service.service::setFavoriteItem via REST API' + menuId); - let url = this.conf.api.setFavoriteItem; - this.$http({ - method: "POST", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate(), - 'Content-Type': 'application/json' - }, - data: menuId - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("MenusService::setFavoriteItem Failed"); - } else { - this.$log.info('MenusService::setFavoriteItem success:'); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - this.$log.error('MenusService::setFavoriteItem rejection:' + JSON.stringify(errRes)); - deferred.reject(errRes); - }); - - return deferred.promise; - } - - removeFavoriteItem(menuId) { - let deferred = this.$q.defer(); - // this.$log.info('menus-service.service::removeFavoriteItem via REST API'); - let url = this.conf.api.removeFavoriteItem.replace(':menuId', menuId); - this.$http({ - method: "DELETE", - url: url, - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("MenusService::removeFavoriteItem Failed"); - } else { - // this.$log.info('MenusService::removeFavoriteItem success:'); - deferred.resolve(res.data); - } - }) - .catch(errRes => { - this.$log.error('MenusService::removeFavoriteItem rejection:' + status); - deferred.reject(errRes); - }); - return deferred.promise; - } - - } - MenusService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4']; - angular.module('ecompApp').service('menusService', MenusService) -})(); diff --git a/ecomp-portal-FE/client/app/services/portal-admins/portal-admins.service.js b/ecomp-portal-FE/client/app/services/portal-admins/portal-admins.service.js deleted file mode 100644 index 683c0f02..00000000 --- a/ecomp-portal-FE/client/app/services/portal-admins/portal-admins.service.js +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ================================================================================ - * 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 PortalAdminsService { - constructor($q, $log, $http, conf, uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - - getPortalAdmins() { - let deferred = this.$q.defer(); - this.$log.info('PortalAdminsService::get all portal admins list'); - this.$http({ - url: this.conf.api.portalAdmins, - method: 'GET', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("PortalAdminsService::getPortalAdmins Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(status => { - deferred.reject(status); - }); - return deferred.promise; - } - - addPortalAdmin(userData) { - let deferred = this.$q.defer(); - this.$log.info('PortalAdminsService:: add Portal Admin' + JSON.stringify(userData)); - this.$http({ - url: this.conf.api.portalAdmin, - method: 'POST', - cache: false, - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - }, - data: userData - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("PortalAdminsService::addPortalAdmin Failed"); - } else { - deferred.resolve(res.data); - } - }) - .catch(errRes => { - deferred.reject(errRes); - }); - return deferred.promise; - } - - removePortalAdmin(userId) { - let deferred = this.$q.defer(); - let url = this.conf.api.portalAdmin + '/' + userId; - this.$log.info('PortalAdminsService:: remove Portal Admin'); - this.$http({ - url: url, - method: 'DELETE', - cache: false, - data: '', - headers: { - 'X-ECOMP-RequestID':this.uuid.generate() - } - }).then(res => { - if (Object.keys(res.data).length == 0) { - deferred.reject("PortalAdminsService::removePortalAdmin Failed"); - } else { - deferred.resolve(res.data); - } - }).catch(errRes => { - deferred.reject(errRes); - }); - - return deferred.promise; - } - } - PortalAdminsService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4']; - angular.module('ecompApp').service('portalAdminsService', PortalAdminsService) -})(); diff --git a/ecomp-portal-FE/client/app/services/support/getAccess/get-access.service.js b/ecomp-portal-FE/client/app/services/support/getAccess/get-access.service.js deleted file mode 100644 index 24b6945d..00000000 --- a/ecomp-portal-FE/client/app/services/support/getAccess/get-access.service.js +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ================================================================================ - * 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 GetAccessService { - constructor($q, $log, $http, conf,uuid) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - } - getListOfApp(searchStr) { - //this.$log.info('GetAccessService::getListOfApp: get all app list'); - let deferred = this.$q.defer(); - //this.$log.info('GetAccessService::getListOfApp: searchStr', searchStr); - //this.$log.info('GetAccessService::getListOfApp: ', this.conf.api.listOfApp); - this.$http({ - method: "GET", - url: this.conf.api.listOfApp, - params: {search:searchStr}, - cache: false - }).then( res => { - // this.$log.info('GetAccessService::getListOfApp response: ', res); - if (Object.keys(res).length == 0) { - deferred.reject("GetAccessService::getListOfApp: Failed"); - } else { - // this.$log.debug('GetAccessService::getListOfApp: query results: ', res); - // this.$log.info('GetAccessService::getListOfApp Succeeded'); - deferred.resolve(res); - } - }).catch( status => { - this.$log.error('GetAccessService::getListOfApp: query error: ',status); - deferred.reject(status); - }); - return deferred.promise; - } - - } - GetAccessService.$inject = ['$q', '$log', '$http', 'conf','uuid4']; - angular.module('ecompApp').service('getAccessService', GetAccessService) -})(); diff --git a/ecomp-portal-FE/client/app/services/support/session/session.service.js b/ecomp-portal-FE/client/app/services/support/session/session.service.js deleted file mode 100644 index d18c42a4..00000000 --- a/ecomp-portal-FE/client/app/services/support/session/session.service.js +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ================================================================================ - * 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 SessionService { - constructor($q, $log, $http, conf,uuid,$sce) { - this.$q = $q; - this.$log = $log; - this.$http = $http; - this.conf = conf; - this.uuid = uuid; - this.$sce = $sce; - } - - logout(appStr) { - this.$log.info('SessionService::logout from App'); - let deferred = this.$q.defer(); - this.$log.info('SessionService appStr: ', appStr); - - var eaccessPattern = '\https?\:\/\/[^/]+/[^/]+/[^/]+'; - var standardPattern = '\https?\:\/\/[^/]+/[^/]+'; - - if(appStr.includes("e-access")) { - standardPattern = eaccessPattern; - } - - var contextUrl = appStr.match(new RegExp(standardPattern)); - var logoutUrl = contextUrl + "/logout.htm" ; - this.$sce.trustAsResourceUrl(logoutUrl); - console.log('logoutUrl ' + logoutUrl); - jQuery('#reg-logout-div').append("