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 * ================================================================================
21 * Created by nnaffar on 1/18/16.
26 class ConfirmBoxService {
27 constructor($q, $log, ngDialog,$modal) {
30 this.ngDialog = ngDialog;
33 reloadPageConfirm(msg){
34 let deferred = this.$q.defer();
35 var modalInstance = this.$modal.open({
36 templateUrl: 'app/views/confirmation-box/reload-page-confirm.html',
37 controller: 'ConfirmationBoxCtrl',
38 sizeClass:'modal-small',
40 message: function message() {
49 modalInstance.result.then(function () {
52 return deferred.promise;
54 showInformation(msg) {
55 let deferred = this.$q.defer();
56 var modalInstance = this.$modal.open({
57 templateUrl: 'app/views/confirmation-box/information-box.tpl.html',
58 controller: 'ConfirmationBoxCtrl',
59 sizeClass:'modal-small',
61 message: function message() {
70 modalInstance.result.then(function () {
73 return deferred.promise;
77 let deferred = this.$q.defer();
78 var modalInstance = this.$modal.open({
79 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
80 controller: 'ConfirmationBoxCtrl',
81 sizeClass:'modal-small',
83 message: function message() {
92 modalInstance.result.then(function (confirm) {
94 deferred.resolve(confirm);
96 deferred.reject(confirm);
98 return deferred.promise;
102 showDynamicInformation(msg, templatePath, controller) {
103 let deferred = this.$q.defer();
104 var modalInstance = this.$modal.open({
105 templateUrl: templatePath,
106 controller: controller,
107 sizeClass:'modal-small',
109 message: function message() {
118 modalInstance.result.then(function () {
121 return deferred.promise;
125 let deferred = this.$q.defer();
126 var modalInstance = this.$modal.open({
127 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
128 controller: 'ConfirmationBoxCtrl',
129 sizeClass:'modal-small',
131 message: function message() {
140 modalInstance.result.then(function (confirm) {
142 deferred.resolve(confirm);
144 deferred.reject(confirm);
146 return deferred.promise;
150 let deferred = this.$q.defer();
151 var modalInstance = this.$modal.open({
152 templateUrl: 'app/views/confirmation-box/confirmation-box.tpl.html',
153 controller: 'ConfirmationBoxCtrl',
154 sizeClass:'modal-small',
156 message: function message() {
159 title:'Confirmation',
160 content: 'Are you sure you want to delete ' +item+ ' ?'
166 modalInstance.result.then(function (confirm) {
168 deferred.resolve(confirm);
170 deferred.reject(confirm);
172 return deferred.promise;
176 let deferred = this.$q.defer();
177 var modalInstance = this.$modal.open({
178 templateUrl: 'app/views/confirmation-box/dragdrop-confirmation-box.tpl.html',
179 controller: 'ConfirmationBoxCtrl',
180 sizeClass:'modal-small',
182 message: function message() {
185 title:'Functional Menu - Move',
192 modalInstance.result.then(function (confirm) {
194 deferred.resolve(confirm);
196 deferred.reject(confirm);
198 return deferred.promise;
201 makeAdminChanges(msg) {
202 let deferred = this.$q.defer();
203 var modalInstance = this.$modal.open({
204 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
205 controller: 'ConfirmationBoxCtrl',
206 sizeClass:'modal-small',
208 message: function message() {
211 title:'Admin Update',
218 modalInstance.result.then(function (confirm) {
220 deferred.resolve(confirm);
222 deferred.reject(confirm);
224 return deferred.promise;
228 makeUserAppRoleCatalogChanges(msg) {
229 let deferred = this.$q.defer();
230 var modalInstance = this.$modal.open({
231 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
232 controller: 'ConfirmationBoxCtrl',
233 sizeClass:'modal-small',
235 message: function message() {
238 title:'UserRoles Update',
245 modalInstance.result.then(function (confirm) {
247 deferred.resolve(confirm);
249 deferred.reject(confirm);
251 return deferred.promise;
255 webAnalyticsChanges(msg) {
256 let deferred = this.$q.defer();
257 var modalInstance = this.$modal.open({
258 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
259 controller: 'ConfirmationBoxCtrl',
260 sizeClass:'modal-small',
262 message: function message() {
265 title:'Add WebAnalytics Source',
272 modalInstance.result.then(function (confirm) {
274 deferred.resolve(confirm);
276 deferred.reject(confirm);
278 return deferred.promise;
282 updateWebAnalyticsReport(msg) {
283 let deferred = this.$q.defer();
284 var modalInstance = this.$modal.open({
285 templateUrl: 'app/views/confirmation-box/admin-confirmation-box.tpl.html',
286 controller: 'ConfirmationBoxCtrl',
287 sizeClass:'modal-small',
289 message: function message() {
292 title:'Update WebAnalytics Source',
299 modalInstance.result.then(function (confirm) {
301 deferred.resolve(confirm);
303 deferred.reject(confirm);
305 return deferred.promise;
309 ConfirmBoxService.$inject = ['$q', '$log', 'ngDialog','$modal'];
310 angular.module('ecompApp').service('confirmBoxService', ConfirmBoxService)