webpackJsonp([32],{

/***/ 1498:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebSettingsPageModule", function() { return WebSettingsPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__web_settings__ = __webpack_require__(1796);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    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;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var WebSettingsPageModule = /** @class */ (function () {
    function WebSettingsPageModule() {
    }
    WebSettingsPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__web_settings__["a" /* WebSettingsPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__web_settings__["a" /* WebSettingsPage */]),
            ],
        })
    ], WebSettingsPageModule);
    return WebSettingsPageModule;
}());

//# sourceMappingURL=web-settings.module.js.map

/***/ }),

/***/ 1796:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WebSettingsPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common_http__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(1009);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_activation_service_env_provider__ = __webpack_require__(376);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__providers_app_extractor_app_extractor__ = __webpack_require__(151);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    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;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};








/**
 * Generated class for the WebSettingsPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
var WebSettingsPage = /** @class */ (function () {
    function WebSettingsPage(navCtrl, envPro, settings, http, logger, authSvc, appSvc, appBuilder) {
        this.navCtrl = navCtrl;
        this.envPro = envPro;
        this.settings = settings;
        this.http = http;
        this.logger = logger;
        this.authSvc = authSvc;
        this.appSvc = appSvc;
        this.appBuilder = appBuilder;
    }
    WebSettingsPage.prototype.ionViewDidLoad = function () {
        var _this = this;
        var url = this.envPro.getEnvVar(__WEBPACK_IMPORTED_MODULE_4__providers_activation_service_env_provider__["b" /* MainServiceEndPoints */].DEPLOY_SVC_WEB);
        var urlParams = new __WEBPACK_IMPORTED_MODULE_3__angular_http__["URLSearchParams"](window.location.search);
        var c = urlParams.get('?appId');
        if (!c || c === '') {
            this.error = true;
        }
        else {
            c = c.replace('/', '');
            url = url.replace('$id', c);
            this.http.get(url).subscribe(function (res) {
                _this.logger.debug(res);
                _this.processResponse(res);
            });
        }
        // this.http.get()
    };
    WebSettingsPage.prototype.processResponse = function (response) {
        var _this = this;
        if (response['data']) {
            this.model = [];
            this.data_profile = response['data']['data_profile'];
            this.app_master = response['data']['app_master'];
            this.config = response['data']['config'];
            this.versions = {};
            this.app_master.apps.forEach(function (app) {
                _this.versions[app.product_type] = app.version;
                var conf = _this.config.find(function (item) { return item.product_type === app.product_type; });
                _this.model.push({ name: app.app_name, version: app.version, app_type: app.product_type, meta: conf });
            });
            this.settings.setValue('data_profile', this.data_profile);
            this.settings.setValue('app_master', this.app_master);
            this.logger.debug(this.model);
            this.config.forEach(function (conf) {
                _this.settings.setValue('app_data_' + conf.product_type, conf);
            });
        }
    };
    WebSettingsPage.prototype.go = function () {
        var _this = this;
        this.appBuilder.loadAppMaster().then(function (res) {
            // this.navCtrl.setRoot('LoginPage', {}, {animate: true, direction: 'forward'});
            _this.proceedToMainApp();
        });
    };
    WebSettingsPage.prototype.proceedToMainApp = function () {
        var _this = this;
        this.authSvc.isAuthModuleReady().subscribe(function (x) {
            _this.logger.debug('Authentication Module Ready');
        }, function (e) {
            _this.navCtrl.setRoot('LoginPage', {}, { animate: true, direction: 'forward' });
        }, function () {
            if (_this.authSvc.authenticated()) {
                /* go to landing page of main module*/
                _this.appSvc.notifyDataChanged('LOGIN_SUCCESSFUL', Math.random());
            }
            else {
                _this.navCtrl.setRoot('LoginPage', {}, { animate: true, direction: 'forward' });
            }
        });
    };
    WebSettingsPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-web-settings',template:/*ion-inline-start:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/web-settings/web-settings.html"*/'<!--\n  Generated template for the WebSettingsPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<!-- <ion-header>\n\n  <ion-navbar>\n    <ion-title>WebSettings</ion-title>\n  </ion-navbar>\n\n</ion-header> -->\n\n<ion-content padding class="pg-container">\n<ion-grid no-padding class="height-100">\n    <ion-row class="height-100">\n        <ion-col col-5 class="height-100 welcome-section">\n            <ion-row class="top-section">\n                <div class="welcome-message width100">Welcome to</div>\n                <div class="width100"><img class="ncinga-logo" src="assets/imgs/nCinga-nfactory.png"></div>\n            </ion-row>\n            <ion-row class="welcome-img">\n                <div><img class="ncinga-logo" src="assets/imgs/welcome-image.png"></div>\n            </ion-row>\n        </ion-col>\n\n        <!-- error message -->\n        <ion-col col-7 class="error-message" *ngIf="error">\n            <ion-row class="er-wrap">\n                <div class="er-lin1">Access Error</div>\n                <div class="er-lin2">Please contact your system administrator</div>\n                <div class="er-img"><img class="ncinga-logo" src="assets/imgs/no-app-id.png"></div>\n            </ion-row>\n        </ion-col>\n        <!-- error message -->\n\n        <ion-col col-7 class="height-100 app-info-wrap">\n        \n            <ion-row class="info-hdr">Application Information</ion-row>\n            \n            <ion-row class="app-group">\n                    <div class="app-info width100" *ngFor="let conf of model">\n                        <div class="one-app-info width100">\n                            <ion-row class="app-info-hdr">\n                                <div class="icon"><ion-icon name="phone-portrait"></ion-icon></div>\n                                <div class="push-r-2">{{conf.name}}</div>\n                                <div class="tag">{{conf.version}}</div>\n                            </ion-row>\n\n                            <ion-row class="tem-lin">\n                                <ion-col col-4 *ngFor="let subj of conf.meta.subjects"><div>{{subj.name}} - <span>({{subj.hsk}})</span></div></ion-col>\n                            </ion-row>\n                        </div>\n                    </div>\n            </ion-row>\n\n            <ion-row class="continue-btn">\n                <div class="push-r-1"></div>\n                <button *ngIf="!error" ion-button color="ocean" (click)="go()">Continue</button>\n                <div class="push-r-1"></div>\n            </ion-row>\n        </ion-col>\n\n    </ion-row>\n</ion-grid>\n</ion-content>\n'/*ion-inline-end:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/web-settings/web-settings.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["o" /* NavController */], __WEBPACK_IMPORTED_MODULE_4__providers_activation_service_env_provider__["a" /* EnvProvider */], __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["o" /* Settings */],
            __WEBPACK_IMPORTED_MODULE_2__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_5_ngx_logger__["b" /* NGXLogger */],
            __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["f" /* AuthProvider */], __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["e" /* ApplicationService */],
            __WEBPACK_IMPORTED_MODULE_7__providers_app_extractor_app_extractor__["a" /* AppExtractorService */]])
    ], WebSettingsPage);
    return WebSettingsPage;
}());

//# sourceMappingURL=web-settings.js.map

/***/ })

});
//# sourceMappingURL=32.js.map