Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

editappgroup.js 8.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let AppGroups;
  6. (function (AppGroups) {
  7. let Components;
  8. (function (Components) {
  9. class EditAppGroup extends Platform.Core.BaseComponent {
  10. constructor() {
  11. super();
  12. this._appGroupManager = AppGroups.Managers.AppGroupManager.Instance();
  13. }
  14. cssFiles() {
  15. return [];
  16. }
  17. jsFiles() {
  18. return ["platform/appgroups/requests/appgroup.js"];
  19. }
  20. html(id, containerid) {
  21. 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>`;
  22. return html;
  23. }
  24. load(id, containerid, callback) {
  25. var instance = this;
  26. $("#div_EditAppGroupHeader").removeClass("pa-5");
  27. $("#btn_CloseAppGroup").click(function () {
  28. instance.navigationHelper.closePopUp();
  29. });
  30. instance._appGroupManager.getAppGroup(id).then(function (response) {
  31. var groupData = response.result;
  32. $("#AppGroupId").val(groupData.AppGroupId);
  33. $("#txt_RenameGroup").val(groupData.AppGroupName);
  34. $("#txt_DisplayIndex").val(groupData.DisplayIndex);
  35. });
  36. }
  37. deleteGroup() {
  38. var instance = this;
  39. var AppGroupId = Number($('#AppGroupId').val());
  40. instance._appGroupManager.getAppsByGroup(AppGroupId).then(function (response) {
  41. var Listhtml = "";
  42. for (var i = 0; i < response.result.length; i++) {
  43. Listhtml += '<li id="' + response.result[i].InstalledAppId + '" class="list-group-item">' + response.result[i].AppTitle + '</li>';
  44. }
  45. if (Listhtml != "") {
  46. $('#UlMoveGroup').html(Listhtml);
  47. $('#GrpItemDiv').removeClass('hidden');
  48. }
  49. var itmLength = $('#UlMoveGroup li').length;
  50. if (itmLength == 0) {
  51. instance._appGroupManager.deleteAppGroup(AppGroupId).then(function (response) {
  52. instance.navigationHelper.closePopUp();
  53. Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
  54. if (response.errors == null)
  55. MessageHelper.Instance().showSuccess('Group Deleted Successfully', '');
  56. else
  57. MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
  58. });
  59. }
  60. });
  61. }
  62. UnGroupAllandDelete() {
  63. var instance = this;
  64. var ToDeleteGroupId = $('#AppGroupId').val();
  65. instance._appGroupManager.deleteAppGroup(ToDeleteGroupId).then(function (response) {
  66. instance.navigationHelper.closePopUp();
  67. Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
  68. if (response.errors == null)
  69. MessageHelper.Instance().showSuccess('Group Deleted Successfully', '');
  70. else
  71. MessageHelper.Instance().showError(response.errors[0], "Bizgaze_AppGroupErrorMessages");
  72. });
  73. }
  74. renameGroup() {
  75. var instance = this;
  76. var objreq = new Unibase.Platform.AppGroups.Requests.AppGroup();
  77. objreq.AppGroupId = Number($('#AppGroupId').val());
  78. objreq.DisplayIndex = Number($('#txt_DisplayIndex').val());
  79. objreq.AppGroupName = String($('#txt_RenameGroup').val());
  80. instance._appGroupManager.saveAppGroup(objreq).then(function (response) {
  81. if (response.errors == null) {
  82. MessageHelper.Instance().showSuccess('App Group Saved Successfully', '');
  83. instance.navigationHelper.closePopUp();
  84. Unibase.Platform.AppGroups.Components.ManageAppGroup.Instance().loadAppGroups();
  85. }
  86. else
  87. MessageHelper.Instance().showError(response.errors[0], "Bizgaze_ErrorMessagesEditAppGroup");
  88. });
  89. }
  90. static Instance() {
  91. return new EditAppGroup();
  92. }
  93. }
  94. Components.EditAppGroup = EditAppGroup;
  95. })(Components = AppGroups.Components || (AppGroups.Components = {}));
  96. })(AppGroups = Platform.AppGroups || (Platform.AppGroups = {}));
  97. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  98. })(Unibase || (Unibase = {}));