var Unibase;
(function (Unibase) {
let Platform;
(function (Platform) {
let Analytics;
(function (Analytics) {
let Components;
(function (Components) {
class UserDesignDevApps extends Components._ReportViewer {
constructor() {
super(...arguments);
this.PortletWidgetId = 0;
this.totalreportWidgetData = [];
this.ReportId = 0;
}
jsFiles() {
return this._jsFiles();
}
cssFiles() {
return this._cssFiles();
}
html(id, containerid) {
var instance = this;
let html = ``;
return html;
}
load(id, containerid, callback) {
var instance = this;
}
init(containerid) {
var instance = this;
instance.loadDevApps(containerid);
}
loadDevApps(containerid) {
let reportid = 0;
let totalcontent = '';
var jsfiles = ["apps/transact/managers/inventory/transactsettingmanager.js"];
$(`.${containerid}`).append(`
`);
let height = $(`.${containerid}`).siblings('#hf_portletwidgetheight').val();
if (height != '0px') {
$('.userDesignWidgetCardBody').css({ "height": `` + height + ``, "overflow-x": "hidden" }).addClass("biz-custom-scrollbar");
}
var instance = this;
instance.fileCacheHelper.loadJsFiles(["apps/transact/managers/inventory/transactsettingmanager.js"], () => {
Unibase.Platform.Apps.Managers.AppManager.Instance().getDevApps().then((res) => {
let appdata = res.result.sort(function (a, b) {
var a1 = a.AppGroupName.toLowerCase(), b1 = b.AppGroupName.toLowerCase();
if (a1 == b1)
return 0;
return a1 > b1 ? 1 : -1;
});
let totalcount = res.result.length;
let old_groupname = "";
for (var i = 0; i < appdata.length; i++) {
let icon = '';
let imgurl = '';
var data = res.result[i];
let appname = data.AppTitle;
let appdescription = data.Description;
icon = data.IconName;
imgurl = data.ImageUrl;
let installedappid = data.MyAppId;
let count = i;
let appgroupname = data.AppGroupName;
if (appgroupname == '')
appgroupname = "No Group";
let avatarTxt = "";
let matches = appname.match(/\b(\w)/g);
if (matches.length == 1) {
avatarTxt = $.trim(appname).substr(0, 2).toUpperCase();
}
else {
avatarTxt = matches.join('').slice(0, 2).toUpperCase();
}
if (appgroupname != old_groupname) {
let appgroupnameid = appgroupname.replace(/ /g, "_");
appgroupnameid = appgroupnameid.replace(/&/g, "_");
let groupnamecontent = '';
if (old_groupname != '') {
groupnamecontent = ``;
groupnamecontent = ``;
}
groupnamecontent += `` + avatarTxt + `
` + appname + `
` + appdescription + `
`;
totalcontent += groupnamecontent;
old_groupname = appgroupname;
}
else {
let childsetting = `` + avatarTxt + `
` + appname + `` + appdescription + `
`;
totalcontent += childsetting;
}
}
$("#userdesignedTreeview").html(totalcontent);
if (screen.width < 1198) {
$(".appname").addClass("font-12");
$(".text-truncate.description-Text").addClass("font-11").removeClass("font-12");
}
});
});
instance.settingsearch(containerid);
}
getform(AppName, InstalledAppId, callback) {
var instance = this;
if (AppName != " ") {
Unibase.Platform.Helpers.NavigationHelper.Instance().loadSettings(InstalledAppId, callback);
}
else {
Bizgaze.Apps.Transact.Managers.TransactSettingManager.Instance().getBranchSettingByInstalledApp(InstalledAppId).then(function (bs_res) {
let Pk_Id = 0;
if (bs_res.result != "" && bs_res.result != null) {
Pk_Id = bs_res.result.BranchSettingId;
}
var FormUniqueId = 'Bizgaze_Extension_Transact_Apps_' + AppName;
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(FormUniqueId).then(function (response) {
var successCallBack = {
CallBack: function (id) {
},
Parameters: null,
};
var formviewerObj = {
FormId: response.result.FormId,
AppConfigurationId: 0,
Pk_Value: Pk_Id,
PortletWidgetId: 0,
OnSuccess: successCallBack,
OnFail: null,
OnLoad: null,
FormSize: Platform.Helpers.Size.Medium,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
instance.navigationHelper.hideLoading();
});
});
}
}
settingsearch(containerid) {
$(".biz-highlight-opacity").mouseover(function () {
$(this).css({ "cursor": "context-menu" });
});
$('.clear_icon').click(function () {
$("#ListSearch").val('');
$('.userdesignedTreeview_' + containerid).find('.report-group-tree-view').css("display", "block");
$('.userdesignedTreeview_' + containerid).find('.report-group-tree-view').find('.lireportgrp-item').css("display", "block");
$(".clear_icon").addClass("d-none");
});
if (($(window).width()) <= 1198) {
$("#userdesignedTreeview").css({ "column-count": "2" });
$(".search-wrapper").css({ "display": "block !important" });
}
if (($(window).width()) <= 576) {
$("#userdesignedTreeview").css({ "column-count": "1" });
$(".search-wrapper").css({ "display": "block !important" });
$(".report-group-tree-view").each(function (index) {
let width = $(this).width();
let maxwidth = $(this).width() - 100;
$(this).find(".report-Header-Title").css("width", width + 'px');
$(this).find(".lireportgrp-item").find(".description-Text").css("max-width", maxwidth + 'px');
});
}
$('#' + containerid).find("#ListSearch").on('keyup', function () {
$(".clear_icon").removeClass("d-none");
var _value = $(this).val().toString(), value = _value.toUpperCase();
if (_value == '') {
$(".clear_icon").addClass("d-none");
}
$('.userdesignedTreeview_' + containerid).find('.report-group-tree-view').each(function () {
let reportName = $(this).find('.lireportgrp-item a').text();
if (reportName.toUpperCase().indexOf(value) > -1) {
$(this).css('display', 'block');
$(this).find('.lireportgrp-item a').each(function () {
let reportName = $(this).text();
let reportGroupName = $(this).find('.a').text();
if (reportName.toUpperCase().indexOf(value) > -1) {
$(this).parent().css('display', 'block');
}
else {
$(this).parent().css('display', 'none');
}
});
}
else {
$(this).css('display', 'none');
}
});
});
}
generatecolor() {
}
settingsListEditForm(pkid, formid, configureid) {
let id = pkid;
let form = Number(formid);
let configure = configureid;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["platform/forms/components/formviewer/formviewer.js"], function () {
var formviewerobj = {
FormId: form,
Pk_Value: id,
AppConfigurationId: configure,
PortletWidgetId: 0,
OnLoad: null,
OnSuccess: null,
OnFail: null,
FormContainer: null,
FormSize: Unibase.Platform.Helpers.Size.Medium,
OnClose: null,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerobj);
$("#btn_CloseForm_" + formid).click(function () {
Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new UserDesignDevApps();
return this._instance;
}
}
Components.UserDesignDevApps = UserDesignDevApps;
})(Components = Analytics.Components || (Analytics.Components = {}));
})(Analytics = Platform.Analytics || (Platform.Analytics = {}));
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
})(Unibase || (Unibase = {}));