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.

index.appgroup.min.js 13KB

1234567891011121314151617181920
  1. var Unibase;(function(Unibase){let Platform;(function(Platform){let AppGroups;(function(AppGroups){let Components;(function(Components){class CreateAppGroup extends Platform.Core.BaseComponent{constructor(){super();this._appGroupManager=AppGroups.Managers.AppGroupManager.Instance()}cssFiles(){return[]}jsFiles(){return["platform/appgroups/requests/appgroup.js"]}html(){return`<form id="frm_BizgazeCreateAppGroup" method="post" data-validate="parsley" class="w-f bg-white"><div class="header b-b p-3"><h5>Create App Group</h5></div>
  2. <div data-simplebar class="simple-scroll-bar scrollable"><div id="Bizgaze_CreateAppGroupErrorMsgs" class="clear"></div><div class="card"><div class="card-header">Details</div><div class="card-body"><div class="row"><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id="div_AppGroupName"><label for="txt_AppGroupName" id="lbl_AppGroupName">App Group Name<span class="text-danger"> *</span></label><div class=""><input type="text" id="txt_AppGroupName" class="form-control value-control floating-label-control" data-isdynamic="false" placeholder="Group Name *" data-placeholder="Enter Group Name" data-label="Group Name *" /></div></div></div><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id="div_Index"><label for="txt_DisplayIndex" id="lbl_DisplayIndex">Display Index<span class="text-danger"> </span></label><div class=""><input type="number" min="0" onkeypress="return event.charCode != 45 && event.charCode!=101" id="txt_DisplayIndex" class="form-control value-control floating-label-control" data-isdynamic="false" placeholder="Display Index" data-placeholder="Enter Display Index" data-label="Display Index" /></div></div></div></div></div><br /><br /></div>
  3. <div class="card" id="div_ChooseApps"><div class="card-header">Choose Apps</div><div class="card-body"><div class="row"><div class="col-sm-12" style="overflow:auto"><ul class="list-group" style="" id="UnGroupedAppItems"></ul></div></div></div></div></div>
  4. <div class="footer bg-white"><a href="javascript:;" id="btn_CloseAppGroup" class="pull-left btn btn-light btn-sm mr-auto">Close</a><a href="javascript:;" id="btn_SaveAppGroup" class="pull-right btn btn-primary btn-sm">Save</a></div></form>`}load(){var instance=this,TotalGroups=$("li.RootGroup").length;$("#txt_DisplayIndex").val(TotalGroups+1);$("#btn_SaveAppGroup").click(function(){instance.saveAppGroup()});$("#btn_CloseAppGroup").click(function(){instance.navigationHelper.closePopUp()});instance.loadUngroupedApps()}saveAppGroup(){var instance=this,selectedapps=[];$("#UnGroupedAppItems li").each(function(){var cb=$(this).find(":checkbox"),AppId;cb.prop("checked")&&(AppId=cb.parent("li").attr("id"),selectedapps.push(Number(AppId)))});let reqObj=new Unibase.Platform.AppGroups.Requests.AppGroup;reqObj.AppGroupName=String($("#txt_AppGroupName").val());reqObj.DisplayIndex=Number($("#txt_DisplayIndex").val());reqObj.InstalledApps=selectedapps;reqObj.InstalledAppId=0;instance._appGroupManager.saveAppGroup(reqObj).then(function(response){response.errors==null?(instance.navigationHelper.closePopUp(),MessageHelper.Instance().showSuccess("App Group Saved Successfully",""),Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups()):MessageHelper.Instance().showError(response.errors[0],"Bizgaze_CreateAppGroupErrorMsgs")})}loadUngroupedApps(){var instance=this;instance._appGroupManager.getUngroupedApps().then(function(response){var ungroupeddashboards=response.result,i;let html="";if(ungroupeddashboards.length>0){for($("#div_ChooseApps").removeClass("hidden"),i=0;i<ungroupeddashboards.length;i++)html+='<li id="'+ungroupeddashboards[i].InstalledAppId+'" style="margin-top:3px;font-size:15px" class="list-group-item"><input type="checkbox" style="height:17px;width:17px"><span style="margin-left:5px">'+ungroupeddashboards[i].AppTitle+"<\/span><\/li>";$("#UnGroupedAppItems").html(html)}else $("#div_ChooseApps").addClass("hidden")})}static Instance(){return new CreateAppGroup}}Components.CreateAppGroup=CreateAppGroup})(Components=AppGroups.Components||(AppGroups.Components={}))})(AppGroups=Platform.AppGroups||(Platform.AppGroups={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))})(Unibase||(Unibase={})),function(Unibase){let Platform;(function(Platform){let AppGroups;(function(AppGroups){let Components;(function(Components){class EditAppGroup extends Platform.Core.BaseComponent{constructor(){super();this._appGroupManager=AppGroups.Managers.AppGroupManager.Instance()}cssFiles(){return[]}jsFiles(){return["platform/appgroups/requests/appgroup.js"]}html(){return`<form id="frm_Bizgaze_EditAppGroup" method="post" data-validate="parsley" class="w-f bg-white"><input type="hidden" id="AppGroupId" value="" /><div class="header b-b bg-white p-3" id="div_EditAppGroupHeader"><strong>Edit App Group</strong></div><div class="scrollable"><div id="Bizgaze_ErrorMessagesEditAppGroup" class="clear"></div><div class="card"><div class="card-body"><div class="row"><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id="div_AppGroupName"><label for="txt_RenameGroup" id="lbl_RenameGroup">App Group Name <span class="text-danger">*</span></label><input type="text" id="txt_RenameGroup" class="form-control value-control floating-label-control" data-isdynamic="false" placeholder="App Group Name *" data-placeholder="Enter Group Name" data-label="App Group Name *" value="" /></div></div><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id="div_Index"><label for="txt_DisplayIndex" id="lbl_DisplayIndex">Display Index</label><div class=""><input type="number" min="0" onkeypress="return event.charCode != 45 && event.charCode!=101" id="txt_DisplayIndex" class="form-control value-control floating-label-control" placeholder="Display Index" data-placeholder="Enter Display Index" data-label="Display Index" value="" /></div></div></div></div><br /><div class="panel panel-danger mt-3"><div class="panel-body text-center">You can delete this Group if you do not want this Group to exists for any users across all the portals<div class="clear text-center mt-2"><input onclick="Unibase.Platform.AppGroups.Components.EditAppGroup.Instance().deleteGroup();" type="button" id="DeleteGrp" value="Delete Group" class="btn btn-danger m-t-lg" /></div></div></div></div></div><div class="mt-30 hidden" id="GrpItemDiv"><div class="card"><div class="card-body"><p style="color:red"><em>* Before deleting the Group, Apps needs to be Un-grouped.</em></p></div><ul class="list-group list-group-flush" id="UlMoveGroup"></ul><div class="card-footer"><input type="button" style="width:auto" id="" value="Un-group all Apps & Delete" onclick="Unibase.Platform.AppGroups.Components.EditAppGroup.Instance().UnGroupAllandDelete()" class="btn btn-warning btn-sm" /><br /></div></div></div></div><div class="footer bg-white"><a href="javascript:;" id="btn_CloseAppGroup" class="btn btn-sm btn-light mr-auto">Close</a><a href="javascript:;" onclick="Unibase.Platform.AppGroups.Components.EditAppGroup.Instance().renameGroup();" id="RenameGrp" class="btn btn-sm btn-primary">Save</a></div></form>`}load(id){var instance=this;$("#div_EditAppGroupHeader").removeClass("pa-5");$("#btn_CloseAppGroup").click(function(){instance.navigationHelper.closePopUp()});instance._appGroupManager.getAppGroup(id).then(function(response){var groupData=response.result;$("#AppGroupId").val(groupData.AppGroupId);$("#txt_RenameGroup").val(groupData.AppGroupName);$("#txt_DisplayIndex").val(groupData.DisplayIndex)})}deleteGroup(){var instance=this,AppGroupId=Number($("#AppGroupId").val());instance._appGroupManager.getAppsByGroup(AppGroupId).then(function(response){for(var itmLength,Listhtml="",i=0;i<response.result.length;i++)Listhtml+='<li id="'+response.result[i].InstalledAppId+'" class="list-group-item">'+response.result[i].AppTitle+"<\/li>";Listhtml!=""&&($("#UlMoveGroup").html(Listhtml),$("#GrpItemDiv").removeClass("hidden"));itmLength=$("#UlMoveGroup li").length;itmLength==0&&instance._appGroupManager.deleteAppGroup(AppGroupId).then(function(response){instance.navigationHelper.closePopUp();Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();response.errors==null?MessageHelper.Instance().showSuccess("Group Deleted Successfully",""):MessageHelper.Instance().showError(response.errors[0],"Bizgaze_AppGroupErrorMessages")})})}UnGroupAllandDelete(){var instance=this,ToDeleteGroupId=$("#AppGroupId").val();instance._appGroupManager.deleteAppGroup(ToDeleteGroupId).then(function(response){instance.navigationHelper.closePopUp();Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();response.errors==null?MessageHelper.Instance().showSuccess("Group Deleted Successfully",""):MessageHelper.Instance().showError(response.errors[0],"Bizgaze_AppGroupErrorMessages")})}renameGroup(){var instance=this,objreq=new Unibase.Platform.AppGroups.Requests.AppGroup;objreq.AppGroupId=Number($("#AppGroupId").val());objreq.DisplayIndex=Number($("#txt_DisplayIndex").val());objreq.AppGroupName=String($("#txt_RenameGroup").val());instance._appGroupManager.saveAppGroup(objreq).then(function(response){response.errors==null?(MessageHelper.Instance().showSuccess("App Group Saved Successfully",""),instance.navigationHelper.closePopUp(),Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups()):MessageHelper.Instance().showError(response.errors[0],"Bizgaze_ErrorMessagesEditAppGroup")})}static Instance(){return new EditAppGroup}}Components.EditAppGroup=EditAppGroup})(Components=AppGroups.Components||(AppGroups.Components={}))})(AppGroups=Platform.AppGroups||(Platform.AppGroups={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))}(Unibase||(Unibase={})),function(Unibase){let Platform;(function(Platform){let AppGroups;(function(AppGroups){let Components;(function(Components){class AppGroup_Template{AppGroups(){return`<li class="dd-item dd3-item RootGroup" data-type="root" data-id="{{AppGroupId}}" id="{{AppGroupId}}" name="{{AppGroupName}}">
  5. <button style="color:Black;font-size:20px" class="dd-collapse text-info" data-action="collapse" type="button">Collapse</button>
  6. <button style="color:Black;font-size:18px" class="dd-expand text-info" data-action="expand" type="button">Expand</button>
  7. <div class="pull-right">
  8. <div class="dropdown" style="margin-top:5px;margin-right:10px">
  9. <a href="javascript:;" style="width:20px" class="fa fa-ellipsis-h divtag text-info" style="height:20px" id="" type="" data-toggle="dropdown"><span class="caret"></span></a>
  10. <div class="dropdown-menu" role="menu">
  11. <a href="javascript:;" class="dropdown-item" id="btn_EditAppGroup" onclick = "Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().editAppGroup({{AppGroupId}})";>Edit/Delete</a>
  12. </div>
  13. </div>
  14. <i class="fa fa-pencil hidden"></i>
  15. </div>
  16. <div class="dd-handle dd3-handle"></div><div class="dd3-content dd-handle text-info"> {{AppGroupName}}</div>
  17. <ol class="dd-list AppGroupOl" id="GroupApps-{{AppGroupId}}" GroupId="{{AppGroupId}}">
  18. <li class="grpItem hidden"></li>
  19. </ol>
  20. </li>`}Apps(){return'<li id="{{InstalledAppId}}" class="dd-item dd3-item" appindex="{{AppIndex}}" name="{{AppTitle}}"> <div class="dd-handle dd3-handle-child">Drag<\/div> <div class="dd3-content dd-handle">&nbsp;{{AppTitle}}<\/div><\/li>'}UnGroupedApps(){return'<li id="{{InstalledAppId}}" class="dd-item dd3-item" appindex={{AppIndex}}" name="{{AppTitle}}"> <div class="dd-handle dd3-handle-child">Drag<\/div><div class="dd3-content dd-handle">&nbsp;{{AppTitle}}<\/div><\/li > '}static Instance(){return new AppGroup_Template}}Components.AppGroup_Template=AppGroup_Template})(Components=AppGroups.Components||(AppGroups.Components={}))})(AppGroups=Platform.AppGroups||(Platform.AppGroups={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))}(Unibase||(Unibase={})),function(Unibase){let Platform;(function(Platform){let AppGroups;(function(AppGroups){let Requests;(function(Requests){class AppGroup{}Requests.AppGroup=AppGroup;class InstalledApp{}Requests.InstalledApp=InstalledApp;class AppGroupSettings{}Requests.AppGroupSettings=AppGroupSettings})(Requests=AppGroups.Requests||(AppGroups.Requests={}))})(AppGroups=Platform.AppGroups||(Platform.AppGroups={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))}(Unibase||(Unibase={}));