webpackJsonp([29],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivityLogModule", function() { return ActivityLogModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__activity_log__ = __webpack_require__(1769);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_components_module__ = __webpack_require__(959);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_pagination_ngx_pagination_module__ = __webpack_require__(101);
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;
};
/**
 * Created by dilshan on 6/11/18.
 */






var ActivityLogModule = /** @class */ (function () {
    function ActivityLogModule() {
    }
    ActivityLogModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [__WEBPACK_IMPORTED_MODULE_1__activity_log__["a" /* ActivityLogComponent */]],
            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_5__ncinga_sp_nsp_app_core_dist_pagination_ngx_pagination_module__["a" /* NgxPaginationModule */],
                __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_1__activity_log__["a" /* ActivityLogComponent */]),
            ]
        })
    ], ActivityLogModule);
    return ActivityLogModule;
}());

//# sourceMappingURL=activity.log.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActivityLogComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__activitylog_view_template__ = __webpack_require__(1770);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_activity_log_event_activity_log__ = __webpack_require__(207);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_app_core_dist_providers_app_events__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_application_cache_service_app_cache_service__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_shared_data_service_shared_data_service__ = __webpack_require__(44);
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);
};
/**
 * Created by dilshan on 6/11/18.
 */










var ActivityLogComponent = /** @class */ (function () {
    function ActivityLogComponent(logger, evntActLog, businessCtx, navParam, appCtx, appState, appCachePro, sharedSrv) {
        this.logger = logger;
        this.evntActLog = evntActLog;
        this.businessCtx = businessCtx;
        this.navParam = navParam;
        this.appCtx = appCtx;
        this.appState = appState;
        this.appCachePro = appCachePro;
        this.sharedSrv = sharedSrv;
        this.DATATYPE = 'evnlog';
        this.activityLogs = [];
        this.table_header = [];
        this.unwnat = [];
        this.others = [];
        this.p = 1;
        this.indx = null;
        this.pageConf = this.navParam.get('conf');
        if (this.pageConf) {
            this.table_header = this.pageConf['table_header'];
            this.unwnat = this.pageConf['hide_data'];
            this.paramOne = this.pageConf['main_param'][0];
            this.paramTwo = this.pageConf['main_param'][1];
            if (this.pageConf['activity_name'] === 'station_act') {
                this.station_act = true;
            }
            else if (this.pageConf['activity_name'] === 'line_act') {
                this.line_act = true;
            }
            else if (this.pageConf['activity_name'] === 'summary_act') {
                this.summary_act = true;
            }
        }
        var subj = this.appCtx.getCurrentSubject();
        this.subject = subj.id;
        this.initEventListener();
    }
    ActivityLogComponent.prototype.initEventListener = function () {
        var _this = this;
        this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_app_core_dist_providers_app_events__["b" /* APPEvents */].APP_SUBJECT_CHANGE, function (res) {
            _this.logger.trace('subject change header', res);
            var subj = res;
            _this.subject = subj.id;
        });
    };
    ActivityLogComponent.prototype.ionViewWillEnter = function () {
        var cntxtCrnt = this.businessCtx.getCurrentContext();
        this.setCntxtShown(cntxtCrnt.ctx);
        this.evntActLog.getEventActivity(); // only to execute sorting
        this._getCurrentActivities();
    };
    ActivityLogComponent.prototype._getCurrentActivities = function () {
        var _this = this;
        this.activityLogs = [];
        var subject = this.appCtx.getCurrentSubject();
        var tempActLog = [];
        tempActLog = this.appCachePro.getDataFromMemory(subject.id, this.DATATYPE).slice(0);
        var bool = false;
        tempActLog.forEach(function (dt) {
            if (JSON.stringify(dt) !== '{}') {
                bool = true;
                _this.activityLogs.push(dt);
            }
        });
        if (bool) {
            this.activityLogs.sort(function (a, b) {
                return b.dateTime - a.dateTime;
            });
        }
        else {
            this.activityLogs = [];
        }
    };
    /*
     set cntxt showing details
     */
    ActivityLogComponent.prototype.setCntxtShown = function (cntxt) {
        var _this = this;
        try {
            if (cntxt) {
                cntxt.forEach(function (data, index) {
                    if (data.d.toLowerCase() === _this.paramOne.toLowerCase()) {
                        _this.pr1 = index;
                    }
                    else if (data.d.toLowerCase() === _this.paramTwo.toLowerCase()) {
                        _this.pr2 = index;
                    }
                    else if (_this.unwnat.indexOf(data.d.toLowerCase()) < 0) {
                        _this.others.push(index);
                    }
                });
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     toggle bsns cntxt
     */
    ActivityLogComponent.prototype.toggle = function (index) {
        if (index !== this.indx) {
            this.indx = index;
        }
        else {
            this.indx = null;
        }
    };
    /*
    undo for activity log
     */
    ActivityLogComponent.prototype.undoclick = function () {
        this.sharedSrv.updateSharedDataModelForBucket(this.pageConf.undobtn, 0, null, []);
        this._getCurrentActivities();
    };
    ActivityLogComponent = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'activity-log-view',
            template: __WEBPACK_IMPORTED_MODULE_1__activitylog_view_template__["a" /* ACTIVITY_LOG_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_3_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_4__providers_activity_log_event_activity_log__["a" /* EventActivity */],
            __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["p" /* NavParams */], __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["d" /* ApplicationContext */],
            __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist__["e" /* ApplicationService */], __WEBPACK_IMPORTED_MODULE_8__providers_application_cache_service_app_cache_service__["a" /* AppCacheService */],
            __WEBPACK_IMPORTED_MODULE_9__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */]])
    ], ActivityLogComponent);
    return ActivityLogComponent;
}());

