webpackJsonp([38],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppselectPageModule", function() { return AppselectPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__appselect__ = __webpack_require__(1818);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pipes_pipes_module__ = __webpack_require__(1025);
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 AppselectPageModule = /** @class */ (function () {
    function AppselectPageModule() {
    }
    AppselectPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__appselect__["a" /* AppselectPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_3__pipes_pipes_module__["a" /* PipesModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__appselect__["a" /* AppselectPage */]),
            ],
        })
    ], AppselectPageModule);
    return AppselectPageModule;
}());

//# sourceMappingURL=appselect.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppselectPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_activation_service_activation_service__ = __webpack_require__(117);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_ngx_logger__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__inprogress_Inprogress_component__ = __webpack_require__(1024);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
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 AppselectPage page.
 *
 * The page is used to show different app types to the user
 * Ionic pages and navigation.
 */
var AppselectPage = /** @class */ (function () {
    function AppselectPage(navCtrl, platform, navParams, actProvider, logger, modalCtrl, settings) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.actProvider = actProvider;
        this.logger = logger;
        this.modalCtrl = modalCtrl;
        this.settings = settings;
        this.availableGroups = [];
        this.isAndroid = false;
        this.isAndroid = platform.is('android');
    }
    AppselectPage.prototype.ionViewDidLoad = function () {
        var apps = this.navParams.get('apps');
        if (apps) {
            this.apps = apps;
            this.prepareGroups();
        }
        else {
            this.logger.error('No apps found for this tenant');
        }
    };
    AppselectPage.prototype.prepareGroups = function () {
        var _this = this;
        this.availableGroups = [];
        if (!this.apps.app_masters) {
            return;
        }
        this.apps.app_masters.forEach(function (app) {
            app.labels.forEach(function (grp) {
                if (_this.availableGroups.indexOf(grp) === -1) {
                    _this.availableGroups.push(grp);
                }
            });
            if (app.hasOwnProperty('icon')) {
                app['hasIcon'] = true;
            }
            if (app.hasOwnProperty('letter')) {
                app['hasLetter'] = true;
            }
        });
        this.group = this.availableGroups[0];
    };
    AppselectPage.prototype.installApp = function (selectedAppMaster) {
        var _this = this;
        /*
         * save app data profile here
         * */
        this.settings.setValue('data_profile', {
            tenant: this.apps.client_info.tenant,
            subject_key: this.apps.client_info.subject_key
        });
        var modal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_4__inprogress_Inprogress_component__["a" /* InProgressComponent */], {
            master: selectedAppMaster,
            tenant: this.apps.client_info.name
        }, { enableBackdropDismiss: false });
        modal.present();
        modal.onDidDismiss(function (res) {
            _this.optionalModuleInputs();
        });
    };
    AppselectPage.prototype.optionalModuleInputs = function () {
        var requiredConfigs = this.actProvider.getInitConfigs();
        if (requiredConfigs.length > 0) {
            this.navCtrl.setRoot('ModuleConfigPage', {
                options: requiredConfigs,
                tenant: this.apps.client_info.tenant,
                subject_key: this.apps.client_info.subject_key
            }, {
                animate: true,
                animation: 'slide',
                direction: 'left'
            });
        }
        else {
            this.navCtrl.setRoot('LoginPage', {}, { animate: true, direction: 'forward' });
        }
    };
    AppselectPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-appselect',template:/*ion-inline-start:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/appselect/appselect.html"*/'<!--\n  Generated template for the AppselectPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n    <ion-navbar no-border-bottom color="mheader">\n        <ion-title>\n            nFactory All In One App Store\n        </ion-title>\n    </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n    <ion-card *ngIf="apps">\n        <ion-card-content class="org-identity-wrapper">\n            <ion-grid no-padding>\n                <ion-row>\n                    <ion-col>\n                        <div class="cover-image"></div>\n                    </ion-col>\n                    <ion-col class="detail-wrapper">\n                        <div class="card-title">{{apps.client_info.name}}</div>\n                        <div class="other-details">\n                            <span class="email">{{apps.client_info.email}}</span>\n                            <span class="contact-no">{{apps.client_info.contact_no}}</span>\n                            <span class="contact-no">{{apps.client_info.subject_key}}</span>\n                        </div>\n                        <span class="subscriptiontype"><ion-icon name="star" color="c20"></ion-icon>\n                            <span class="subscript_lable">{{apps.client_info.subscription_type}}</span></span>\n                    </ion-col>\n                </ion-row>\n            </ion-grid>\n\n            <ion-segment [(ngModel)]="group" color="calm">\n                <ion-segment-button *ngFor="let btn of availableGroups" [value]="btn">\n                    {{btn}}\n                </ion-segment-button>\n            </ion-segment>\n        </ion-card-content>\n    </ion-card>\n    <div *ngIf="apps" class="app-list">\n        <div>\n            <ion-grid>\n                <ion-row>\n                    <ion-col col-12 col-md-4 col-lg-3 *ngFor="let appMaster of apps.app_masters | groupFilter:group ">\n                        <div class="install-block">\n                            <h5>{{appMaster.name}}</h5>\n                            <div *ngIf="appMaster.hasIcon" class="image-wrapper">\n                                <img [src]="appMaster.icon">\n                            </div>\n                            <div *ngIf="appMaster.hasLetter" class="letter-wrapper">\n                                <h3>{{appMaster.letter}}</h3>\n                            </div>\n                            <div class="desc-wrapper">\n                                <p>{{appMaster.description}}</p>\n                            </div>\n                            <div class="btn-wrapper">\n                                <ion-grid no-margin>\n                                    <ion-row>\n                                        <ion-col col-12 col-md-12 col-lg-6>\n                                            <button ion-button block color="calm"\n                                                    [disabled]="appMaster.active_licence==0"\n                                                    (click)="installApp(appMaster)">Install\n                                            </button>\n                                        </ion-col>\n                                        <ion-col col-12 col-md-12 col-lg-6>\n                                            <button class="license-btn" [disabled]="appMaster.active_licence==0"\n                                                    ion-button block color="light" icon-right>Licence\n                                                <span class="number-block">{{appMaster.active_licence}}/{{appMaster.total_licence}}</span>\n                                            </button>\n\n                                        </ion-col>\n                                    </ion-row>\n                                </ion-grid>\n                            </div>\n                        </div>\n                    </ion-col>\n                </ion-row>\n            </ion-grid>\n        </div>\n    </div>\n\n</ion-content>\n'/*ion-inline-end:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/appselect/appselect.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["o" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* Platform */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__providers_activation_service_activation_service__["a" /* ActivationService */],
            __WEBPACK_IMPORTED_MODULE_3_ngx_logger__["b" /* NGXLogger */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* ModalController */], __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["o" /* Settings */]])
    ], AppselectPage);
    return AppselectPage;
}());

//# sourceMappingURL=appselect.js.map

/***/ })

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