summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
diff options
context:
space:
mode:
authorKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-05-14 17:19:51 -0400
committerKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-05-25 13:39:38 -0400
commit2845910b34682056c1949f82e39d9205a26554e9 (patch)
tree825474a899dc5783e6ea8c4aefd26b6d4c881dfd /ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
parent485296388748c1efb5737cf7ae9d4a8254681552 (diff)
Bulk upload changes and music health check apis
Issue-ID: PORTAL-290, PORTAL-291 Bulk upload changes and music health check apis Change-Id: I63d289d75420658ff4a14385a5106838fa8c32b2 Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Diffstat (limited to 'ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js')
-rw-r--r--ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js129
1 files changed, 129 insertions, 0 deletions
diff --git a/ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js b/ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
index 6c8e6194..6d1d813d 100644
--- a/ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
+++ b/ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
@@ -329,6 +329,135 @@
});
return deferred.promise;
}
+
+ saveBulkRole(appId, appRole)
+ {
+ let canceller = this.$q.defer();
+ let isActive = false;
+
+ let cancel = () => {
+ if(isActive){
+ this.$log.debug('FunctionalMenuService::saveBulkRole: canceling the request');
+ canceller.resolve();
+ }
+ };
+
+ let promise = () => {
+ let deferred = this.$q.defer();
+ let url = this.conf.api.saveRole.replace(':appId', appId);
+ this.$http({
+ method: 'POST',
+ url: url,
+ cache: false,
+ data : appRole,
+ headers: {
+ 'X-ECOMP-RequestID':this.uuid.generate()
+ }
+ }).then( res => {
+ if (this.utilsService.isValidJSON(res)== false) {
+ deferred.reject('UsersService::saveBulkRole: Failed');
+ } else {
+ deferred.resolve(res.data);
+ }
+ })
+ .catch( status => {
+ deferred.reject(status);
+ });
+
+ return deferred.promise;
+ };
+
+ return {
+ cancel: cancel,
+ promise: promise
+ };
+ }
+
+ saveBulkFunction(appId, appFunction)
+ {
+ let canceller = this.$q.defer();
+ let isActive = false;
+
+ let cancel = () => {
+ if(isActive){
+ this.$log.debug('FunctionalMenuService::saveRoleFunction: canceling the request');
+ canceller.resolve();
+ }
+ };
+
+ let promise = () => {
+ let deferred = this.$q.defer();
+ let url = this.conf.api.saveRoleFunction.replace(':appId', appId);
+ this.$http({
+ method: 'POST',
+ url: url,
+ cache: false,
+ data : appFunction,
+ headers: {
+ 'X-ECOMP-RequestID':this.uuid.generate()
+ }
+ }).then( res => {
+ if (this.utilsService.isValidJSON(res)== false) {
+ deferred.reject('UsersService::saveRoleFunction: Failed');
+ } else {
+ deferred.resolve(res.data);
+ }
+ })
+ .catch( status => {
+ deferred.reject(status);
+ });
+
+ return deferred.promise;
+ };
+
+ return {
+ cancel: cancel,
+ promise: promise
+ };
+ }
+
+ updateBulkRoleFunction(appId, roleFunction)
+ {
+ let canceller = this.$q.defer();
+ let isActive = false;
+
+ let cancel = () => {
+ if(isActive){
+ this.$log.debug('FunctionalMenuService::updateBulkRoleFunction: canceling the request');
+ canceller.resolve();
+ }
+ };
+
+ let promise = () => {
+ let deferred = this.$q.defer();
+ let url = this.conf.api.uploadRoleFunction.replace(':appId', appId);
+ this.$http({
+ method: 'POST',
+ url: url,
+ cache: false,
+ data : roleFunction,
+ headers: {
+ 'X-ECOMP-RequestID':this.uuid.generate()
+ }
+ }).then( res => {
+ if (this.utilsService.isValidJSON(res)== false) {
+ deferred.reject('UsersService::updateBulkRoleFunction: Failed');
+ } else {
+ deferred.resolve(res.data);
+ }
+ })
+ .catch( status => {
+ deferred.reject(status);
+ });
+
+ return deferred.promise;
+ };
+
+ return {
+ cancel: cancel,
+ promise: promise
+ };
+ }
}
FunctionalMenuService.$inject = ['$q', '$log', '$http', 'conf','uuid4', 'utilsService'];