Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

w_ruleflow.js 3.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Automation;
  6. (function (Automation) {
  7. let Components;
  8. (function (Components) {
  9. class RuleFlowWidget extends Platform.Core.BaseComponent {
  10. constructor() {
  11. super(...arguments);
  12. this.ruleid = 0;
  13. }
  14. cssFiles() {
  15. return ["libs/notificationbuilder/notificationbuilder.css"];
  16. }
  17. jsFiles() {
  18. return ["libs/notificationbuilder/notificationbuilder.js"];
  19. }
  20. html() {
  21. return "";
  22. }
  23. load() {
  24. }
  25. static Instance() {
  26. if (this.instance == undefined) {
  27. this.instance = new RuleFlowWidget();
  28. }
  29. return this.instance;
  30. }
  31. init(containerid) {
  32. Unibase.Platform.Automation.Components.RuleFlowWidget.Instance().loadjsfile();
  33. Unibase.Platform.Automation.Components.RuleFlowWidget.Instance().loadcssfile();
  34. if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.length > 0) {
  35. for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
  36. if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_recordid") {
  37. RuleFlowWidget.Instance().ruleid = Number(obj.Value);
  38. }
  39. }
  40. }
  41. Unibase.Platform.Automation.Components.RuleFlowWidget.Instance().render(containerid);
  42. }
  43. loadjsfile() {
  44. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(this.jsFiles(), function () { });
  45. }
  46. loadcssfile() {
  47. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadCssFiles(this.cssFiles(), function () { });
  48. }
  49. render(containerid) {
  50. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/automation/managers/rulemanager.js", function () {
  51. Unibase.Platform.Automation.Managers.RuleManager.Instance().getRule(RuleFlowWidget.Instance().ruleid).then(function (response) {
  52. var infodata;
  53. if (response.RuleFlow != null) {
  54. $("." + containerid).html('');
  55. var info = JSON.parse(response.RuleFlow);
  56. infodata = info.html.replaceAll('\\\\', '').replaceAll("onclick=", '');
  57. }
  58. else {
  59. infodata = '<center><b style="font-size:13px">No Data Found</b></center>';
  60. }
  61. var html = '<div class="rulewidget bg-white" style="height:100%;overflow:auto"><div class="flowchart_header"><b style="font-size:15px">Rule Flow</b></div><hr>' + infodata + '</div>';
  62. $("." + containerid).html(html);
  63. });
  64. });
  65. }
  66. }
  67. Components.RuleFlowWidget = RuleFlowWidget;
  68. })(Components = Automation.Components || (Automation.Components = {}));
  69. })(Automation = Platform.Automation || (Platform.Automation = {}));
  70. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  71. })(Unibase || (Unibase = {}));