webpackJsonp([24],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecentPageModule", function() { return RecentPageModule; });
/* 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__recent__ = __webpack_require__(1850);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_components_module__ = __webpack_require__(991);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__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 RecentPageModule = /** @class */ (function () {
    function RecentPageModule() {
    }
    RecentPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__recent__["a" /* RecentPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_3__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__recent__["a" /* RecentPage */]),
            ],
        })
    ], RecentPageModule);
    return RecentPageModule;
}());

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

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RecentPage; });
/* 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_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__providers_recentevent_provider__ = __webpack_require__(153);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__recent_template__ = __webpack_require__(1851);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash__ = __webpack_require__(367);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__models_btnModel__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_shared_data_service_shared_data_service__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_util__ = __webpack_require__(69);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_util___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_util__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_activity_log_activity_log__ = __webpack_require__(149);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_dateFormate_dateFormates__ = __webpack_require__(209);
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);
};













var RecentPage = /** @class */ (function () {
    function RecentPage(logger, navParams, navigationProvider, qcAppProvider, toastCtrl, sharedDataService, businessCtx, activityLog, _crntDate) {
        this.logger = logger;
        this.navParams = navParams;
        this.navigationProvider = navigationProvider;
        this.qcAppProvider = qcAppProvider;
        this.toastCtrl = toastCtrl;
        this.sharedDataService = sharedDataService;
        this.businessCtx = businessCtx;
        this.activityLog = activityLog;
        this._crntDate = _crntDate;
        this.recent_all_list = [];
        this.recent_selected_list = [];
        this.previous_data = [];
        this.sub_header = true;
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true,
        };
        this.data_set = this.navParams.get('data');
        this.previous_data = this.data_set['data'];
        this.data_store_dum = new __WEBPACK_IMPORTED_MODULE_7__models_btnModel__["a" /* ClassificationModel */](this.data_set['model']);
        if (this.data_store_dum.value === 0) {
            this.data_store_dum.setValue(1);
        }
        this.currentPageConfig = this.navParams.get('conf');
        this.sub_header = this.currentPageConfig['order_heading'];
        if (!this.sub_header) {
            this.grid_class = 'main-grid_none_header';
        }
    }
    RecentPage.prototype.ionViewWillEnter = function () {
        this.logger.debug('recent called  1');
    };
    RecentPage.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.logger.debug('recent called  2', this.data_set['btnConf']['id']);
        this.currentPageData = this.sharedDataService.getDataSharedDataService(this.data_set['btnConf']['id']);
        this.logger.info(this.currentPageData['recent_cat_list'], 'recent_cat_list -------------');
        // load page header and footer
        this.currentPageheader = this.currentPageConfig['title'];
        this.currentPagebuttons = this.currentPageConfig['view_controles'];
        // generate page body data
        if (!Object(__WEBPACK_IMPORTED_MODULE_9_util__["isUndefined"])(this.currentPageData['recent_cat_list'])) {
            if (!Object(__WEBPACK_IMPORTED_MODULE_9_util__["isUndefined"])(this.currentPageData['recent_cat_list'][0])) {
                this.currentPageData['recent_cat_list'][0]['result'].forEach(function (item, idx) {
                    var mainItem = {};
                    mainItem['data'] = item.data;
                    mainItem['size'] = item.size;
                    mainItem['operation'] = item.operation;
                    mainItem['operations'] = item.event_ac[0].operation;
                    mainItem['category_id'] = item.category_id;
                    mainItem['status'] = false;
                    _this.recent_all_list.push(mainItem);
                });
                this.recent_all_list.reverse();
            }
        }
        // check whether next page available
        if (this.currentPageConfig['next_view_ref'] !== 'EXIT') {
            this.nextPage = this.currentPageConfig['next_view_ref'];
        }
        else {
            this.nextPage = 'page_order_end';
        }
    };
    RecentPage.prototype.navigationClick = function (type) {
        var _this = this;
        this.recent_selected_list = [];
        this.recent_all_list.forEach(function (item1, index1) {
            if (item1.status === true) {
                /* const newItem = {};
                 item1.data.forEach((item2, index2) => {
                     newItem[item2.key] = item2.value;
                 });*/
                var catOne = Object.assign({}, item1.operations);
                var catTwo = Object.assign({}, item1.data);
                delete catOne['id'];
                delete catOne['group_id'];
                delete catOne['status'];
                delete catOne['data'];
                delete catOne['size'];
                delete catTwo['operation'];
                delete catTwo['id'];
                delete catTwo['group_id'];
                var temp = {};
                temp['operation'] = item1.operation;
                temp['data'] = item1.data;
                temp['size'] = item1.size;
                temp['size'] = _this.data_store_dum.recent_grade;
                temp['bsns_cntxt'] = _this.businessCtx.getCurrentContext().ctx;
                if (_this.data_set['btnConf']['only_one_page']) {
                    delete catTwo['status'];
                    temp['event_ac'] = {
                        'size': _this.data_store_dum.select_item,
                        'issues': catTwo
                    };
                }
                else {
                    temp['event_ac'] = {
                        'size': _this.data_store_dum.select_item,
                        'operation': catOne,
                        'issues': catTwo
                    };
                }
                temp['date'] = _this._crntDate.dashFormate();
                _this.recent_selected_list.push(temp);
            }
        });
        var finalmap = {};
        var date = new Date();
        var count = this.data_store_dum.count + 1;
        var ctxId = this.generateCtxId();
        var sname = this.activityLog.getCurrentStyleSilhouetteID();
        // if (isUndefined(this.previous_data)) {
        finalmap['id'] = count + '@' + ctxId + '@' + date.getTime();
        finalmap['round'] = 1;
        finalmap['ctx'] = this.businessCtx.getCurrentContext().ctx;
        finalmap['sname'] = sname;
        // } else {
        //     finalMap['id'] = this.previous_data['display_item']['id'];
        //     finalMap['round'] = this.previous_data['display_item']['round'] + 1;
        // }
        finalmap['result'] = this.recent_selected_list;
        var finalResultList = [];
        finalResultList.push(finalmap);
        if (type === 'cancel') {
            this.navigationProvider.exitToRoot(null);
        }
        else if (type === 'ok') {
            if (this.recent_selected_list.length > 0) {
                if (this.nextPage !== 'page_order_end') {
                    // this.navigationProvider.nextView(this.nextPage, this.viewModel);
                    var data = {};
                    data['type'] = 'push';
                    data['next_page'] = this.nextPage;
                    data['result'] = finalResultList;
                    data['result_type'] = this.data_store_dum.name;
                    this.navigationProvider.nextView(this.nextPage, { data: finalResultList,
                        model: this.data_store_dum, btnConf: this.data_set['btnConf'] });
                }
                else {
                    // this.navigationProvider.exitToRoot({total: this.viewModel, type: 'count', operation: 'increment_by'});
                    // if (isUndefined(this.viewModel['relational_parent_data_type'])) {
                    //     this.ccDataProvider.completeDataCycle(this.viewModel['data_type'], '');
                    // } else {
                    //     this.ccDataProvider.completeAdvancedDecrementDataCycle(this.viewModel['relational_parent_data_type'], '');
                    //     this.ccDataProvider.completeAdvancedIncrementDataCycle(this.viewModel['data_type'], '');
                    //     this.ccDataProvider.removeParentdataType(this.viewModel['data_type']);
                    // }
                    var data = {};
                    data['type'] = 'remove_all';
                    data['next_page'] = this.nextPage;
                    data['result'] = finalResultList;
                    data['result_type'] = this.data_store_dum.name;
                    // if (this.data_set['btnConf']['reference_data_type_id']) {
                    //     let referenceData = this.sharedDataService.getDataSharedDataService(
                    //         this.data_set['btnConf']['reference_data_type_id']);
                    //     referenceData.updateGrades(referenceData['recent_grade']);
                    // }
                    this.data_store_dum.recentCatList(data['result']);
                    this.data_store_dum.updateGrades(this.data_store_dum['recent_grade']);
                    this.data_store_dum.increment();
                    this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], this.data_store_dum.value, new __WEBPACK_IMPORTED_MODULE_7__models_btnModel__["a" /* ClassificationModel */](this.data_store_dum));
                    // this.saveRecentItems(data);
                    this.navigationProvider.exitToRoot(null);
                }
            }
            else {
                var toast = this.toastCtrl.create({
                    message: 'Please Select Item(s) to Proceed',
                    duration: 3000,
                    position: 'middle',
                    showCloseButton: true,
                    closeButtonText: 'OK'
                });
                toast.present();
            }
        }
    };
    RecentPage.prototype.saveRecentItems = function (data) {
        // TODO:  remove hardcoded datatypes and use it from given config data types
        if (data.result_type === 'defectives') {
            this.qcAppProvider.new_items_selected = __WEBPACK_IMPORTED_MODULE_6_lodash__["concat"](this.qcAppProvider.new_items_selected, data['result']);
            this.qcAppProvider.rectified_display_list = __WEBPACK_IMPORTED_MODULE_6_lodash__["concat"](this.qcAppProvider.rectified_display_list, data['result']);
        }
        else if (data.result_type === 'recent') {
            this.qcAppProvider.new_items_selected = __WEBPACK_IMPORTED_MODULE_6_lodash__["concat"](this.qcAppProvider.new_items_selected, data['result']);
        }
        else if (data.result_type === 'reject') {
            this.qcAppProvider.reject_items_selected = __WEBPACK_IMPORTED_MODULE_6_lodash__["concat"](this.qcAppProvider.reject_items_selected, data['result']);
        }
        this.logger.info(this.qcAppProvider.new_items_selected);
    };
    /*
     generate ctx id
     */
    RecentPage.prototype.generateCtxId = function () {
        var bsnsCtx = this.businessCtx.getCurrentContext();
        var id = null;
        if (!Object(__WEBPACK_IMPORTED_MODULE_9_util__["isUndefined"])(bsnsCtx.ctx)) {
            bsnsCtx.ctx.forEach(function (dt) {
                if (id === null) {
                    id = dt.v;
                }
                else {
                    id = id + '-' + dt.v;
                }
            });
        }
        return id;
    };
    RecentPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-recent',
            template: __WEBPACK_IMPORTED_MODULE_4__recent_template__["a" /* RECENT_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */], __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */],
            __WEBPACK_IMPORTED_MODULE_3__providers_recentevent_provider__["a" /* RecentEventProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["x" /* ToastController */],
            __WEBPACK_IMPORTED_MODULE_8__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */],
            __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */], __WEBPACK_IMPORTED_MODULE_11__providers_activity_log_activity_log__["a" /* ActivityLogProvider */],
            __WEBPACK_IMPORTED_MODULE_12__providers_dateFormate_dateFormates__["a" /* DateFormatting */]])
    ], RecentPage);
    return RecentPage;
}());

