vega-footer-logo
Version:
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.5.
2 lines • 6.99 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/http"),require("rxjs/operators"),require("crypto-js"),require("@angular/router"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("vega-footer-logo",["exports","@angular/core","@angular/http","rxjs/operators","crypto-js","@angular/router","@angular/platform-browser"],e):e(t["vega-footer-logo"]={},t.ng.core,t.ng.http,t.rxjs.operators,t.CryptoJS,t.ng.router,t.ng.platformBrowser)}(this,function(t,e,a,n,o,r,i){"use strict";var s=function d(){},c=function(){function t(t){this.http=t,this.userTO={},this.resultMessage=new s}return t.prototype.getUserTOFromLocalStorage=function(){return JSON.parse(this.decryption(localStorage.getItem("currentUser")))},t.prototype.getAlertForNotify=function(t){null==this.userTO&&this.userTO==undefined||this.getAllActiveNotification(this.userTO,t).subscribe(function(t){var e=t.filter(function(t){return 0==t.IsAcknowledged}).length;null!=document.getElementById("bgNotification")&&(document.getElementById("bgNotification").innerText=0==e?"":e.toString())},function(t){})},t.prototype.getAllActiveNotification=function(t,e){var o=e+"Notify/GetAllActiveAlertList?userId=1&roleId=1";return this.http.get(o).pipe(n.map(function(t){return t.json()}))},t.prototype.postAlertAcknowledgement=function(t,e,o){var n={alertUsersTO:t,loginUserId:e},r=JSON.stringify(n),i=new a.Headers({"Content-Type":"application/json"}),s=new a.RequestOptions({headers:i});return this.http.post(o+"Notify/PostAlertAcknowledgement",r,s)},t.prototype.postAllAlertAcknowledgement=function(t,e){var o={loginUserId:t.IdUser,roleId:t.UserRoleList[0].RoleId},n=JSON.stringify(o),r=new a.Headers({"Content-Type":"application/json"}),i=new a.RequestOptions({headers:r});return this.http.post(e+"Notify/PostResetAllAlerts",n,i)},t.prototype.encryption=function(t){return t=JSON.stringify(t),o.AES.encrypt(t.toString(),"secret key 123").toString()},t.prototype.decryption=function(t){return t?o.AES.decrypt(t,"secret key 123").toString(o.enc.Utf8):null},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:a.Http}]},t}(),l=function(){function t(t,e,o){this.comman=t,this.router=e,this.userTO={},this.resultMessage=new s,this.notificationList=[],this.userTO=this.comman.getUserTOFromLocalStorage()}return t.prototype.ngOnInit=function(){this.comman.getAlertForNotify(this.URL),this.getNotificationListByUser()},t.prototype.getNotificationListByUser=function(){var e=this;this.notificationList=[],this.comman.getAllActiveNotification(this.userTO,this.URL).subscribe(function(t){e.notificationList=t},function(t){console.log("Err : "+t)})},t.prototype.markAsReadToNotification=function(t,e){var o=this;void 0===e&&(e=!1),(0==t.IsAcknowledged||e)&&(e&&(t.IsReseted=1),this.comman.postAlertAcknowledgement(t,this.userTO.IdUser,this.URL).subscribe(function(t){o.comman.getAlertForNotify(o.URL),o.getNotificationListByUser()},function(t){console.log("Error Msg : "+t)}))},t.prototype.getValidationColor=function(t){return 0==t?"bold":"normal"},t.prototype.resetAllNotification=function(){var e=this;this.comman.postAllAlertAcknowledgement(this.userTO,this.URL).subscribe(function(t){1==e.resultMessage.MessageType&&1==e.resultMessage.Result&&(e.comman.getAlertForNotify(e.URL),e.notificationList=[])},function(t){console.log("Error Msg : "+t)})},t.prototype.redirectFun=function(t){null==t.NavigationUrl&&""==t.NavigationUrl||this.router.navigate(["/"+t.NavigationUrl])},t.decorators=[{type:e.Component,args:[{selector:"notification",template:'\r\n<div class="col-lg-12" style="margin-top: 20px">\r\n<div class="panel panel-default top10 ">\r\n <div class="panel-heading" style="color: red">\r\n All Notification\r\n </div>\r\n <div class="panel-body">\r\n <div class="row col-lg-12 top10" *ngIf=" notificationList?.length == 0 || notificationList == null">\r\n <div class=" alert-success">\r\n <strong class="col-sm-2">Information: </strong>\r\n <label class="control-label-left col-sm-10 fontweight">All Message caught up !</label>\r\n </div>\r\n </div>\r\n <div class="row" *ngIf="notificationList?.length > 0">\r\n <div class="col-lg-12 ">\r\n <div class="table-responsive ">\r\n <table class="table table-bordered table-hover">\r\n <thead>\r\n <tr class="bg-info">\r\n <th>Raised By</th>\r\n <th>Alert Message</th>\r\n <th>Raised On</th>\r\n \x3c!--<th>Action</th>--\x3e\r\n <th>\r\n <i class="fa fa-trash btn-custom-icon" style="width:25px; height:20px;margin-right: 3px;" aria-hidden="true" (click)="resetAllNotification()"> \r\n </i> Delete All\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n \x3c!-- redirectFun(notificationTo)" --\x3e\r\n <tr style="cursor: pointer" *ngFor=" let notificationTo of notificationList " [style.font-weight]="getValidationColor(notificationTo.IsAcknowledged)">\r\n <td (click)="markAsReadToNotification(notificationTo)">{{notificationTo.RaisedByUserName}}</td>\r\n <td (click)="markAsReadToNotification(notificationTo)">{{notificationTo.AlertComment}}</td>\r\n <td (click)="markAsReadToNotification(notificationTo)">{{notificationTo.RaisedOnStr}}</td>\r\n <td>\r\n <p style="width: 50px;margin: 0px">\r\n <i class="fa fa-trash btn-custom-icon" style="width:20px; height:20px;margin-right: 3px;" aria-hidden="true" (click)="markAsReadToNotification(notificationTo, true)"></i>\r\n </p>\r\n </td>\r\n\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n</div>'}]}],t.ctorParameters=function(){return[{type:c},{type:r.Router},{type:r.ActivatedRoute}]},t.propDecorators={URL:[{type:e.Input}]},t}(),u=[{path:"",component:l}],p=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[l],imports:[i.BrowserModule,a.HttpModule,r.RouterModule.forRoot(u)],providers:[c],exports:[l]}]}],t}();t.NotifyModule=p,t.ɵa=l,t.ɵb=c,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=vega-footer-logo.umd.min.js.map