Built files from Bizgaze WebServer
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

editrole.min.js 12KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.InstalledAppId=0}cssFiles(){return["libs/jquery-ui-slider-pips/jquery-ui-slider-pips.css","libs/jquery-ui-slider-pips/Custom-slider-ui-pips.css"]}jsFiles(){return["platform/permission/components/editrole.js","platform/permission/requests/role.js","/platform/apps/components/stages/stages.js","platform/permission/components/permissions.js","/platform/apps/managers/stagemanager.js","/platform/apps/components/stages/stagepermissions.js","/platform/filters/components/filter.js","/platform/filters/managers/filtermanager.js","platform/permission/managers/permissionmanager.js","platform/permission/requests/approlesetting.js","/platform/permission/infos/role.js","platform/forms/components/formviewer/formviewer.js","libs/parsley/parsley.min.js","platform/permission/managers/permissionmanager.js","platform/core/infos/status.js"]}html(){var n=this,i=n.appSettings.InstalledAppId;n.InstalledAppId=n.appSettings.InstalledAppId;let t=``;return t+`<form id="form_Roles" default="" button="btnSaveDesignation" data-validate="parsley" data-isdynamic="false">
  2. <input type="hidden" id="hf_RoleId" value="" />
  3. <div class="b-b bg-white header">
  4. <strong class="text-dark Title" id="newRole">New Role</strong>
  5. <strong class="text-dark hidden Title" id="editRole">Edit Role</strong>
  6. <div class="btn-group ml-auto">
  7. <a class="btn btn-sm"><i class="ti-help-alt" title="help"></i></a>
  8. </div>
  9. </div>
  10. <div class="simple-scroll-bar scrollable" id="divroleheight">
  11. <div class="clear" id="divRoleError">
  12. </div>
  13. <div class="card">
  14. <div id="div_rolemessage" class="clear"></div>
  15. <div class="card-body">
  16. <div class="row">
  17. <div class="col-sm-12">
  18. <div class="" id="div_rolename">
  19. <label for="lblName">Role Name<span class="text-danger"> *</span></label>
  20. <input id="txtRoleName" class="form-control value-control required floating-label-control pl-1" data-isdefault="true" data-required="true" data-validatemsg data-val-required="The RoleName field is required." placeholder="RoleName" type="text" value="" data-label="Role Name *" data-placeholder="Administrator">
  21. </div>
  22. </div>
  23. </div>
  24. <div class="row">
  25. <div class="col-sm-12">
  26. <div class="" id="div_roleDescription">
  27. <label for="lblDescription">Description</label>
  28. <input id="txtDescription" class="form-control value-control floating-label-control pl-1" name="Description" data-isdefault="true" data-required="true" data-regularexp data-validatemsg placeholder="Short description about the role" type="text" value="" data-label="Description" data-placeholder="Short description about the role">
  29. </div>
  30. <br />
  31. </div>
  32. </div>
  33. <div class="row">
  34. <div class="col-sm-6">
  35. <label for="lblLobCategory" class="mt-15">
  36. Is
  37. Public ?
  38. </label>
  39. <input type="hidden" id="hfIsPublic" value="false" />
  40. <div class="btn-group btn-group-justified mt-10" data-toggle="buttons">
  41. <label class="btn btn-sm btn-isPublic btn-default active" onclick="Unibase.Platform.Permissions.Components.EditRole.Instance().ispublicChange(false)">
  42. <input name="options" id="option2" type="radio">
  43. <i class="fa fa-check text-active"></i>No
  44. </label>
  45. <label class="btn btn-sm btn-default btn-isPublictrue " onclick=" Unibase.Platform.Permissions.Components.EditRole.Instance().ispublicChange(true)">
  46. <input name="options" id="option1" type="radio">
  47. <i class="fa fa-check text-active"></i> Yes
  48. </label>
  49. </div>
  50. </div>
  51. <div class="col-sm-6">
  52. <label class="mt-15">Auto Assignment</label>
  53. <input type="hidden" id="hfAutoAssignment" value="false" />
  54. <div class="btn-group btn-group-justified mt-10" data-toggle="buttons">
  55. <label class="btn btn-sm btn-default btn-isAutoAssignment active" onclick=" Unibase.Platform.Permissions.Components.EditRole.Instance().isAutoAssignmentChange(false)">
  56. <input name="options" id="option2" type="radio">
  57. <i class="fa fa-check text-active"></i>No
  58. </label>
  59. <label class="btn btn-sm btn-default btn-isAutoAssignmentTrue " onclick=" Unibase.Platform.Permissions.Components.EditRole.Instance().isAutoAssignmentChange(true)">
  60. <input name="options" id="option1" type="radio">
  61. <i class="fa fa-check text-active"></i>Yes
  62. </label>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="row">
  67. <div class="col-sm-6">
  68. <div class=" floating-label-form-group floating-label-form-group-with-value" id="div_InternalRole">
  69. <label for="lblInternalRole">Internal Role <span class="text-danger"> *</span></label>
  70. <select id="select_InternalRole" class="form-control value-control required floating-label-control" placeholder="Select Internal Role" data-required="true"></select>
  71. </div>
  72. <br />
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="bg-white footer b-t">
  79. <a href="javascript:;" id="btn_Close" class="btn btn-light btn-sm mr-auto btn-close">Close</a>
  80. <a href="javascript:;" id="btn_SaveRole" class="pull-right btn btn-sm btn-primary">Save</a>
  81. </div>
  82. </form>`}load(t,i){var u=t,r=this;r.InstalledAppId=r.appSettings.InstalledAppId;$("#btn_rolesClose").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});$("#btn_SaveRole").click(function(){let t=n.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation("form_Roles");if(t==!1)return MessageHelper.Instance().showError("Mandatory fields are missing","div_rolemessage"),!1;r.SaveRole(i,u,r.InstalledAppId)});$("#btnAddNewStage_"+i).click(function(){n.Platform.Apps.Components.Stages.Instance().AddStage(0)});$("#btn_Close").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});r.roledata(t)}roledata(t){var r=this;$("#divroleheight").height($(window).outerHeight()-144);i.Managers.PermissionManager.Instance().getInternalRoles().then(function(i){for(var r=0;r<i.result.length;r++)$("#select_InternalRole").append('<option value="'+i.result[r].Value+'">'+i.result[r].SelectText+"<\/option>");t!=0&&n.Platform.Permissions.Managers.PermissionManager.Instance().getRole(t).then(function(n){var t=n.result,u="",f="",i,r;t.IsPublic==!0?(u="active",f=""):(u="",f="active");i="";r="";t.AutoAssignment==!0?(i="active",r=""):(i="",r="active");$("#txtRoleName").val(t.RoleName);$("#txtDescription").val(t.Description);$("#hf_RoleId").val(t.RoleId);$(".btn-isPublic").removeClass("active").addClass(f);$(".btn-isPublictrue").addClass(u);$(".btn-isAutoAssignment").removeClass("active").addClass(r);$(".btn-isAutoAssignmentTrue").addClass(i);$("#editRole").removeClass("hidden");$("#newRole").addClass("hidden");$("#hfIsPublic").val(String(t.IsPublic));$("#hfAutoAssignment").val(String(t.AutoAssignment));$("#select_InternalRole").val(t.InternalRoleId)})})}editRole(i,r){var f=r,u=n.Platform.Permissions.Components.EditRole.Instance();u.appSettings.InstalledAppId=Number(f);this.navigationHelper.popup(i,"",u,null,t.Helpers.Size.DockLeft)}ispublicChange(n){$("#hfIsPublic").val(n)}isAutoAssignmentChange(n){$("#hfAutoAssignment").val(n)}SaveRole(t,r,u){if(r==0&&$("#hf_RoleId").val(0),$("#hfIsPublic").val()==""&&$("#hfIsPublic").val("false"),$("#hfAutoAssignment").val()==""&&$("#hfAutoAssignment").val("false"),Number($("#select_InternalRole").val())==0)return MessageHelper.Instance().showError("Please Select InternalRole","divRoleError"),!1;let f=new i.Requests.Role;f.RoleId=Number(r);f.RoleName=String($("#txtRoleName").val());f.Description=String($("#txtDescription").val());f.IsPublic=Boolean($("#hfIsPublic").val());f.AutoAssignment=Boolean($("#hfAutoAssignment").val());f.InternalRoleId=Number($("#select_InternalRole").val());i.Managers.PermissionManager.Instance().saveRole(f).then(function(i){i.status==n.Data.Status.Error?MessageHelper.Instance().showError(i.message,"divRoleError"):(MessageHelper.Instance().showSuccess(i.message,"divRoleError"),$("#"+t).modal("hide"),$("#"+t).remove());n.Platform.Permissions.Components.Permission.Instance().loadRoles(u,"")})}static Instance(){return this.instance===undefined&&(this.instance=new u),this.instance}}r.EditRole=u})(r=i.Components||(i.Components={}))})(i=t.Permissions||(t.Permissions={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));