//# sourceMappingURL=recent.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RECENT_HTML; });
/**
 * Created by Paramee Gunethilake on 5/3/2018.
 */
var RECENT_HTML = "\n\n<ion-header>\n       <common-main-header [title]=\"currentPageheader\" [tools]=\"tools\" [header_disabled]=\"currentPageConfig?.subject_disable\">\n</common-main-header>\n</ion-header>\n<ion-content class=\"main-container\">\n<ion-grid class=\"summary-grid\">\n   <ion-row class=\"summary-row\" *ngIf=\"sub_header\">\n            <ion-col class=\"summary-col\">\n                <core-domain-header></core-domain-header>\n            </ion-col>\n        </ion-row>\n</ion-grid>\n  <ion-grid [ngClass]=\"grid_class\" class=\"main-grid\">\n\n        <ion-row no-padding class=\"data-empty-time\" *ngIf=\"data_store_dum['parent_input_categories'].length === 0\">\n       <div class=empt-msg>\n       <ion-icon name=\"md-alert\" class=\"ion-icon\" item-left></ion-icon><span class=\"space-rem\"></span>\n        No Recent Items\n       </div>\n</ion-row>\n\n         <ion-list *ngFor=\"let singleData of recent_all_list\">\n           <ion-item class=\"main-grid-list-item\">\n            <ion-checkbox [(ngModel)]=\"singleData.status\"></ion-checkbox>\n            <ion-label *ngIf=\"singleData.data.operation\"> <span class=\"cls_one_name\" >  {{singleData.data.operation}}  </span> </ion-label>\n            <ion-label *ngIf=\"singleData.data.name\"> <span class=\"cls_two_name\" >{{singleData.data.category_id}}{{' - '}}\n            {{singleData.data.name}}</span> </ion-label>\n             </ion-item>\n</ion-list>\n            </ion-grid>\n</ion-content>\n<ion-footer no-padding>\n    <ion-navbar no-padding>\n\n        <ion-grid no-padding>\n            <ion-row justify-content-end no-padding>\n                <ion-col *ngFor=\"let button of currentPagebuttons \" col-5 col-lg-2 col-md-3 class=\"right-pdn\">\n                    <button [ngClass]=\"button.button_type\" ion-button [hidden]=\"!button.display\"\n                    (click)=\"navigationClick(button.button_type)\" class=\"page-button help-category-btn\">\n                        {{button.button_name}}\n                    </button>\n                </ion-col>\n            </ion-row>\n        </ion-grid>\n\n    </ion-navbar>\n</ion-footer>\n\n\n\n";
//# sourceMappingURL=recent-template.js.map

/***/ })

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