Iniit
This commit is contained in:
@@ -0,0 +1,779 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
class NavigationHelper {
|
||||
constructor() {
|
||||
this.detailsViewIndex = 1;
|
||||
this.fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
|
||||
}
|
||||
login(callback) {
|
||||
let _idntityCookie = Unibase.Platform.Helpers.CookieHelper.Instance().getIdentityCookie();
|
||||
if (_idntityCookie != '' && _idntityCookie != undefined) {
|
||||
window.location.href = '#/welcome';
|
||||
$('.modal').modal('hide');
|
||||
}
|
||||
else {
|
||||
var instance = this;
|
||||
jQuery("#external-form").html('');
|
||||
if (isMobileApp()) {
|
||||
Unibase.Platform.Helpers.MobileHelper.Instance().checkCredentials();
|
||||
}
|
||||
else {
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.Login.Instance(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
registerUser(callback) {
|
||||
var instance = this;
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.Register.Instance(), callback);
|
||||
}
|
||||
signup(callback) {
|
||||
var instance = this;
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.SignUp.Instance(), null);
|
||||
}
|
||||
createcontact(callback) {
|
||||
var instance = this;
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.CreateCustomer.Instance(), null);
|
||||
}
|
||||
forgotPassword(callback) {
|
||||
var instance = this;
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.ForgotPassword.Instance(), null);
|
||||
}
|
||||
logOff(callback) {
|
||||
var instance = this;
|
||||
jQuery("#external-form").html('');
|
||||
instance.popin(0, "external-form", Unibase.Themes.Providers.Login.Instance(), null);
|
||||
}
|
||||
register(unibaseid, tenantid, email, phonenumber, callback) {
|
||||
var instance = this;
|
||||
this.fileCacheHelper.loadJsFile('tenants/themes/compact/components/confirmregister/mobilregister.js', function () {
|
||||
instance.popin(0, "external-form", Unibase.Themes.Compact.Components.MobilRegister.Instance(), function (containerid, component) {
|
||||
var obj = Unibase.Themes.Compact.Components.MobilRegister.Instance();
|
||||
obj.userid = unibaseid;
|
||||
obj.tenant = tenantid;
|
||||
obj.email = email;
|
||||
obj.phonenumber = phonenumber;
|
||||
var detail = component;
|
||||
detail.register(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
welcome(callback, isdocument) {
|
||||
let _filecahe = this.fileCacheHelper;
|
||||
Unibase.Platform.Membership.Managers.AccountManager.Instance().IsValidSession().then(function (isvalid) {
|
||||
if (isvalid) {
|
||||
if (!isdocument) {
|
||||
$('.preloader-it').remove();
|
||||
Unibase.Themes.Compact.Components.Index.Instance().init(callback);
|
||||
}
|
||||
else if (isdocument === true) {
|
||||
Unibase.Themes.Compact.Components.Index.Instance().documentinit(callback);
|
||||
}
|
||||
else if ((isdocument == 'detail') || (isdocument == 'form') || (isdocument == 'List') || (isdocument == 'notifiList')) {
|
||||
Unibase.Themes.Compact.Components.Index.Instance().detailsInit(callback);
|
||||
}
|
||||
else if (isdocument == 'ChatFull') {
|
||||
Unibase.Themes.Compact.Components.Index.Instance().init(callback);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Unibase.Platform.Helpers.CookieHelper.Instance().setIdentityCookie('');
|
||||
window.location.href = '#/login';
|
||||
}
|
||||
});
|
||||
}
|
||||
_loadWelcomeFirst(callback) {
|
||||
var cacheHelper = this.fileCacheHelper;
|
||||
if (cacheHelper.isFileRegistered("tenants/themes/compact/index.js")) {
|
||||
if (callback !== null)
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
this.welcome(callback);
|
||||
}
|
||||
}
|
||||
sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
popin(id, containerid, component, callback) {
|
||||
var instance = this;
|
||||
if (component.cssFiles() !== []) {
|
||||
this.fileCacheHelper.loadCssFiles(component.cssFiles(), null);
|
||||
}
|
||||
this.fileCacheHelper.loadJsFiles(component.jsFiles(), function () {
|
||||
var panel = containerid;
|
||||
if (panel === "" || panel === undefined)
|
||||
panel = '_modal_bizgaze_edit_' + moment().unix();
|
||||
if (panel != "external-form" && panel != "" && !panel.includes("div_portletwidget_") && !panel.includes("div_dashboardportletwidget_") && $.inArray(panel, Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds)) {
|
||||
if (Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.find(x => x == panel) == undefined) {
|
||||
Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.push(panel);
|
||||
}
|
||||
}
|
||||
if (($("#" + panel).length <= 0) && (!panel.includes('div_dashboardportletwidget') && !panel.includes("div_portletwidget_"))) {
|
||||
var detailhtml = '<div class="_bizgaze_detail_container bg-cyan-light-5-removed p-0 col-sm" id="' + panel + '"></div>';
|
||||
$("#layout-detail").before(detailhtml);
|
||||
}
|
||||
var html = component.html(id, panel);
|
||||
$('#' + panel).html(html);
|
||||
$("#" + panel).find(".btn-close").click(function () {
|
||||
instance.close(panel, null);
|
||||
});
|
||||
if (!containerid.includes("_modal_bizgaze_popup_") && instance.detailsViewIndex == 1) {
|
||||
$("._bizgaze_detail_container").addClass("hidden");
|
||||
}
|
||||
$('#' + panel).removeClass("hidden");
|
||||
if ($("#" + panel).length <= 0) {
|
||||
panel = "_bizgaze_body";
|
||||
}
|
||||
$("#" + panel).find(".header").addClass("modal-header").removeClass("header");
|
||||
$("#" + panel).find(".footer").addClass("modal-footer").removeClass("footer");
|
||||
$("#" + panel).find(".scrollable").addClass("modal-body").addClass("bg-cyan-light-5-removed").removeClass("scrollable");
|
||||
$('._bizgaze_popup_container').find(".card-footer").find(".col-7").addClass("d-none");
|
||||
$('._bizgaze_popup_container').find(".card-footer").removeClass("d-none").addClass("z-index-9");
|
||||
$('._bizgaze_popup_container').find(".btnClose").removeClass("hidden btn-primary pull-right").addClass("btn-outline-danger");
|
||||
$("#" + panel).off('remove').on("remove", function () {
|
||||
const ModalContainers = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds;
|
||||
if (ModalContainers.find(x => x == panel) != undefined) {
|
||||
ModalContainers.splice($.inArray(panel, ModalContainers), 1);
|
||||
}
|
||||
instance.updateDefaultWidgetValues(panel);
|
||||
});
|
||||
var deductHeight = 90;
|
||||
if ($(document).width() < 1200) {
|
||||
$("#" + panel).find(".modal-body").removeClass("w-f");
|
||||
deductHeight = 160;
|
||||
}
|
||||
$("#" + panel).find(".modal-body").css("overflow", "hidden auto");
|
||||
component.load(id, panel, function () {
|
||||
if (callback != null) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
if (callback != null) {
|
||||
callback(containerid, component);
|
||||
}
|
||||
});
|
||||
}
|
||||
popup(id, containerid, component, callback, size) {
|
||||
$(".biz-submenu").css({ "z - index": "1040" });
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "1040" });
|
||||
$(".toplayout-structures-panel").css({ "z-index": "1040" });
|
||||
if (component.cssFiles() !== []) {
|
||||
this.fileCacheHelper.loadCssFiles(component.cssFiles(), null);
|
||||
}
|
||||
$('.preloader-it').attr('data-preloader', 'preloaderForm');
|
||||
var instance = this;
|
||||
this.fileCacheHelper.loadJsFiles(component.jsFiles(), function () {
|
||||
var panel = containerid;
|
||||
if (panel === "" || panel === undefined)
|
||||
panel = '_modal_bizgaze_popup_' + moment().unix();
|
||||
if (panel != "" && !panel.includes("div_portletwidget_") && !panel.includes("div_dashboardportletwidget_") && $.inArray(panel, Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds)) {
|
||||
if (Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.find(x => x == panel) == undefined) {
|
||||
Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.push(panel);
|
||||
}
|
||||
}
|
||||
let width = 0;
|
||||
if ($("#" + panel).length <= 0) {
|
||||
let colSpan = "col-sm-9";
|
||||
if (size === Unibase.Platform.Helpers.Size.Mini) {
|
||||
colSpan = "col-sm-4";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.Medium) {
|
||||
colSpan = "col-sm-6";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.Large) {
|
||||
colSpan = "col-sm-8";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.ExtraLarge) {
|
||||
colSpan = "col-sm-12";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.DockRight) {
|
||||
colSpan = "";
|
||||
width = ($(document).width() - 258);
|
||||
}
|
||||
let supportAttr = '';
|
||||
if (typeof id === 'string') {
|
||||
if (id != undefined && id.includes != undefined) {
|
||||
if ((id.includes('ticketcreate') || id.includes('ticket')) && !id.includes('ticketlist')) {
|
||||
supportAttr = 'data-isticketcreate="true"';
|
||||
}
|
||||
}
|
||||
}
|
||||
var modalhtml = '<div class="_bizgaze_popup_container shadow-left shadow-xl modal right ml-auto bg-light ' + colSpan + ' p-0" id="' + panel + '" ' + supportAttr + '></div>';
|
||||
$("#_bizgaze_modal").before(modalhtml);
|
||||
}
|
||||
if ($("#" + panel).length <= 0) {
|
||||
panel = "_bizgaze_body";
|
||||
}
|
||||
$('#' + panel).html(component.html(id, panel));
|
||||
$("#" + panel).find(".btn-close").click(function () {
|
||||
instance.closePopUp();
|
||||
});
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isIframe) {
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isIframeObj.isForm) {
|
||||
$("#" + panel).find(".btn_CloseForm ").on("click", function () {
|
||||
window.parent.postMessage('closeForm_detailIframe', '*');
|
||||
});
|
||||
}
|
||||
$("#" + panel).find(".btn_CloseForm ").on("click", function () {
|
||||
$("#" + panel).find('.modal-header .close').click();
|
||||
window.parent.postMessage('closeForm', '*');
|
||||
});
|
||||
$("#" + panel).find("#btnDynamicSave").on("click", function () {
|
||||
let formid = $("#" + panel + ' .modal-header #hf_FormId').val();
|
||||
window.parent.postMessage(`save-form/${formid}`, '*');
|
||||
});
|
||||
}
|
||||
if (Unibase.Themes.Providers.DetailHelper.isListStages) {
|
||||
$("#" + panel).find(".btn_CloseForm ").on("click", function () {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isListRefresh();
|
||||
});
|
||||
}
|
||||
$("#" + panel).off('remove').on("remove", function () {
|
||||
var ModalContainers = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds;
|
||||
if (ModalContainers.find(x => x == panel) != undefined) {
|
||||
ModalContainers.splice($.inArray(panel, ModalContainers), 1);
|
||||
}
|
||||
instance.loadReportPopUpSettings(panel, ModalContainers);
|
||||
instance.updateDefaultWidgetValues(panel);
|
||||
});
|
||||
$("#" + panel).find(".header,.modal-header").addClass("modal-header pa-10").removeClass("header");
|
||||
$("#" + panel).find(".footer,.modal-footer").addClass("modal-footer pa-10").removeClass("footer");
|
||||
if ($("#" + panel).find('.modal-body').siblings(".card-header").length) {
|
||||
$("#" + panel).find('.modal-body').siblings(".card-header").addClass("modal-header pa-10").removeClass("card-header");
|
||||
}
|
||||
if ($("#" + panel).find('.modal-body').siblings(".card-footer").length) {
|
||||
$("#" + panel).find('.modal-body').siblings(".card-footer").addClass("modal-footer pa-10").removeClass("card-footer");
|
||||
}
|
||||
if (!$("#" + panel).find(".scrollable").hasClass('biz-detail-page-view')) {
|
||||
$("#" + panel).find(".scrollable").addClass("modal-body simple-scroll-bar bg-cyan-light-5").removeClass("scrollable").attr('data-simplebar', '');
|
||||
}
|
||||
if (width !== 0)
|
||||
$("#" + panel).width(width);
|
||||
if ($(document).width() < 600) {
|
||||
$("#" + panel).find(".modal-body").addClass("px-0");
|
||||
}
|
||||
$(document).off('shown.bs.modal', '#' + panel).on('shown.bs.modal', '#' + panel, function () {
|
||||
component.load(id, panel, callback);
|
||||
instance.loadReportPopUpSettings(panel);
|
||||
if (callback != null) {
|
||||
callback(panel);
|
||||
}
|
||||
if (!Unibase.Themes.Compact.Components.Index.Instance().isIframeObj.isPopupPage) {
|
||||
instance.setPopUpBodyHeight('#' + panel);
|
||||
}
|
||||
});
|
||||
$('#' + panel).modal({ backdrop: 'static', show: true });
|
||||
$(".toplayout-structures-panel").css({ "z-index": "1040" });
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "1040" });
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
if (id != 0 && id.includes != undefined) {
|
||||
if ((id.includes('ticketcreate') || id.includes('ticket')) && !id.includes('ticketlist')) {
|
||||
$('#div_Footer').addClass('hidden');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
setPopUpBodyHeight(panelId) {
|
||||
let headerHeight = 0, footerHeight = 0, deductHeight = 0;
|
||||
let panel = $(panelId);
|
||||
let bodyEl = panel.find('.modal-body');
|
||||
if (bodyEl.siblings(".modal-header").length) {
|
||||
let headerEl = bodyEl.siblings(".modal-header");
|
||||
headerHeight = headerEl.outerHeight(true);
|
||||
if (headerHeight != 0 && headerHeight < 45) {
|
||||
headerEl.css({ 'height': '45px', 'overflow-y': 'auto' });
|
||||
headerHeight = 45;
|
||||
}
|
||||
}
|
||||
if (bodyEl.siblings(".modal-footer").length) {
|
||||
footerHeight = bodyEl.siblings(".modal-footer:visible").outerHeight(true);
|
||||
}
|
||||
if (headerHeight && footerHeight) {
|
||||
deductHeight = headerHeight + footerHeight;
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isIframeObj.isDetailsPage) {
|
||||
deductHeight = headerHeight + footerHeight + 50;
|
||||
}
|
||||
bodyEl.css({ "height": `${window.innerHeight - deductHeight}px`, "overflow": "hidden auto" }).attr('data-deductheight', `${deductHeight}`);
|
||||
}
|
||||
else {
|
||||
deductHeight = 143;
|
||||
bodyEl.height(window.innerHeight - deductHeight).css("overflow", "hidden auto");
|
||||
}
|
||||
}
|
||||
loadReportPopUpSettings(panel, modalContainers) {
|
||||
const indexInstance = Unibase.Themes.Compact.Components.Index.Instance();
|
||||
if (modalContainers) {
|
||||
panel = modalContainers[modalContainers.length - 1];
|
||||
}
|
||||
if (this.isReportPopup(panel) || panel.includes('_modal_bizgaze_detail_')) {
|
||||
const containerEl = $(`#${panel}`);
|
||||
$('body').addClass('active-report-popup');
|
||||
if (!indexInstance.desktopMode || !indexInstance.isLeftLayout()) {
|
||||
const navbarHeight = $('.navbar.biz-navbar').outerHeight(true);
|
||||
containerEl.css('margin-top', `${navbarHeight}px`);
|
||||
}
|
||||
else {
|
||||
const sideNavWidth = $('#biz-right-side-menu').outerWidth(true);
|
||||
containerEl.css({ 'margin-right': `${sideNavWidth}px`, width: `calc(100% - ${sideNavWidth}px)` });
|
||||
}
|
||||
if (indexInstance.desktopMode && indexInstance.isTopLeftLayout()) {
|
||||
let isNavVisible = 'true';
|
||||
if ($('.biz-layout-3-left-nav').hasClass('biz__nav__toggle')) {
|
||||
isNavVisible = 'false';
|
||||
}
|
||||
$('#navbar_toggle_btn').attr('data-nav-visible', isNavVisible);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('body').removeClass('active-report-popup');
|
||||
}
|
||||
}
|
||||
isReportPopup(containerid) {
|
||||
if (containerid && (containerid.includes('_viewall') || containerid.includes('fullscreen') || containerid.includes('_ViewAllByUniqueId_') || containerid.includes('_linkedreport_') || containerid.includes('_previewreport_') || containerid.includes('div_kpireport_'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
closePopUp() {
|
||||
var panel = $("#_bizgaze_modal").prev('.modal')[0].getAttribute('id');
|
||||
$('#' + panel).modal('hide');
|
||||
$('#' + panel).remove();
|
||||
$(".biz-submenu").css({ "z-index": "9999" });
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "9999" });
|
||||
$(".toplayout-structures-panel").css({ "z-index": "9999" });
|
||||
let layout_chng = $("#bizgaze_body").find(".hk-wrapper").hasClass("biz-layout-2-top-navbar");
|
||||
let layout_chng3 = $("#bizgaze_body").find(".biz-wrapper").hasClass("biz__submenu biz__bottom__nav__menu");
|
||||
let cls_nav_2 = $(".toplayout-structures-panel").hasClass("nav_2_layout");
|
||||
let cls_nav_3 = $(".biz-layout-3-left-nav").hasClass("nav_3_layout");
|
||||
let cls_nav_sub = $(".biz-submenu").hasClass("nav_sub_layout");
|
||||
let set_attr = $(".biz-submenu").attr("data-details_structure");
|
||||
if (layout_chng == true) {
|
||||
}
|
||||
else if (layout_chng3 == true) {
|
||||
if (cls_nav_sub == false) {
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
if (set_attr == "true") {
|
||||
$(".biz-submenu").css({ "z-index": "9999" });
|
||||
}
|
||||
else {
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (set_attr == "true") {
|
||||
if ($("#bizgaze_body").find("#dashboardWidget-modal-content").length == 0) {
|
||||
$(".biz-submenu").css({ "z-index": "9999" });
|
||||
}
|
||||
else {
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cls_nav_3 == false) {
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "1040" });
|
||||
}
|
||||
else {
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "9999" });
|
||||
if ($("#bizgaze_body").find("#dashboardWidget-modal-content").length == 0) {
|
||||
$("#bizgaze_body").addClass("edit-dashboard-mode");
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "9999" });
|
||||
}
|
||||
else {
|
||||
$("#bizgaze_body").removeClass("edit-dashboard-mode");
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "1040" });
|
||||
}
|
||||
}
|
||||
if (cls_nav_2 == false) {
|
||||
$("#bizgaze_body").addClass("edit-dashboard-mode");
|
||||
$(".toplayout-structures-panel").css({ "z-index": "9999" });
|
||||
}
|
||||
}
|
||||
}
|
||||
close(containerid, callback) {
|
||||
var instance = this;
|
||||
instance.closeDetailsPage(containerid);
|
||||
}
|
||||
getLastContainerId() {
|
||||
return Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
|
||||
}
|
||||
closeDetailsPage(containerid) {
|
||||
var instance = this;
|
||||
let modallength = $("._bizgaze_detail_container").length;
|
||||
if (modallength > 0) {
|
||||
var panel = $($("._bizgaze_detail_container")[modallength - 1]).attr('id');
|
||||
$('#' + panel).empty();
|
||||
if (instance.detailsViewIndex == 3)
|
||||
$($('#' + panel).siblings()[0]).removeClass('col-4').addClass('col-12');
|
||||
$('#' + panel).remove();
|
||||
}
|
||||
let containerlength = $("._bizgaze_detail_container").length;
|
||||
if (containerlength > 0) {
|
||||
var container = $($("._bizgaze_detail_container")[containerlength - 1]).attr('id');
|
||||
$('#' + container).removeClass('hidden');
|
||||
}
|
||||
}
|
||||
closeAllModals(containerId) {
|
||||
$("._bizgaze_detail_container").remove();
|
||||
$("._bizgaze_popup_container").modal('hide');
|
||||
let nav = Unibase.Platform.Helpers.NavigationHelper;
|
||||
nav.ModalContainerIds = [];
|
||||
if (containerId) {
|
||||
let rv = Unibase.Platform.Analytics.Components.ReportViewer.Instance().getReportViewerInstance(containerId);
|
||||
let idx = nav.reportViewerInstance.findIndex(x => { return x.instance == rv; });
|
||||
let dtl_ins = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
if (idx > -1 && dtl_ins.isDetailsUpdated) {
|
||||
Unibase.Themes.Compact.Components.Details.Instance().lastReportInstance = nav.reportViewerInstance[idx].instance;
|
||||
}
|
||||
}
|
||||
nav.reportViewerInstance = [];
|
||||
Unibase.Themes.Providers.Detail_Settings.Instance().DetailParameters = [];
|
||||
Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters = [];
|
||||
Unibase.Themes.Providers.DetailHelper.installedAppId = 0;
|
||||
}
|
||||
loadList(installedappid, callback) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var instance = this;
|
||||
if (!Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBck) {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBckArray.push({ "InstalledAppId": installedappid, "AppName": $('#' + installedappid).find("#hf_Apps_InstalledAppName").val(), "isBack": "App", "isDetails": false, "isDetailsBack": [] });
|
||||
}
|
||||
else {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBck = false;
|
||||
}
|
||||
this.fileCacheHelper.loadJsFiles(["tenants/themes/compact/components/list/list.js", "tenants/themes/compact/components/nav/nav.template.js"], function () {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
$('#preloader-it').remove();
|
||||
let html = '<div class="skelton_loader biz-secondary-color position-absolute w-100 z-index-10">';
|
||||
html += Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonListPage();
|
||||
html += '</div>';
|
||||
$('#layout-detail').before(html);
|
||||
let apptype;
|
||||
let res = yield Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallApp(installedappid);
|
||||
apptype = res.result.AppTypeId;
|
||||
if (apptype == 2 || apptype == 3) {
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().loadSettings(installedappid, callback);
|
||||
}
|
||||
else {
|
||||
instance.closeAllModals(Unibase.Themes.Compact.Components.Details.Instance().lastContinerId);
|
||||
instance.popin(installedappid, "", Unibase.Themes.Compact.Components.List.Instance(), null);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
loadSettings(installedappid, callback) {
|
||||
var instance = this;
|
||||
let html = '<div class="skelton_loader biz-secondary-color position-absolute w-100 z-index-10">';
|
||||
html += Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonListPage();
|
||||
html += '</div>';
|
||||
$('#layout-detail').before(html);
|
||||
instance.popup(installedappid, "", Unibase.Themes.Compact.Components.List.Instance(), function () {
|
||||
$(".report-close-btn").removeClass("d-none");
|
||||
}, Unibase.Platform.Helpers.Size.Medium);
|
||||
}
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, PortletWidgetId, callback) {
|
||||
var instance = this.fileCacheHelper;
|
||||
$(".toplayout-structures-panel").css({ "z-index": "1040" });
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
|
||||
Unibase.Platform.Forms.Managers.FormManager.Instance().getForm(FormId).then(function (response) {
|
||||
instance.loadJsFile(response.result.DefaultJsUrl, function () {
|
||||
var dynamicInstance = eval(response.result.FormJsVariableName + ".Instance()");
|
||||
dynamicInstance.loadForm(FormId, Pk_Value, AppConfigurationId, callback, PortletWidgetId);
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
|
||||
});
|
||||
});
|
||||
if (event !== undefined && event !== null) {
|
||||
$(event.currentTarget).blur();
|
||||
}
|
||||
}
|
||||
loadDetailSettingForm(FormId, Pk_Value, AppConfigurationId, PortletWidgetId, callback) {
|
||||
var instance = this.fileCacheHelper;
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
|
||||
Unibase.Platform.Forms.Managers.FormManager.Instance().getForm(FormId).then(function (response) {
|
||||
instance.loadJsFile(response.result.DefaultJsUrl, function () {
|
||||
var dynamicInstance = eval(response.result.FormJsVariableName + ".Instance()");
|
||||
var activePortletId = Number($(".layout-detail-tabs .tab-addeditem").find(".active").parent().attr("value"));
|
||||
if (!isNaN(activePortletId)) {
|
||||
var portletWidgetInfo = {
|
||||
PortletId: activePortletId,
|
||||
};
|
||||
Unibase.Platform.Forms.Components.FormViewer.instance.ProtletWidgetInfo = portletWidgetInfo;
|
||||
}
|
||||
dynamicInstance.loadForm(FormId, Pk_Value, AppConfigurationId, callback, PortletWidgetId);
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
|
||||
});
|
||||
});
|
||||
if (event !== undefined && event !== null) {
|
||||
$(event.currentTarget).blur();
|
||||
}
|
||||
}
|
||||
loadDetailPopup(id, installedappid, callback) {
|
||||
var instance = this;
|
||||
if (id != 0 && installedappid != 0) {
|
||||
var component = Themes.Compact.Components.Details.Instance();
|
||||
instance.popup(id, "", component, function (containerid) {
|
||||
var obj = Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = id;
|
||||
obj._installedAppId = installedappid;
|
||||
Themes.Providers.DetailHelper.recordId = id;
|
||||
Themes.Providers.DetailHelper.installedAppId = installedappid;
|
||||
var detailObj = obj;
|
||||
Themes.Providers.DetailHelper.SetDetailInstance(obj);
|
||||
var detail = component;
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
}, Unibase.Platform.Helpers.Size.Auto);
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError("Installedappid & recordid should not be 0", "");
|
||||
}
|
||||
}
|
||||
loadDetail(id, installedappid, callback, detailContainerId = "", detailheader = false) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const instance = this;
|
||||
let VisibleContainerId = instance.getLastContainerId();
|
||||
let record = {};
|
||||
let filter = Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBckArray.filter(function (o) {
|
||||
return o.InstalledAppId == installedappid;
|
||||
});
|
||||
record = { "RecordId": id, "InstalledAppId": installedappid, "isBack": "DetailPage", "DetailConatinerId": detailContainerId, "DetailHeader": detailheader };
|
||||
if (filter != undefined && filter.length > 0) {
|
||||
filter[0].isDetails = true;
|
||||
filter[0].isDetailsBack.push(record);
|
||||
}
|
||||
else {
|
||||
console.log("navigation-back functionality not tracking in detail page, track by conatianerid");
|
||||
}
|
||||
if (id != 0 && installedappid != 0) {
|
||||
this.detailsViewIndex = Unibase.Themes.Compact.Components.Index.Instance().detailsViewIndex;
|
||||
var containerId = "";
|
||||
if (instance.isReportPopup(VisibleContainerId)) {
|
||||
containerId = '_modal_bizgaze_detail_' + moment().unix();
|
||||
}
|
||||
var component = Themes.Compact.Components.Details.Instance();
|
||||
var obj = Themes.Compact.Components.Details.Instance();
|
||||
if (detailheader == true) {
|
||||
obj._detailsHeader = detailheader;
|
||||
Unibase.Themes.Compact.Components.Details.Instance().IsCustomDetailHeader = detailheader;
|
||||
}
|
||||
else {
|
||||
obj._detailsHeader = false;
|
||||
Unibase.Themes.Compact.Components.Details.Instance().IsCustomDetailHeader = false;
|
||||
}
|
||||
obj._recordId = id;
|
||||
obj._installedAppId = installedappid;
|
||||
Themes.Providers.DetailHelper.recordId = id;
|
||||
Themes.Providers.DetailHelper.installedAppId = installedappid;
|
||||
var detailObj = obj;
|
||||
Themes.Providers.DetailHelper.SetDetailInstance(obj);
|
||||
let apptype;
|
||||
var detail = component;
|
||||
let ress = yield Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallApp(installedappid);
|
||||
apptype = ress.result.AppTypeId;
|
||||
if (apptype == 2 || apptype == 3) {
|
||||
instance.popup(id, containerId, component, function (containerid, component) {
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
}, Unibase.Platform.Helpers.Size.Medium);
|
||||
}
|
||||
else if ($("._bizgaze_popup_container").is(":visible")) {
|
||||
instance.popup(id, containerId, component, function (containerid, component) {
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
}, Unibase.Platform.Helpers.Size.Auto);
|
||||
}
|
||||
else {
|
||||
if (instance.detailsViewIndex == 1) {
|
||||
instance.popin(id, containerId, Themes.Compact.Components.Details.Instance(), function (containerid, component) {
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
});
|
||||
}
|
||||
else if (instance.detailsViewIndex == 2) {
|
||||
instance.popin(id, containerId, Themes.Compact.Components.Details.Instance(), function (containerid, component) {
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
$('#' + obj._containerId).parent().addClass('d-flex');
|
||||
$($("#" + obj._containerId).siblings()[0]).css({ "z-index": "1", "position": "absolute" });
|
||||
$('#' + obj._containerId).removeClass("col-sm").addClass('col-12 col-xl-10 bg-light').css({ "z-index": "9", "position": "absolute", "right": "0px" });
|
||||
});
|
||||
}
|
||||
else if (instance.detailsViewIndex == 3) {
|
||||
instance.popin(id, containerId, Themes.Compact.Components.Details.Instance(), function (containerid, component) {
|
||||
detail.loadPortlets(obj);
|
||||
if (callback != null)
|
||||
callback();
|
||||
$('#' + obj._containerId).parent().addClass('row');
|
||||
$($('#' + obj._containerId).siblings()[0]).removeClass('hidden col-sm col-12').addClass('col-4');
|
||||
$('#' + obj._containerId).removeClass('col-sm').addClass('col-8');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError("Installedappid & recordid should not be 0", "div_ErrorMessage", VisibleContainerId);
|
||||
}
|
||||
});
|
||||
}
|
||||
loadSection(id, containerid, component, obj, callback) {
|
||||
var instance = this;
|
||||
if (component.cssFiles() !== []) {
|
||||
this.fileCacheHelper.loadCssFiles(component.cssFiles(), null);
|
||||
}
|
||||
this.fileCacheHelper.loadJsFiles(component.jsFiles(), function () {
|
||||
var panel = containerid;
|
||||
if (panel === "" || panel === undefined)
|
||||
panel = '_modal_bizgaze_edit_' + moment().unix();
|
||||
if (panel != "_bizgaze_body" && panel != "external-form" && panel != "" && !panel.includes("div_portletwidget_") && !panel.includes("div_dashboardportletwidget_") && $.inArray(panel, Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds)) {
|
||||
if (Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.find(x => x == panel) == undefined) {
|
||||
Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.push(panel);
|
||||
}
|
||||
}
|
||||
if (($("#" + panel).length <= 0) && (!panel.includes('div_dashboardportletwidget') && !panel.includes("div_portletwidget_") && (!panel.includes('_bizgaze_body')))) {
|
||||
var detailhtml = '<div class="_bizgaze_detail_container p-0 col-sm" id="' + panel + '"></div>';
|
||||
$("#layout-detail").before(detailhtml);
|
||||
}
|
||||
var html = component.html(id, panel);
|
||||
$("#" + panel).html(html);
|
||||
component.load(id, panel, callback);
|
||||
if (callback != null)
|
||||
callback(containerid, component);
|
||||
});
|
||||
}
|
||||
showLoading() {
|
||||
$(".unibase_modal_backdrop").removeAttr('style');
|
||||
$(".preloader-it").fadeIn();
|
||||
}
|
||||
hideLoading() {
|
||||
const instance = this;
|
||||
let containerid = instance.getLastContainerId();
|
||||
if (containerid != undefined && Unibase.Themes.Providers.DetailHelper.installedAppId != 0) {
|
||||
if (containerid.includes('_viewall')) {
|
||||
containerid = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 2];
|
||||
}
|
||||
}
|
||||
if (($('.skelton_loader').length != 0) && ($("#" + containerid).html() != "")) {
|
||||
$({ to: 0 }).animate({ to: 1 }, 0, function () {
|
||||
$(".unibase_modal_backdrop").css("display", "none");
|
||||
$(".biz-db-header").removeClass('invisible');
|
||||
$(".BindData_" + containerid).removeClass('invisible');
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isList = false;
|
||||
$("#" + containerid).find('#div_detail_profile').removeClass('invisible');
|
||||
$(".dashboardwidget-container").removeClass('invisible');
|
||||
$('.detail-container-content').removeClass('invisible');
|
||||
$('.skelton_loader').remove();
|
||||
let html = '<div class="preloader-it" id="preloader-it" style="background: transparent; display: none;"><div class="loader-pendulums"> </div></div>';
|
||||
if ($('.preloader-it').length == 0) {
|
||||
$('#bizgaze_message').before(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".preloader-it").fadeOut("slow", function () {
|
||||
$(".unibase_modal_backdrop").css("display", "none");
|
||||
$(".biz-db-header").removeClass('invisible');
|
||||
$(".dashboardwidget-container").removeClass('invisible');
|
||||
$('.detail-container-content').removeClass('invisible');
|
||||
});
|
||||
}
|
||||
showContainerLoading(containerid) {
|
||||
$("#" + containerid).find(".line-loader-container").addClass('show-loading');
|
||||
}
|
||||
hideContainerLoading(containerid) {
|
||||
$("#" + containerid).find(".line-loader-container").removeClass('show-loading');
|
||||
}
|
||||
popupHtml(html, size, callback) {
|
||||
var panel = '_modal_bizgaze_popup_' + moment().unix();
|
||||
let width = 0;
|
||||
if ($("#" + panel).length <= 0) {
|
||||
let colSpan = "col-sm-8";
|
||||
if (size === Unibase.Platform.Helpers.Size.Mini) {
|
||||
colSpan = "col-sm-4";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.Medium) {
|
||||
colSpan = "col-sm-6";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.ExtraLarge) {
|
||||
colSpan = "col-sm-12";
|
||||
}
|
||||
else if (size === Unibase.Platform.Helpers.Size.DockRight) {
|
||||
colSpan = "";
|
||||
width = ($(document).width() - 240);
|
||||
}
|
||||
var modalhtml = '<div class="_bizgaze_create_container shadow-left shadow-xl modal right bg-light ' + colSpan + ' p-0" id="' + panel + '"></div>';
|
||||
$("#_bizgaze_modal").before(modalhtml);
|
||||
}
|
||||
if ($("#" + panel).length <= 0) {
|
||||
panel = "_bizgaze_body";
|
||||
}
|
||||
var instance = this;
|
||||
$('#' + panel).html(html);
|
||||
$("#" + panel).find(".btn-close").click(function () {
|
||||
instance.closePopUp();
|
||||
});
|
||||
$("#" + panel).find(".header").addClass("modal-header").addClass("pa-5").removeClass("header");
|
||||
$("#" + panel).find(".footer").addClass("modal-footer").addClass("pa-5").removeClass("footer");
|
||||
$("#" + panel).find(".scrollable").addClass("modal-body").addClass("bg-white").removeClass("scrollable");
|
||||
$("#" + panel).find(".modal-body").height($(window).outerHeight() - 110);
|
||||
if (width !== 0)
|
||||
$("#" + panel).width(width);
|
||||
if ($(document).width() < 700) {
|
||||
$("#" + panel).find(".modal-body").removeClass("w-f");
|
||||
}
|
||||
$(document).on('shown.bs.modal', '#' + panel, function () {
|
||||
if (callback != null) {
|
||||
callback(panel);
|
||||
}
|
||||
});
|
||||
$('#' + panel).modal({ backdrop: 'static', show: true });
|
||||
}
|
||||
updateDefaultWidgetValues(panel) {
|
||||
var ModalContainers = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds;
|
||||
var key = Object.keys(Unibase.Themes.Providers.Detail_Settings.Instance().DetailParameters).find(x => x == "#" + panel);
|
||||
if (key == "#" + panel) {
|
||||
delete Unibase.Themes.Providers.Detail_Settings.Instance().DetailParameters['#' + panel];
|
||||
Unibase.Themes.Providers.Detail_Settings.Instance().DetailParameters.length--;
|
||||
}
|
||||
var DetailSetting_Instance = Unibase.Themes.Providers.Detail_Settings.Instance();
|
||||
var Details_Instance = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
var ContainerId = ModalContainers[ModalContainers.length - 1];
|
||||
var installedappid = DetailSetting_Instance.DetailParameters["#" + ContainerId].InstalledAppId;
|
||||
var portletid = Number(DetailSetting_Instance.DetailParameters["#" + ContainerId].ActivePortletId);
|
||||
Details_Instance.unibase_core_activeportletid = portletid;
|
||||
Unibase.Themes.Providers.DetailHelper.installedAppId = installedappid;
|
||||
Details_Instance._installedAppId = installedappid;
|
||||
Details_Instance.unibase_ActiveInstalledAppId = installedappid;
|
||||
DetailSetting_Instance.InputParameters = DetailSetting_Instance.DetailParameters["#" + ContainerId].InputParameters;
|
||||
if (DetailSetting_Instance.InputParameters.length > 0) {
|
||||
var recordid = Number(DetailSetting_Instance.InputParameters.find(x => x.Key == "hf_" + installedappid + "_recordid").Value);
|
||||
Details_Instance._recordId = recordid;
|
||||
}
|
||||
}
|
||||
}
|
||||
Compact.NavigationHelper = NavigationHelper;
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Viittaa uudesa ongelmassa
Block a user