How to use Ng1Directive method in Protractor

Best JavaScript code snippet using protractor

Run Protractor automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

ng1-sandbox.directive.js

Source: ng1-sandbox.directive.js Github

copy
1var ynfsworkshop;
2(function (ynfsworkshop) {
3    'use strict';
4    angular
5        .module('ynfsworkshop')
6        .directive('sidenavNg1', sidenavNg1Directive);
7    function sidenavNg1Directive() {
8        return {
9            controller: SideNavController,
10            controllerAs: 'sn',
11            templateUrl: 'app/ng1-sandbox/layout/sidenavNg1.html'
12        };
13    }
14    function SideNavController($mdSidenav) {
15        this.sidenavNg1 = 'sidenavNg1';
16    }
17})(ynfsworkshop || (ynfsworkshop = {}));
18
Full Screen

index.js

Source: index.js Github

copy
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
7var angular = _interopDefault(require('angular'));
8var core = require('@angular/core');
9var _static = require('@angular/upgrade/static');
10var common = require('@angular/common');
11var common$1 = require('@msx/common');
12var forms = require('@msx/forms');
13var templateManagement = require('@msx/template-management');
14var _ = _interopDefault(require('lodash'));
15var rxjs = require('rxjs');
16
17/*! *****************************************************************************
18Copyright (c) Microsoft Corporation. All rights reserved.
19Licensed under the Apache License, Version 2.0 (the "License"); you may not use
20this file except in compliance with the License. You may obtain a copy of the
21License at http://www.apache.org/licenses/LICENSE-2.0
22
23THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
24KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
25WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
26MERCHANTABLITY OR NON-INFRINGEMENT.
27
28See the Apache Version 2.0 License for specific language governing permissions
29and limitations under the License.
30***************************************************************************** */
31
32function __decorate(decorators, target, key, desc) {
33    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
35    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
36    return c > 3 && r && Object.defineProperty(target, key, r), r;
37}
38
39function __param(paramIndex, decorator) {
40    return function (target, key) { decorator(target, key, paramIndex); }
41}
42
43function __metadata(metadataKey, metadataValue) {
44    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
45}
46
47function __awaiter(thisArg, _arguments, P, generator) {
48    return new (P || (P = Promise))(function (resolve, reject) {
49        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
52        step((generator = generator.apply(thisArg, _arguments || [])).next());
53    });
54}
55
56function __generator(thisArg, body) {
57    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
58    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
59    function verb(n) { return function (v) { return step([n, v]); }; }
60    function step(op) {
61        if (f) throw new TypeError("Generator is already executing.");
62        while (_) try {
63            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
64            if (y = 0, t) op = [op[0] & 2, t.value];
65            switch (op[0]) {
66                case 0: case 1: t = op; break;
67                case 4: _.label++; return { value: op[1], done: false };
68                case 5: _.label++; y = op[1]; op = [0]; continue;
69                case 7: op = _.ops.pop(); _.trys.pop(); continue;
70                default:
71                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
72                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
73                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
74                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
75                    if (t[2]) _.ops.pop();
76                    _.trys.pop(); continue;
77            }
78            op = body.call(thisArg, _);
79        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
80        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
81    }
82}
83
84function __spreadArrays() {
85    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
86    for (var r = Array(s), k = 0, i = 0; i < il; i++)
87        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
88            r[k] = a[j];
89    return r;
90}
91
92var template = "<div class=\"msx-add-device-info\"><div class=\"msx-add-device-info__deviceDetails\" *ngIf=\"!isLoading\"><div class=\"msx-add-device-info__deviceDetails__name\"><msx-input-box type=\"text\" name=\"deviceName\" [msxModel]=\"deviceName\" [msxRequired]=\"true\" (msxModelChange)=\"onValueChange($event, 'deviceName')\" placeholder=\"cisco.common.workflow.add.device.deviceInfo.device.name.placeholder\" label=\"cisco.common.workflow.add.device.deviceInfo.device.name.label\" inputErrorMessage=\"cisco.common.workflow.add.device.deviceInfo.device.name.errorMessage\"></msx-input-box></div><div class=\"msx-add-device-info__deviceDetails__model\"><msx-multi-select-combo-dropdown [items]=\"deviceModelsList\" appendTo=\"body\" [msxModel]=\"deviceModel\" [msxRequired]=\"true\" (msxModelChange)=\"onValueChange($event, 'deviceModel')\" label=\"cisco.common.workflow.add.device.deviceInfo.device.model.label\" placeholder=\"cisco.common.workflow.add.device.deviceInfo.device.model.placeholder\" [singleSelect]=\"true\" [showClearSelection]=\"false\"></msx-multi-select-combo-dropdown></div><div class=\"msx-add-device-info__deviceDetails__serial\"><msx-input-box type=\"text\" name=\"deviceSerial\" [msxModel]=\"deviceSerial\" (msxModelChange)=\"onValueChange($event, 'deviceSerial')\" placeholder=\"cisco.common.workflow.add.device.deviceInfo.device.serial.placeholder\" label=\"cisco.common.workflow.add.device.deviceInfo.device.serial.label\"></msx-input-box></div></div></div>\n";
93
94var AddDeviceInfoComponent = (function () {
95    function AddDeviceInfoComponent(devicesService, _step) {
96        this.devicesService = devicesService;
97        this._step = _step;
98        this.deviceName = '';
99        this.deviceSerial = '';
100        this.deviceModelsList = [];
101    }
102    AddDeviceInfoComponent.prototype.ngOnInit = function () {
103        var _this = this;
104        this.deviceModelsList = [];
105        this.devicesService.getDeviceModelsByType().then(function (data) {
106            var items = [];
107            data.forEach(function (val) {
108                items.push({
109                    label: val.name,
110                    value: val.name
111                });
112            });
113            _this.deviceModelsList = _this.rangeWildcardReplacement(items);
114        });
115    };
116    AddDeviceInfoComponent.prototype.rangeWildcardReplacement = function (items) {
117        var updatedItems = [];
118        items.forEach(function (modelItem) {
119            updatedItems.push({
120                label: modelItem.label.replaceAll('[0-9]', '*').replaceAll('(', '').replaceAll(')', ''),
121                value: modelItem.value
122            });
123        });
124        return updatedItems;
125    };
126    AddDeviceInfoComponent.prototype.onValueChange = function (value, type) {
127        var _this = this;
128        setTimeout(function () {
129            if (type === 'deviceName') {
130                _this.deviceName = value;
131            }
132            else if (type === 'deviceModel') {
133                _this.deviceModel = value;
134            }
135            else if (type === 'deviceSerial') {
136                _this.deviceSerial = value;
137            }
138            if (_this.deviceName && !_.isEmpty(_this.deviceModel)) {
139                var deviceData = {
140                    managed: false,
141                    model: _this.deviceModel[0].value,
142                    name: _this.deviceName,
143                    onboardType: "none",
144                    serialKey: _this.deviceSerial,
145                    tags: {},
146                    tenantId: _this.componentData.tenantId,
147                    type: "ANY"
148                };
149                _this.componentData.deviceInfo = deviceData;
150                _this._step.completed = true;
151            }
152            else {
153                _this._step.completed = false;
154            }
155        });
156    };
157    __decorate([
158        core.Input(),
159        __metadata("design:type", Object)
160    ], AddDeviceInfoComponent.prototype, "componentData", void 0);
161    AddDeviceInfoComponent = __decorate([
162        core.Component({
163            selector: 'msx-add-device-info',
164            providers: [
165                new common$1.AngularJSProvider('msx.devicesService')
166            ],
167            template: template
168        }),
169        __param(0, core.Inject('msx.devicesService')),
170        __param(1, core.Inject(common$1.WizardStepComponent)),
171        __metadata("design:paramtypes", [Object, Object])
172    ], AddDeviceInfoComponent);
173    return AddDeviceInfoComponent;
174}());
175
176var template$1 = "<div class=\"msx-add-device-review\"><div *ngIf=\"componentData.deviceInfo\" class=\"msx-add-device-review__details\">\n        <div *ngIf=\"componentData.deviceInfo.name\">\n            <label role=\"label\" class=\"sk-font-metadata-medium\" msxResourceString=\"cisco.common.workflow.add.device.deviceReview.device.name.label\"></label>\n            <span class=\"msx-add-device-review__details_name sk-font-standard-text\" msxResourceString=\"{{componentData.deviceInfo.name}}\"></span>\n        </div>\n        <div *ngIf=\"componentData.deviceInfo.model\">\n            <label role=\"label\" class=\"sk-font-metadata-medium\" msxResourceString=\"cisco.common.workflow.add.device.deviceReview.device.model.label\"></label>\n            <span class=\"msx-add-device-review__details_model sk-font-standard-text\" msxResourceString=\"{{componentData.deviceInfo.model}}\"></span>\n        </div>\n        <div *ngIf=\"componentData.deviceInfo.serialKey\">\n            <label role=\"label\" class=\"sk-font-metadata-medium\" msxResourceString=\"cisco.common.workflow.add.device.deviceReview.device.serial.label\"></label>\n            <span class=\"msx-add-device-review__details_serial sk-font-standard-text\" msxResourceString=\"{{componentData.deviceInfo.serialKey}}\"></span>\n        </div>\n    </div><div class=\"msx-add-device-review__details__button-bar button-bar center-buttons\">\n        <button class=\"button button--medium button--secondary\" (click)=\"back()\" msxResourceString=\"cisco.common.button.back\"></button>\n        <button *ngIf=\"componentData.deviceInfo\" class=\"button button--medium button--cta\" (click)=\"addDevice()\" msxResourceString=\"cisco.common.button.submission\"></button>\n    </div></div>\n";
177
178var AddDeviceReviewComponent = (function () {
179    function AddDeviceReviewComponent(devicesService, loggerService, _wizardStepper) {
180        this.devicesService = devicesService;
181        this.loggerService = loggerService;
182        this._wizardStepper = _wizardStepper;
183    }
184    AddDeviceReviewComponent.prototype.back = function () {
185        this._wizardStepper.previous();
186    };
187    AddDeviceReviewComponent.prototype.addDevice = function () {
188        var _this = this;
189        var device = this.componentData.deviceInfo;
190        this.componentData.deviceName = device.name;
191        if (device && device.name) {
192            this.devicesService.addDevice(device.tenantId, this.componentData.selectedService.serviceInstanceId, this.componentData.selectedService.type, device.serialKey, device.model, device.deviceType || '', device.deviceSubtype || '', device.name, null, device.version || '', 'none', false).then(function (resp) {
193                if (resp && resp.data && resp.data.responseObject) {
194                    _this.componentData.deviceId = resp.data.responseObject.id;
195                    _this._wizardStepper.next();
196                }
197            }, function (err) {
198                _this.loggerService.warn("addDevice Error:", err);
199                _this.componentData.failureMessage = err.data.message;
200                _this._wizardStepper.next();
201            });
202        }
203    };
204    __decorate([
205        core.Input(),
206        __metadata("design:type", Object)
207    ], AddDeviceReviewComponent.prototype, "componentData", void 0);
208    AddDeviceReviewComponent = __decorate([
209        core.Component({
210            selector: 'msx-add-device-review',
211            providers: [
212                new common$1.AngularJSProvider('msx.devicesService'),
213                new common$1.AngularJSProvider('msx.loggerService')
214            ],
215            template: template$1
216        }),
217        __param(0, core.Inject('msx.devicesService')),
218        __param(1, core.Inject('msx.loggerService')),
219        __param(2, core.Inject(common$1.WizardComponent)),
220        __metadata("design:paramtypes", [Object, Object, Object])
221    ], AddDeviceReviewComponent);
222    return AddDeviceReviewComponent;
223}());
224
225var template$2 = "<div class=\"msx-add-device-service\"><msx-busy-indicator *ngIf=\"isLoading\" [radius]=\"3.2\" class=\"vms-busy-center\"></msx-busy-indicator><div *ngIf=\"!isLoading\"><div class=\"msx-add-device-service__services\" *ngIf=\"componentData.tenantServices && componentData.tenantServices.length\"><ng-container *ngFor=\"let tile of componentData.tenantServices\"><div class=\"msx-add-device-service__services__service msx-add-device-service__services__service-for-{{tile.type}}\" [ngClass]=\"{'msx-add-device-service__services__service__disabled': componentData.preSelectedService || tile.doesNotSupportGlobalAddDevice}\" (click)=\"onServiceChange(tile)\"><div class=\"msx-add-device-service__services__service__icon-wrapper\" [ngClass]=\"{'msx-add-device-service__services__service__icon-wrapper__disabled': componentData.preSelectedService}\"><msx-image-loader [ngClass]=\"{'msx-add-device-service__services__service__not_supported': tile.doesNotSupportGlobalAddDevice}\" *ngIf=\"tile.icon != null\" url=\"{{tile.icon}}\"></msx-image-loader><div *ngIf=\"tile.type === selectedServiceType || tile.type === componentData.preSelectedService\" class=\"msx-add-device-service__services__service__icon-badge vms_fi_alert6015-16\" [ngClass]=\"{'sk-color-white': tile.type === selectedServiceType, 'sk-background-primary-1': tile.type === selectedServiceType }\"></div></div><div class=\"msx-add-device-service__services__service__title sk-font-standard-text\" [ngClass]=\"{'msx-add-device-service__services__service__not_supported': tile.doesNotSupportGlobalAddDevice}\" msxResourceString=\"{{tile.title}}\">\n\t\t\t\t\t</div><div class=\"msx-add-device-service__services__service__link sk-font-standard-link\" tabindex=\"{{ componentData.preSelectedService ? -1 : 0 }}\" role=\"link\" *ngIf=\"!tile.doesNotSupportGlobalAddDevice\" [ngClass]=\"{'sk-font-metadata-medium': componentData.preSelectedService, 'msx-add-device-service__services__service__link__disabled': componentData.preSelectedService}\" msxResourceString=\"{{getLinkTitle(tile)}}\"></div><div class=\"msx-add-device-service__services__service__not_supported sk-font-metadata-medium\" *ngIf=\"tile.doesNotSupportGlobalAddDevice\" msxResourceString=\"{{getDisabledMessage(tile)}}\"></div>\n\t\t\t\t</div></ng-container></div></div></div>";
226
227var AddDeviceServiceComponent = (function () {
228    function AddDeviceServiceComponent(translateService, servicesService) {
229        this.translateService = translateService;
230        this.servicesService = servicesService;
231        this.selectedServiceType = '';
232    }
233    AddDeviceServiceComponent.prototype.ngOnInit = function () {
234        var _this = this;
235        this.stepChange.subscribe(function (step) {
236            if (step === 'addDeviceService' && _this.componentData && _this.componentData.preSelectedService) {
237                _this.selectedServiceType = _this.componentData.preSelectedService;
238            }
239        });
240    };
241    AddDeviceServiceComponent.prototype.onServiceChange = function (service) {
242        if (service.doesNotSupportGlobalAddDevice) {
243            return;
244        }
245        if (this.componentData && this.componentData.preSelectedService) {
246            this.selectedServiceType = this.componentData.preSelectedService;
247        }
248        else if (this.componentData && (service === null || service === void 0 ? void 0 : service.type) !== this.selectedServiceType) {
249            this.selectedServiceType = service.type;
250            this.componentData.serviceSelected(service);
251        }
252        else {
253            this.selectedServiceType = null;
254            this.componentData.serviceSelected(null);
255        }
256    };
257    AddDeviceServiceComponent.prototype.getLinkTitle = function (service) {
258        if (service && service.type && this.componentData.preSelectedService && this.componentData.preSelectedService === service.type) {
259            return "cisco.common.button.selected";
260        }
261        else if (this.componentData.preSelectedService && this.componentData.preSelectedService !== service.type) {
262            return "cisco.common.button.disabled";
263        }
264        else if ((service === null || service === void 0 ? void 0 : service.type) === this.selectedServiceType) {
265            return "cisco.common.button.unselect";
266        }
267        return "cisco.common.button.select";
268    };
269    AddDeviceServiceComponent.prototype.getDisabledMessage = function (service) {
270        var msg = "cisco.global.actions.add.device.disabled.for.label";
271        return this.translateService(msg, { serviceName: this.servicesService.getTranslatedServiceName(service.type) });
272    };
273    __decorate([
274        core.Input(),
275        __metadata("design:type", Object)
276    ], AddDeviceServiceComponent.prototype, "componentData", void 0);
277    __decorate([
278        core.Input(),
279        __metadata("design:type", rxjs.Subject)
280    ], AddDeviceServiceComponent.prototype, "stepChange", void 0);
281    AddDeviceServiceComponent = __decorate([
282        core.Component({
283            selector: 'msx-add-device-service',
284            providers: [
285                new common$1.AngularJSProvider('msx.translateService'),
286                new common$1.AngularJSProvider('msx.servicesService')
287            ],
288            template: template$2
289        }),
290        __param(0, core.Inject('msx.translateService')),
291        __param(1, core.Inject('msx.servicesService')),
292        __metadata("design:paramtypes", [Object, Object])
293    ], AddDeviceServiceComponent);
294    return AddDeviceServiceComponent;
295}());
296
297var template$3 = "<div class=\"msx-add-device\"><msx-wizard #wizard (wizardClosed)=\"closeWizard()\" (wizardStepChange)=\"handleStepChange($event)\"><ng-container *ngFor=\"let step of jsonStepMetadata\"><msx-wizard-step [title]=\"step.title\" [description]=\"step.description\" [key]=\"step.key\" [status]=\"step.status\" [skipToStepKey]=\"step.skipToStepKey\" [introductionTitle]=\"step.introductionTitle\" [introductionDescription]=\"step.introductionDescription\" [introductionIcon]=\"step.introductionIcon\" [introductionLargeImage]=\"step.introductionLargeImage\" [introductionStartButtonLabel]=\"step.introductionStartButtonLabel\" [introductionSkipButtonLabel]=\"step.introductionSkipButtonLabel\" [introductionStepLabel]=\"step.introductionStepLabel\" [showIntroductionStep]=\"step.showIntroductionStep\" [allowSkippingIntroductionStep]=\"step.allowSkippingIntroductionStep\" [isChanged]=\"step.isChanged\" [hideTitle]=\"step.hideTitle\" [hideButtonBar]=\"step.hideButtonBar\" [disableButtons]=\"step.disableButtons\" [showBusyDir]=\"step.showBusyDir\" [optional]=\"step.optional\" [completed]=\"step.completed\" (stepEnterHandler)=\"step.stepEnterHandler()\" [systemStepTitle]=\"step.systemStepTitle\" [systemStepLoadingCaption]=\"step.systemStepLoadingCaption\" [systemStepIconClasses]=\"step.systemStepIconClasses\" [systemStepButtons]=\"step.systemStepButtons\" [showFinalStep]=\"step.showFinalStep\"><dynamic-wizard-step *ngIf=\"step.component\" [(component)]=\"step.component\" [(module)]=\"step.module\" [(componentData)]=\"step.componentData\" [(stepChange)]=\"stepChange\" (nextSteps)=\"addNextSteps($event, step.key)\"></dynamic-wizard-step></msx-wizard-step></ng-container></msx-wizard></div>\n";
298
299var AddDeviceComponent = (function () {
300    function AddDeviceComponent(servicesService, serviceCatalogService, sitesService, translateService, deviceDetailsRegistry, twgaRegistry, msxInfo, $state) {
301        var _this = this;
302        this.servicesService = servicesService;
303        this.serviceCatalogService = serviceCatalogService;
304        this.sitesService = sitesService;
305        this.translateService = translateService;
306        this.deviceDetailsRegistry = deviceDetailsRegistry;
307        this.twgaRegistry = twgaRegistry;
308        this.msxInfo = msxInfo;
309        this.$state = $state;
310        this.globalAddCheck = false;
311        this.close = new core.EventEmitter();
312        this.jsonStepMetadata = [];
313        this.serviceSteps = [];
314        this.serviceActions = [];
315        this.stepChange = new rxjs.Subject();
316        this.lastInsertedSteps = [];
317        this.deviceStepsData = {
318            tenantServices: [],
319            preSelectedService: this.serviceType,
320            selectedService: {},
321            serviceSelected: function (data) { return _this.getServiceSteps(data); },
322            deviceInfo: {},
323            closeWizard: function () { return _this.closeWizard(); }
324        };
325        this.initialSteps = [{
326                optional: true,
327                key: "addDeviceIntroduction",
328                introductionTitle: "cisco.common.workflow.add.device.introduction.title",
329                introductionDescription: "cisco.common.workflow.add.device.introduction.description",
330                introductionIcon: "vms_fi_settings3027-48",
331                introductionStepLabel: "addDeviceIntroduction",
332                showIntroductionStep: true,
333                allowSkippingIntroductionStep: true,
334                hideButtonBar: true
335            }, {
336                title: "cisco.common.workflow.add.device.serviceselection.title",
337                description: "cisco.common.workflow.add.device.serviceselection.description",
338                optional: false,
339                key: "addDeviceService",
340                completed: false,
341                component: AddDeviceServiceComponent,
342                componentData: this.deviceStepsData
343            }];
344        this.defaultFlowSteps = [{
345                title: "cisco.common.workflow.add.device.deviceInfo.title",
346                description: "cisco.common.workflow.add.device.deviceInfo.description",
347                optional: false,
348                key: "platformAddDeviceInfo",
349                completed: false,
350                component: AddDeviceInfoComponent,
351                componentData: this.deviceStepsData
352            }, {
353                title: "cisco.common.workflow.add.device.deviceReview.title",
354                description: "cisco.common.workflow.add.device.deviceReview.description",
355                optional: true,
356                hideButtonBar: true,
357                key: "platformAddDeviceReview",
358                completed: false,
359                component: AddDeviceReviewComponent,
360                componentData: this.deviceStepsData
361            }];
362        this.finalStep = [{
363                title: 'cisco.common.workflow.add.device.final.busy.caption',
364                optional: true,
365                hideButtonBar: true,
366                key: 'addDeviceFinal',
367                completed: false,
368                stepEnterHandler: function () { return _this.getFinalStepInfo(); },
369                hideTitle: true,
370                systemStepLoadingCaption: "cisco.common.workflow.add.device.final.busy.caption",
371                systemStepTitle: '',
372                description: '',
373                systemStepIconClasses: '',
374                systemStepButtons: [],
375                showFinalStep: true
376            }];
377        this.originalSpStepsComponentData = null;
378    }
379    AddDeviceComponent.prototype.ngOnInit = function () {
380        var tenant = JSON.parse(window.localStorage.getItem('ngStorage-tenantItem') || '{}');
381        this._tenantId = this.tenantId ? this.tenantId : tenant.tenantId;
382        this.deviceStepsData.preSelectedService = this.serviceType;
383        if (this.serviceType) {
384            this.initialSteps[1].description = 'cisco.common.workflow.add.device.serviceselection.selected';
385        }
386        this.jsonStepMetadata = this.initialSteps;
387        this.addStepEnter();
388        this.getServices();
389    };
390    AddDeviceComponent.prototype.closeWizard = function () {
391        this.close.emit();
392    };
393    AddDeviceComponent.prototype.handleStepChange = function (step) {
394        this.stepChange.next(step.key);
395    };
396    AddDeviceComponent.prototype.getServices = function () {
397        var _this = this;
398        var serviceTiles = [];
399        var filter = [{
400                name: "tenantId",
401                value: [this._tenantId]
402            }];
403        var getCtx = function (ctx) {
404            return ctx;
405        };
406        var self = getCtx(this);
407        this.servicesService.getServices('', 0, 100, filter).then(function (data) {
408            if (data.entities && data.entities.length) {
409                data.entities.forEach(function (service) {
410                    var title = _this.servicesService.getTranslatedServiceName(service.serviceDefAttribute.type);
411                    _this.serviceCatalogService.getService(service.serviceDefAttribute.id).then(function (serviceData) {
412                        var tile = {
413                            serviceInstanceId: service.serviceInstanceId,
414                            subscriptionId: service.subscriptionId,
415                            type: service.serviceDefAttribute.type || "unknown",
416                            title: _this.translateService(title),
417                            icon: serviceData.image,
418                            doesNotSupportGlobalAddDevice: false
419                        };
420                        if (self.globalAddCheck) {
421                            var actions = _this.twgaRegistry.getGlobalActionsSupport(tile.type);
422                            if (!actions.addDevice) {
423                                tile.doesNotSupportGlobalAddDevice = true;
424                            }
425                        }
426                        serviceTiles.push(tile);
427                        serviceTiles.sort(function (a, b) {
428                            var aLabel = (a.title || "").toLowerCase();
429                            var bLabel = (b.title || "").toLowerCase();
430                            if (aLabel < bLabel) {
431                                return -1;
432                            }
433                            else if (aLabel > bLabel) {
434                                return 1;
435                            }
436                            return 0;
437                        });
438                        if (_this.serviceType && _this.serviceType === tile.type && !tile.doesNotSupportGlobalAddDevice) {
439                            _this.getServiceSteps(tile);
440                        }
441                    });
442                });
443                _this.deviceStepsData.tenantServices = serviceTiles;
444            }
445        });
446    };
447    AddDeviceComponent.prototype.addStepEnter = function () {
448        _.forEach(this.jsonStepMetadata, function (step) {
449            if (!step.stepEnterHandler) {
450                step.stepEnterHandler = function () { };
451            }
452        });
453    };
454    AddDeviceComponent.prototype.getServiceSteps = function (service) {
455        if (service && service.type) {
456            this.deviceStepsData.selectedService = service;
457            var steps = this.deviceDetailsRegistry.getAddDeviceSteps(service.type) || [];
458            if (steps.length) {
459                this.jsonStepMetadata = __spreadArrays(this.initialSteps, steps, this.finalStep);
460            }
461            else {
462                this.jsonStepMetadata = __spreadArrays(this.initialSteps, this.defaultFlowSteps, this.finalStep);
463            }
464            this.originalSpStepsComponentData = _.cloneDeep(this.jsonStepMetadata[2].componentData);
465            this.jsonStepMetadata[2].componentData.tenantId = this._tenantId;
466            this.jsonStepMetadata[2].componentData.selectedService = this.deviceStepsData.selectedService;
467            this.addStepEnter();
468        }
469        else {
470            this.deviceStepsData.selectedService = {};
471            this.jsonStepMetadata = __spreadArrays(this.initialSteps);
472        }
473        this.jsonStepMetadata[1].completed = !!(service && service.type);
474    };
475    AddDeviceComponent.prototype.processFinalStepFailure = function (stepIndex, description, deviceId) {
476        var _this = this;
477        this.jsonStepMetadata[stepIndex].status = 'major';
478        this.jsonStepMetadata[stepIndex].systemStepIconClasses = 'sk-background-status-major vms_fi_alert6001-48';
479        this.jsonStepMetadata[stepIndex].systemStepTitle = 'cisco.common.workflow.add.device.final.failure.title';
480        this.jsonStepMetadata[stepIndex].description = description;
481        if (this.siteId) {
482            this.jsonStepMetadata[stepIndex].systemStepButtons.push({
483                label: "cisco.common.workflow.add.device.final.button.viewdevice.label",
484                buttonClass: 'button--primary',
485                handler: function () {
486                    _this.$state.go("app.tenant_deviceDetails", { obj: { id: deviceId } });
487                }
488            });
489        }
490        this.jsonStepMetadata[stepIndex].systemStepButtons = [{ label: "cisco.common.button.close" }];
491        this.jsonStepMetadata[stepIndex].completed = true;
492    };
493    AddDeviceComponent.prototype.processFinalStepSuccess = function (stepIndex, description, deviceId, deviceName) {
494        var _this = this;
495        this.jsonStepMetadata[stepIndex].systemStepIconClasses = 'sk-background-status-normal vms_fi_alert6015-48';
496        this.jsonStepMetadata[stepIndex].systemStepTitle = 'cisco.common.workflow.add.device.final.success.title';
497        this.jsonStepMetadata[stepIndex].description = description;
498        this.serviceActions = this.deviceDetailsRegistry.getAddDeviceActions(this.deviceStepsData.selectedService.type) || [];
499        var assignSiteAction;
500        var addAnotherDeviceAction;
501        if (this.completeActions && this.completeActions.length) {
502            var assignToSiteDefaultAction = _.find(this.completeActions, ['commonType', 'ASSIGN_TO_SITE']);
503            if (assignToSiteDefaultAction) {
504                assignSiteAction = assignToSiteDefaultAction;
505                if (!assignSiteAction.label) {
506                    assignSiteAction.label = this.translateService("cisco.common.workflow.add.device.final.button.addsite.label");
507                }
508                if (!assignSiteAction.buttonClass) {
509                    assignSiteAction.buttonClass = 'button--primary';
510                }
511            }
512            var addAnotherDeviceDefaultAction = _.find(this.completeActions, ['commonType', 'ADD_ANOTHER']);
513            if (addAnotherDeviceDefaultAction) {
514                addAnotherDeviceAction = addAnotherDeviceDefaultAction;
515                if (!addAnotherDeviceAction.label) {
516                    addAnotherDeviceAction.label = this.translateService("cisco.common.workflow.add.device.final.button.adddevice.label");
517                }
518            }
519        }
520        if (this.serviceActions && this.serviceActions.length) {
521            var assignSiteSpAction = _.find(this.serviceActions, ['commonType', 'ASSIGN_TO_SITE']);
522            if (assignSiteSpAction) {
523                assignSiteAction = assignSiteSpAction;
524            }
525            var addAnotherDeviceSpAction = _.find(this.serviceActions, ['commonType', 'ADD_ANOTHER']);
526            if (addAnotherDeviceSpAction) {
527                addAnotherDeviceAction = addAnotherDeviceSpAction;
528            }
529        }
530        if (this.siteId) {
531            this.jsonStepMetadata[stepIndex].systemStepButtons.push({
532                label: "cisco.common.workflow.assigndevice.final.button.viewsite",
533                buttonClass: 'button--primary',
534                handler: function () {
535                    _this.$state.go("app.tenant_siteDetails", { obj: { siteId: _this.siteId } });
536                }
537            });
538        }
539        else if (assignSiteAction) {
540            if (assignSiteAction.handler) {
541                var data_1 = {
542                    deviceInstanceId: deviceId,
543                    deviceName: deviceName,
544                    serviceType: this.deviceStepsData.selectedService.type,
545                    tenantId: this._tenantId
546                };
547                var action = {
548                    label: assignSiteAction.label,
549                    buttonClass: assignSiteAction.buttonClass,
550                    hide: assignSiteAction.hide,
551                    commonType: assignSiteAction.commonType,
552                    handler: (function () { return assignSiteAction.handler(data_1); })
553                };
554                this.jsonStepMetadata[stepIndex].systemStepButtons.push(action);
555            }
556            else {
557                this.jsonStepMetadata[stepIndex].systemStepButtons.push(assignSiteAction);
558            }
559        }
560        if (addAnotherDeviceAction) {
561            if (addAnotherDeviceAction.handler && this.siteId && this.siteName) {
562                var data_2 = {
563                    deviceInstanceId: deviceId,
564                    deviceName: deviceName,
565                    serviceType: this.deviceStepsData.selectedService.type,
566                    tenantId: this._tenantId,
567                    siteId: this.siteId,
568                    siteName: this.siteName
569                };
570                var action = {
571                    label: addAnotherDeviceAction.label,
572                    buttonClass: addAnotherDeviceAction.buttonClass,
573                    hide: addAnotherDeviceAction.hide,
574                    commonType: addAnotherDeviceAction.commonType,
575                    handler: (function () { return addAnotherDeviceAction.handler(data_2); })
576                };
577                this.jsonStepMetadata[stepIndex].systemStepButtons.push(action);
578            }
579            else {
580                this.jsonStepMetadata[stepIndex].systemStepButtons.push(addAnotherDeviceAction);
581            }
582        }
583        this.jsonStepMetadata[stepIndex].systemStepButtons.push({ label: "cisco.common.button.close" });
584        this.jsonStepMetadata[stepIndex].completed = true;
585    };
586    AddDeviceComponent.prototype.getFinalStepInfo = function () {
587        var _this = this;
588        var lastStepIndex = this.jsonStepMetadata.length - 1;
589        var previousStepIndex = lastStepIndex - 1;
590        var previousStepData = this.jsonStepMetadata[previousStepIndex].componentData;
591        var deviceName = previousStepData && previousStepData.deviceName ? previousStepData.deviceName : null;
592        var deviceId = previousStepData && previousStepData.deviceId ? previousStepData.deviceId : null;
593        var siteName = this.siteName ? this.siteName : null;
594        if (deviceId) {
595            if (this.siteId && siteName) {
596                this.sitesService.addDevice(this.siteId, deviceId).then(function (resp) {
597                    if (resp && resp.data && resp.data.responseObject) {
598                        var description = _this.translateService("cisco.common.workflow.assigndevice.final.success.description", { deviceName: deviceName, siteName: siteName });
599                        _this.processFinalStepSuccess(lastStepIndex, description, deviceId, deviceName);
600                    }
601                }, function (err) {
602                    var failureMessage = err.data && err.data.message ? err.data.message : null;
603                    var description = _this.translateService("cisco.common.workflow.add.device.final.assignment.failure.description", { deviceName: deviceName, siteName: siteName }) + " " + failureMessage;
604                    _this.processFinalStepFailure(lastStepIndex, description, deviceId);
605                });
606            }
607            else {
608                var description = this.translateService("cisco.common.workflow.add.device.final.success.caption", { deviceName: deviceName });
609                this.processFinalStepSuccess(lastStepIndex, description, deviceId, deviceName);
610            }
611        }
612        else {
613            var failureMessage = previousStepData.failureMessage ? previousStepData.failureMessage : "";
614            var description = this.translateService("cisco.common.workflow.add.device.final.failure.caption", { deviceName: deviceName }) + " " + failureMessage;
615            this.processFinalStepFailure(lastStepIndex, description, null);
616        }
617    };
618    AddDeviceComponent.prototype.addNextSteps = function (steps, key) {
619        var _a;
620        if (key && steps && steps.length) {
621            if (key === this.stepKeyofLastInsertedSteps) {
622                this.jsonStepMetadata = _.differenceBy(this.jsonStepMetadata, this.lastInsertedSteps, 'key');
623            }
624            var currentStepIndex = _.findIndex(this.jsonStepMetadata, ['key', key]);
625            (_a = this.jsonStepMetadata).splice.apply(_a, __spreadArrays([currentStepIndex + 1, 0], steps));
626            this.stepKeyofLastInsertedSteps = key;
627            this.lastInsertedSteps = steps;
628            this.addStepEnter();
629        }
630    };
631    AddDeviceComponent.prototype.ngOnDestroy = function () {
632        var _this = this;
633        if (this.originalSpStepsComponentData) {
634            this.jsonStepMetadata.forEach(function (step, index) {
635                if (step.componentData && index !== 0 && index !== 1 && index !== _this.jsonStepMetadata.length - 1) {
636                    step.componentData = _this.originalSpStepsComponentData;
637                }
638            });
639        }
640    };
641    AddDeviceComponent.ng1DirectiveName = 'msxAddDevice';
642    __decorate([
643        core.Input(),
644        __metadata("design:type", String)
645    ], AddDeviceComponent.prototype, "tenantId", void 0);
646    __decorate([
647        core.Input(),
648        __metadata("design:type", String)
649    ], AddDeviceComponent.prototype, "serviceType", void 0);
650    __decorate([
651        core.Input(),
652        __metadata("design:type", String)
653    ], AddDeviceComponent.prototype, "siteId", void 0);
654    __decorate([
655        core.Input(),
656        __metadata("design:type", String)
657    ], AddDeviceComponent.prototype, "siteName", void 0);
658    __decorate([
659        core.Input(),
660        __metadata("design:type", Object)
661    ], AddDeviceComponent.prototype, "completeActions", void 0);
662    __decorate([
663        core.Input(),
664        __metadata("design:type", Boolean)
665    ], AddDeviceComponent.prototype, "globalAddCheck", void 0);
666    __decorate([
667        core.Output(),
668        __metadata("design:type", Object)
669    ], AddDeviceComponent.prototype, "close", void 0);
670    __decorate([
671        core.ViewChild('wizard', { static: false }),
672        __metadata("design:type", common$1.WizardComponent)
673    ], AddDeviceComponent.prototype, "wizard", void 0);
674    AddDeviceComponent = __decorate([
675        core.Component({
676            selector: 'msx-add-device',
677            providers: [
678                new common$1.AngularJSProvider('msx.servicesService'),
679                new common$1.AngularJSProvider('msx.serviceCatalogService'),
680                new common$1.AngularJSProvider('msx.sitesService'),
681                new common$1.AngularJSProvider('msx.translateService'),
682                new common$1.AngularJSProvider('msx.platform.deviceDetailsRegistry'),
683                new common$1.AngularJSProvider('msx.platform.tenantWorkspaceGlobalActionsRegistry'),
684                new common$1.AngularJSProvider('msx.platform.msxInfo')
685            ],
686            template: template$3
687        }),
688        __param(0, core.Inject('msx.servicesService')),
689        __param(1, core.Inject('msx.serviceCatalogService')),
690        __param(2, core.Inject('msx.sitesService')),
691        __param(3, core.Inject('msx.translateService')),
692        __param(4, core.Inject('msx.platform.deviceDetailsRegistry')),
693        __param(5, core.Inject('msx.platform.tenantWorkspaceGlobalActionsRegistry')),
694        __param(6, core.Inject('msx.platform.msxInfo')),
695        __param(7, core.Inject('$state')),
696        __metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object, Object, Object])
697    ], AddDeviceComponent);
698    return AddDeviceComponent;
699}());
700
701var template$4 = "<div class=\"msx-assign-device\"><msx-wizard #wizard class=\"wizard-style assign-device-wizard\" (wizardClosed)=\"closeWizard()\"><msx-wizard-step key=\"assignToSite_introduction\" introductionTitle=\"cisco.common.workflow.assigndevice.introduction.title\" introductionDescription=\"{{introStepDescription}}\" introductionIcon=\"vms_fi_settings3036-48\" introductionStepLabel=\"assignToSiteIntroduction\" [showIntroductionStep]=\"true\" [allowSkippingIntroductionStep]=\"true\" [optional]=\"true\" [hideButtonBar]=\"true\"></msx-wizard-step><msx-wizard-step key=\"assignToSite_selection\" title=\"cisco.common.workflow.assigndevice.siteselection.title\" description=\"cisco.common.workflow.assigndevice.siteselection.description\" [completed]=\"siteSelectionCompleted\"><msx-assign-device-selection [tenantId]=\"_tenantId\" [serviceType]=\"serviceType\" (selectedSite)=\"selectedSite($event)\"></msx-assign-device-selection></msx-wizard-step><msx-wizard-step key=\"assignToSite_final\" title=\"cisco.common.workflow.assigndevice.final.title\" [hideTitle]=\"true\" (stepEnterHandler)=\"handleAssignDevice()\" [hideButtonBar]=\"true\" [status]=\"assignmentStatus\" [completed]=\"isAssignCompleted\" [optional]=\"true\" [showFinalStep]=\"true\" systemStepLoadingCaption=\"cisco.common.workflow.assigndevice.final.busy.caption\" systemStepTitle=\"{{finalStepTitle}}\" description=\"{{finalStepDescription}}\" systemStepIconClasses=\"{{finalStepIcons}}\" [systemStepButtons]=\"finalStepButtons\"></msx-wizard-step></msx-wizard></div>\n";
702
703var AssignDeviceComponent = (function () {
704    function AssignDeviceComponent(sitesService, loggerService, translateService, $state) {
705        this.sitesService = sitesService;
706        this.loggerService = loggerService;
707        this.translateService = translateService;
708        this.$state = $state;
709        this.close = new core.EventEmitter();
710        this.serviceActions = [];
711        this.siteSelectionCompleted = false;
712        this.isAssignCompleted = false;
713        this.finalStepButtons = [];
714    }
715    AssignDeviceComponent.prototype.ngOnInit = function () {
716        this.introStepDescription = this.translateService("cisco.common.workflow.assigndevice.introduction.description", { deviceName: this.deviceName });
717        var tenant = JSON.parse(window.localStorage.getItem('ngStorage-tenantItem') || '{}');
718        this._tenantId = this.tenantId ? this.tenantId : tenant.tenantId;
719    };
720    AssignDeviceComponent.prototype.selectedSite = function (data) {
721        this.siteSelectionCompleted = !!(data && data.id);
722        this.siteData = data;
723    };
724    AssignDeviceComponent.prototype.closeWizard = function () {
725        this.close.emit();
726    };
727    AssignDeviceComponent.prototype.handleAssignDevice = function () {
728        var _this = this;
729        if (this.siteData && this.siteData.id && this.deviceInstanceId) {
730            var siteName_1 = this.siteData.name;
731            this.sitesService.addDevice(this.siteData.id, this.deviceInstanceId).then(function (resp) {
732                if (resp && resp.data && resp.data.responseObject) {
733                    _this.isAssignCompleted = true;
734                    _this.finalStepIcons = 'sk-background-status-normal vms_fi_alert6015-48';
735                    _this.finalStepTitle = _this.translateService("cisco.common.workflow.assigndevice.final.success.title");
736                    _this.finalStepDescription = _this.translateService("cisco.common.workflow.assigndevice.final.success.description", { deviceName: _this.deviceName, siteName: siteName_1 });
737                    _this.finalStepButtons = [{
738                            label: "cisco.common.button.close"
739                        }, {
740                            label: "cisco.common.workflow.assigndevice.final.button.viewsite",
741                            buttonClass: 'button--primary',
742                            handler: function () {
743                                _this.$state.go("app.tenant_siteDetails", { obj: { siteId: resp.data.responseObject.id } });
744                            }
745                        }];
746                }
747            }, function (err) {
748                var failureMessage = err.data && err.data.message ? err.data.message : null;
749                _this.isAssignCompleted = true;
750                _this.assignmentStatus = 'major';
751                _this.finalStepIcons = 'sk-background-status-major vms_fi_alert6001-48';
752                _this.finalStepTitle = _this.translateService("cisco.common.workflow.assigndevice.final.failure.title");
753                _this.finalStepDescription = _this.translateService("cisco.common.workflow.assigndevice.final.failure.description", { deviceName: _this.deviceName, siteName: siteName_1 }) + " " + failureMessage;
754                _this.finalStepButtons = [{
755                        label: "cisco.common.button.close"
756                    }];
757                _this.loggerService.warn("Error Assigning Device To Site:", err);
758            });
759        }
760    };
761    AssignDeviceComponent.ng1DirectiveName = 'msxAssignDevice';
762    __decorate([
763        core.Input(),
764        __metadata("design:type", String)
765    ], AssignDeviceComponent.prototype, "tenantId", void 0);
766    __decorate([
767        core.Input(),
768        __metadata("design:type", String)
769    ], AssignDeviceComponent.prototype, "serviceType", void 0);
770    __decorate([
771        core.Input(),
772        __metadata("design:type", String)
773    ], AssignDeviceComponent.prototype, "deviceInstanceId", void 0);
774    __decorate([
775        core.Input(),
776        __metadata("design:type", String)
777    ], AssignDeviceComponent.prototype, "deviceName", void 0);
778    __decorate([
779        core.Input(),
780        __metadata("design:type", Object)
781    ], AssignDeviceComponent.prototype, "completeActions", void 0);
782    __decorate([
783        core.Output(),
784        __metadata("design:type", Object)
785    ], AssignDeviceComponent.prototype, "close", void 0);
786    __decorate([
787        core.ViewChild('wizard', { static: false }),
788        __metadata("design:type", common$1.WizardComponent)
789    ], AssignDeviceComponent.prototype, "wizard", void 0);
790    AssignDeviceComponent = __decorate([
791        core.Component({
792            selector: 'msx-assign-device',
793            providers: [
794                new common$1.AngularJSProvider('msx.sitesService'),
795                new common$1.AngularJSProvider('msx.loggerService'),
796                new common$1.AngularJSProvider('msx.translateService')
797            ],
798            template: template$4
799        }),
800        __param(0, core.Inject('msx.sitesService')),
801        __param(1, core.Inject('msx.loggerService')),
802        __param(2, core.Inject('msx.translateService')),
803        __param(3, core.Inject('$state')),
804        __metadata("design:paramtypes", [Object, Object, Object, Object])
805    ], AssignDeviceComponent);
806    return AssignDeviceComponent;
807}());
808
809var template$5 = "<div class=\"msx-assign-device-site-selection\">\n\t<msx-site-selector class=\"msx-assign-device-site-selection__site-dropdown\" label=\"cisco.common.workflow.assigndevice.siteselection.site.label\" showLabel=\"true\" includeImage=\"true\" mappedOnly=\"true\" [tenantId]=\"tenantId\" (onSiteSelect)=\"onSiteSelect($event)\" appendTo=\"body\"></msx-site-selector>\n\t<msx-site-info-tile *ngIf=\"showSite\" [image]=\"selectedSiteData.image\" [mainTitle]=\"selectedSiteData.name\" [subTitle]=\"selectedSiteData.address.formattedAddress || selectedSiteData.address.name\" [notes]=\"selectedSiteData.address.address2\" [description]=\"selectedSiteData.description\" class=\"msx-assign-device-site-selection__site-info\"></msx-site-info-tile>\n</div>";
810
811var AssignDeviceSelectionComponent = (function () {
812    function AssignDeviceSelectionComponent() {
813        this.selectedSite = new core.EventEmitter();
814        this.selectedSiteData = {};
815        this.showSite = false;
816    }
817    AssignDeviceSelectionComponent.prototype.onSiteSelect = function (selection) {
818        if (selection.site) {
819            this.selectedSiteData = selection.site;
820            this.showSite = true;
821        }
822        else {
823            this.selectedSiteData = {};
824            this.showSite = false;
825        }
826        this.selectedSite.emit(this.selectedSiteData);
827    };
828    __decorate([
829        core.Input(),
830        __metadata("design:type", String)
831    ], AssignDeviceSelectionComponent.prototype, "tenantId", void 0);
832    __decorate([
833        core.Input(),
834        __metadata("design:type", String)
835    ], AssignDeviceSelectionComponent.prototype, "serviceType", void 0);
836    __decorate([
837        core.Output(),
838        __metadata("design:type", core.EventEmitter)
839    ], AssignDeviceSelectionComponent.prototype, "selectedSite", void 0);
840    AssignDeviceSelectionComponent = __decorate([
841        core.Component({
842            selector: 'msx-assign-device-selection',
843            template: template$5
844        })
845    ], AssignDeviceSelectionComponent);
846    return AssignDeviceSelectionComponent;
847}());
848
849var ADD_DEVICE_DIRECTIVES = [
850    AddDeviceComponent,
851    AddDeviceServiceComponent,
852    AddDeviceInfoComponent,
853    AddDeviceReviewComponent,
854    AssignDeviceComponent,
855    AssignDeviceSelectionComponent
856];
857var DevicesModule = (function () {
858    function DevicesModule() {
859    }
860    DevicesModule = __decorate([
861        core.NgModule({
862            providers: [
863                new common$1.AngularJSProvider('$state'),
864                new common$1.AngularJSProvider('msx.servicesService'),
865                new common$1.AngularJSProvider('msx.serviceCatalogService'),
866                new common$1.AngularJSProvider('msx.translateService'),
867                new common$1.AngularJSProvider('msx.loggerService'),
868                new common$1.AngularJSProvider('skI18nService'),
869                new common$1.AngularJSProvider('rbacService'),
870                new common$1.AngularJSProvider('$stateParams')
871            ],
872            imports: [common$1.MsxCommonModule, common.CommonModule, forms.MsxFormsModule, templateManagement.TemplateManagementModule],
873            declarations: [ADD_DEVICE_DIRECTIVES],
874            exports: [ADD_DEVICE_DIRECTIVES],
875            entryComponents: [ADD_DEVICE_DIRECTIVES]
876        })
877    ], DevicesModule);
878    return DevicesModule;
879}());
880
881function getRootInjector() {
882    var msx = window["msx"];
883    return msx.rootInjector.getRootInjector();
884}
885var downgradedDevices = _static.downgradeModule(function () {
886    return __awaiter(this, void 0, void 0, function () {
887        var rootInjector, factory;
888        return __generator(this, function (_a) {
889            switch (_a.label) {
890                case 0: return [4, getRootInjector()];
891                case 1:
892                    rootInjector = _a.sent();
893                    return [4, rootInjector.get(core.Compiler).compileModuleAsync(DevicesModule)];
894                case 2:
895                    factory = _a.sent();
896                    return [2, factory.create(rootInjector)];
897            }
898        });
899    });
900});
901var msxAddDeviceFactory = _static.downgradeComponent({
902    component: AddDeviceComponent,
903    downgradedModule: downgradedDevices
904});
905var msxAssignDeviceFactory = _static.downgradeComponent({
906    component: AssignDeviceComponent,
907    downgradedModule: downgradedDevices
908});
909var msxDevices = angular.module('msx.devices', [
910    'ui.router',
911    downgradedDevices
912])
913    .directive(AddDeviceComponent.ng1DirectiveName, msxAddDeviceFactory)
914    .directive(AssignDeviceComponent.ng1DirectiveName, msxAssignDeviceFactory);
915
916exports.DevicesModule = DevicesModule;
917exports.msxDevices = msxDevices;
918
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Protractor on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)