@seniorsistemas/exclusion-process-component 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-exclusion-process-component.umd.js +2 -2
- package/bundles/seniorsistemas-exclusion-process-component.umd.js.map +1 -1
- package/bundles/seniorsistemas-exclusion-process-component.umd.min.js +1 -1
- package/bundles/seniorsistemas-exclusion-process-component.umd.min.js.map +1 -1
- package/esm2015/exclusion-details/exclusion-details.component.js +3 -3
- package/esm5/exclusion-details/exclusion-details.component.js +3 -3
- package/fesm2015/seniorsistemas-exclusion-process-component.js +2 -2
- package/fesm2015/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/fesm5/seniorsistemas-exclusion-process-component.js +2 -2
- package/fesm5/seniorsistemas-exclusion-process-component.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var D,v=function(){return(v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function x(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function C(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,o=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)r.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r}!function(e){e.PENDING="PENDING",e.PROCESSING="PROCESSING",e.ERROR="ERROR",e.SUCCESS="SUCCESS"}(D||(D={}));var _=new n.InjectionToken("projectConfigs"),S=function(){function e(e){this.projectConfigs=e}var t,i;return e.prototype.getDomain=function(){return this.projectConfigs.domain},e.prototype.getService=function(){return this.projectConfigs.service},e.prototype.getTranslationPrefix=function(){return this.projectConfigs.translationPrefix?this.projectConfigs.translationPrefix:this.projectConfigs.domain+"."+this.projectConfigs.service},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[_]}]}]},e=x([n.Injectable(),(t=0,i=n.Inject(_),function(e,n){i(e,n,t)})],e)}(),T=function(){function e(e,t,n,i){this.http=e,this.messageService=t,this.translate=n,this.projectConfigs=i;var s=i.getDomain()+"/"+i.getService();this.exclusionProcessUrl=s+"/entities/exclusionProcess",this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.defaultCatch=function(){var e=this;return u.catchError((function(t){var n;if(t){var i=t.status?String(t.status):"Error",s=(null===(n=t.error)||void 0===n?void 0:n.message)||t.statusText||t.message;if(401===t.status){var o=e.projectConfigs.getTranslationPrefix();i=e.translate.instant(o+".error_unauthorized_title"),s=e.translate.instant(o+".error_unauthorized_description")}e.messageService.add({severity:"error",summary:i,detail:s||"Error"})}return c.throwError(t)}))},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,s=void 0===i?10:i,o=e.sort,r=void 0===o?[]:o,a=e.filterQuery,l=void 0===a?"":a,c=e.displayFields,u=void 0===c?[]:c,p=new d.HttpParams;return p=(p=p.append("size",String(s))).append("offset",String(n)),r&&r.length&&(p=p.append("orderby",r.map((function(e){return-1===e.order?e.field+" desc":e.field+" asc"})).join(", "))),l&&(p=p.append("filter",l)),u&&u.length&&(p=p.append("displayfields",u.join())),p},e.prototype.getProcessDetails=function(e){return this.doGetProcessDetails({filter:"id eq '"+e+"'",size:"1",offset:"0"})},e.prototype.getLatestProcessDetails=function(e){return this.doGetProcessDetails({filter:"recordId eq '"+e+"'",size:"1",offset:"0",orderby:"startDate desc"})},e.prototype.doGetProcessDetails=function(e){var t=this;return this.http.get(this.exclusionProcessUrl,{params:e}).pipe(this.defaultCatch()).pipe(u.map((function(e){var n;return(null===(n=e.contents)||void 0===n?void 0:n.length)?t.mapExclusionsDates(e.contents[0]):null})))},e.prototype.mapExclusionsDates=function(e){var t;return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null,groups:null===(t=e.groups)||void 0===t?void 0:t.map((function(e){var t;return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null,steps:null===(t=e.steps)||void 0===t?void 0:t.map((function(e){return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null})}))})}))})},e.prototype.listExclusions=function(e,t){var n=this;return void 0===t&&(t={}),t.filterQuery?t.filterQuery+=" and lower(entityName) eq lower('"+e+"')":t.filterQuery="lower(entityName) eq lower('"+e+"')",this.http.get(this.exclusionProcessUrl,{params:this.getListQueryParams(t)}).pipe(this.defaultCatch()).pipe(u.map((function(e){return e.contents=e.contents.map(n.mapExclusionsDates),e})))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:f.MessageService},{type:l.TranslateService},{type:S}]},e=x([n.Injectable()],e)}(),P=[{enumValue:D.ERROR,color:o.EnumBadgeColors.RED},{enumValue:D.PENDING,color:o.EnumBadgeColors.YELLOW},{enumValue:D.PROCESSING,color:o.EnumBadgeColors.BLUE},{enumValue:D.SUCCESS,color:o.EnumBadgeColors.GREEN}],E=function(){function e(e,t,i,s){this.route=e,this.translate=t,this.logicalDeleteService=i,this.projectConfigs=s,this.expandedRows={},this.onProcessFinishedSuccessfully=new n.EventEmitter,this._isVisible=!1,this._isLoading=!1,this._processGroupData=[],this._processGroupColumns=[],this._processStepColumns=[],this.ngUnsubscribe=new c.Subject,this.subscriptionLoadProcess=null}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processGroupData",{get:function(){return this._processGroupData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processGroupColumns",{get:function(){return this._processGroupColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processStepColumns",{get:function(){return this._processStepColumns},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.locale=t.localeConfig})),this._processGroupColumns=this.getGroupColumns(),this._processStepColumns=this.getStepColumns()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete(),this.disconnectWebSocket()},e.prototype.showDetails=function(e){this._exclusionDetails=e,this._isVisible=!0,this._processGroupData=[],this.processDetails=null,this.entityDescription=e.entityDescription,this.loadProcessDetails(e,!0),this.connectWebSocket()},e.prototype.onVisibilityChanged=function(e){this.closeDetails()},e.prototype.closeDetails=function(){this._isVisible=!1,this._exclusionDetails=null,this._processGroupData=[],this.disconnectWebSocket()},e.prototype.getRecordDescription=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.description)?this.processDetails.description:""},e.prototype.getInicialDate=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.startDate)?r(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss"):""},e.prototype.getFinishDate=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.finishDate)?r(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss"):""},e.prototype.isFinished=function(){var e;return!!(null===(e=this.processDetails)||void 0===e?void 0:e.finishDate)},e.prototype.getShowExclusionsButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_show_deletions")},e.prototype.getCloseButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_close")},e.prototype.getUpdateButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_update")},e.prototype.getSummaryLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_summary")},e.prototype.getStartDateLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_start")},e.prototype.getFinishDateLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_finish")},e.prototype.getSidebarTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_details_title")},e.prototype.getEmptyStateTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_title")},e.prototype.getEmptyStateDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_description")},e.prototype.getGroupColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_group"),type:o.EnumColumnFieldType.STRING,style:{width:"340px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:P}]},e.prototype.getStepColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_step"),type:o.EnumColumnFieldType.STRING,style:{width:"340px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:P}]},e.prototype.getColumnStatusTooltip=function(e){return e.errorMessage?e.errorMessage:null},e.prototype.updateDetails=function(){this._exclusionDetails&&this.loadProcessDetails(this._exclusionDetails)},e.prototype.abortRunningLoadProcessCall=function(){this.subscriptionLoadProcess&&(this.subscriptionLoadProcess.closed||this.subscriptionLoadProcess.unsubscribe(),this.subscriptionLoadProcess=null)},e.prototype.loadProcessDetails=function(e,t){var n=this;void 0===t&&(t=!1),this._isLoading=!0,this.abortRunningLoadProcessCall();var i=e.processId?this.logicalDeleteService.getProcessDetails(e.processId):this.logicalDeleteService.getLatestProcessDetails(e.recordId);this.subscriptionLoadProcess=i.pipe(u.takeUntil(this.ngUnsubscribe)).pipe(u.finalize((function(){return n._isLoading=!1}))).subscribe((function(e){e&&(n.processDetails=e,n._processGroupData=n.sortGroupsByStartDate(e.groups).map((function(e){return v(v({},e),{steps:n.sortStepsByStartDate(e.steps)})})),n.expandedRows={},n._processGroupData.filter((function(e){return e.status!==D.SUCCESS})).forEach((function(e){n.expandedRows[e.id]=!0})),n.isProcessFinished()&&n.disconnectWebSocket(),t||n.checkIfProcessWasSuccessuful())}))},e.prototype.isProcessFinished=function(){return!!this._processGroupData.length&&this._processGroupData.every((function(e){return e.status===D.ERROR||e.status===D.SUCCESS}))},e.prototype.checkIfProcessWasSuccessuful=function(){this._processGroupData.every((function(e){return e.status===D.SUCCESS}))&&this.notifyProcessFinishedSuccessfully()},e.prototype.notifyProcessFinishedSuccessfully=function(){this.onProcessFinishedSuccessfully.emit(this.processDetails)},e.prototype.sortByDate=function(e,t){return e&&t?e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0:1},e.prototype.sortGroupsByStartDate=function(e){var t=this;return e.sort((function(e,n){return t.sortByDate(e.startDate,n.startDate)}))},e.prototype.sortStepsByStartDate=function(e){var t=this;return e.sort((function(e,n){return t.sortByDate(e.startDate,n.startDate)}))},e.prototype.disconnectWebSocket=function(){this._exclusionProcessStatusChangedSubscribe&&(this._exclusionProcessStatusChangedSubscribe.unsubscribe(),this._exclusionProcessStatusChangedSubscribe=null),this._websocketService&&(this._websocketService.disconnect(),this._websocketService=null)},e.prototype.connectWebSocket=function(){var e=this;this._websocketService&&this.disconnectWebSocket(),this._websocketService=new p.WebsocketService,this._websocketService.onConnect().pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.startListeningWebhookEvents(),e.processDetails&&!e.isProcessFinished()&&e.loadProcessDetails(e._exclusionDetails)}))},e.prototype.startListeningWebhookEvents=function(){var e=this;this._websocketService.onError().pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return console.error("onWSError",e)})),this._exclusionProcessStatusChangedSubscribe=this._websocketService.onEvent({domain:this.projectConfigs.getDomain(),service:this.projectConfigs.getService(),primitive:"exclusionProcessStatusChanged"}).pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n=t.data;(e._exclusionDetails.processId&&n.pid===e._exclusionDetails.processId||e._exclusionDetails.recordId&&n.recordId===e._exclusionDetails.recordId)&&e.loadProcessDetails(e._exclusionDetails)}))},e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:l.TranslateService},{type:T},{type:S}]},x([n.Output()],e.prototype,"isVisible",null),x([n.Output()],e.prototype,"isLoading",null),x([n.Output()],e.prototype,"processGroupData",null),x([n.Output()],e.prototype,"processGroupColumns",null),x([n.Output()],e.prototype,"processStepColumns",null),x([n.Output()],e.prototype,"processDetails",void 0),x([n.Output()],e.prototype,"entityDescription",void 0),x([n.Output()],e.prototype,"expandedRows",void 0),x([n.Output()],e.prototype,"onProcessFinishedSuccessfully",void 0),e=x([n.Component({selector:"s-exclusion-details",template:'<s-sidebar [visible]="isVisible" (visibleChange)="onVisibilityChanged($event)" [header]="getSidebarTitle()">\n <s-loading-state [loading]="isLoading">\n <p-panel [showHeader]="false" styleClass="s-exclusion-details-record-details-panel">\n <div class="s-exclusion-details-record-details-container">\n <div class="s-exclusion-details-record-icon-background">\n <em class="far fa-file-alt s-exclusion-details-record-icon"></em>\n </div>\n\n <div class="s-exclusion-details-record-details-recordinfo">\n <span class="s-exclusion-details-record-details-type">\n {{entityDescription}}\n </span>\n <span>\n {{getRecordDescription()}}\n </span>\n </div>\n\n <div class="s-exclusion-details-record-details-dateinfo">\n <span>\n {{getStartDateLabel()}}: {{getInicialDate()}}\n </span>\n <span *ngIf="isFinished()">\n {{getFinishDateLabel()}}: {{getFinishDate()}}\n </span>\n </div>\n </div>\n </p-panel>\n\n <p-panel>\n <p-header>\n {{getSummaryLabel()}}\n </p-header>\n\n <s-empty-state\n *ngIf="processGroupData && !processGroupData.length"\n [title]="getEmptyStateTitle()"\n [description]="getEmptyStateDescription()">\n [showPrimaryAction]="false"\n </s-empty-state>\n\n <p-table\n [value]="processGroupData"\n [columns]="processGroupColumns"\n dataKey="id"\n [lazy]="false"\n [scrollable]="false"\n [paginator]="false"\n *ngIf="processGroupData && processGroupData.length"\n [expandedRowKeys]="expandedRows">\n\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th id="expend-column" style="width: 40px;"></th>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [ngStyle]="col.style"\n [pSortableColumn]="col.field">\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="body" let-rowData let-columns="columns" let-expanded="expanded">\n <tr sNavigation [sRowToggler]="rowData">\n <td style="width: 40px;" tabindex="0">\n <em class="fa fa-{{ expanded ? \'minus\' : \'plus\' }}"></em>\n </td>\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="rowexpansion" let-rowData let-columns="columns">\n <tr class="sds-expanded-row">\n <td [attr.colspan]="columns.length + 1">\n <p-table \n [value]="rowData.steps"\n [columns]="processStepColumns"\n dataKey="id"\n [paginator]="false"\n [responsive]="true"\n [scrollable]="false"\n [lazy]="false">\n\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [ngStyle]="col.style"\n [pSortableColumn]="col.field">\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n \n <ng-template pTemplate="body" let-rowData let-columns="columns">\n <tr>\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n </tr>\n </ng-template>\n </p-table>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </p-panel>\n </s-loading-state>\n\n <s-footer>\n <div class="ui-fluid">\n <div class="ui-g-12 s-exclusion-details-footer">\n <s-button [label]="getUpdateButtonLabel()" priority="link" (onClick)="updateDetails()"></s-button>\n <s-button [label]="getCloseButtonLabel()" priority="link" (onClick)="closeDetails()"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n',encapsulation:n.ViewEncapsulation.None,styles:[".s-exclusion-details-record-details-panel{margin-bottom:10px}.s-exclusion-details-record-details-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.s-exclusion-details-record-details-recordinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex:1;flex:1}.s-exclusion-details-record-details-dateinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex-align:end;align-items:flex-end;font-size:12px}.s-exclusion-details-record-details-type{color:#999}.s-exclusion-details-record-icon{font-size:22pt;color:#7e8d95}.s-exclusion-details-record-icon-background{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:16px;background-color:#c1cad1;border-radius:50%;height:60px;width:60px}.s-exclusion-details-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}"]})],e)}(),F=function(){function e(){}return e=x([n.NgModule({imports:[t.CommonModule,o.SidebarModule,o.ButtonModule,i.PanelModule,s.TableModule,o.TableModule,o.LoadingStateModule,o.LocaleModule,o.EmptyStateModule],declarations:[E],exports:[E],entryComponents:[E]})],e)}(),w=function(){function e(e,t){this.logicalDeleteConfigService=e,this.translate=t,this.numberTypes=[o.FieldType.Integer,o.FieldType.Double]}return e.prototype.getEnumQuery=function(e,t,n){return void 0===n&&(n=!1),n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},e.prototype.createFilterString=function(e,t){var n=e.name,i=e.type,s=e.multiple;if("number"==typeof t)return n+" eq "+t;switch(i){case o.FieldType.Date:return n+" eq '"+r(t).format("YYYY-MM-DD")+"'";case o.FieldType.Time:return n+" eq '"+r(t).format("HH:mm:ss")+"'";case o.FieldType.DateTime:return n+" eq '"+r(t).format()+"'";case o.FieldType.LocalDateTime:return n+" eq '"+r(t).format("YYYY-MM-DD[T]HH:mm:ss.SSS")+"'";case o.FieldType.Enum:return this.getEnumQuery(n,t,s);case o.FieldType.String:return"containing(upper("+n+"), upper('"+t.replace(/'/g,"'")+"'))";case o.FieldType.Lookup:return n+" eq '"+t.id+"'";default:return n+" eq '"+t+"'"}},e.prototype.createFilterTokens=function(e,t){var n=this,i=e,s=i.name,a=i.type,l=i.label,c=i.searchFields,u=i.options,p=t;switch(a){case o.FieldType.Date:p=r(t).format("L");break;case o.FieldType.Time:p=r(t).format("LTS");break;case o.FieldType.LocalDateTime:case o.FieldType.DateTime:p=r(t).format("L LTS");break;case o.FieldType.Lookup:p=c.map((function(e){return n.getProp(t,e.name)})).join(" - ");break;case o.FieldType.Enum:p=Array.isArray(t)?t.map((function(e){return u.filter((function(t){return t.value===e}))[0].label})):u.filter((function(e){return e.value===p}))[0].label;break;case o.FieldType.Boolean:p=t?this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix()+".list_grid_boolean_true"):this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix()+".list_grid_boolean_false");break;default:p=t}return{id:s,label:l+": "+p}},e.prototype.getSuggestionValue=function(e,t,n,i){var s=this;return e.map((function(e){return s.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+i+t}))+""},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.getLabelValueRequest=function(e,t){var n=this;return e.map((function(e){return v(v({},e),{label:t.map((function(t){return n.getProp(e,t)})).join(" - ")})}))},e.prototype.isValidFilter=function(e,t){var n=this.numberTypes.includes(e),i=t.match(/^\d+\b$/);return!(n&&!i)},e.ctorParameters=function(){return[{type:S},{type:l.TranslateService}]},e=x([n.Injectable()],e)}(),j=function(){function e(e,t,n,i,s,o,r,a,l){this.router=e,this.route=t,this.translate=n,this.formBuilder=i,this.changeDetectorRef=s,this.logicalDeleteService=o,this.filterService=r,this.projectConfigs=a,this.cdr=l,this.currentListParams={page:0,size:10,sort:[],filterData:{}},this.showLoader=!1,this.totalRecords=0,this.filtersPanelCollapsed=!0,this.searchTokens=[],this.serverError=!1,this.ngUnsubscribe=new c.Subject}var t;return t=e,e.prototype.ngOnInit=function(){var e=this;this.filterFormGroup=this.getFormBuilder(),this.filterFields=this.getFilterFields(),this.gridColumns=this.getGridColumns(),this.route.data.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.locale=t.localeConfig})),this.route.queryParams.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.entityName=t.entityName,e.entityDescription=t.entityDescription,e.processId=t.processId||t.pid}))},e.prototype.ngAfterViewInit=function(){this.entityName&&this.entityDescription&&this.processId&&(this.exclusionDetailsComponent.showDetails({processId:this.processId,entityDescription:this.entityDescription,entityName:this.entityName}),this.cdr.detectChanges())},e.prototype.ngOnDestroy=function(){var e,t=v({},null===(e=this.route.snapshot)||void 0===e?void 0:e.queryParams);t&&(delete t.entityName,delete t.entityDescription,this.router.navigate([],{queryParams:t})),this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getFormBuilder=function(){return this.formBuilder.group({description:[void 0,g.Validators.compose([])],status:[void 0,g.Validators.compose([])],startDate:[{value:null,disabled:!1},g.Validators.compose([])],endDate:[{value:null,disabled:!1},g.Validators.compose([])]})},e.prototype.getGridColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_description"),type:o.EnumColumnFieldType.STRING,style:{width:"300px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:[{enumValue:D.ERROR,color:o.EnumBadgeColors.RED},{enumValue:D.PENDING,color:o.EnumBadgeColors.YELLOW},{enumValue:D.PROCESSING,color:o.EnumBadgeColors.BLUE},{enumValue:D.SUCCESS,color:o.EnumBadgeColors.GREEN}]},{field:"startDate",attributes:["startDate"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_start"),type:o.EnumColumnFieldType.DATE,dateFormat:"DD/MM/YYYY HH:mm:ss",style:{width:"100px"}},{field:"finishDate",attributes:["finishDate"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_finish"),type:o.EnumColumnFieldType.DATE,dateFormat:"DD/MM/YYYY HH:mm:ss",style:{width:"100px"}}]},e.prototype.getColumnStatusTooltip=function(e){return e.errorMessage?e.errorMessage:null},e.prototype.getFilterFields=function(){var e=this.projectConfigs.getTranslationPrefix();return[new o.FormField({type:o.FieldType.String,name:"description",label:this.translate.instant(e+".logical_delete_description")}),new o.FormField({type:o.FieldType.Enum,name:"status",label:this.translate.instant(e+".logical_delete_status"),placeholder:this.translate.instant(e+".logical_delete_status"),multiple:!0,options:[{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_error"),value:D.ERROR},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_pending"),value:D.PENDING},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_processing"),value:D.PROCESSING},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_success"),value:D.SUCCESS}]}),new o.FormField({type:o.FieldType.Date,name:"startDate",label:this.translate.instant(e+".logical_delete_start")}),new o.FormField({type:o.FieldType.Date,name:"endDate",label:this.translate.instant(e+".logical_delete_finish")})]},e.prototype.getEmptyStateTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_title")},e.prototype.getEmptyStateDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_description")},e.prototype.getTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_list_title")},e.prototype.getDetailsButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_details")},e.prototype.getFiltersTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".filters")},e.prototype.getFilterButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".filter")},e.prototype.getClearButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".clear")},e.prototype.getErrorInvalid=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_invalid")},e.prototype.getErrorServerTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_server_title")},e.prototype.getErrorServerDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_server_description")},e.prototype.getActionsColumnLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".actions")},e.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e})},e.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e})},e.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t})},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,i=e.multiSortMeta?e.multiSortMeta:[];return this.updateGrid({page:n,size:t,sort:i})},e.prototype.getFilterTokens=function(){var e=this,t=this.filterFormGroup.value;return this.filterFields.filter((function(e){var n=e.name;return void 0!==t[n]&&""!==t[n]&&null!==t[n]})).map((function(n){return e.filterService.createFilterTokens(n,t[n.name])}))},e.prototype.getFilterQuery=function(){var e,n=this,i=this.currentListParams.filterData,s=["startDate","endDate"],o=this.filterFields.filter((function(e){var t=e.name;return!s.includes(t)})).filter((function(e){var t=e.name;return void 0!==i[t]&&""!==i[t]&&null!==i[t]})).map((function(e){return n.filterService.createFilterString(e,i[e.name])})).join(" and ");if(i.startDate&&i.endDate)e="startDate between '"+r(i.startDate).format(t.DATE_FORMAT)+"T00:00:00Z' and '"+r(i.endDate).format(t.DATE_FORMAT)+"T23:59:59Z'";else if(i.startDate){e="startDate >= '"+r(i.startDate).format(t.DATE_FORMAT)+"T00:00:00Z'"}else if(i.endDate){e="finishDate <= '"+r(i.endDate).format(t.DATE_FORMAT)+"T23:59:59Z'"}return e&&(o+=o?" and "+e:e),o},e.prototype.updateGrid=function(e){void 0===e&&(e={}),this.currentListParams=v(v({},this.currentListParams),e);var t=this.currentListParams,n=t.page,i=t.size,s=t.sort;this.searchTokens=this.getFilterTokens();var o=this.getFilterQuery(),r=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}(["recordId","errorMessage"],this.gridColumns.map((function(e){return e.field})));s.length||s.push({field:"startDate",order:-1}),this.listExclusions({page:n,size:i,sort:s,filterQuery:o,displayFields:r})},e.prototype.listExclusions=function(e){var t=this;this.showLoader=!0,this.serverError=!1,this.changeDetectorRef.detectChanges(),this.logicalDeleteService.listExclusions(this.entityName,e).pipe(u.takeUntil(this.ngUnsubscribe),u.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),u.finalize((function(){return t.showLoader=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements}))},e.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},e.prototype.resetGrid=function(e){e&&(this.currentListParams=v(v({},this.currentListParams),e)),this.currentListParams=v(v({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.onClickDetails=function(e){this.exclusionDetailsComponent.showDetails({processId:e.id,entityDescription:this.entityDescription,entityName:this.entityName})},e.DATE_FORMAT="YYYY-MM-DD",e.ctorParameters=function(){return[{type:a.Router},{type:a.ActivatedRoute},{type:l.TranslateService},{type:g.FormBuilder},{type:n.ChangeDetectorRef},{type:T},{type:w},{type:S},{type:n.ChangeDetectorRef}]},x([n.ViewChild("exclusionsTable")],e.prototype,"table",void 0),x([n.ViewChild(E)],e.prototype,"exclusionDetailsComponent",void 0),e=t=x([n.Component({template:'<div>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel\n *sLoadingState="showLoader"\n styleClass="form-group"\n [toggleable]="true"\n [(collapsed)]="filtersPanelCollapsed"\n (onAfterToggle)="focusInput(\'description\')"\n >\n <p-header>\n {{ getFiltersTitle() }}\n <s-token-list\n [tokens]="searchTokens"\n (tokenRemoved)="onRemoveToken($event)"\n [removableTokens]="true"\n ></s-token-list>\n </p-header>\n <div>\n <s-dynamic-form\n [fields]="filterFields"\n [form]="filterFormGroup"\n [errorMessages]="{ pattern: getErrorInvalid() }"\n ></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button\n id="filter-button"\n class="ui-button"\n type="submit"\n pButton\n [label]="getFilterButtonTitle()"\n (click)="onSearch()"\n ></button>\n <button\n id="clear-button"\n class="ui-button ui-button-link"\n type="button"\n pButton\n [label]="getClearButtonTitle()"\n (click)="onClear()"\n ></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{ getTitle() }}\n </p-header>\n <ng-container>\n <s-empty-state\n *ngIf="serverError && !showLoader"\n iconClass="fa fa-exclamation-triangle"\n title="{{ getErrorServerTitle() | translate }}"\n primaryActionLabel="{{ \'error_server_try_again\' | translate }}"\n (primaryAction)="resetGrid()"\n description="{{ getErrorServerDescription() | translate }}"\n ></s-empty-state>\n\n <s-empty-state\n *ngIf="!showLoader && !serverError && totalRecords === 0"\n [title]="getEmptyStateTitle()"\n [showPrimaryAction]="false"\n [description]="getEmptyStateDescription()"\n ></s-empty-state>\n\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table\n #exclusionsTable\n id="exclusionsTable"\n [hidden]="totalRecords === 0 || serverError"\n [value]="gridData"\n [columns]="gridColumns"\n dataKey="id"\n [lazy]="true"\n [scrollable]="true"\n [resizableColumns]="true"\n sortMode="multiple"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [rows]="10"\n sortField="startDate"\n sortOrder="-1"\n rows="10"\n [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)"\n >\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col\n *ngFor="let col of columns"\n [style.width]="col.width"\n />\n </colgroup>\n </ng-template>\n\n <ng-template\n pTemplate="header"\n let-columns\n >\n <tr>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [pSortableColumn]="col.field"\n [ngStyle]="col.style"\n pResizableColumn\n >\n <div class="senior-header">\n <span class="senior-header-title">\n {{ col.header }}\n </span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th id="action-column" style="width: 100px">\n <div class="senior-header">\n <span class="senior-header-title">{{ getActionsColumnLabel() }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="body" let-rowData let-columns="columns">\n <tr [pSelectableRow]="rowData">\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n <td style="width: 100px">\n <s-button\n id="details-button"\n priority="default"\n [label]="getDetailsButtonTitle()"\n [auxiliary]="true"\n (onClick)="onClickDetails(rowData)">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <s-table-paging\n [table]="exclusionsTable"\n [totalRecords]="totalRecords"\n ></s-table-paging>\n </ng-template>\n </p-table>\n </div>\n </div>\n </ng-container>\n </p-panel>\n</div>\n\n<s-exclusion-details></s-exclusion-details>\n',providers:[]})],e)}(),L=function(){function e(){}return e.prototype.canActivate=function(){return!0},e=x([n.Injectable()],e)}(),R=function(){function e(e){this.permissionsService=e}return e.prototype.resolve=function(){return this.permissionsService.get()},e.ctorParameters=function(){return[{type:b.PermissionsService}]},e=x([n.Injectable()],e)}(),M=function(){function e(e){this.localeService=e}return e.prototype.resolve=function(){return this.localeService.get()},e.ctorParameters=function(){return[{type:o.LocaleService}]},e=x([n.Injectable()],e)}(),k=function(){function e(){}return e=x([n.Component({template:"<router-outlet></router-outlet>"})],e)}(),G=[{path:"exclusions-list",component:k,canActivate:[L],resolve:{allPermissions:R,localeConfig:M},children:[{path:"",component:j}]}],I=function(){function e(){}return e=x([n.NgModule({imports:[a.RouterModule.forChild(G)],exports:[a.RouterModule],providers:[L,R,M],declarations:[k]})],e)}(),O=function(){function e(){}return e=x([n.NgModule({imports:[g.FormsModule,g.ReactiveFormsModule,l.TranslateModule,t.CommonModule,o.ControlErrorsModule,o.ButtonModule,i.PanelModule,y.InputTextModule,o.InfoSignModule,h.ConfirmDialogModule,m.DialogModule,s.TableModule,o.TableModule,o.LoadingStateModule,o.EmptyStateModule,o.DynamicFormModule,o.TokenListModule,o.LocaleModule.forChild(),F,I],declarations:[j],exports:[j],entryComponents:[j]})],e)}(),N=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:_,useValue:e}]}},e=t=x([n.NgModule({providers:[T,S,w]})],e)}();e.EmptyComponent=k,e.ExclusionDetailsComponent=E,e.ExclusionDetailsModule=F,e.ExclusionsListComponent=j,e.ExclusionsListFeatureRouting=I,e.ExclusionsListFeatureRoutingGuard=L,e.ExclusionsListFeatureRoutingLocaleResolver=M,e.ExclusionsListFeatureRoutingPermissionResolver=R,e.ExclusionsListModule=O,e.LogicalDeleteModule=N,e.routes=G,e.ɵa=T,e.ɵb=S,e.ɵc=_,e.ɵe=F,e.ɵf=E,e.ɵg=T,e.ɵh=w,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var D,v=function(){return(v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function x(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function C(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,o=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)r.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r}!function(e){e.PENDING="PENDING",e.PROCESSING="PROCESSING",e.ERROR="ERROR",e.SUCCESS="SUCCESS"}(D||(D={}));var _=new n.InjectionToken("projectConfigs"),S=function(){function e(e){this.projectConfigs=e}var t,i;return e.prototype.getDomain=function(){return this.projectConfigs.domain},e.prototype.getService=function(){return this.projectConfigs.service},e.prototype.getTranslationPrefix=function(){return this.projectConfigs.translationPrefix?this.projectConfigs.translationPrefix:this.projectConfigs.domain+"."+this.projectConfigs.service},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[_]}]}]},e=x([n.Injectable(),(t=0,i=n.Inject(_),function(e,n){i(e,n,t)})],e)}(),T=function(){function e(e,t,n,i){this.http=e,this.messageService=t,this.translate=n,this.projectConfigs=i;var s=i.getDomain()+"/"+i.getService();this.exclusionProcessUrl=s+"/entities/exclusionProcess",this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.defaultCatch=function(){var e=this;return u.catchError((function(t){var n;if(t){var i=t.status?String(t.status):"Error",s=(null===(n=t.error)||void 0===n?void 0:n.message)||t.statusText||t.message;if(401===t.status){var o=e.projectConfigs.getTranslationPrefix();i=e.translate.instant(o+".error_unauthorized_title"),s=e.translate.instant(o+".error_unauthorized_description")}e.messageService.add({severity:"error",summary:i,detail:s||"Error"})}return c.throwError(t)}))},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,s=void 0===i?10:i,o=e.sort,r=void 0===o?[]:o,a=e.filterQuery,l=void 0===a?"":a,c=e.displayFields,u=void 0===c?[]:c,p=new d.HttpParams;return p=(p=p.append("size",String(s))).append("offset",String(n)),r&&r.length&&(p=p.append("orderby",r.map((function(e){return-1===e.order?e.field+" desc":e.field+" asc"})).join(", "))),l&&(p=p.append("filter",l)),u&&u.length&&(p=p.append("displayfields",u.join())),p},e.prototype.getProcessDetails=function(e){return this.doGetProcessDetails({filter:"id eq '"+e+"'",size:"1",offset:"0"})},e.prototype.getLatestProcessDetails=function(e){return this.doGetProcessDetails({filter:"recordId eq '"+e+"'",size:"1",offset:"0",orderby:"startDate desc"})},e.prototype.doGetProcessDetails=function(e){var t=this;return this.http.get(this.exclusionProcessUrl,{params:e}).pipe(this.defaultCatch()).pipe(u.map((function(e){var n;return(null===(n=e.contents)||void 0===n?void 0:n.length)?t.mapExclusionsDates(e.contents[0]):null})))},e.prototype.mapExclusionsDates=function(e){var t;return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null,groups:null===(t=e.groups)||void 0===t?void 0:t.map((function(e){var t;return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null,steps:null===(t=e.steps)||void 0===t?void 0:t.map((function(e){return v(v({},e),{startDate:e.startDate?r(e.startDate).toDate():null,finishDate:e.finishDate?r(e.finishDate).toDate():null})}))})}))})},e.prototype.listExclusions=function(e,t){var n=this;return void 0===t&&(t={}),t.filterQuery?t.filterQuery+=" and lower(entityName) eq lower('"+e+"')":t.filterQuery="lower(entityName) eq lower('"+e+"')",this.http.get(this.exclusionProcessUrl,{params:this.getListQueryParams(t)}).pipe(this.defaultCatch()).pipe(u.map((function(e){return e.contents=e.contents.map(n.mapExclusionsDates),e})))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:f.MessageService},{type:l.TranslateService},{type:S}]},e=x([n.Injectable()],e)}(),P=[{enumValue:D.ERROR,color:o.EnumBadgeColors.RED},{enumValue:D.PENDING,color:o.EnumBadgeColors.YELLOW},{enumValue:D.PROCESSING,color:o.EnumBadgeColors.BLUE},{enumValue:D.SUCCESS,color:o.EnumBadgeColors.GREEN}],E=function(){function e(e,t,i,s){this.route=e,this.translate=t,this.logicalDeleteService=i,this.projectConfigs=s,this.expandedRows={},this.onProcessFinishedSuccessfully=new n.EventEmitter,this._isVisible=!1,this._isLoading=!1,this._processGroupData=[],this._processGroupColumns=[],this._processStepColumns=[],this.ngUnsubscribe=new c.Subject,this.subscriptionLoadProcess=null}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processGroupData",{get:function(){return this._processGroupData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processGroupColumns",{get:function(){return this._processGroupColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processStepColumns",{get:function(){return this._processStepColumns},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.locale=t.localeConfig})),this._processGroupColumns=this.getGroupColumns(),this._processStepColumns=this.getStepColumns()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete(),this.disconnectWebSocket()},e.prototype.showDetails=function(e){this._exclusionDetails=e,this._isVisible=!0,this._processGroupData=[],this.processDetails=null,this.entityDescription=e.entityDescription,this.loadProcessDetails(e,!0),this.connectWebSocket()},e.prototype.onVisibilityChanged=function(e){this.closeDetails()},e.prototype.closeDetails=function(){this._isVisible=!1,this._exclusionDetails=null,this._processGroupData=[],this.disconnectWebSocket()},e.prototype.getRecordDescription=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.description)?this.processDetails.description:""},e.prototype.getInicialDate=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.startDate)?r(this.processDetails.startDate).format("DD/MM/YYYY HH:mm:ss"):""},e.prototype.getFinishDate=function(){var e;return(null===(e=this.processDetails)||void 0===e?void 0:e.finishDate)?r(this.processDetails.finishDate).format("DD/MM/YYYY HH:mm:ss"):""},e.prototype.isFinished=function(){var e;return!!(null===(e=this.processDetails)||void 0===e?void 0:e.finishDate)},e.prototype.getShowExclusionsButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_show_deletions")},e.prototype.getCloseButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_close")},e.prototype.getUpdateButtonLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_update")},e.prototype.getSummaryLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_summary")},e.prototype.getStartDateLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_start")},e.prototype.getFinishDateLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_finish")},e.prototype.getSidebarTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_details_title")},e.prototype.getEmptyStateTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_title")},e.prototype.getEmptyStateDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_description")},e.prototype.getGroupColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_group"),type:o.EnumColumnFieldType.STRING,style:{width:"340px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:P}]},e.prototype.getStepColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_step"),type:o.EnumColumnFieldType.STRING,style:{width:"340px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:P}]},e.prototype.getColumnStatusTooltip=function(e){return e.errorMessage?e.errorMessage:null},e.prototype.updateDetails=function(){this._exclusionDetails&&this.loadProcessDetails(this._exclusionDetails)},e.prototype.abortRunningLoadProcessCall=function(){this.subscriptionLoadProcess&&(this.subscriptionLoadProcess.closed||this.subscriptionLoadProcess.unsubscribe(),this.subscriptionLoadProcess=null)},e.prototype.loadProcessDetails=function(e,t){var n=this;void 0===t&&(t=!1),this._isLoading=!0,this.abortRunningLoadProcessCall();var i=e.processId?this.logicalDeleteService.getProcessDetails(e.processId):this.logicalDeleteService.getLatestProcessDetails(e.recordId);this.subscriptionLoadProcess=i.pipe(u.takeUntil(this.ngUnsubscribe)).pipe(u.finalize((function(){return n._isLoading=!1}))).subscribe((function(e){e&&(n.processDetails=e,n._processGroupData=n.sortGroupsByStartDate(e.groups).map((function(e){return v(v({},e),{steps:n.sortStepsByStartDate(e.steps)})})),n.expandedRows={},n._processGroupData.filter((function(e){return e.status!==D.SUCCESS})).forEach((function(e){n.expandedRows[e.id]=!0})),n.isProcessFinished()&&n.disconnectWebSocket(),t||n.checkIfProcessWasSuccessuful())}))},e.prototype.isProcessFinished=function(){return!!this._processGroupData.length&&this._processGroupData.every((function(e){return e.status===D.ERROR||e.status===D.SUCCESS}))},e.prototype.checkIfProcessWasSuccessuful=function(){this._processGroupData.every((function(e){return e.status===D.SUCCESS}))&&this.notifyProcessFinishedSuccessfully()},e.prototype.notifyProcessFinishedSuccessfully=function(){this.onProcessFinishedSuccessfully.emit(this.processDetails)},e.prototype.sortByDate=function(e,t){return e&&t?e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0:1},e.prototype.sortGroupsByStartDate=function(e){var t=this;return(null==e?void 0:e.length)?e.sort((function(e,n){return t.sortByDate(e.startDate,n.startDate)})):e},e.prototype.sortStepsByStartDate=function(e){var t=this;return(null==e?void 0:e.length)?e.sort((function(e,n){return t.sortByDate(e.startDate,n.startDate)})):e},e.prototype.disconnectWebSocket=function(){this._exclusionProcessStatusChangedSubscribe&&(this._exclusionProcessStatusChangedSubscribe.unsubscribe(),this._exclusionProcessStatusChangedSubscribe=null),this._websocketService&&(this._websocketService.disconnect(),this._websocketService=null)},e.prototype.connectWebSocket=function(){var e=this;this._websocketService&&this.disconnectWebSocket(),this._websocketService=new p.WebsocketService,this._websocketService.onConnect().pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.startListeningWebhookEvents(),e.processDetails&&!e.isProcessFinished()&&e.loadProcessDetails(e._exclusionDetails)}))},e.prototype.startListeningWebhookEvents=function(){var e=this;this._websocketService.onError().pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return console.error("onWSError",e)})),this._exclusionProcessStatusChangedSubscribe=this._websocketService.onEvent({domain:this.projectConfigs.getDomain(),service:this.projectConfigs.getService(),primitive:"exclusionProcessStatusChanged"}).pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n=t.data;(e._exclusionDetails.processId&&n.pid===e._exclusionDetails.processId||e._exclusionDetails.recordId&&n.recordId===e._exclusionDetails.recordId)&&e.loadProcessDetails(e._exclusionDetails)}))},e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:l.TranslateService},{type:T},{type:S}]},x([n.Output()],e.prototype,"isVisible",null),x([n.Output()],e.prototype,"isLoading",null),x([n.Output()],e.prototype,"processGroupData",null),x([n.Output()],e.prototype,"processGroupColumns",null),x([n.Output()],e.prototype,"processStepColumns",null),x([n.Output()],e.prototype,"processDetails",void 0),x([n.Output()],e.prototype,"entityDescription",void 0),x([n.Output()],e.prototype,"expandedRows",void 0),x([n.Output()],e.prototype,"onProcessFinishedSuccessfully",void 0),e=x([n.Component({selector:"s-exclusion-details",template:'<s-sidebar [visible]="isVisible" (visibleChange)="onVisibilityChanged($event)" [header]="getSidebarTitle()">\n <s-loading-state [loading]="isLoading">\n <p-panel [showHeader]="false" styleClass="s-exclusion-details-record-details-panel">\n <div class="s-exclusion-details-record-details-container">\n <div class="s-exclusion-details-record-icon-background">\n <em class="far fa-file-alt s-exclusion-details-record-icon"></em>\n </div>\n\n <div class="s-exclusion-details-record-details-recordinfo">\n <span class="s-exclusion-details-record-details-type">\n {{entityDescription}}\n </span>\n <span>\n {{getRecordDescription()}}\n </span>\n </div>\n\n <div class="s-exclusion-details-record-details-dateinfo">\n <span>\n {{getStartDateLabel()}}: {{getInicialDate()}}\n </span>\n <span *ngIf="isFinished()">\n {{getFinishDateLabel()}}: {{getFinishDate()}}\n </span>\n </div>\n </div>\n </p-panel>\n\n <p-panel>\n <p-header>\n {{getSummaryLabel()}}\n </p-header>\n\n <s-empty-state\n *ngIf="processGroupData && !processGroupData.length"\n [title]="getEmptyStateTitle()"\n [description]="getEmptyStateDescription()">\n [showPrimaryAction]="false"\n </s-empty-state>\n\n <p-table\n [value]="processGroupData"\n [columns]="processGroupColumns"\n dataKey="id"\n [lazy]="false"\n [scrollable]="false"\n [paginator]="false"\n *ngIf="processGroupData && processGroupData.length"\n [expandedRowKeys]="expandedRows">\n\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th id="expend-column" style="width: 40px;"></th>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [ngStyle]="col.style"\n [pSortableColumn]="col.field">\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="body" let-rowData let-columns="columns" let-expanded="expanded">\n <tr sNavigation [sRowToggler]="rowData">\n <td style="width: 40px;" tabindex="0">\n <em class="fa fa-{{ expanded ? \'minus\' : \'plus\' }}"></em>\n </td>\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="rowexpansion" let-rowData let-columns="columns">\n <tr class="sds-expanded-row">\n <td [attr.colspan]="columns.length + 1">\n <p-table \n [value]="rowData.steps"\n [columns]="processStepColumns"\n dataKey="id"\n [paginator]="false"\n [responsive]="true"\n [scrollable]="false"\n [lazy]="false">\n\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [ngStyle]="col.style"\n [pSortableColumn]="col.field">\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field" ></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n \n <ng-template pTemplate="body" let-rowData let-columns="columns">\n <tr>\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n </tr>\n </ng-template>\n </p-table>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </p-panel>\n </s-loading-state>\n\n <s-footer>\n <div class="ui-fluid">\n <div class="ui-g-12 s-exclusion-details-footer">\n <s-button [label]="getUpdateButtonLabel()" priority="link" (onClick)="updateDetails()"></s-button>\n <s-button [label]="getCloseButtonLabel()" priority="link" (onClick)="closeDetails()"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n',encapsulation:n.ViewEncapsulation.None,styles:[".s-exclusion-details-record-details-panel{margin-bottom:10px}.s-exclusion-details-record-details-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.s-exclusion-details-record-details-recordinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex:1;flex:1}.s-exclusion-details-record-details-dateinfo{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:10px;-ms-flex-align:end;align-items:flex-end;font-size:12px}.s-exclusion-details-record-details-type{color:#999}.s-exclusion-details-record-icon{font-size:22pt;color:#7e8d95}.s-exclusion-details-record-icon-background{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:16px;background-color:#c1cad1;border-radius:50%;height:60px;width:60px}.s-exclusion-details-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}"]})],e)}(),F=function(){function e(){}return e=x([n.NgModule({imports:[t.CommonModule,o.SidebarModule,o.ButtonModule,i.PanelModule,s.TableModule,o.TableModule,o.LoadingStateModule,o.LocaleModule,o.EmptyStateModule],declarations:[E],exports:[E],entryComponents:[E]})],e)}(),w=function(){function e(e,t){this.logicalDeleteConfigService=e,this.translate=t,this.numberTypes=[o.FieldType.Integer,o.FieldType.Double]}return e.prototype.getEnumQuery=function(e,t,n){return void 0===n&&(n=!1),n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},e.prototype.createFilterString=function(e,t){var n=e.name,i=e.type,s=e.multiple;if("number"==typeof t)return n+" eq "+t;switch(i){case o.FieldType.Date:return n+" eq '"+r(t).format("YYYY-MM-DD")+"'";case o.FieldType.Time:return n+" eq '"+r(t).format("HH:mm:ss")+"'";case o.FieldType.DateTime:return n+" eq '"+r(t).format()+"'";case o.FieldType.LocalDateTime:return n+" eq '"+r(t).format("YYYY-MM-DD[T]HH:mm:ss.SSS")+"'";case o.FieldType.Enum:return this.getEnumQuery(n,t,s);case o.FieldType.String:return"containing(upper("+n+"), upper('"+t.replace(/'/g,"'")+"'))";case o.FieldType.Lookup:return n+" eq '"+t.id+"'";default:return n+" eq '"+t+"'"}},e.prototype.createFilterTokens=function(e,t){var n=this,i=e,s=i.name,a=i.type,l=i.label,c=i.searchFields,u=i.options,p=t;switch(a){case o.FieldType.Date:p=r(t).format("L");break;case o.FieldType.Time:p=r(t).format("LTS");break;case o.FieldType.LocalDateTime:case o.FieldType.DateTime:p=r(t).format("L LTS");break;case o.FieldType.Lookup:p=c.map((function(e){return n.getProp(t,e.name)})).join(" - ");break;case o.FieldType.Enum:p=Array.isArray(t)?t.map((function(e){return u.filter((function(t){return t.value===e}))[0].label})):u.filter((function(e){return e.value===p}))[0].label;break;case o.FieldType.Boolean:p=t?this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix()+".list_grid_boolean_true"):this.translate.instant(this.logicalDeleteConfigService.getTranslationPrefix()+".list_grid_boolean_false");break;default:p=t}return{id:s,label:l+": "+p}},e.prototype.getSuggestionValue=function(e,t,n,i){var s=this;return e.map((function(e){return s.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+i+t}))+""},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.getLabelValueRequest=function(e,t){var n=this;return e.map((function(e){return v(v({},e),{label:t.map((function(t){return n.getProp(e,t)})).join(" - ")})}))},e.prototype.isValidFilter=function(e,t){var n=this.numberTypes.includes(e),i=t.match(/^\d+\b$/);return!(n&&!i)},e.ctorParameters=function(){return[{type:S},{type:l.TranslateService}]},e=x([n.Injectable()],e)}(),j=function(){function e(e,t,n,i,s,o,r,a,l){this.router=e,this.route=t,this.translate=n,this.formBuilder=i,this.changeDetectorRef=s,this.logicalDeleteService=o,this.filterService=r,this.projectConfigs=a,this.cdr=l,this.currentListParams={page:0,size:10,sort:[],filterData:{}},this.showLoader=!1,this.totalRecords=0,this.filtersPanelCollapsed=!0,this.searchTokens=[],this.serverError=!1,this.ngUnsubscribe=new c.Subject}var t;return t=e,e.prototype.ngOnInit=function(){var e=this;this.filterFormGroup=this.getFormBuilder(),this.filterFields=this.getFilterFields(),this.gridColumns=this.getGridColumns(),this.route.data.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.locale=t.localeConfig})),this.route.queryParams.pipe(u.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.entityName=t.entityName,e.entityDescription=t.entityDescription,e.processId=t.processId||t.pid}))},e.prototype.ngAfterViewInit=function(){this.entityName&&this.entityDescription&&this.processId&&(this.exclusionDetailsComponent.showDetails({processId:this.processId,entityDescription:this.entityDescription,entityName:this.entityName}),this.cdr.detectChanges())},e.prototype.ngOnDestroy=function(){var e,t=v({},null===(e=this.route.snapshot)||void 0===e?void 0:e.queryParams);t&&(delete t.entityName,delete t.entityDescription,this.router.navigate([],{queryParams:t})),this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getFormBuilder=function(){return this.formBuilder.group({description:[void 0,g.Validators.compose([])],status:[void 0,g.Validators.compose([])],startDate:[{value:null,disabled:!1},g.Validators.compose([])],endDate:[{value:null,disabled:!1},g.Validators.compose([])]})},e.prototype.getGridColumns=function(){return[{field:"description",attributes:["description"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_description"),type:o.EnumColumnFieldType.STRING,style:{width:"300px"}},{field:"status",attributes:["status"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_status"),type:o.EnumColumnFieldType.ENUM,enumPrefix:this.projectConfigs.getTranslationPrefix()+".logical_delete_enum_exclusion_process_status_",style:{width:"100px"},tooltip:this.getColumnStatusTooltip,badgeConfigs:[{enumValue:D.ERROR,color:o.EnumBadgeColors.RED},{enumValue:D.PENDING,color:o.EnumBadgeColors.YELLOW},{enumValue:D.PROCESSING,color:o.EnumBadgeColors.BLUE},{enumValue:D.SUCCESS,color:o.EnumBadgeColors.GREEN}]},{field:"startDate",attributes:["startDate"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_start"),type:o.EnumColumnFieldType.DATE,dateFormat:"DD/MM/YYYY HH:mm:ss",style:{width:"100px"}},{field:"finishDate",attributes:["finishDate"],header:this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_finish"),type:o.EnumColumnFieldType.DATE,dateFormat:"DD/MM/YYYY HH:mm:ss",style:{width:"100px"}}]},e.prototype.getColumnStatusTooltip=function(e){return e.errorMessage?e.errorMessage:null},e.prototype.getFilterFields=function(){var e=this.projectConfigs.getTranslationPrefix();return[new o.FormField({type:o.FieldType.String,name:"description",label:this.translate.instant(e+".logical_delete_description")}),new o.FormField({type:o.FieldType.Enum,name:"status",label:this.translate.instant(e+".logical_delete_status"),placeholder:this.translate.instant(e+".logical_delete_status"),multiple:!0,options:[{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_error"),value:D.ERROR},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_pending"),value:D.PENDING},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_processing"),value:D.PROCESSING},{label:this.translate.instant(e+".logical_delete_enum_exclusion_process_status_success"),value:D.SUCCESS}]}),new o.FormField({type:o.FieldType.Date,name:"startDate",label:this.translate.instant(e+".logical_delete_start")}),new o.FormField({type:o.FieldType.Date,name:"endDate",label:this.translate.instant(e+".logical_delete_finish")})]},e.prototype.getEmptyStateTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_title")},e.prototype.getEmptyStateDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_empty_state_description")},e.prototype.getTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_list_title")},e.prototype.getDetailsButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".logical_delete_details")},e.prototype.getFiltersTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".filters")},e.prototype.getFilterButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".filter")},e.prototype.getClearButtonTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".clear")},e.prototype.getErrorInvalid=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_invalid")},e.prototype.getErrorServerTitle=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_server_title")},e.prototype.getErrorServerDescription=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".error_server_description")},e.prototype.getActionsColumnLabel=function(){return this.translate.instant(this.projectConfigs.getTranslationPrefix()+".actions")},e.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e})},e.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e})},e.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t})},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,i=e.multiSortMeta?e.multiSortMeta:[];return this.updateGrid({page:n,size:t,sort:i})},e.prototype.getFilterTokens=function(){var e=this,t=this.filterFormGroup.value;return this.filterFields.filter((function(e){var n=e.name;return void 0!==t[n]&&""!==t[n]&&null!==t[n]})).map((function(n){return e.filterService.createFilterTokens(n,t[n.name])}))},e.prototype.getFilterQuery=function(){var e,n=this,i=this.currentListParams.filterData,s=["startDate","endDate"],o=this.filterFields.filter((function(e){var t=e.name;return!s.includes(t)})).filter((function(e){var t=e.name;return void 0!==i[t]&&""!==i[t]&&null!==i[t]})).map((function(e){return n.filterService.createFilterString(e,i[e.name])})).join(" and ");if(i.startDate&&i.endDate)e="startDate between '"+r(i.startDate).format(t.DATE_FORMAT)+"T00:00:00Z' and '"+r(i.endDate).format(t.DATE_FORMAT)+"T23:59:59Z'";else if(i.startDate){e="startDate >= '"+r(i.startDate).format(t.DATE_FORMAT)+"T00:00:00Z'"}else if(i.endDate){e="finishDate <= '"+r(i.endDate).format(t.DATE_FORMAT)+"T23:59:59Z'"}return e&&(o+=o?" and "+e:e),o},e.prototype.updateGrid=function(e){void 0===e&&(e={}),this.currentListParams=v(v({},this.currentListParams),e);var t=this.currentListParams,n=t.page,i=t.size,s=t.sort;this.searchTokens=this.getFilterTokens();var o=this.getFilterQuery(),r=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}(["recordId","errorMessage"],this.gridColumns.map((function(e){return e.field})));s.length||s.push({field:"startDate",order:-1}),this.listExclusions({page:n,size:i,sort:s,filterQuery:o,displayFields:r})},e.prototype.listExclusions=function(e){var t=this;this.showLoader=!0,this.serverError=!1,this.changeDetectorRef.detectChanges(),this.logicalDeleteService.listExclusions(this.entityName,e).pipe(u.takeUntil(this.ngUnsubscribe),u.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),u.finalize((function(){return t.showLoader=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements}))},e.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},e.prototype.resetGrid=function(e){e&&(this.currentListParams=v(v({},this.currentListParams),e)),this.currentListParams=v(v({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.onClickDetails=function(e){this.exclusionDetailsComponent.showDetails({processId:e.id,entityDescription:this.entityDescription,entityName:this.entityName})},e.DATE_FORMAT="YYYY-MM-DD",e.ctorParameters=function(){return[{type:a.Router},{type:a.ActivatedRoute},{type:l.TranslateService},{type:g.FormBuilder},{type:n.ChangeDetectorRef},{type:T},{type:w},{type:S},{type:n.ChangeDetectorRef}]},x([n.ViewChild("exclusionsTable")],e.prototype,"table",void 0),x([n.ViewChild(E)],e.prototype,"exclusionDetailsComponent",void 0),e=t=x([n.Component({template:'<div>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel\n *sLoadingState="showLoader"\n styleClass="form-group"\n [toggleable]="true"\n [(collapsed)]="filtersPanelCollapsed"\n (onAfterToggle)="focusInput(\'description\')"\n >\n <p-header>\n {{ getFiltersTitle() }}\n <s-token-list\n [tokens]="searchTokens"\n (tokenRemoved)="onRemoveToken($event)"\n [removableTokens]="true"\n ></s-token-list>\n </p-header>\n <div>\n <s-dynamic-form\n [fields]="filterFields"\n [form]="filterFormGroup"\n [errorMessages]="{ pattern: getErrorInvalid() }"\n ></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button\n id="filter-button"\n class="ui-button"\n type="submit"\n pButton\n [label]="getFilterButtonTitle()"\n (click)="onSearch()"\n ></button>\n <button\n id="clear-button"\n class="ui-button ui-button-link"\n type="button"\n pButton\n [label]="getClearButtonTitle()"\n (click)="onClear()"\n ></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{ getTitle() }}\n </p-header>\n <ng-container>\n <s-empty-state\n *ngIf="serverError && !showLoader"\n iconClass="fa fa-exclamation-triangle"\n title="{{ getErrorServerTitle() | translate }}"\n primaryActionLabel="{{ \'error_server_try_again\' | translate }}"\n (primaryAction)="resetGrid()"\n description="{{ getErrorServerDescription() | translate }}"\n ></s-empty-state>\n\n <s-empty-state\n *ngIf="!showLoader && !serverError && totalRecords === 0"\n [title]="getEmptyStateTitle()"\n [showPrimaryAction]="false"\n [description]="getEmptyStateDescription()"\n ></s-empty-state>\n\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table\n #exclusionsTable\n id="exclusionsTable"\n [hidden]="totalRecords === 0 || serverError"\n [value]="gridData"\n [columns]="gridColumns"\n dataKey="id"\n [lazy]="true"\n [scrollable]="true"\n [resizableColumns]="true"\n sortMode="multiple"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [rows]="10"\n sortField="startDate"\n sortOrder="-1"\n rows="10"\n [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)"\n >\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col\n *ngFor="let col of columns"\n [style.width]="col.width"\n />\n </colgroup>\n </ng-template>\n\n <ng-template\n pTemplate="header"\n let-columns\n >\n <tr>\n <th *ngFor="let col of columns"\n [id]="col.field"\n [pSortableColumn]="col.field"\n [ngStyle]="col.style"\n pResizableColumn\n >\n <div class="senior-header">\n <span class="senior-header-title">\n {{ col.header }}\n </span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th id="action-column" style="width: 100px">\n <div class="senior-header">\n <span class="senior-header-title">{{ getActionsColumnLabel() }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="body" let-rowData let-columns="columns">\n <tr [pSelectableRow]="rowData">\n <s-table-columns\n [columns]="columns"\n [rowValue]="rowData"\n [locale]="locale">\n </s-table-columns>\n <td style="width: 100px">\n <s-button\n id="details-button"\n priority="default"\n [label]="getDetailsButtonTitle()"\n [auxiliary]="true"\n (onClick)="onClickDetails(rowData)">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <s-table-paging\n [table]="exclusionsTable"\n [totalRecords]="totalRecords"\n ></s-table-paging>\n </ng-template>\n </p-table>\n </div>\n </div>\n </ng-container>\n </p-panel>\n</div>\n\n<s-exclusion-details></s-exclusion-details>\n',providers:[]})],e)}(),L=function(){function e(){}return e.prototype.canActivate=function(){return!0},e=x([n.Injectable()],e)}(),R=function(){function e(e){this.permissionsService=e}return e.prototype.resolve=function(){return this.permissionsService.get()},e.ctorParameters=function(){return[{type:b.PermissionsService}]},e=x([n.Injectable()],e)}(),M=function(){function e(e){this.localeService=e}return e.prototype.resolve=function(){return this.localeService.get()},e.ctorParameters=function(){return[{type:o.LocaleService}]},e=x([n.Injectable()],e)}(),k=function(){function e(){}return e=x([n.Component({template:"<router-outlet></router-outlet>"})],e)}(),G=[{path:"exclusions-list",component:k,canActivate:[L],resolve:{allPermissions:R,localeConfig:M},children:[{path:"",component:j}]}],I=function(){function e(){}return e=x([n.NgModule({imports:[a.RouterModule.forChild(G)],exports:[a.RouterModule],providers:[L,R,M],declarations:[k]})],e)}(),O=function(){function e(){}return e=x([n.NgModule({imports:[g.FormsModule,g.ReactiveFormsModule,l.TranslateModule,t.CommonModule,o.ControlErrorsModule,o.ButtonModule,i.PanelModule,y.InputTextModule,o.InfoSignModule,h.ConfirmDialogModule,m.DialogModule,s.TableModule,o.TableModule,o.LoadingStateModule,o.EmptyStateModule,o.DynamicFormModule,o.TokenListModule,o.LocaleModule.forChild(),F,I],declarations:[j],exports:[j],entryComponents:[j]})],e)}(),N=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:_,useValue:e}]}},e=t=x([n.NgModule({providers:[T,S,w]})],e)}();e.EmptyComponent=k,e.ExclusionDetailsComponent=E,e.ExclusionDetailsModule=F,e.ExclusionsListComponent=j,e.ExclusionsListFeatureRouting=I,e.ExclusionsListFeatureRoutingGuard=L,e.ExclusionsListFeatureRoutingLocaleResolver=M,e.ExclusionsListFeatureRoutingPermissionResolver=R,e.ExclusionsListModule=O,e.LogicalDeleteModule=N,e.routes=G,e.ɵa=T,e.ɵb=S,e.ɵc=_,e.ɵe=F,e.ɵf=E,e.ɵg=T,e.ɵh=w,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=seniorsistemas-exclusion-process-component.umd.min.js.map
|