12 |
- var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super(...arguments);this.RuleFlow=[]}jsFiles(){return["platform/automation/managers/rulemanager.js","libs/notificationbuilder/notificationbuilder.js","platform/automation/components/eventtemplate.js"]}cssFiles(){return["libs/flowy/styles.css","libs/notificationbuilder/notificationbuilder.css"]}html(){return`<div class="flowchart_new" onclick="eval('closemenu()')" style="background-color:white"><div id="Validate_RuleBuilder" class="col-sm-12 clear"></div><div class=" col-md-12 create_rule" style="margin-top:15px"><div class="row"><div class="col-sm-6 d-flex"><span class="rule_name" style="margin-right:10px;margin-left:10px;"><input type="text" class="form-control border-0" placeholder="Rule Name" id="txt_Rule" style="height:38px;width:200px" class="Rulename_text"></span><span class="Installed_app" style="width:200px"><select id="installedapp_dropdown" class="form-control text-control required" style="width:100%;" onchange="eval('ruleproviders()')" placeholder="Select InstalledApp" data-placeholder="InstalledApp" data-label="" data-istagselect="true"></select></span><span class="rule_providerdropdown ml-5"><select id="ddl_RuleProvider" onchange="eval('ruleprovideridinfo()')" class="form-control text-control"style="margin-right:10px;height:38px;width:200px"><option value='0'>Select RuleProvider</option></select><input type="hidden" id="hf_RuleProvider" value="" /></span></div><div class="col-md-6"><span class="buttons pull-right"><span id="discard">Discard</span><span id="publish">Save Flow</span></span></div></div></div><hr><div class="treeContainer">
- <div class="treebody"></div></div></div>`}load(t,i){var r=this;$("#discard").click(function(){let n=eval("bizgaze_automation_flow_main.getruleid()");n!=0?bootbox.confirm("All items will be deleted, Do You Want To Continue?",function(n){if(n)$(".treebody").html(""),eval("bizgaze_automation_flow_main.getcloseadvmode()"),$("#"+i).modal("hide"),$("#"+i).remove();else return}):($(".treebody").html(""),eval("bizgaze_automation_flow_main.getcloseadvmode()"),$("#"+i).modal("hide"),$("#"+i).remove())});$("#publish").click(function(){r.SaveRuleFlow(i)});n.Platform.Automation.Components.RuleBuilder.Instance().loadinstalledappsfordrpdown();t!=0?n.Platform.Automation.Components.RuleBuilder.Instance().EditRuleFlow(t):eval("load()")}loadScript(n,t){let i=document.createElement("script");i.type="text/javascript";i.readyState?i.onreadystatechange=function(){(i.readyState=="loaded"||i.readyState=="complete")&&(i.onreadystatechange=null,t())}:i.onload=function(){t()};i.src=n;document.getElementsByTagName("head")[0].appendChild(i)}removejscssfile(n,t){for(var u=t=="js"?"script":t=="css"?"link":"none",f=t=="js"?"src":t=="css"?"href":"none",r=document.getElementsByTagName(u),i=r.length;i>=0;i--)r[i]&&r[i].getAttribute(f)!=null&&r[i].outerHTML.includes(n)&&r[i].parentNode.removeChild(r[i])}loadinstalledappsfordrpdown(){var n=_appsettings.server_url()+"/apis/v4/unibase/platform/apps/installedappautocomplete";AutoCompleteHelper.getHelper().Create("#installedapp_dropdown","#hf_Autocomplete_InstalledApp",n,function(n){var t=n})}SearchBlocks(){var u,i,f,t,r,n;for(u=document.getElementById("SearchBlocks"),i=u.value.toUpperCase(),f=document.getElementById("blocklist"),t=f.getElementsByClassName("blockelem create-flowy noselect"),n=0;n<t.length;n++)t[n].firstElementChild.value.toUpperCase()==i?(r=t[n],r.innerHTML.indexOf(i)>-1&&(t[n].style.display="")):(r=t[n],t[n].style.display=r.firstElementChild.value.toUpperCase().indexOf(i)>-1?"":"none")}render(i){this.navigationHelper.popup(i,"",n.Platform.Automation.Components.RuleBuilder.Instance(),null,t.Helpers.Size.ExtraLarge)}SaveRuleFlow(t){let u=eval("bizgaze_automation_flow_main.getruleid()"),e=eval("bizgaze_automation_flow_main.output()"),f=JSON.stringify(e),r=new n.Platform.Automation.Requests.Rule;r.RuleId=eval("bizgaze_automation_flow_main.getruleid()");r.RuleFlow=f;f!=undefined&&u!=0?i.Managers.RuleManager.Instance().saveRuleFlow(r).then(function(i){i.status==n.Data.Status.Error?MessageHelper.Instance().showError(i.message,"Validate_RuleBuilder"):(MessageHelper.Instance().showSuccess(i.message,"Validate_RuleBuilder"),eval("bizgaze_automation_flow_main.getcloseadvmode()"),$("#"+t).modal("hide"),$("#"+t).remove(),n.Platform.Helpers.NavigationHelper.Instance().loadDetail(u,n.Platform.Automation.Components.Rule.installedappid,null))}):MessageHelper.Instance().showError("Please Create Rule","Validate_RuleBuilder")}EditRuleFlow(t){n.Platform.Automation.Managers.RuleManager.Instance().getRule(t).then(function(t){eval("bizgaze_automation_flow_main.appendruleid('"+t.RuleId+"')");eval("bizgaze_automation_flow_main.appendruleproviderid('"+t.RuleProviderId+"')");n.Platform.Automation.Components.RuleBuilder.Instance().RuleFlow=t.RuleFlow;eval(" bizgaze_automation_flow_main.import("+t.RuleFlow+")");eval("load()")})}static Instance(){return this.instance===undefined&&(this.instance=new u),this.instance}}r.RuleBuilder=u})(r=i.Components||(i.Components={}))})(i=t.Automation||(t.Automation={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|