2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the "License");
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
39 * Created by nnaffar on 1/18/16.
44 class ConfirmBoxService {
45 constructor($q, $log, ngDialog,$modal) {
48 this.ngDialog = ngDialog;
51 reloadPageConfirm(msg){
52 let deferred = this.$q.defer();
53 var modalInstance = this.$modal.open({
54 templateUrl: 'app/views/confirmation-box/reload-page-confirm.html',
55 controller: 'ConfirmationBoxCtrl',
56 sizeClass:'modal-small',
58 message: function message() {
67 modalInstance.result.then(function () {
70 return deferred.promise;
72 showInformation(msg) {
73 let deferred = this.$q.defer();
74 var modalInstance = this.$modal.open({
75 templateUrl: 'app/views/confirmation-box/information-box.tpl.html',
76 controller: 'ConfirmationBoxCtrl',
77 sizeClass:'modal-small',
79 message: function message() {
88 modalInstance.result.then(function () {
91 return deferred.promise;
95 let deferred = this.$q.defer();
96 var modalInstance = this.$modal.open({
97 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
98 controller: 'ConfirmationBoxCtrl',
99 sizeClass:'modal-small',
101 message: function message() {
110 modalInstance.result.then(function (confirm) {
112 deferred.resolve(confirm);
114 deferred.reject(confirm);
116 return deferred.promise;
120 showDynamicInformation(msg, templatePath, controller) {
121 let deferred = this.$q.defer();
122 var modalInstance = this.$modal.open({
123 templateUrl: templatePath,
124 controller: controller,
125 sizeClass:'modal-small',
127 message: function message() {
136 modalInstance.result.then(function () {
139 return deferred.promise;
143 let deferred = this.$q.defer();
144 var modalInstance = this.$modal.open({
145 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
146 controller: 'ConfirmationBoxCtrl',
147 sizeClass:'modal-small',
149 message: function message() {
158 modalInstance.result.then(function (confirm) {
160 deferred.resolve(confirm);
162 deferred.reject(confirm);
164 return deferred.promise;
168 let deferred = this.$q.defer();
169 var modalInstance = this.$modal.open({
170 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
171 controller: 'ConfirmationBoxCtrl',
172 sizeClass:'modal-small',
174 message: function message() {
177 title:'Confirmation',
178 content: 'Are you sure you want to delete ' +item+ ' ?'
184 modalInstance.result.then(function (confirm) {
186 deferred.resolve(confirm);
188 deferred.reject(confirm);
190 return deferred.promise;
194 let deferred = this.$q.defer();
195 var modalInstance = this.$modal.open({
196 templateUrl: 'app/views/confirmation-box/dragdrop-confirmation-box.tpl.html',
197 controller: 'ConfirmationBoxCtrl',
198 sizeClass:'modal-small',
200 message: function message() {
203 title:'Functional Menu - Move',
210 modalInstance.result.then(function (confirm) {
212 deferred.resolve(confirm);
214 deferred.reject(confirm);
216 return deferred.promise;
219 makeAdminChanges(msg) {
220 let deferred = this.$q.defer();
221 var modalInstance = this.$modal.open({
222 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
223 controller: 'ConfirmationBoxCtrl',
224 sizeClass:'modal-small',
226 message: function message() {
229 title:'Admin Update',
236 modalInstance.result.then(function (confirm) {
238 deferred.resolve(confirm);
240 deferred.reject(confirm);
242 return deferred.promise;
246 makeUserAppRoleCatalogChanges(msg) {
247 let deferred = this.$q.defer();
248 var modalInstance = this.$modal.open({
249 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
250 controller: 'ConfirmationBoxCtrl',
251 sizeClass:'modal-small',
253 message: function message() {
256 title:'UserRoles Update',
263 modalInstance.result.then(function (confirm) {
265 deferred.resolve(confirm);
267 deferred.reject(confirm);
269 return deferred.promise;
273 webAnalyticsChanges(msg) {
274 let deferred = this.$q.defer();
275 var modalInstance = this.$modal.open({
276 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
277 controller: 'ConfirmationBoxCtrl',
278 sizeClass:'modal-small',
280 message: function message() {
283 title:'Add WebAnalytics Source',
290 modalInstance.result.then(function (confirm) {
292 deferred.resolve(confirm);
294 deferred.reject(confirm);
296 return deferred.promise;
300 updateWebAnalyticsReport(msg) {
301 let deferred = this.$q.defer();
302 var modalInstance = this.$modal.open({
303 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
304 controller: 'ConfirmationBoxCtrl',
305 sizeClass:'modal-small',
307 message: function message() {
310 title:'Update WebAnalytics Source',
317 modalInstance.result.then(function (confirm) {
319 deferred.resolve(confirm);
321 deferred.reject(confirm);
323 return deferred.promise;
327 ConfirmBoxService.$inject = ['$q', '$log', 'ngDialog','$modal'];
328 angular.module('ecompApp').service('confirmBoxService', ConfirmBoxService)