//# sourceMappingURL=activity.log.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ACTIVITY_LOG_HTML; });
/**
 * Created by dilshan on 6/11/18.
 */
var ACTIVITY_LOG_HTML = "\n<ion-header >\n <common-main-header [title]=\"pageConf?.title\" [header_disabled]=\"pageConf?.subject_disable\"></common-main-header>\n</ion-header>\n<ion-content>\n  <ion-grid *ngIf=\"line_act\" class=\"content-wrapper\">\n  <ion-grid *ngIf=\"activityLogs.length>0\">\n        <ion-row class=\"tbl-data-hdr\">\n            <ion-col col-2>{{table_header[0]}}</ion-col>\n            <ion-col col-2>{{table_header[1]}}</ion-col>\n            <ion-col *ngIf=\"table_header.length>2\" col-3>{{table_header[2]}}</ion-col>\n            <ion-col *ngIf=\"table_header.length>3\" col-5>{{table_header[3]}}</ion-col>\n         </ion-row>\n           <ion-row class=\"tbl-data-row\"\n           *ngFor=\"let activity of activityLogs | paginate: { itemsPerPage: 10, currentPage: p };let j = index\">\n            <ion-col col-2 class=\"dtatim\"><ion-row>{{activity.dateTime | date: 'dd/MM/yyyy'}}</ion-row>\n            <ion-row>{{activity.dateTime |  date: 'H:mm'}}</ion-row></ion-col>\n            <!-- <ion-col col-2 class=\"dtatim\">{{activity.dateTime |  date: 'H:mm'}}</ion-col> -->\n            <ion-col col-2>{{activity.eventType}}</ion-col>\n            <ion-col col-3>{{activity.eventDetail}}</ion-col>\n            <ion-col col-5>\n              <ion-row class=\"inlin-dta\" no-padding style=\"border-bottom: none;\">\n                <ion-col *ngIf=\"activity.bsnsCntxt.length>0 && activity.bsnsCntxt[pr1]\"\n                 class=\"sty-dta\">{{activity.bsnsCntxt[pr1].v}}</ion-col>\n                <ion-col *ngIf=\"activity.bsnsCntxt.length>0 && activity.bsnsCntxt[pr2]\"\n                 class=\"po-dta\">{{activity.bsnsCntxt[pr2].v}}</ion-col>\n              </ion-row>\n              <ion-row *ngIf=\"activity.bsnsCntxt.length>0\" class=\"inlin-dta\" no-padding >\n                <ion-col *ngFor=\"let ind of others\">{{activity.bsnsCntxt[ind].v}}</ion-col>\n                <ion-col *ngFor=\"let dt of activity.grade\" class=\"number\">{{dt}}</ion-col>\n              </ion-row>\n              <ion-row *ngIf=\"activity.bsnsCntxt.length===0\" class=\"inlin-dta\" no-padding >\n                <ion-col *ngFor=\"let dt of activity.grade\" class=\"number\">{{dt}}</ion-col>\n              </ion-row>\n      </ion-col>\n      </ion-row>\n      </ion-grid>\n  </ion-grid>\n  <ion-grid *ngIf=\"station_act\" no-padding  class=\"content-wrapper\">\n  <ion-grid *ngIf=\"activityLogs.length>0\">\n  <ion-grid *ngFor=\"let activity of activityLogs | paginate: { itemsPerPage: 10, currentPage: p };let j = index \" >\n  <ion-grid >\n  <ion-row class=\"tbl-data-hdr grop-hdr\">\n            <ion-col col-8>\n            <div class=\"r-align-flx\">\n              <span class=\"dt-tm\"><span class=\"lbl\">{{table_header[0]}}</span >{{activity.dateTime | date: 'dd/MM/yyyy'}}</span>\n              <span class=\"dt-tm\"><span class=\"lbl\">{{table_header[1]}}</span>{{activity.dateTime |  date: 'H:mm'}}</span>\n            </div>\n            </ion-col>\n            <ion-col *ngIf=\"table_header.length>2\" col-2>\n             <div class=\"evt-typ\">{{table_header[2]}}</div>\n            </ion-col>\n            <ion-col col-2>{{activity.eventType}}</ion-col>\n         </ion-row>\n         <ion-row class=\"tbl-data-row\" *ngFor=\"let data of activity.data;let i = index\" >\n          <ion-col col-12 >\n          <ion-row no-padding>{{data.eventDetail}}</ion-row>\n            <ion-row class=\"inlin-dta\" no-padding *ngIf=\"activity.bsnsCntxt.length>0\">\n                <ion-col *ngIf=\"activity.bsnsCntxt[pr1]\" class=\"sty-dta\">{{activity.bsnsCntxt[pr1].v}}</ion-col>\n                <ion-col *ngIf=\"activity.bsnsCntxt[pr2]\" class=\"po-dta\">{{activity.bsnsCntxt[pr2].v}}</ion-col>\n                 <ion-col *ngFor=\"let ind of others\">{{activity.bsnsCntxt[ind]?.v}}</ion-col>\n                <ion-col *ngFor=\"let dt of data.grade\" class=\"number\">{{dt}}</ion-col>\n            </ion-row>\n          </ion-col>\n         </ion-row></ion-grid>\n  </ion-grid>\n  </ion-grid>\n  </ion-grid>\n\n  <ion-grid *ngIf=\"summary_act\" class=\"aql-pge-hdr\">\n    <ion-row *ngIf=\"activityLogs.length>0\">\n      <div class=\"r-align-flx\"></div>\n      <button (click)=\"undoclick()\" ion-button><ion-icon name=\"undo\"></ion-icon></button>\n    </ion-row>\n  </ion-grid>\n\n  <ion-grid *ngIf=\"summary_act\" class=\"aql-act-log\">\n  <ion-grid *ngIf=\"activityLogs.length>0\">\n  <ion-grid *ngFor=\"let activity of activityLogs | paginate: { itemsPerPage: 10, currentPage: p };let j = index \">\n  <ion-row class=\"hdr-row\">\n      <div class=\"dt-tmi\"><span class=\"lbl\">Date</span><span class=\"valu\">{{activity.dateTime | date: 'dd/MM/yyyy'}}</span></div>\n      <div class=\"dt-tmi\"><span class=\"lbl\">Time</span><span class=\"valu\">{{activity.dateTime |  date: 'H:mm'}}</span></div>\n      <div class=\"r-align-flx\"></div>\n      <div class=\"qty-evt\"><span class=\"lbl\">QTY</span><span class=\"valuf1\">{{activity.qty}}</span></div>\n      <div class=\"qty-evt\"><span class=\"lbl\">Event Type</span><span class=\"valuf1\">{{activity.eventType}}</span></div>\n    </ion-row>\n\n     <!-- Dom header -->\n    <ion-row class=\"dom-content\">\n      <ion-col *ngFor=\"let ctx of activity.bsnsCntxt\">\n        <ion-row class=\"lbl\">{{ctx.d}}</ion-row>\n        <ion-row class=\"valu\">{{ctx.v}}</ion-row>\n      </ion-col>\n    </ion-row>\n\n\n    <!-- data Row -->\n    <ion-row class=\"acti-dta-row\" *ngFor=\"let arr of activity.data\" no-padding>\n      <ion-col class=\"dta-cel\" *ngFor=\"let col of arr\">\n        <ion-row>\n          <div class=\"lbl\">{{col.n}}</div>\n          <div class=\"vlu\">{{col.v}}</div>\n        </ion-row>\n      </ion-col>\n    </ion-row>\n  </ion-grid>\n  </ion-grid>\n  </ion-grid>\n</ion-content>\n<ion-footer>\n <pagination-controls (pageChange)=\"p = $event\"></pagination-controls>\n</ion-footer>\n";
//# sourceMappingURL=activitylog-view-template.js.map

/***/ })

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