Iniit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let AppGroups;
|
||||
(function (AppGroups) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class AppGroup_Template {
|
||||
AppGroups() {
|
||||
var html;
|
||||
html = `<li class="dd-item dd3-item RootGroup" data-type="root" data-id="{{AppGroupId}}" id="{{AppGroupId}}" name="{{AppGroupName}}">
|
||||
<button style="color:Black;font-size:20px" class="dd-collapse text-info" data-action="collapse" type="button">Collapse</button>
|
||||
<button style="color:Black;font-size:18px" class="dd-expand text-info" data-action="expand" type="button">Expand</button>
|
||||
<div class="pull-right">
|
||||
<div class="dropdown" style="margin-top:5px;margin-right:10px">
|
||||
<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>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a href="javascript:;" class="dropdown-item" id="btn_EditAppGroup" onclick = "Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().editAppGroup({{AppGroupId}})";>Edit/Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fa fa-pencil hidden"></i>
|
||||
</div>
|
||||
<div class="dd-handle dd3-handle"></div><div class="dd3-content dd-handle text-info"> {{AppGroupName}}</div>
|
||||
<ol class="dd-list AppGroupOl" id="GroupApps-{{AppGroupId}}" GroupId="{{AppGroupId}}">
|
||||
<li class="grpItem hidden"></li>
|
||||
</ol>
|
||||
</li>`;
|
||||
return html;
|
||||
}
|
||||
Apps() {
|
||||
var html;
|
||||
html = '<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"> {{AppTitle}}</div>' +
|
||||
'</li>';
|
||||
return html;
|
||||
}
|
||||
UnGroupedApps() {
|
||||
var html;
|
||||
html = '<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"> {{AppTitle}}</div>' +
|
||||
'</li > ';
|
||||
return html;
|
||||
}
|
||||
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 = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"appgroup.template.js","sourceRoot":"","sources":["appgroup.template.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAyDhB;AAzDD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAuDxB;IAvDD,WAAiB,QAAQ;QACrB,IAAiB,SAAS,CAqDzB;QArDD,WAAiB,SAAS;YACtB,IAAiB,UAAU,CAmD1B;YAnDD,WAAiB,UAAU;gBACvB,MAAa,iBAAiB;oBAG1B,SAAS;wBAEL,IAAI,IAAS,CAAC;wBACd,IAAI,GAAE;;;;;;;;;;;;;;;;qCAgBO,CAAA;wBAEb,OAAO,IAAI,CAAC;oBAChB,CAAC;oBAED,IAAI;wBACA,IAAI,IAAS,CAAC;wBACd,IAAI,GAAG,mGAAmG;4BACtG,iHAAiH;4BACjH,OAAO,CAAC;wBAEZ,OAAO,IAAI,CAAC;oBAChB,CAAC;oBAED,aAAa;wBACT,IAAI,IAAS,CAAC;wBACd,IAAI,GAAG,kGAAkG;4BACrG,gHAAgH;4BAChH,SAAS,CAAC;wBAEd,OAAO,IAAI,CAAC;oBAChB,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,OAAO,IAAI,iBAAiB,EAAE,CAAC;oBACnC,CAAC;iBACJ;gBAjDY,4BAAiB,oBAiD7B,CAAA;YACL,CAAC,EAnDgB,UAAU,GAAV,oBAAU,KAAV,oBAAU,QAmD1B;QACL,CAAC,EArDgB,SAAS,GAAT,kBAAS,KAAT,kBAAS,QAqDzB;IACL,CAAC,EAvDgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAuDxB;AACL,CAAC,EAzDS,OAAO,KAAP,OAAO,QAyDhB"}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{AppGroups(){return`<li class="dd-item dd3-item RootGroup" data-type="root" data-id="{{AppGroupId}}" id="{{AppGroupId}}" name="{{AppGroupName}}">
|
||||
<button style="color:Black;font-size:20px" class="dd-collapse text-info" data-action="collapse" type="button">Collapse</button>
|
||||
<button style="color:Black;font-size:18px" class="dd-expand text-info" data-action="expand" type="button">Expand</button>
|
||||
<div class="pull-right">
|
||||
<div class="dropdown" style="margin-top:5px;margin-right:10px">
|
||||
<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>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a href="javascript:;" class="dropdown-item" id="btn_EditAppGroup" onclick = "Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().editAppGroup({{AppGroupId}})";>Edit/Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fa fa-pencil hidden"></i>
|
||||
</div>
|
||||
<div class="dd-handle dd3-handle"></div><div class="dd3-content dd-handle text-info"> {{AppGroupName}}</div>
|
||||
<ol class="dd-list AppGroupOl" id="GroupApps-{{AppGroupId}}" GroupId="{{AppGroupId}}">
|
||||
<li class="grpItem hidden"></li>
|
||||
</ol>
|
||||
</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"> {{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"> {{AppTitle}}<\/div><\/li > '}static Instance(){return new t}}n.AppGroup_Template=t})(t=n.Components||(n.Components={}))})(t=n.AppGroups||(n.AppGroups={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,89 @@
|
||||
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(id, containerid) {
|
||||
let html = `<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
var 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;
|
||||
var selectedapps = [];
|
||||
$("#UnGroupedAppItems li").each(function () {
|
||||
var cb = $(this).find(':checkbox');
|
||||
if (cb.prop("checked")) {
|
||||
var 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) {
|
||||
if (response.errors == null) {
|
||||
instance.navigationHelper.closePopUp();
|
||||
MessageHelper.Instance().showSuccess('App Group Saved Successfully', '');
|
||||
Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
|
||||
}
|
||||
else
|
||||
MessageHelper.Instance().showError(response.errors[0], "Bizgaze_CreateAppGroupErrorMsgs");
|
||||
});
|
||||
}
|
||||
loadUngroupedApps() {
|
||||
var instance = this;
|
||||
instance._appGroupManager.getUngroupedApps().then(function (response) {
|
||||
var ungroupeddashboards = response.result;
|
||||
let html = "";
|
||||
if (ungroupeddashboards.length > 0) {
|
||||
$('#div_ChooseApps').removeClass("hidden");
|
||||
for (var 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 = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"createappgroup.js","sourceRoot":"","sources":["createappgroup.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAuGhB;AAvGD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAqGxB;IArGD,WAAiB,QAAQ;QACrB,IAAiB,SAAS,CAmGzB;QAnGD,WAAiB,SAAS;YACtB,IAAiB,UAAU,CAiG1B;YAjGD,WAAiB,UAAU;gBACvB,MAAa,cAAe,SAAQ,SAAA,IAAI,CAAC,aAAa;oBAGlD;wBACI,KAAK,EAAE,CAAC;wBACR,IAAI,CAAC,gBAAgB,GAA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AAQ,EAAE,CAAC;4BACnB,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;gCAChC,CAAC,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;gCAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oCACjD,IAAI,IAAI,UAAU,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,cAAc,GAAG,sJAAsJ,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,cAAc,CAAC;iCAC1Q;gCACD,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;6BACtC;iCACI;gCACD,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;6BAC3C;wBACL,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,OAAO,IAAI,cAAc,EAAE,CAAC;oBAChC,CAAC;iBACJ;gBA/FY,yBAAc,iBA+F1B,CAAA;YACL,CAAC,EAjGgB,UAAU,GAAV,oBAAU,KAAV,oBAAU,QAiG1B;QACL,CAAC,EAnGgB,SAAS,GAAT,kBAAS,KAAT,kBAAS,QAmGzB;IACL,CAAC,EArGgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAqGxB;AACL,CAAC,EAvGS,OAAO,KAAP,OAAO,QAuGhB"}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
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._appGroupManager=i.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>
|
||||
<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>
|
||||
<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>
|
||||
<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 n=this,t=$("li.RootGroup").length;$("#txt_DisplayIndex").val(t+1);$("#btn_SaveAppGroup").click(function(){n.saveAppGroup()});$("#btn_CloseAppGroup").click(function(){n.navigationHelper.closePopUp()});n.loadUngroupedApps()}saveAppGroup(){var i=this,r=[];$("#UnGroupedAppItems li").each(function(){var n=$(this).find(":checkbox"),t;n.prop("checked")&&(t=n.parent("li").attr("id"),r.push(Number(t)))});let t=new n.Platform.AppGroups.Requests.AppGroup;t.AppGroupName=String($("#txt_AppGroupName").val());t.DisplayIndex=Number($("#txt_DisplayIndex").val());t.InstalledApps=r;t.InstalledAppId=0;i._appGroupManager.saveAppGroup(t).then(function(t){t.errors==null?(i.navigationHelper.closePopUp(),MessageHelper.Instance().showSuccess("App Group Saved Successfully",""),n.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups()):MessageHelper.Instance().showError(t.errors[0],"Bizgaze_CreateAppGroupErrorMsgs")})}loadUngroupedApps(){var n=this;n._appGroupManager.getUngroupedApps().then(function(n){var i=n.result,t;let r="";if(i.length>0){for($("#div_ChooseApps").removeClass("hidden"),t=0;t<i.length;t++)r+='<li id="'+i[t].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">'+i[t].AppTitle+"<\/span><\/li>";$("#UnGroupedAppItems").html(r)}else $("#div_ChooseApps").addClass("hidden")})}static Instance(){return new u}}r.CreateAppGroup=u})(r=i.Components||(i.Components={}))})(i=t.AppGroups||(t.AppGroups={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,98 @@
|
||||
var 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(id, containerid) {
|
||||
let html = `<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>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
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;
|
||||
var AppGroupId = Number($('#AppGroupId').val());
|
||||
instance._appGroupManager.getAppsByGroup(AppGroupId).then(function (response) {
|
||||
var Listhtml = "";
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
Listhtml += '<li id="' + response.result[i].InstalledAppId + '" class="list-group-item">' + response.result[i].AppTitle + '</li>';
|
||||
}
|
||||
if (Listhtml != "") {
|
||||
$('#UlMoveGroup').html(Listhtml);
|
||||
$('#GrpItemDiv').removeClass('hidden');
|
||||
}
|
||||
var itmLength = $('#UlMoveGroup li').length;
|
||||
if (itmLength == 0) {
|
||||
instance._appGroupManager.deleteAppGroup(AppGroupId).then(function (response) {
|
||||
instance.navigationHelper.closePopUp();
|
||||
Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
|
||||
if (response.errors == null)
|
||||
MessageHelper.Instance().showSuccess('Group Deleted Successfully', '');
|
||||
else
|
||||
MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
UnGroupAllandDelete() {
|
||||
var instance = this;
|
||||
var ToDeleteGroupId = $('#AppGroupId').val();
|
||||
instance._appGroupManager.deleteAppGroup(ToDeleteGroupId).then(function (response) {
|
||||
instance.navigationHelper.closePopUp();
|
||||
Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
|
||||
if (response.errors == null)
|
||||
MessageHelper.Instance().showSuccess('Group Deleted Successfully', '');
|
||||
else
|
||||
MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
|
||||
});
|
||||
}
|
||||
renameGroup() {
|
||||
var instance = this;
|
||||
var 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) {
|
||||
if (response.errors == null) {
|
||||
MessageHelper.Instance().showSuccess('App Group Saved Successfully', '');
|
||||
instance.navigationHelper.closePopUp();
|
||||
Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
|
||||
}
|
||||
else
|
||||
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 = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"editappgroup.js","sourceRoot":"","sources":["editappgroup.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAyHhB;AAzHD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAuHxB;IAvHD,WAAiB,QAAQ;QACrB,IAAiB,SAAS,CAqHzB;QArHD,WAAiB,SAAS;YACtB,IAAiB,UAAU,CAmH1B;YAnHD,WAAiB,UAAU;gBACvB,MAAa,YAAa,SAAQ,SAAA,IAAI,CAAC,aAAa;oBAGhD;wBACI,KAAK,EAAE,CAAC;wBACR,IAAI,CAAC,gBAAgB,GAAG,UAAA,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;oBAChE,CAAC;oBAED,QAAQ;wBACJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,OAAO;wBACH,O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C,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,CAAC;6BACnF;;gCAEG,aAAa,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,mCAAmC,CAAC,CAAC;wBACpG,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,OAAO,IAAI,YAAY,EAAE,CAAC;oBAC9B,CAAC;iBACJ;gBAjHY,uBAAY,eAiHxB,CAAA;YACL,CAAC,EAnHgB,UAAU,GAAV,oBAAU,KAAV,oBAAU,QAmH1B;QACL,CAAC,EArHgB,SAAS,GAAT,kBAAS,KAAT,kBAAS,QAqHzB;IACL,CAAC,EAvHgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAuHxB;AACL,CAAC,EAzHS,OAAO,KAAP,OAAO,QAyHhB"}
|
||||
+1
File diff soppresso perché una o più righe sono troppo lunghe
@@ -0,0 +1,220 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let AppGroups;
|
||||
(function (AppGroups) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class ManageAppGroup extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this._appGroupManager = AppGroups.Managers.AppGroupManager.Instance();
|
||||
this._appManager = Platform.Apps.Managers.AppManager.Instance();
|
||||
}
|
||||
cssFiles() {
|
||||
return ["libs/nestable/JqueryminMenu.css"];
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/bundle/index.appgroup.min.js"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="frm_BizgazeNavigationAppGroup" method="post" data-validate="parsley" class="w-f bg-white"><div class="header b-b bg-white p-3" id="div_AppGroupSettingHeader"><h5>App Group Settings</h5><div class="btn-group pull-right"><a class="btn btn-sm btn-info" style="color:white" id="btn_CreateAppGroup"><i class="fa fa-plus"></i> App Group</a> </div></div><div data-simplebar class="simple-scroll-bar scrollable"><div id="Bizgaze_AppGroupErrorMessages" class="clear"></div><br /><div class="card"><div class="card-body"><div class="row"><div class="col-sm-12"><div class="dd" id="div_nestable3"><div><h5>Apps and Groups</h5></div><hr/><ol class="dd-list" id="ol_MainAppGroup"></ol></div><div class="dd" id="div_nestable2"><div><h5>Groupable Apps</h5></div><hr /><ol class="dd-list" id="ol_GrouplessApps"><li class="li_GroupItem"></li><li class="li_DisplayItem"></li></ol>Note: These Apps are groupable & draggable, AppGroup Settings will affect to all the Portals.</div></div></div></div></div></div><div class="footer bg-white"><a href="javascript:;" id="btn_CloseAppGroupSettings" class="pull-left btn btn-light btn-sm mr-auto">Close</a><a href="javascript:;" id="btn_SaveAppGroupSettings" class="pull-right btn btn-primary btn-sm">Save</a></div></form>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().addCacheFiles(["platform/appgroups/components/createappgroup.js", "platform/appgroups/components/editappgroup.js", "platform/appgroups/components/appgroup.template.js", "platform/appgroups/requests/appgroup.js"]);
|
||||
var instance = this;
|
||||
$("#div_AppGroupSettingHeader").removeClass("pa-5");
|
||||
let x = $('#div_nestable3');
|
||||
x.nestable({
|
||||
group: 'categories',
|
||||
maxDepth: 2,
|
||||
scroll: true,
|
||||
scrollSpeed: 20,
|
||||
beforeDragStop: function (l, e, p) {
|
||||
var isGroup = $(e).hasClass('RootGroup');
|
||||
var Area = $(p).attr("id");
|
||||
if (isGroup == true) {
|
||||
if (Area !== 'ol_GrouplessApps') {
|
||||
let y = $('#ol_MainAppGroup');
|
||||
y.sortable({
|
||||
scrollSpeed: 20,
|
||||
});
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
setTimeout(function () {
|
||||
instance.saveAppGroupSettings();
|
||||
}, 300);
|
||||
}
|
||||
else {
|
||||
let Checkroot = $(p).parent().attr('data-type');
|
||||
let checkGroupable = $(p).parent().attr('id');
|
||||
if (Checkroot != 'root' || Checkroot.toString() == 'undefind') {
|
||||
if (checkGroupable == 'div_nestable2') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
let z = $("#ol_MainAppGroup");
|
||||
z.sortable({
|
||||
disabled: true
|
||||
});
|
||||
},
|
||||
});
|
||||
let a = $('#div_nestable2');
|
||||
a.nestable({
|
||||
group: 'categories',
|
||||
maxDepth: 2,
|
||||
scroll: true,
|
||||
scrollSpeed: 20,
|
||||
beforeDragStop: function (l, e, p) {
|
||||
let AppId = $(e).attr('id');
|
||||
let AppGroupId = $(p).parents('li').attr('id');
|
||||
let Appindex = $(e).attr('appindex');
|
||||
if (AppGroupId == undefined || AppGroupId == "undefined")
|
||||
AppGroupId = "0";
|
||||
var isGroup = $(e).hasClass('RootGroup');
|
||||
var Area = $(p).attr("id");
|
||||
if (isGroup == true) {
|
||||
instance.saveAppGroupSettings();
|
||||
}
|
||||
else {
|
||||
}
|
||||
},
|
||||
});
|
||||
$('.dd-empty').remove();
|
||||
$("#btn_CreateAppGroup").click(function () {
|
||||
instance.navigationHelper.popup(0, "", Unibase.Platform.AppGroups.Components.CreateAppGroup.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
});
|
||||
$("#btn_SaveAppGroupSettings").click(function () {
|
||||
instance.saveAppGroupSettings();
|
||||
instance.navigationHelper.closePopUp();
|
||||
});
|
||||
$("#btn_CloseAppGroupSettings").click(function () {
|
||||
instance.navigationHelper.closePopUp();
|
||||
});
|
||||
instance.loadAppGroups();
|
||||
}
|
||||
loadAppGroups() {
|
||||
var instance = this;
|
||||
jQuery("#ol_MainAppGroup").empty();
|
||||
var html = "";
|
||||
instance._appGroupManager.getAppGroups().then(function (response) {
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var groupData = response.result[i];
|
||||
var template = Unibase.Platform.AppGroups.Components.AppGroup_Template.Instance().AppGroups();
|
||||
var templateScript = Handlebars.compile(template);
|
||||
var context = { "AppGroupId": groupData.AppGroupId, "AppGroupName": groupData.AppGroupName };
|
||||
html = templateScript(context);
|
||||
$("#ol_MainAppGroup").append(html);
|
||||
}
|
||||
instance.loadApps();
|
||||
instance.loadUngroupedApps();
|
||||
});
|
||||
}
|
||||
loadApps() {
|
||||
var instance = this;
|
||||
instance._appManager.getActiveUserApps().then(function (response) {
|
||||
if (response.result.length > 0) {
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var appData = response.result[i];
|
||||
var html = "";
|
||||
var groupId = appData.AppGroupId;
|
||||
var template = Unibase.Platform.AppGroups.Components.AppGroup_Template.Instance().Apps();
|
||||
var templateScript = Handlebars.compile(template);
|
||||
var context = { "InstalledAppId": appData.MyAppId, "AppTitle": appData.AppTitle, "AppIndex": appData.AppIndex };
|
||||
html = templateScript(context);
|
||||
$('#GroupApps-' + groupId).find(".grpItem:last").after(html);
|
||||
}
|
||||
$(".AppGroupOl").each(function () {
|
||||
let element = $(this).children('li');
|
||||
$(this).html(element.sort(function (a, b) {
|
||||
return ($(b).attr('appindex')) < ($(a).attr('appindex')) ? 1 : -1;
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
loadUngroupedApps() {
|
||||
var instance = this;
|
||||
$('#ol_GrouplessApps').empty();
|
||||
instance._appGroupManager.getUngroupedApps().then(function (response) {
|
||||
var appData = response.result;
|
||||
if (appData.length > 0) {
|
||||
appData = appData.filter(f => f.ParentAppId == 0);
|
||||
}
|
||||
var html = "";
|
||||
for (var i = 0; i < appData.length; i++) {
|
||||
var group = appData[i];
|
||||
var template = Unibase.Platform.AppGroups.Components.AppGroup_Template.Instance().UnGroupedApps();
|
||||
var templateScript = Handlebars.compile(template);
|
||||
var context = { "InstalledAppId": group.InstalledAppId, "AppTitle": group.AppTitle, "AppIndex": group.AppIndex };
|
||||
html += templateScript(context);
|
||||
}
|
||||
$('#ol_GrouplessApps').html(html + "<li class='li_DisplayItem dd-item'></li>");
|
||||
});
|
||||
}
|
||||
saveAppGroupSettings() {
|
||||
var instance = this;
|
||||
var Groups = [];
|
||||
$('#ol_MainAppGroup .RootGroup').each(function (index, el) {
|
||||
Groups.push(el);
|
||||
});
|
||||
let AppsAndGroups = [];
|
||||
for (var i = 0; i < Groups.length; i++) {
|
||||
var appIds = [];
|
||||
var currentGrp = Groups[i];
|
||||
var grpId = Number($(currentGrp).attr('id'));
|
||||
$(currentGrp).children('ol').find('li').each(function (index, el) {
|
||||
let id = $(el).attr('id');
|
||||
if (id > 0 || id != null) {
|
||||
appIds.push(Number(id));
|
||||
}
|
||||
});
|
||||
AppsAndGroups.push({ "GroupId": grpId, "AppIds": appIds });
|
||||
}
|
||||
instance._appGroupManager.saveAppGroupSettings(AppsAndGroups).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
instance.loadAppGroups();
|
||||
MessageHelper.Instance().showSuccess('App Group Settings Saved Successfully', '');
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
|
||||
}
|
||||
});
|
||||
}
|
||||
updateAppGroup(app, appGroupId) {
|
||||
var instance = this;
|
||||
var DisplayIndex = $(app).attr('appindex');
|
||||
DisplayIndex = DisplayIndex.replace(/['"]+/g, '');
|
||||
var InstalledAppId = $(app).attr('id');
|
||||
let reqObj = new Unibase.Platform.AppGroups.Requests.AppGroup();
|
||||
reqObj.AppGroupId = Number(appGroupId);
|
||||
reqObj.InstalledAppId = Number(InstalledAppId);
|
||||
reqObj.DisplayIndex = Number(DisplayIndex);
|
||||
instance._appGroupManager.updateAppGroup(reqObj).then(function (response) {
|
||||
if (response.errors == null)
|
||||
MessageHelper.Instance().showSuccess('App Group Updated Successfully', '');
|
||||
else
|
||||
MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
|
||||
});
|
||||
}
|
||||
editAppGroup(GroupId) {
|
||||
var instance = this;
|
||||
instance.navigationHelper.popup(GroupId, "", Unibase.Platform.AppGroups.Components.EditAppGroup.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
static Instance() {
|
||||
return new ManageAppGroup();
|
||||
}
|
||||
}
|
||||
Components.ManageAppGroup = ManageAppGroup;
|
||||
})(Components = AppGroups.Components || (AppGroups.Components = {}));
|
||||
})(AppGroups = Platform.AppGroups || (Platform.AppGroups = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff soppresso perché una o più righe sono troppo lunghe
+1
File diff soppresso perché una o più righe sono troppo lunghe
Fai riferimento in un nuovo problema
Block a user