2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
23 class userbarUpdateService {
24 constructor($q, $log, $http, conf, uuid) {
30 this.refreshCount = 0;
35 return this.refreshCount;
37 setRefreshCount(count){
38 this.refreshCount = count;
40 setMaxRefreshCount(count){
41 this.maxCount = count;
43 decrementRefreshCount(){
44 this.refreshCount = this.refreshCount - 1;
47 getWidthThresholdLeftMenu() {
48 let deferred = this.$q.defer();
49 this.$log.info('userbarUpdateService::getWidthThresholdLeftMenu');
51 url: this.conf.api.getWidthThresholdLeftMenu,
55 'X-ECOMP-RequestID':this.uuid.generate()
58 if (Object.keys(res.data).length == 0) {
59 deferred.reject("userbarUpdateService::getWidthThresholdLeftMenu Failed");
61 deferred.resolve(res.data);
65 deferred.reject(status);
67 return deferred.promise;
70 getWidthThresholdRightMenu() {
71 let deferred = this.$q.defer();
72 this.$log.info('userbarUpdateService::getWidthThresholdRightMenu');
74 url: this.conf.api.getWidthThresholdRightMenu,
78 'X-ECOMP-RequestID':this.uuid.generate()
81 if (Object.keys(res.data).length == 0) {
82 deferred.reject("userbarUpdateService::getWidthThresholdRightMenu Failed");
84 deferred.resolve(res.data);
88 deferred.reject(status);
90 return deferred.promise;
95 userbarUpdateService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4'];
96 angular.module('ecompApp').service('userbarUpdateService', userbarUpdateService)