Iniit
This commit is contained in:
@@ -0,0 +1,986 @@
|
||||
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) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Dashboard extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.firstLoad = true;
|
||||
this.filterClickBtn = true;
|
||||
this.jsindex = 0;
|
||||
this.htmlindex = 0;
|
||||
this.evalExecuted = 0;
|
||||
this._bizgaze_core_activeinstalledappId = 0;
|
||||
this._bizgaze_core_activeportletid = 0;
|
||||
this._dashboard_first_load = 0;
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/bundle/dashboard.min.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
var _a;
|
||||
let width = $(window).width(), mx;
|
||||
if (width <= 576) {
|
||||
mx = 'mx-2';
|
||||
}
|
||||
else {
|
||||
mx = 'mx-20';
|
||||
}
|
||||
let isRestrictHidden = '', isSupportHidden = '';
|
||||
if (Unibase.Platform.Membership.Infos.Identity.currentUser.isRestrictedUser == true) {
|
||||
isRestrictHidden = 'd-none';
|
||||
}
|
||||
let isSupportHeader = window.location.hash;
|
||||
if (isSupportHeader.includes('ticket')) {
|
||||
isSupportHidden = 'd-none';
|
||||
}
|
||||
var html = `<input type="hidden" id="hf_DashboardPortletId" value="" />
|
||||
<input type="hidden" id="hf_DashboardPortletName" value="0" />
|
||||
<input type="hidden" id="hf_PortletId" />
|
||||
<input type="hidden" id="hf_App_DefaultWidgetId" value="0" />
|
||||
<input type="hidden" id="hf_AppUniqueId" value="0" />
|
||||
<div class="biz-db-header pt-10 pb-2 pb-sm-15 px-sm-0 ${mx} invisible" id="bizDbHeader">
|
||||
<div class="db-top-header d-flex justify-content-between align-items-center position-relative px-0 pb-5" id="dbTopHeader"><div class="db-header-left dashboard-tab d-flex align-items-center w-85">
|
||||
<div class="d-flex align-items-center biz-highlight-bg-color text-truncate biz-dropdown db-dropdown-wrap">
|
||||
<span id="lblDbGroup_Title" class="db-group-title font-20 font-weight-600 font-sm-20 text-truncate ${isSupportHidden}">No Dashboards</span><a class="dp-toggle-icon btn btn-icon btn-flush-biz-theme btn-rounded flush-soft-hover d-xl-none flex-shrink-0 ${isRestrictHidden}" href="javascript:;" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="btn-icon-wrap"><i class="fa fa-caret-down"></i></span></a>
|
||||
<div class="dropdown-menu biz-custom-dropdown biz-custom-scrollbar biz-db-groups-dropdown" id="dbGroupsDropdownMenu"><ul id="dbGroupsDropdownList" class="custom-dropdown-body biz-custom-scrollbar db-groups-dropdown-list row mx-0"></ul></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="db-header-right d-flex align-items-center" id="dbHeaderRight"><div class="dashboard-fav exclude-tab"><a href="javascript:;" class="biz-highlight-bg-color ml-10" onclick="bizgaze.extensions.web.themes.compact.nav.setAsFavorite();" id="Biz_favorite"><span class="glyphicon glyphicon-heart"></span></a><a href="javascript:;" class="hidden ml-10" id="Biz_Unfavorite" onclick="bizgaze.extensions.web.themes.compact.nav.removeFromFavorite();"><span class="glyphicon glyphicon-heart"></span></a>
|
||||
</div>
|
||||
<a id="filter_toggle_btn${containerid}" class="btn btn-outline-light border d-flex align-items-center rounded biz-highlight-bg-color common-filter-dp-btn line-height-0 order-last ${isRestrictHidden}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-tooltip="true" title="Common Filters"><i class="la la-filter font-weight-700" style="height:auto"></i></a>
|
||||
<div class="dropdown-menu biz-custom-dropdown biz-common-filter-dropdown" id="bizCmnFilterDp_${containerid}" onclick="event.stopPropagation();"><div class="cmn-filter-content-wrap position-relative"><div class="custom-dropdown-body biz-custom-scrollbar row mx-0 common-filter-dropdown-body cmn-filters-body" id="dynamic-filters${containerid}"></div><div class="common-filter-footer mt-10" id="commonfilter_footerbuttons${containerid}"></div><div class="cmn-filter-errmsg text-center d-none" id="cmnFilterErrMsg_${containerid}"><p class="text-danger">No Filters Found!</p><a class="btn btn-outline-primary btn-sm mt-10" href="javascript:;" id="btnCreateCommonFilter" onclick="Unibase.Platform.Analytics.Components._CommonFilter.Instance().loadCommonFilterForm(0)">Create Filter</a></div><a href="javascript:;" class="btn btn-icon btn-flush-biz-theme btn-rounded flush-soft-hover h-30p w-30p shadow cmn-filter-panel-pin d-none" id="cmnFilterPanelPin_${containerid}" onclick="Unibase.Themes.Compact.Components.Dashboard.Instance().loadCommonFilterPanel('${containerid}');" data-tooltip="true" title="Pin Filters"><span class="btn-icon-wrap"><i class="las la-thumbtack font-18"></i></span></a></div></div>
|
||||
<div class="admin-user-only d-none d-xl-block mr-10">
|
||||
<div class="btn-group dropdown dashboard-setting-dp ${!((_a = this.currentUser) === null || _a === void 0 ? void 0 : _a.isAdmin) ? 'd-none' : ''}" id="dashboardSettingsDp">
|
||||
<a class="btn btn-outline-light border d-flex align-items-center rounded biz-highlight-bg-color line-height-0 dashboard-settings-btn" data-tooltip="true" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="javascript:void(0);" data-tooltip="true" title="Dashboard Settings"><i class="la la-cog"></i></a>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="javascript:;" onclick="Unibase.Themes.Compact.Components.Nav.Instance().addWidget()"><i class="la la-pencil mr-1"></i>Edit Dashboard</a>
|
||||
<a class="dropdown-item " href="javascript:;" onclick="Unibase.Themes.Compact.Components.Nav.Instance().manageDashboards()" ><i class="la la-newspaper-o mr-1"></i>Manage Dashboard</a>
|
||||
</div></div></div>
|
||||
</div></div>
|
||||
<div class="layout-dashboard-tab" id="layout-dashboard-tabs">
|
||||
<div class="dashboard-tab card-header-filters" id="card-header-filters${containerid}">
|
||||
<ul class="biz-report-filters dashboard-options-list" id="filters-list${containerid}"></ul>
|
||||
<a href="javascript:;" class="filter-left-icon filter-nav-icon biz-highlight-bg-color hidden" onclick="Unibase.Themes.Compact.Components.Nav.Instance().changeFilterScroll(this,'${containerid}')" data-operation="-"><i class="fa fa-chevron-left"></i></a>
|
||||
<a href="javascript:;" class="filter-right-icon filter-nav-icon biz-highlight-bg-color hidden" onclick="Unibase.Themes.Compact.Components.Nav.Instance().changeFilterScroll(this,'${containerid}')" data-operation="+"><i class="fa fa-chevron-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboardfooter hidden" id="dashboardfooter">
|
||||
<a class="btn btn-outline-primary bg-white dashboardcreatewidgetbtn mr-10" href="javascript:;" id="AddWidget_btnCreateWidget" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().createWidget(` + id + `)">Create Widget</a>
|
||||
<div class="Dashboard_SaveChanges pull-right">
|
||||
<a href="javascript:;" class="btn btn-outline-danger mr-10" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().loadportlet();">Close</a>
|
||||
<a href="javascript:;" class="btn btn-primary" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().SaveScreen();" data-dismiss="modal">Save changes</a>
|
||||
<a class="btn btn-sm btn-success hidden" href="javascript:;" data-toggle="modal" data-target="#SaveEditScreen" onclick="Unibase.Themes.Compact.Components.Dashboard.Instance().confirmSave();" id="AddWidget_btnSelectWidget">Done</a>
|
||||
</div></div>
|
||||
</div>
|
||||
<div id="dashboardwidget-container-outer" class="px-0 flex-grow-1 overflow-auto"><div data-simplebar class="simple-scroll-bar container-fluid scrollable pb-15 px-0" id="dashboardwidget-container-scroll"><div id="dashboardwidget-container" class="row dashboardwidget-container px-2 px-sm-2 px-md-20 px-lg-20 mx-0 mx-sm-1" data-id="dashboardwidget-container"></div></div>
|
||||
</div>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().addCacheFiles([
|
||||
"tenants/themes/compact/widgets/kpiwidgets/manager/kpimanager.js", "tenants/themes/compact/widgets/kpiwidgets/manager/interfaces/ikpimanager.js", "tenants/themes/compact/widgets/reportwidgets/default.js", "tenants/themes/compact/widgets/kpiwidgets/default.js", "tenants/themes/compact/widgets/detailwidgets/default.js", "tenants/themes/compact/widgets/detailwidgets/singledata.js", "tenants/themes/compact/widgets/detailwidgets/singlecolumn.js", "tenants/themes/compact/widgets/detailwidgets/singlecolumn_noborder.js", "tenants/themes/compact/widgets/kpiwidgets/comparision.js", "tenants/themes/compact/widgets/kpiwidgets/icon.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentage.js", "tenants/themes/compact/widgets/kpiwidgets/twovalue.js", "tenants/themes/compact/widgets/reportwidgets/withnoheaderandfooter.js", "platform/widgets/components/widgetpermission.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluebgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentagebgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluecenterline.js", "tenants/themes/compact/widgets/kpiwidgets/owlcarouselslider.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentageprogressbar.js", "tenants/themes/compact/widgets/kpiwidgets/kpi_fulfillment.js", "tenants/themes/compact/widgets/kpiwidgets/carouselslider.js", "tenants/themes/compact/widgets/kpiwidgets/carouselsliderbgcolor.js", "platform/analytics/components/reportviewer/reportviewer.js", "tenants/themes/compact/widgets/detailwidgets/customdesign.js", "tenants/themes/compact/widgets/kpiwidgets/comparisionrightbarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/comparisionbottombarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/singlevalueborder.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluebottombarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/singlevaluepiechart.js", "tenants/themes/compact/widgets/kpiwidgets/iconbgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/iconcolor.js", "tenants/themes/compact/widgets/kpiwidgets/iconleftbarcolor.js", "tenants/themes/compact/components/dashboard/walkthrough.js"
|
||||
]);
|
||||
let instance = this;
|
||||
if ($(window).outerWidth() <= 575) {
|
||||
$("#dashboardwidget-container-outer").css("margin-left", "-15px").css("margin-right", "-15px");
|
||||
$("#dashboardwidget-container-scroll").removeClass("px-0");
|
||||
}
|
||||
$(`#filter_toggle_btn${containerid}`).click(function () {
|
||||
if ($(`#bizCmnFilterDp_${containerid}`).hasClass('show')) {
|
||||
return;
|
||||
}
|
||||
let portleId = Number($("#hf_PortletId").val());
|
||||
Unibase.Platform.Analytics.Components._CommonFilter.Instance().commonFilter(portleId, containerid);
|
||||
});
|
||||
$(document).on("click", ".daterangepicker", function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
$('#dbHeaderRight').on('shown.bs.dropdown', function () {
|
||||
if ($(this).hasClass('show')) {
|
||||
$(`#filter_toggle_btn${containerid}`).find('.la-filter').removeClass('la-filter').addClass('la-times');
|
||||
}
|
||||
});
|
||||
$('#dbHeaderRight').on('hide.bs.dropdown', function () {
|
||||
$(`#filter_toggle_btn${containerid}`).find('.la-times').removeClass('la-times').addClass('la-filter');
|
||||
});
|
||||
Unibase.Platform.Analytics.Components._CommonFilter.Instance().commonFilter(0, containerid);
|
||||
if (isMobileApp()) {
|
||||
eval(`jquerySwipeHandler.handleSwipe("#dashboardwidget-container-outer", [jquerySwipeHandler.SWIPE_LEFT, jquerySwipeHandler.SWIPE_RIGHT], function (direction) {
|
||||
if(direction == 'SWIPE_LEFT' || direction == 'SWIPE_RIGHT'){
|
||||
Unibase.Themes.Compact.Components.Dashboard.Instance().DashBoardSwipe(direction);
|
||||
}
|
||||
});`);
|
||||
}
|
||||
}
|
||||
init(containerid) {
|
||||
}
|
||||
loadDashboard(dashboardid, containerid, callback) {
|
||||
var instance = this;
|
||||
}
|
||||
loadCreateDashboard() {
|
||||
var instance = this;
|
||||
instance.fileCacheHelper.loadJsFile('platform/dashboards/components/createdashboard.js', function () {
|
||||
instance.navigationHelper.popup(0, "", Unibase.Platform.Dashboards.Components.CreateDashboard.Instance(), null, Unibase.Platform.Helpers.Size.DockLeft);
|
||||
});
|
||||
}
|
||||
confirmSave() {
|
||||
var html = '<div class="modal fade" id="SaveEditScreen" tabindex="-1" role="dialog" aria-labelledby="SaveEditScreenLabel" style="display: none;" aria-hidden="true">' +
|
||||
'<div class="modal-dialog" role = "document" >' +
|
||||
'<div class="modal-content">' +
|
||||
'<div class="modal-header d-none">' +
|
||||
'<h5 class="modal-title" id="SaveEditScreenLabel"></h5>' +
|
||||
'<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
|
||||
'<span aria-hidden="true">×</span>' +
|
||||
'</button>' +
|
||||
'</div>' +
|
||||
'<div class="modal-body">' +
|
||||
'<p>Do you want to Save Changes?</p >' +
|
||||
'</div>' +
|
||||
'<div class="modal-footer">' +
|
||||
'<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
|
||||
'<button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().loadportlet()">Discard Changes</button>' +
|
||||
'<button type="button" class="btn btn-primary" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().SaveScreen(true)" data-dismiss="modal">Save changes</button>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div >';
|
||||
$("#_bizgaze_modal").before(html);
|
||||
$("#SaveEditScreen").modal();
|
||||
}
|
||||
sortportletWidgets(a, b) {
|
||||
const sortA = a.PortletWidgetId;
|
||||
const sortB = b.PortletWidgetId;
|
||||
let comparison = 0;
|
||||
if (sortA > sortB) {
|
||||
comparison = 1;
|
||||
}
|
||||
else if (sortA < sortB) {
|
||||
comparison = -1;
|
||||
}
|
||||
return comparison;
|
||||
}
|
||||
loadWidgetData(portletWidgetdata) {
|
||||
let data;
|
||||
if (portletWidgetdata != undefined) {
|
||||
data = portletWidgetdata.sort(this.sortStructureWidgets);
|
||||
}
|
||||
if (data != null && data != undefined) {
|
||||
var html = "";
|
||||
var instance = this;
|
||||
var datalength = data.length;
|
||||
var isFirstTime = true;
|
||||
for (let i = 0; i < datalength; i++) {
|
||||
var model = data[i];
|
||||
var widgetUrl = model.WidgetUrl;
|
||||
var Width = model.Width;
|
||||
var WidgetName = "";
|
||||
if (model.DisplayText == "" || model.displayText == null) {
|
||||
WidgetName = model.WidgetName;
|
||||
}
|
||||
else {
|
||||
WidgetName = model.DisplayText;
|
||||
}
|
||||
var IsFiltarable = model.IsFilterable;
|
||||
var filterhtml = "";
|
||||
if (IsFiltarable == null || IsFiltarable == false || IsFiltarable == "") {
|
||||
filterhtml = "hidden";
|
||||
}
|
||||
var widgetdata = '<div class="widgetdataHere w-100 mb-2 mb-sm-15 widgetid-' + model.WidgetId + '" id ="widgetid-' + model.WidgetId + '" data-strctwidgetindex="' + model.StrctWidgetIndex + '" data-boxid="' + model.StructureDesignId + '"><div class="rounded portlet dashboardwidget-item dashboardwidget-addeditem widgetItem-' + model.PortletWidgetId + ' widgetid-' + model.WidgetId + '" id=' + model.WidgetId + '>' +
|
||||
'<div class="Border bg-transparent mb-1 mb-sm-3" >' +
|
||||
'<div class="Border1 hidden">' +
|
||||
'<div class="editwidget card-action-wrap editwidget-' + model.WidgetId + ' pull-right m-t-sm m-r-lg" id="editwidget">' +
|
||||
'<a href="javascript:;" data-tooltip="true" title="Edit Widget" onclick="Unibase.Themes.Compact.Components.Dashboard.Instance().EditWidget(' + model.WidgetId + ',' + 0 + ',' + model.PortletWidgetId + ')" ><i class="ti-pencil text-info mr-3" id = "EditWidget-' + model.PortletWidgetId + '" ></i></a>' +
|
||||
'<a href="javascript:;" id="WidgetSettings-' + model.PortletWidgetId + '" data-tooltip="true" title="Settings" ><i class="ti-settings mr-3" id = "EditWidget-' + model.PortletWidgetId + '"></i></a>' +
|
||||
'<a href = "javascript:;" data-tooltip="true" title="Permissions" onclick = "Unibase.Themes.Compact.Components.Dashboard.Instance().ShowWidgetPermissions(' + model.PortletWidgetId + ')";><i class="ti-key mr-2" id = "ShowWidgetPermissions-' + model.PortletWidgetId + '"></i></a>' +
|
||||
'<a href="javascript:;" data-tooltip="true" title="delete widget" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().deletePortletWidgets(' + model.PortletWidgetId + ')"> <i class="ti-trash text-danger mr-2" id = "EditWidget-' + model.PortletWidgetId + '"></i></a>' +
|
||||
'<a href="javascript:;" title = "Export Widget" onclick = "Unibase.Platform.Widgets.Components.Widget.Instance().exportWidgetByWidgetId(' + model.WidgetId + ')" > <i class="fa fa-download text-info mr-2" id = "ExportWidget-' + model.PortletWidgetId + '" > </i></a >' +
|
||||
'</div>' +
|
||||
'<div class="dragWidget dargwidget-' + model.WidgetId + ' pull-left" id="dragWidget">' +
|
||||
'<a class="pull-left btn btn-sm">' +
|
||||
'<i class="ti-fullscreen"></i>' +
|
||||
'</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<input type="hidden" id="hf_widgetId" value="' + model.WidgetId + '" />' +
|
||||
'<input type="hidden" id="hf_widgetId_' + model.WidgetId + '" value="' + model.WidgetId + '" />' +
|
||||
'<input type="hidden" id="hf_widgetName_' + model.PortletWidgetId + '" value="' + WidgetName + '" />' +
|
||||
'<input type="hidden" id="hf_widgetUniqueId_' + model.PortletWidgetId + '" value="' + model.UniqueId + '" />' +
|
||||
'<input type="hidden" class="hf_portletwidgetId" id="hf_portletwidgetId" value="' + model.PortletWidgetId + '" />' +
|
||||
'<input type="hidden" class="hf_portletwidgetheight" id="hf_portletwidgetheight" value="' + model.PortletWidgetHeight + 'px" />' +
|
||||
'<input type="hidden"id="hf_PortletId" value="' + model.PortletId + '"/>';
|
||||
if (model.WidgetLayoutName == 'KPI') {
|
||||
widgetdata += '<div class="bg-white d-block position-relative h-90p line-loader"></div><div id="div_dashboardportletwidget_' + model.PortletWidgetId + '" class="widgetsstructure hidden div_dashboardwidget_' + model.PortletWidgetId + ' div_dashboardportletwidget_' + model.PortletWidgetId + '" />';
|
||||
}
|
||||
else {
|
||||
widgetdata += '<div id="div_dashboardportletwidget_' + model.PortletWidgetId + '" class="widgetsstructure div_dashboardwidget_' + model.PortletWidgetId + ' div_dashboardportletwidget_' + model.PortletWidgetId + '" />';
|
||||
}
|
||||
widgetdata += '</div></div></div></div>';
|
||||
let afterchild, beforechild;
|
||||
if ($('#structureId_' + model.StructureDesignId).length != 0) {
|
||||
if (model.StrctWidgetIndex == 1 || model.StrctWidgetIndex == 0) {
|
||||
$('#structureId_' + model.StructureDesignId).find('.widgetplace').first().prepend(widgetdata);
|
||||
}
|
||||
else {
|
||||
afterchild = model.StrctWidgetIndex - 1;
|
||||
beforechild = model.StrctWidgetIndex + 1;
|
||||
if (($('#structureId_' + model.StructureDesignId + ' .widgetplace').find('[data-strctwidgetindex="' + afterchild + '"][data-boxid="' + model.StructureDesignId + '"]').length) > 0) {
|
||||
$('#structureId_' + model.StructureDesignId + ' .widgetplace').find('[data-strctwidgetindex="' + afterchild + '"][data-boxid="' + model.StructureDesignId + '"]').after(widgetdata);
|
||||
}
|
||||
else if (($('#structureId_' + model.StructureDesignId + ' .widgetplace').find('[data-strctwidgetindex="' + beforechild + '"][data-boxid="' + model.StructureDesignId + '"]').length) > 0) {
|
||||
$('#structureId_' + model.StructureDesignId + ' .widgetplace').find('[data-strctwidgetindex="' + beforechild + '"][data-boxid="' + model.StructureDesignId + '"]').before(widgetdata);
|
||||
}
|
||||
else if (model.StrctWidgetIndex < Number($('#structureId_' + model.StructureDesignId + ' [data-boxid="' + model.StructureDesignId + '"]').attr('data-strctwidgetindex'))) {
|
||||
$('#structureId_' + model.StructureDesignId + ' [data-boxid="' + model.StructureDesignId + '"]').before(widgetdata);
|
||||
}
|
||||
else if (model.StrctWidgetIndex > Number($('#structureId_' + model.StructureDesignId + ' [data-boxid="' + model.StructureDesignId + '"]').attr('data-strctwidgetindex'))) {
|
||||
$('#structureId_' + model.StructureDesignId + ' [data-boxid="' + model.StructureDesignId + '"]').after(widgetdata);
|
||||
}
|
||||
else {
|
||||
$('#structureId_' + model.StructureDesignId + ' .widgetplace').append(widgetdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('[data-divstructureid="default-structure"]').find('.widgetplace').append(widgetdata);
|
||||
}
|
||||
var StrWidgetID = '.widgetdataHere.widgetid-' + model.WidgetId + '';
|
||||
var FindStrutreLength = $(StrWidgetID).length;
|
||||
if (FindStrutreLength >= 2) {
|
||||
$('#dashboardwidget-container .widgetdataHere.widgetid-' + model.WidgetId + '').not(':last').remove();
|
||||
}
|
||||
$(widgetdata).addClass("mb-2");
|
||||
$(".structureToDelete .structureToDelete").find(".PaddingMoveRight").addClass("p-0 pr-1").removeClass("p-1");
|
||||
$(".structureToDelete .structureToDelete").find(".PaddingMoveLeft").addClass("p-0 pl-1").removeClass("p-1");
|
||||
$(".structureToDelete .structureToDelete").find(".PaddingMoveX").addClass("p-0 px-1").removeClass("p-1");
|
||||
$(".structureToDelete ").find(".PaddingMoveRight").addClass("p-0 pr-1").removeClass("p-1");
|
||||
$(".structureToDelete ").find(".PaddingMoveLeft").addClass("p-0 pl-1").removeClass("p-1");
|
||||
$(".structureToDelete ").find(".PaddingMoveX").addClass("p-0 px-1").removeClass("p-1");
|
||||
$("#deleteWidget-" + model.PortletWidgetId).click(function () {
|
||||
instance.fileCacheHelper.loadJsFile("platform/widgets/components/widget.js", function () {
|
||||
Unibase.Platform.Widgets.Components.Widget.Instance().deletePortletWidgets(model.PortletWidgetId);
|
||||
});
|
||||
});
|
||||
}
|
||||
var _fileCacheHelper = this.fileCacheHelper;
|
||||
this.models = data;
|
||||
this.jsindex = 0;
|
||||
this.htmlindex = 0;
|
||||
this.evalExecuted = 0;
|
||||
instance.evaluateJs(data);
|
||||
$("#section_bizgaze_main").removeClass("hidden");
|
||||
}
|
||||
}
|
||||
ShowWidgetPermissions(PortletWidgetId) {
|
||||
var instance = this;
|
||||
$('.btn_addportlt').addClass('hidden');
|
||||
$('.btnEdit_portlet').addClass('hidden');
|
||||
$('.manage_pPermissions').addClass('hidden');
|
||||
$('.btn_dltportlet').addClass('hidden');
|
||||
instance.navigationHelper.popup(0, "", Unibase.Platform.Widgets.Components.WidgetPermission.Instance(), function () {
|
||||
$("#chkIsWidgetViewable").change(function () {
|
||||
Unibase.Platform.Widgets.Components.WidgetPermission.Instance().setViewable();
|
||||
});
|
||||
Unibase.Platform.Widgets.Components.WidgetPermission.Instance().showPermissions(PortletWidgetId, 'widget', Unibase.Platform.Widgets.WidgetHiddenFields.Instance().unix_pwid);
|
||||
}, Unibase.Platform.Helpers.Size.Medium);
|
||||
}
|
||||
EditWidget(Wid, x, PortletWidgetId, isFromAddWidget) {
|
||||
var instance = this;
|
||||
$(".biz-submenu").css({ "z-index": "1040" });
|
||||
$(".biz-layout-3-left-nav").css({ "z-index": "1040" });
|
||||
$(".toplayout-structures-panel").css({ "z-index": "1040" });
|
||||
instance.fileCacheHelper.loadJsFile("platform/widgets/components/widget.js", function () {
|
||||
Unibase.Platform.Widgets.Components.Widget.Instance().loadWidgetData(Wid, 0, true, PortletWidgetId, isFromAddWidget);
|
||||
});
|
||||
}
|
||||
filterStructures(data, containerid, parentId) {
|
||||
let myStructures, instance = this;
|
||||
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
if (VisibleContainerId.includes('_viewall')) {
|
||||
VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 2];
|
||||
}
|
||||
$('#' + VisibleContainerId).find('#' + containerid).attr({ 'data-isedit': 'false' });
|
||||
if (!parentId) {
|
||||
var myStructuresSort = data.filter(structure => structure.ParentId == 0);
|
||||
}
|
||||
else {
|
||||
var myStructuresSort = data.filter(structure => structure.ParentId == parentId);
|
||||
}
|
||||
if (myStructuresSort.length)
|
||||
myStructures = myStructuresSort.sort(this.sortStructureWidgets);
|
||||
let width, innerHtml = '', outerHtml = '', ParentDiv, binding, mobileWidth = [], tabWidth = [], _tabWidth = '', _mobileWidth = '', desktopPdng = '', tabPdng = '', MobilePdng = '';
|
||||
if (myStructures != undefined) {
|
||||
for (var i = 0; i < myStructures.length; i++) {
|
||||
if (myStructures[i].ParentId == 0) {
|
||||
ParentDiv = containerid;
|
||||
outerHtml = '<div class="d-flex flex-wrap structureToDelete w-100 structureDiv" data-divstructureid=' + myStructures[i].StructureId + ' data-clone="clonestruct" data-parent=' + ParentDiv + ' id="divStructure_' + myStructures[i].ParentId + '-' + myStructures[i].StructureId + '-' + myStructures[i].StructureVIndex + '" data-isEdit="false" data-strctwidgetindex=' + myStructures[i].StrctWidgetIndex + ' data-boxid="' + myStructures[i].ParentId + '" data-ParentIndex="' + myStructures[i].ParentId + '"></div>';
|
||||
if (myStructures[i].StructureHIndex == 0) {
|
||||
$('#' + VisibleContainerId).find('#' + ParentDiv).append(outerHtml);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ParentDiv = 'structureId_' + myStructures[i].ParentId;
|
||||
outerHtml = '<div class="d-flex flex-wrap structureToDelete w-100 structureDiv" data-divstructureid=' + myStructures[i].StructureId + ' data-clone="clonestruct" data-parent="' + ParentDiv + '" id="divStructure_' + myStructures[i].ParentId + '-' + myStructures[i].StructureId + '-' + myStructures[i].StructureVIndex + '" data-isEdit="false" data-strctwidgetindex=' + myStructures[i].StrctWidgetIndex + ' data-boxid="' + myStructures[i].ParentId + '" data-ParentIndex="' + myStructures[i].ParentId + '"></div>';
|
||||
if (myStructures[i].StructureHIndex == 0) {
|
||||
$('#' + VisibleContainerId).find('#structureId_' + myStructures[i].ParentId).find('.widgetplace ').first().append(outerHtml);
|
||||
}
|
||||
}
|
||||
width = myStructures[i].StructureWidth.split('|'), _mobileWidth = '', _tabWidth = '';
|
||||
let desktopWidth = width[myStructures[i].StructureHIndex];
|
||||
if (myStructures[i].StructureMobileWidth != '' && myStructures[i].StructureMobileWidth != null && myStructures[i].StructureMobileWidth != undefined) {
|
||||
mobileWidth = myStructures[i].StructureMobileWidth.split('|');
|
||||
if (mobileWidth == null || mobileWidth[myStructures[i].StructureHIndex] == '' || mobileWidth[myStructures[i].StructureHIndex] == '0' || mobileWidth[myStructures[i].StructureHIndex] == undefined) {
|
||||
_mobileWidth = '';
|
||||
}
|
||||
else {
|
||||
_mobileWidth = ' col-' + mobileWidth[myStructures[i].StructureHIndex] + ' col-xs-' + mobileWidth[myStructures[i].StructureHIndex] + ' col-sm-' + mobileWidth[myStructures[i].StructureHIndex];
|
||||
}
|
||||
}
|
||||
if (myStructures[i].StructureTabWidth != '' && myStructures[i].StructureTabWidth != null && myStructures[i].StructureTabWidth != undefined) {
|
||||
tabWidth = myStructures[i].StructureTabWidth.split('|');
|
||||
if (tabWidth == null || tabWidth[myStructures[i].StructureHIndex] == '' || tabWidth[myStructures[i].StructureHIndex] == '0' || tabWidth[myStructures[i].StructureHIndex] == undefined) {
|
||||
_tabWidth = '';
|
||||
}
|
||||
else {
|
||||
_tabWidth = ' col-md-' + tabWidth[myStructures[i].StructureHIndex] + ' col-lg-' + tabWidth[myStructures[i].StructureHIndex];
|
||||
}
|
||||
}
|
||||
desktopPdng = instance.pdng_Algn(myStructures[i].StructureWidth, myStructures[i].StructureHIndex, "Desktop", myStructures[i].StrctWidgetIndex);
|
||||
tabPdng = instance.pdng_Algn(myStructures[i].StructureTabWidth, myStructures[i].StructureHIndex, "Tab", myStructures[i].StrctWidgetIndex);
|
||||
MobilePdng = instance.pdng_Algn(myStructures[i].StructureMobileWidth, myStructures[i].StructureHIndex, "Mobile", myStructures[i].StrctWidgetIndex);
|
||||
innerHtml = '<div class="' + _mobileWidth + ' ' + _tabWidth + ' col-xl-' + desktopWidth + ' droppablePlaceCol ui-sortable-handle ' + desktopPdng + ' ' + tabPdng + ' ' + MobilePdng + '" data-isblock="1" data-structureindex="' + myStructures[i].StructureHIndex + '" data-parent="divStructure_' + myStructures[i].ParentId + '-' + myStructures[i].StructureId + '-' + myStructures[i].StructureVIndex + '" id="structureId_' + myStructures[i].StructureDesignId + '" data-mobile_settingwidth="' + myStructures[i].StructureMobileWidth + '" data-tab_settingwidth="' + myStructures[i].StructureTabWidth + '" data-parentIndex="' + myStructures[i].ParentId + '"><div class="blocks-droppable-items-place ui-sortable-handle widgetplace ui-sortable" id="12"></div></div>';
|
||||
if (myStructures[i].StructureHIndex == 0) {
|
||||
binding = 'divStructure_' + myStructures[i].ParentId + '-' + myStructures[i].StructureId + '-' + myStructures[i].StructureVIndex;
|
||||
$('#' + VisibleContainerId).find('#divStructure_' + myStructures[i].ParentId + '-' + myStructures[i].StructureId + '-' + myStructures[i].StructureVIndex).append(innerHtml);
|
||||
}
|
||||
else {
|
||||
$('#' + VisibleContainerId).find('#' + binding).append(innerHtml);
|
||||
}
|
||||
}
|
||||
myStructures.forEach(structure => {
|
||||
this.filterStructures(data, containerid, structure.StructureDesignId);
|
||||
});
|
||||
}
|
||||
}
|
||||
pdng_Algn(width, HIndex, resolution, WSIndex) {
|
||||
let instance = this, padding;
|
||||
let curIndex = instance.padding(width, HIndex, WSIndex);
|
||||
if (resolution == "Desktop") {
|
||||
if (width != '') {
|
||||
if (curIndex == 0) {
|
||||
padding = 'px-xl-0';
|
||||
}
|
||||
if (curIndex == 1) {
|
||||
padding = 'pl-xl-0 pr-xl-10';
|
||||
}
|
||||
if (curIndex == 2) {
|
||||
padding = 'px-xl-10';
|
||||
}
|
||||
if (curIndex == 3) {
|
||||
padding = 'pl-xl-10 pr-xl-0';
|
||||
}
|
||||
}
|
||||
else {
|
||||
padding = 'px-xl-0';
|
||||
}
|
||||
}
|
||||
if (resolution == "Tab") {
|
||||
if (width != '') {
|
||||
if (curIndex == 0) {
|
||||
padding = 'px-lg-0 px-md-0';
|
||||
}
|
||||
if (curIndex == 1) {
|
||||
padding = 'pl-md-0 pr-md-10 pl-lg-0 pr-lg-10';
|
||||
}
|
||||
if (curIndex == 2) {
|
||||
padding = 'px-lg-10 px-md-10';
|
||||
}
|
||||
if (curIndex == 3) {
|
||||
padding = 'pl-md-10 pr-md-0 pl-lg-10 pr-lg-0';
|
||||
}
|
||||
}
|
||||
else {
|
||||
padding = 'px-md-0 px-lg-0';
|
||||
}
|
||||
}
|
||||
if (resolution == "Mobile") {
|
||||
if (width != '') {
|
||||
if (curIndex == 0) {
|
||||
padding = 'px-0 px-sm-0';
|
||||
}
|
||||
if (curIndex == 1) {
|
||||
padding = 'pl-0 pr-10 pl-sm-0 pr-sm-10';
|
||||
}
|
||||
if (curIndex == 2) {
|
||||
padding = 'px-10 px-sm-10';
|
||||
}
|
||||
if (curIndex == 3) {
|
||||
padding = 'pl-10 pr-0 pl-sm-10 pr-sm-0';
|
||||
}
|
||||
}
|
||||
else {
|
||||
padding = 'px-0 px-sm-0';
|
||||
}
|
||||
}
|
||||
return padding;
|
||||
}
|
||||
padding(width, AcutalIndex, WSIndex) {
|
||||
let ElmntWidth = width.split('|'), currentIndex, breakIndex, breakarray = [], _breakarray = [], isBreak = false, sumWidth = ElmntWidth.reduce((x, y) => parseInt(x) + parseInt(y), 0), preBreakIndex = [], sliceWidth = ElmntWidth.slice(0, AcutalIndex + 1), _sliceWidth, _sumSliceWidth, sumSliceWidth = sliceWidth.reduce((x, y) => parseInt(x) + parseInt(y), 0);
|
||||
if (parseInt(ElmntWidth[AcutalIndex]) == 12) {
|
||||
currentIndex = 0;
|
||||
}
|
||||
else {
|
||||
if (sumSliceWidth < 12 && AcutalIndex == 0) {
|
||||
currentIndex = 1;
|
||||
}
|
||||
if (sumSliceWidth < 12 && AcutalIndex != 0) {
|
||||
currentIndex = 2;
|
||||
}
|
||||
if (sumSliceWidth == 12) {
|
||||
currentIndex = 3;
|
||||
}
|
||||
if (sumSliceWidth > 12) {
|
||||
if (parseInt(ElmntWidth[AcutalIndex]) == 12) {
|
||||
currentIndex = 0;
|
||||
}
|
||||
else {
|
||||
currentIndex = 1;
|
||||
for (let i = 0; i < ElmntWidth.length; i++) {
|
||||
breakarray.push(parseInt(ElmntWidth[i]));
|
||||
let sumbreakarray = breakarray.reduce((x, y) => parseInt(x) + parseInt(y), 0);
|
||||
if (sumbreakarray > 12 && !isBreak) {
|
||||
isBreak = true;
|
||||
breakIndex = i;
|
||||
preBreakIndex.push({ "breakIndex": breakIndex, "isBreak": isBreak, "AcutalIndex": AcutalIndex });
|
||||
}
|
||||
}
|
||||
_sliceWidth = ElmntWidth.slice((breakIndex), (AcutalIndex + 1));
|
||||
_sumSliceWidth = _sliceWidth.reduce((x, y) => parseInt(x) + parseInt(y), 0);
|
||||
if (_sumSliceWidth < 12 && AcutalIndex == breakIndex) {
|
||||
currentIndex = 1;
|
||||
}
|
||||
if (_sumSliceWidth < 12 && AcutalIndex != breakIndex) {
|
||||
currentIndex = 2;
|
||||
}
|
||||
if (_sumSliceWidth == 12) {
|
||||
currentIndex = 3;
|
||||
}
|
||||
if (_sumSliceWidth > 12) {
|
||||
currentIndex = 1;
|
||||
isBreak = false;
|
||||
for (let k = 0; k < _sliceWidth.length; k++) {
|
||||
_breakarray.push(parseInt(_sliceWidth[k]));
|
||||
let sumbreakarray = _breakarray.reduce((x, y) => parseInt(x) + parseInt(y), 0);
|
||||
if (sumbreakarray > 12 && !isBreak) {
|
||||
isBreak = true;
|
||||
breakIndex = k;
|
||||
preBreakIndex.push({ "breakIndex": breakIndex, "isBreak": isBreak, "AcutalIndex": AcutalIndex });
|
||||
}
|
||||
}
|
||||
_sliceWidth = _sliceWidth.slice((breakIndex), (AcutalIndex + 1));
|
||||
_sumSliceWidth = _sliceWidth.reduce((x, y) => parseInt(x) + parseInt(y), 0);
|
||||
if (_sumSliceWidth < 12 && _sliceWidth.length == 1) {
|
||||
currentIndex = 1;
|
||||
}
|
||||
if (_sumSliceWidth < 12 && _sliceWidth.length != 1) {
|
||||
currentIndex = 2;
|
||||
}
|
||||
if (_sumSliceWidth == 12) {
|
||||
currentIndex = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return currentIndex;
|
||||
}
|
||||
sortStructureWidgets(a, b) {
|
||||
const sortA = a.StrctWidgetIndex;
|
||||
const sortB = b.StrctWidgetIndex;
|
||||
let comparison = 0;
|
||||
if (sortA > sortB) {
|
||||
comparison = 1;
|
||||
}
|
||||
else if (sortA < sortB) {
|
||||
comparison = -1;
|
||||
}
|
||||
return comparison;
|
||||
}
|
||||
navigationClickEvent(dashboards, groupid, dashboardOptionList, dashboardId) {
|
||||
const instance = this;
|
||||
const modalContainerId = instance.navigationHelper.getLastContainerId();
|
||||
let optionTemplate = Components.Nav_Template.Instance().DashboardItemTemplate();
|
||||
$('li.li-dashboard-item.active-item').removeClass('active-item');
|
||||
$('.liDashboardGroup_' + groupid).addClass('active-item');
|
||||
let groupTitle = dashboards[0].DashboardGroupName;
|
||||
$('#lblDbGroup_Title').text(groupTitle);
|
||||
const dbOptionEl = $(dashboardOptionList);
|
||||
dbOptionEl.html('');
|
||||
dashboards.forEach(function (dashboard, index) {
|
||||
let context = dashboard;
|
||||
let optiontemplatescript = Handlebars.compile(optionTemplate);
|
||||
let optionhtml = optiontemplatescript(context);
|
||||
dbOptionEl.append(optionhtml);
|
||||
});
|
||||
let filterEl;
|
||||
if (dashboardId) {
|
||||
filterEl = dbOptionEl.find(`#filterItem_${dashboardId}`);
|
||||
}
|
||||
else {
|
||||
filterEl = dbOptionEl.find('.filter-item').first();
|
||||
}
|
||||
filterEl.addClass("active");
|
||||
if (filterEl.attr('data-pincmnfilters') === 'true') {
|
||||
instance.loadCommonFilterPanel(modalContainerId);
|
||||
}
|
||||
if (groupTitle == "") {
|
||||
$('#lblDbGroup_Title').text($(`.liDashboardGroup_${groupid} .nav-link`).first().text());
|
||||
}
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().removeToolTipForFilterItem(dbOptionEl);
|
||||
$('.biz-wrapper').removeClass('biz__nav__toggle');
|
||||
$('.biz-nav-fullwidth').addClass('hidden');
|
||||
}
|
||||
loadDashboards(dashboards, dashboardId, IsEvent) {
|
||||
const instance = this;
|
||||
if (IsEvent) {
|
||||
var groupid = dashboards[0].DashboardGroupId, dashboardOptionList = '.dashboard-options-list';
|
||||
this.navigationClickEvent(dashboards, groupid, dashboardOptionList, dashboardId);
|
||||
}
|
||||
$(".layout-dashboard-tabs").removeClass('hidden');
|
||||
$(".layout-dashboard-tabs").find('.filter-nav-icon').addClass('hidden');
|
||||
if (dashboards.length == 0) {
|
||||
$(".layout-dashboard-tabs .tab-addeditem").empty();
|
||||
$("#dashboardwidget-container").empty();
|
||||
}
|
||||
else {
|
||||
var html = "";
|
||||
$(".tab-addeditem").remove();
|
||||
if (this._bizgaze_core_activeinstalledappId != 0) {
|
||||
this._bizgaze_core_activeportletid = 0;
|
||||
}
|
||||
this._bizgaze_core_activeinstalledappId = 0;
|
||||
if (dashboardId) {
|
||||
this._bizgaze_core_activeportletid = dashboardId;
|
||||
}
|
||||
var firstdashboardid = this._bizgaze_core_activeportletid;
|
||||
var firstdashboardname = "";
|
||||
$("#layout-dashboard-tabs").find('.dashboard-tab').first().before(html);
|
||||
if (firstdashboardid == 0) {
|
||||
var dashboard = dashboards[0];
|
||||
var dashboardId = dashboard.DashboardId;
|
||||
var dashboardName = dashboard.DashboardName;
|
||||
firstdashboardid = dashboardId;
|
||||
firstdashboardname = dashboardName;
|
||||
}
|
||||
$(".tabid-" + firstdashboardid).find(".nav-link").addClass("active");
|
||||
this._bizgaze_core_activeportletid = firstdashboardid;
|
||||
if (firstdashboardid != 0 && this.firstLoad) {
|
||||
this.firstLoad = false;
|
||||
let dbContainerId = instance.navigationHelper.getLastContainerId();
|
||||
let rvInsArray = Unibase.Platform.Helpers.NavigationHelper.reportViewerInstance.filter(x => x.parentcontainerid == dbContainerId);
|
||||
let cmnFilIns = Unibase.Platform.Analytics.Components._CommonFilter.Instance();
|
||||
cmnFilIns.appliedFilters = [];
|
||||
for (var i = 0; i < rvInsArray.length; i++) {
|
||||
rvInsArray[i].instance.inputParameters = [];
|
||||
rvInsArray[i].instance.Filter = [];
|
||||
rvInsArray[i].instance.dynamicFilters = [];
|
||||
}
|
||||
cmnFilIns.cascadingFilters = [];
|
||||
cmnFilIns.selectedCommonFilters = [];
|
||||
cmnFilIns.commonFilter(0, dbContainerId);
|
||||
if (!Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBck) {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBckArray.push({
|
||||
"DashbaordId": firstdashboardid, "DashboardName": firstdashboardname, "isBack": "Dashboard"
|
||||
});
|
||||
}
|
||||
else {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().isDshboardBck = false;
|
||||
}
|
||||
this.loadWidgets(firstdashboardid, firstdashboardname);
|
||||
}
|
||||
$("#collapsed").find("a").removeClass("nav-link").addClass("h-30p");
|
||||
$("#div-layout-report").addClass('hidden');
|
||||
}
|
||||
}
|
||||
loadWidgets(portalid, portletName) {
|
||||
if ($('.dashboard-options-list .filter-item.active').length) {
|
||||
$('.dashboard-options-list .filter-item.active').removeClass('active');
|
||||
$(`.dashboard-options-list #filterItem_${portalid}`).addClass('active');
|
||||
$(`#nav-dashboards .ligrp-item.active-item`).removeClass('active-item');
|
||||
$(`#nav-dashboards .UlItem_${portalid}`).addClass('active-item');
|
||||
}
|
||||
$(".tabid-" + portalid).find(".nav-link").addClass("active");
|
||||
$("#hfLayout_InstalledPageId").val(0);
|
||||
$("#hf_DashboardPortletId").val(portalid);
|
||||
$("#hf_DashboardPortletName").val(portletName);
|
||||
$("#hf_PortletId").val(portalid);
|
||||
$("#Stage").removeClass('hidden');
|
||||
$(".EditPortlets").addClass('hidden');
|
||||
$(".Detail_Configurations").removeClass('hidden');
|
||||
$(".portletmenu-addeditem").remove();
|
||||
$("#AddPortlet").addClass("hidden");
|
||||
$("#SavePortlet").addClass("hidden");
|
||||
$("#chkLayout_PortletsSelector").addClass("hidden");
|
||||
$("#layout-list").hide();
|
||||
$("#layout-dashboard").show();
|
||||
$("#layout-report").hide();
|
||||
this._bizgaze_core_activeportletid = portalid;
|
||||
$("#dashboard-title").html(portletName);
|
||||
$("#txt_global_search").val('');
|
||||
$("#txt_global_clearSearch").addClass("hidden");
|
||||
var instance = this;
|
||||
if (this._dashboard_first_load == 0) {
|
||||
if ($('.skelton_loader').length == 0) {
|
||||
let skelHtml = '<div class="skelton_loader biz-secondary-color position-absolute px-2 px-sm-15 px-md-20 w-100 z-index-10">';
|
||||
skelHtml += Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonDashboardStructure();
|
||||
skelHtml += '</div>';
|
||||
$("#bizDbHeader").after(skelHtml);
|
||||
if (window.innerWidth < 575) {
|
||||
$('.skelton_loader').removeClass('px-2');
|
||||
}
|
||||
}
|
||||
$(".dashboardwidget-container").html("");
|
||||
$(".dashboardwidget-container").addClass('invisible');
|
||||
Unibase.Platform.Portlets.Managers.PortletManager.Instance().getPortletStructureDesign(portalid).then(function (response) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var data = response.result;
|
||||
if (data.length == 0) {
|
||||
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
|
||||
let divStructure = 'divStructure_' + Math.floor(Math.random() * Date.now());
|
||||
let boxId = 'structureId_' + Math.floor(Math.random() * Date.now());
|
||||
let html = `<div class="d-flex flex-wrap structureToDelete w-100 structureDiv" data-divstructureid="default-structure" data-clone="clonestruct" data-parent="dashboardwidget-container" id="${divStructure}" data-isedit="true" data-strctwidgetindex="0" data-parentindex="0"> <div class="col-lg-12 droppablePlaceCol ui-sortable-handle px-md-0 px-0" data-isblock="1" data-structureindex="0" data-parent="${divStructure}" id="${boxId}" data-mobile_settingwidth="" data-tab_settingwidth="" data-parentindex="0"> <div class="blocks-droppable-items-place ui-sortable-handle widgetplace ui-sortable d-flex flex-wrap" id="12"></div></div></div>`;
|
||||
$('#' + VisibleContainerId).find('.dashboardwidget-container').html(html);
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
|
||||
}
|
||||
else {
|
||||
if (data != null) {
|
||||
yield instance.filterStructures(data, 'dashboardwidget-container');
|
||||
yield Unibase.Platform.Portlets.Managers.PortletManager.Instance().getPortletWidgets(portalid, 0).then(function (response) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var data = response.result;
|
||||
yield instance.loadWidgetData(data);
|
||||
});
|
||||
});
|
||||
$('#dashboardwidget-container-scroll').css('background-color', 'unset');
|
||||
yield instance.navigationHelper.hideLoading();
|
||||
}
|
||||
else {
|
||||
return MessageHelper.Instance().showError(response.message, 'bizgaze_message');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (this._dashboard_first_load == 1)
|
||||
this._dashboard_first_load = 0;
|
||||
this.Biz_FavoriteStatus();
|
||||
this.trackPortlet(portalid);
|
||||
}
|
||||
DashBoardSwipe(direction) {
|
||||
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
const dbFiltersEl = $(`#${VisibleContainerId} .dashboard-options-list`);
|
||||
const filtersLength = dbFiltersEl.find('.filter-item').length;
|
||||
let activeIndex = dbFiltersEl.find('.filter-item.active').index();
|
||||
if (direction == 'SWIPE_RIGHT') {
|
||||
let pos = activeIndex < 1 ? filtersLength - 1 : activeIndex - 1;
|
||||
dbFiltersEl.find('.filter-link').eq(pos).trigger('click');
|
||||
}
|
||||
if (direction == 'SWIPE_LEFT') {
|
||||
let pos = activeIndex < filtersLength - 1 ? activeIndex + 1 : 0;
|
||||
dbFiltersEl.find('.filter-link').eq(pos).trigger('click');
|
||||
}
|
||||
}
|
||||
Biz_FavoriteStatus() {
|
||||
var installedPageaId = $('#hfLayout_InstalledPageId').val();
|
||||
var portletId = $('#hf_DashboardPortletId').val();
|
||||
if (installedPageaId == 0 && portletId !== null) {
|
||||
var url = "/api/v3/Portlets/UserPortletStatus/" + portletId;
|
||||
}
|
||||
}
|
||||
trackPortlet(portletid) {
|
||||
var url = "/api/v3/Portlets/SavePortletTrack/" + portletid;
|
||||
}
|
||||
evaluateJs(data) {
|
||||
var currentinstance = this, url;
|
||||
this.evalExecuted = 1;
|
||||
let k = 0;
|
||||
var staticfileaarry = [];
|
||||
var staticwidetfiles = data.filter(function (o) { return o.WidgetUrl !== '' && o.WidgetUrl !== null; });
|
||||
if (staticwidetfiles != null && staticwidetfiles != '') {
|
||||
for (var i = 0; i < staticwidetfiles.length; i++) {
|
||||
var staticjs = staticwidetfiles[i].WidgetUrl.split(',');
|
||||
staticfileaarry.push(staticjs[0]);
|
||||
}
|
||||
}
|
||||
currentinstance.fileCacheHelper.loadJsFiles(staticfileaarry, function () {
|
||||
for (const model of data) {
|
||||
let containerid = "div_dashboardportletwidget_" + model.PortletWidgetId;
|
||||
if (model.WidgetUrl != null && model.WidgetUrl != '') {
|
||||
url = model.WidgetUrl.split(',');
|
||||
currentinstance.fileCacheHelper.loadJsFile(url[0], function () {
|
||||
eval(url[1] + '.init("' + containerid + '")');
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (model != null) {
|
||||
if (model.StaticJsPath != null) {
|
||||
var instance1 = eval(model.StaticJsPath);
|
||||
}
|
||||
if (model.Js != null) {
|
||||
if (model.JsPath != null && model.Js != "") {
|
||||
currentinstance.fileCacheHelper.loadJsFile(model.JsPath, function () {
|
||||
var instance = eval(model.Js);
|
||||
var wclist = [];
|
||||
var wc = instance;
|
||||
var DetailContainerId = currentinstance._dashboard_container;
|
||||
wclist.push({ PortletWidgetId: model.PortletWidgetId, WidgetId: model.WidgetId, WidgetParameters: model.Parameter, WidgetName: model.WidgetName, InstalledAppId: 0, DetailContainerId: DetailContainerId, StaticJsPath: model.StaticJsPath, ReportId: model.ReportId, StructureDesignId: 'structureId_' + model.StructureDesignId, IsFilterable: model.IsFilterable, WidgetDesignName: model.WidgetDesignName, CustomHtml: model.CustomHtml });
|
||||
currentinstance.navigationHelper.loadSection(wclist, containerid, instance, null, null);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
k++;
|
||||
if (k == data.length) {
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isIframe) {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().loadChat();
|
||||
$("#bizgaze_body").removeClass('invisible');
|
||||
}
|
||||
if (!Unibase.Platform.Membership.Infos.Identity.currentUser.tenant.isLoggedIn) {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().wizard();
|
||||
}
|
||||
else {
|
||||
if (Unibase.Platform.Membership.Infos.Identity.currentUser.settings.filter(function (x) { return x.settingName == "isloginfirsttime"; })[0].settingValue != undefined && Unibase.Platform.Membership.Infos.Identity.currentUser.settings.filter(function (x) { return x.settingName == "isloginfirsttime"; })[0].settingValue == true) {
|
||||
currentinstance.appTourGuide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
replaceWidgetParameterValues(Parameter, Installedappid) {
|
||||
let installedappid = Installedappid;
|
||||
let ReplaceText = [];
|
||||
if (Parameter != "" && Parameter != null) {
|
||||
let identityparameter = [];
|
||||
let appparameter = [];
|
||||
let Parameters = Parameter.split('|');
|
||||
if (Parameters.length > 0) {
|
||||
let len = Parameters.length;
|
||||
for (let i = 0; i < Parameters.length; i++) {
|
||||
if (Parameters[i].includes('identity_'))
|
||||
identityparameter.push(Parameters[i]);
|
||||
else
|
||||
appparameter.push(Parameters[i]);
|
||||
}
|
||||
}
|
||||
if (identityparameter.length > 0) {
|
||||
for (let x = 0; x < identityparameter.length; x++) {
|
||||
let split = identityparameter[x].split(':');
|
||||
ReplaceText.push({
|
||||
Key: split[0],
|
||||
Value: (Unibase.Themes.Compact.Components.Dashboard.inputparameters[split[2].split('_')[1]]).toString(),
|
||||
DataType: split[4]
|
||||
});
|
||||
}
|
||||
}
|
||||
if (appparameter.length > 0) {
|
||||
for (let x = 0; x < appparameter.length; x++) {
|
||||
let split = appparameter[x].split(':');
|
||||
if (split[3] == 2) {
|
||||
ReplaceText.push({
|
||||
Key: split[0],
|
||||
Value: split[2],
|
||||
DataType: split[4]
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (installedappid != 0) {
|
||||
for (let obj of Unibase.Themes.Compact.Components.Details.inputparameters) {
|
||||
if (obj.Key === "hf_" + installedappid + "_" + split[2])
|
||||
ReplaceText.push({
|
||||
Key: split[0],
|
||||
Value: obj.Value.toString(),
|
||||
DataType: obj.DataType.toString()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ReplaceText;
|
||||
}
|
||||
loadIdentity() {
|
||||
var identityinfo = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
|
||||
var keys = Object.keys(identityinfo);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let val = identityinfo[keys[i]];
|
||||
Unibase.Themes.Compact.Components.Dashboard.inputparameters[keys[i]] = val;
|
||||
}
|
||||
}
|
||||
exportPortlet(portletId) {
|
||||
var instance = this;
|
||||
if (portletId == 0) {
|
||||
portletId = $("#hf_PortletId").val();
|
||||
portletId = Number(portletId);
|
||||
}
|
||||
instance.fileCacheHelper.loadJsFile("platform/dashboards/managers/dashboardmanager.js", function () {
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
|
||||
Unibase.Platform.Dashboards.Managers.DashboardManager.Instance().getDashboard(portletId).then(function (portletresponse) {
|
||||
if (portletresponse.result != null && portletresponse.result != undefined) {
|
||||
Unibase.Platform.Dashboards.Managers.DashboardManager.Instance().exportPortlet(portletId).then((response) => {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
instance.navigationHelper.hideLoading();
|
||||
MessageHelper.Instance().showError(response.message, "div_permissionsimportmessage");
|
||||
}
|
||||
else if (response.result != null && response.result != undefined && portletresponse.result != null && portletresponse.result != undefined) {
|
||||
var filename = portletresponse.result.DashboardName + " - Dashboard.xml";
|
||||
var xmltext = response.result;
|
||||
var pom = document.createElement('a');
|
||||
var bb = new Blob([xmltext], { type: 'text/plain' });
|
||||
pom.setAttribute('href', window.URL.createObjectURL(bb));
|
||||
pom.setAttribute('download', filename);
|
||||
pom.dataset.downloadurl = ['text/plain', pom.download, pom.href].join(':');
|
||||
pom.draggable = true;
|
||||
pom.classList.add('dragout');
|
||||
pom.click();
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
appTourGuide() {
|
||||
let instance = this;
|
||||
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
|
||||
_fileCacheHelper.loadCssFile("libs/tourguide/tour.min.css", null);
|
||||
_fileCacheHelper.loadJsFiles(["libs/tourguide/tour.min.js", "tenants/themes/compact/components/dashboard/walkthrough.js"], function () {
|
||||
let layouts = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.filter(function (o) { return o.settingName === "themeobj"; });
|
||||
let type, data = [];
|
||||
let JSONdata = JSON.parse(layouts[0].settingValue.layoutSettings.settingValue);
|
||||
let LayoutName = layouts[0].settingValue.layoutName.replace(/\s/g, '');
|
||||
if (Unibase.Themes.Providers.DetailHelper.installedAppId == 0) {
|
||||
let detailContid = 'card-header-filters' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
let listContid = 'filters-list' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
if ($('#' + listContid).length == 1 && $('#' + detailContid).length == 1 && $('#' + detailContid).hasClass('dashboard-tab')) {
|
||||
type = `Unibase.Themes.Compact.Components.WalkThrough.Instance().${LayoutName}()`;
|
||||
data = eval(type);
|
||||
}
|
||||
else if ($('#' + listContid).length == 1) {
|
||||
type = `Unibase.Themes.Compact.Components.WalkThrough.Instance().app()`;
|
||||
data = eval(type);
|
||||
}
|
||||
}
|
||||
else if (Unibase.Themes.Providers.DetailHelper.installedAppId != 0) {
|
||||
type = `Unibase.Themes.Compact.Components.WalkThrough.Instance().details()`;
|
||||
data = eval(type);
|
||||
}
|
||||
if (JSONdata.dashboards.IsEnabled == false) {
|
||||
data.splice(data.findIndex(obj => obj.title == 'DashBoard'), 1);
|
||||
}
|
||||
if (JSONdata.apps.IsEnabled == false) {
|
||||
data.splice(data.findIndex(obj => obj.title == "Apps"), 1);
|
||||
}
|
||||
if (JSONdata.reports.IsEnabled == false) {
|
||||
data.splice(data.findIndex(obj => obj.title == "Reports"), 1);
|
||||
}
|
||||
let _data = JSON.stringify(data);
|
||||
let script = '';
|
||||
script += `window.tour = new Tour({
|
||||
padding: 0,
|
||||
nextText: 'More',
|
||||
doneText: 'Finito',
|
||||
prevText: 'Less',
|
||||
tipClasses: 'tip-class active',
|
||||
steps:${_data}
|
||||
});
|
||||
$('#bizgaze_body').css('pointer-events', 'none').find('.hk-wrapper').css('z-index','0');
|
||||
tour.override('showStep', function(self, step) {
|
||||
self(step);
|
||||
$('.ttour-header').addClass('d-flex justify-content-between align-items-center').find('h1').addClass('list-item-main-title');
|
||||
$('.ttour-header').append('<a href="javascript:;" onclick="tour.end()" title="skip" class="btn btn-flush-biz-theme btn-icon btn-rounded flush-soft-hover"><span class="btn-icon-wrap"><i class="fa fa-fast-forward" ></span></i></a>');
|
||||
$('.ttour-footer button').addClass('btn btn-flush-biz-theme btn-icon btn-rounded flush-soft-hover shadow-none');
|
||||
$('.ttour-footer .next').html('<span class="btn-icon-wrap" title="Next"><i class="font-20 la la-angle-right"></i></span>')
|
||||
$('.ttour-footer .prev').html('<span class="btn-icon-wrap" title="Prev"><i class="font-20 la la-angle-left"></i></span>')
|
||||
$('.ttour-bullets').append('<span>(<span class="current_step"></span> Of <span class="total_steps"></span>)</span>');
|
||||
let noOfSteps = $('.ttour-bullet').length;
|
||||
let currentStep = $('.ttour-bullet.active').index() + 1;
|
||||
$('.current_step').html(currentStep);
|
||||
$('.total_steps').html(noOfSteps);
|
||||
})
|
||||
|
||||
tour.override('end', function(self, step) {
|
||||
self(step);
|
||||
$("#bizgaze_body").css("pointer-events", "auto").find('.hk-wrapper').removeAttr('style');
|
||||
})
|
||||
tour.start();
|
||||
if($('#layoutMainNavbar li.nav-group-container:not(.d-none)').length == 1){
|
||||
let offHeight = $("[data-target='#dash_drp']").offset().top - 15;
|
||||
// let innerHeight = $("[data-target='#dash_drp']").height() + 20;
|
||||
$('.ttour-tip.bottom').css('top', offHeight +'px');
|
||||
}`;
|
||||
eval(script);
|
||||
});
|
||||
}
|
||||
loadCommonFilterPanel(containerid) {
|
||||
const indexInstance = Unibase.Themes.Compact.Components.Index.Instance();
|
||||
$(`#bizCmnFilterDp_${containerid}`).removeClass('show');
|
||||
$(`#filter_toggle_btn${containerid}`).removeClass('d-flex').addClass('d-none');
|
||||
$(`#dynamic-filters${containerid}`).empty();
|
||||
$('.biz-pg-wrapper').first().addClass('has-cmn-filter-panel');
|
||||
$('#bizCmnFilterPanel').html(`<div class="cmn-filter-panel-wrap h-100 d-flex flex-column pa-0"><div class="cmn-filter-panel-head d-flex justify-content-between align-items-center border-bottom pa-10"><span class="cmn-filter-panel-head-title biz-secondary-text-color font-16">Common Filters</span><a href="javascript:void(0);" id="cmnFilterPanelClose" class="cmn-filter-panel-close btn btn-icon btn-flush-danger btn-rounded flush-soft-hover h-30p w-30p" onclick="Unibase.Themes.Compact.Components.Dashboard.Instance().closeCmnFilterPanel('${containerid}');" data-tooltip="true" title="Unpin Filters"><span class="btn-icon-wrap"><img src="tenants/themes/compact/imgs/unpin.png" class="img-fluid w-75" style="padding:3px;"/></span></a></div><div data-simplebar id="cmnFilterPanelBodyWrap" class="simple-scroll-bar cmn-filter-panel-body-wrap flex-grow-1"><div class="cmn-filter-panel-body cmn-filters-body pb-10" id="dynamic-filters_CmnFilterPanel_${containerid}"></div></div><div class="cmn-filter-panel-footer pa-10 pb-15 border-top" id="commonfilter_footerbuttons_CmnFilterPanel_${containerid}"></div>`).addClass('show');
|
||||
if (indexInstance.isTopLeftLayout()) {
|
||||
$('.biz-layout-3-top-navbar,.biz-layout-3-biz-pg-wrapper').addClass('hk-nav-toggle');
|
||||
$('.biz-layout-3-left-nav').addClass('biz__nav__toggle');
|
||||
}
|
||||
const portletId = +$("#hf_PortletId").val();
|
||||
Unibase.Platform.Analytics.Components._CommonFilter.Instance().commonFilter(portletId, `_CmnFilterPanel_${containerid}`);
|
||||
setTimeout(() => {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().showHideFilterNavIcons(containerid);
|
||||
}, 400);
|
||||
}
|
||||
closeCmnFilterPanel(containerid) {
|
||||
const indexInstance = Unibase.Themes.Compact.Components.Index.Instance();
|
||||
$('.biz-pg-wrapper').first().removeClass('has-cmn-filter-panel');
|
||||
$('#bizCmnFilterPanel').empty().removeClass('show');
|
||||
$(`.common-filter-dp-btn`).removeClass('d-none').addClass('d-flex');
|
||||
$('.common-filter-dropdown-body').removeClass('d-none');
|
||||
if (indexInstance.isTopLeftLayout()) {
|
||||
}
|
||||
let cls_fnav = $("#bizgaze_body").find('.biz-layout-3-top-navbar').hasClass("hk-nav-toggle");
|
||||
let cls_nav = $("#bizgaze_body").find('.biz-layout-3-top-navbar').hasClass("biz__nav__toggle");
|
||||
if (cls_fnav == true && cls_nav == false) {
|
||||
$('.biz-layout-3-top-navbar,.biz-layout-3-biz-pg-wrapper').removeClass('hk-nav-toggle');
|
||||
}
|
||||
setTimeout(() => {
|
||||
Unibase.Themes.Compact.Components.Nav.Instance().showHideFilterNavIcons(containerid);
|
||||
}, 400);
|
||||
}
|
||||
static Instance() {
|
||||
return new Dashboard();
|
||||
}
|
||||
}
|
||||
Dashboard.inputparameters = {};
|
||||
Components.Dashboard = Dashboard;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+66
File diff suppressed because one or more lines are too long
@@ -0,0 +1,335 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class WalkThrough {
|
||||
constructor() {
|
||||
this.dashboardObj = {
|
||||
des: 'You can view your Dashboard Groups and Dashboards here',
|
||||
title: "DashBoard"
|
||||
};
|
||||
this.reportObj = {
|
||||
des: 'You can view your Report Groups and Reports list here',
|
||||
title: "Reports",
|
||||
};
|
||||
this.appObj = {
|
||||
des: 'You can view your App Groups and Apps list here',
|
||||
title: "Apps",
|
||||
};
|
||||
this.dateObj = {
|
||||
des: 'Select the default date range that need to applied for Dashboards and Reports',
|
||||
title: "Date Filter",
|
||||
};
|
||||
this.branchObj = {
|
||||
des: 'You can switch your Branch ,Fisical Year and Data access related information',
|
||||
title: "Branch",
|
||||
};
|
||||
this.notificationsObj = {
|
||||
des: 'You can view your related notifcations list and clear them',
|
||||
title: "Notifications",
|
||||
};
|
||||
this.taskObj = {
|
||||
des: 'You can view your related tasks and manage them',
|
||||
title: "Tasks",
|
||||
};
|
||||
this.profileObj = {
|
||||
des: 'To view your Profile info, Application Help ,Themes and User Logoff',
|
||||
title: "Profile",
|
||||
};
|
||||
this.dashboardSettingsObj = {
|
||||
des: 'You can configure dashboard layout here and manage dashboard permissions to the users',
|
||||
title: "Dashbaord Settings",
|
||||
};
|
||||
this.commonFiltersObj = {
|
||||
des: 'You can select filters to be applied to a Dashbaord',
|
||||
title: "Common filters",
|
||||
};
|
||||
}
|
||||
LeftNavigation() {
|
||||
let steps = [{
|
||||
element: '[data-buttontype="nav-button-dashboards"]',
|
||||
title: this.dashboardObj.title,
|
||||
description: this.dashboardObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '[data-buttontype="nav-button-apps"]',
|
||||
title: this.appObj.title,
|
||||
description: this.appObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '[data-buttontype="nav-button-reports"]',
|
||||
title: this.reportObj.title,
|
||||
description: this.reportObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '[title="Dashboard Settings"]',
|
||||
title: this.dashboardSettingsObj.title,
|
||||
description: this.dashboardSettingsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Common Filters"]',
|
||||
title: this.commonFiltersObj.title,
|
||||
description: this.commonFiltersObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#right_side_menu_userdetails',
|
||||
title: this.profileObj.title,
|
||||
description: this.profileObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#navCmnDateFilterDp',
|
||||
title: this.dateObj.title,
|
||||
description: this.dateObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '.usertheme',
|
||||
title: 'Theme',
|
||||
description: 'You can choose your theme here.',
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '.right-side-menu-content-wrap #lnk_nav_changebranch',
|
||||
title: this.branchObj.title,
|
||||
description: this.branchObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Notifications"]',
|
||||
title: this.notificationsObj.title,
|
||||
description: this.notificationsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Tasks"]',
|
||||
title: this.taskObj.title,
|
||||
description: this.taskObj.des,
|
||||
position: "left"
|
||||
},
|
||||
];
|
||||
return steps;
|
||||
}
|
||||
TopNavigation() {
|
||||
let steps = [{
|
||||
element: '.nav-dashboards-item',
|
||||
title: this.dashboardObj.title,
|
||||
description: this.dashboardObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '.nav-apps-item',
|
||||
title: this.appObj.title,
|
||||
description: this.appObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '.nav-reports-item',
|
||||
title: this.reportObj.title,
|
||||
description: this.reportObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '#report-daterange_navCmnDateFilter-0',
|
||||
title: this.dateObj.title,
|
||||
description: this.dateObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#lnk_nav_changebranch',
|
||||
title: this.branchObj.title,
|
||||
description: this.branchObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Notifications"]',
|
||||
title: this.notificationsObj.title,
|
||||
description: this.notificationsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Tasks"]',
|
||||
title: this.taskObj.title,
|
||||
description: this.taskObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#nav-profile-dropdown',
|
||||
title: this.profileObj.title,
|
||||
description: this.profileObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Dashboard Settings"]',
|
||||
title: this.dashboardSettingsObj.title,
|
||||
description: this.dashboardSettingsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Common Filters"]',
|
||||
title: this.commonFiltersObj.title,
|
||||
description: this.commonFiltersObj.des,
|
||||
position: "left"
|
||||
},
|
||||
];
|
||||
return steps;
|
||||
}
|
||||
TopandLeftNavigation() {
|
||||
let steps = [{
|
||||
element: '.nav-dashboards-item',
|
||||
title: this.dashboardObj.title,
|
||||
description: this.dashboardObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '.nav-apps-item',
|
||||
title: this.appObj.title,
|
||||
description: this.appObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '.nav-reports-item',
|
||||
title: this.reportObj.title,
|
||||
description: this.reportObj.des,
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '#report-daterange_navCmnDateFilter-0',
|
||||
title: this.dateObj.title,
|
||||
description: this.dateObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#lnk_nav_changebranch',
|
||||
title: this.branchObj.title,
|
||||
description: this.branchObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Notifications"]',
|
||||
title: this.notificationsObj.title,
|
||||
description: this.notificationsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Tasks"]',
|
||||
title: this.taskObj.title,
|
||||
description: this.taskObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#nav-profile-dropdown',
|
||||
title: this.profileObj.title,
|
||||
description: this.profileObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Dashboard Settings"]',
|
||||
title: this.dashboardSettingsObj.title,
|
||||
description: this.dashboardSettingsObj.des,
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="Common Filters"]',
|
||||
title: this.commonFiltersObj.title,
|
||||
description: this.commonFiltersObj.des,
|
||||
position: "left"
|
||||
},
|
||||
];
|
||||
return steps;
|
||||
}
|
||||
app() {
|
||||
let steps = [{
|
||||
element: '.report-title-dp-wrapper',
|
||||
title: "App Report",
|
||||
description: 'To View connected reports of the app.',
|
||||
position: "right"
|
||||
},
|
||||
{
|
||||
element: '#ListSearch',
|
||||
title: "Search",
|
||||
description: 'You can search the app realted information by entering keywords.',
|
||||
position: "right"
|
||||
},
|
||||
{
|
||||
element: '[title="Dynamic Filters"]',
|
||||
title: "Dynamic Filters",
|
||||
description: 'You can apply filters here to load relevant data.',
|
||||
position: "right"
|
||||
},
|
||||
{
|
||||
element: '.create-btn',
|
||||
title: "Create",
|
||||
description: 'You can click here to open new creation form.',
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '[title="More"]',
|
||||
title: "App More",
|
||||
description: 'To open connected child Apps and Manage more settings of the app like notifications, permissions, Stages and other settings.',
|
||||
position: "left"
|
||||
}
|
||||
];
|
||||
steps = steps.filter(function (e) {
|
||||
return $(e.element).is(":visible") == true;
|
||||
});
|
||||
return steps;
|
||||
}
|
||||
details() {
|
||||
let steps = [
|
||||
{
|
||||
element: '.btnChangeStage',
|
||||
title: "Stages",
|
||||
description: 'You can click here to update stage of the record.',
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '.Detail_Configurations_' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId() + ' a[onclick*="loadForm("]',
|
||||
title: "Edit",
|
||||
description: 'You can click here to edit the current record.',
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '.select.div_configurationsetting',
|
||||
title: "More",
|
||||
description: 'You can click here to view more options.',
|
||||
position: "left"
|
||||
},
|
||||
{
|
||||
element: '#layout-detail-tabs',
|
||||
title: "Tabs",
|
||||
description: 'You can switch tabs here to view relevant data.',
|
||||
position: "bottom"
|
||||
},
|
||||
{
|
||||
element: '#detail-close',
|
||||
title: "Back",
|
||||
description: 'You can click here to load previous page.',
|
||||
position: "right"
|
||||
}
|
||||
];
|
||||
steps = steps.filter(function (e) {
|
||||
return $(e.element).is(":visible") == true;
|
||||
});
|
||||
return steps;
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new Unibase.Themes.Compact.Components.WalkThrough;
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Components.WalkThrough = WalkThrough;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"walkthrough.js","sourceRoot":"","sources":["walkthrough.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA0HhB;AA1HD,WAAU,OAAO;IACb,IAAiB,MAAM,CAwHtB;IAxHD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAsHvB;QAtHD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAoH1B;YApHD,WAAiB,UAAU;gBACvB,MAAa,WAAW;oBAEpB,cAAc;wBACV,IAAI,KAAK,GAAG,CAAC;gCACO,OAAO,EAAE,wBAAwB;gCACjC,KAAK,EAAE,WAAW;gCAClB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,OAAO;6BACpB;4BACD;gCACI,OAAO,EAAE,kBAAkB;gCAC3B,KAAK,EAAE,MAAM;gCACb,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,OAAO;6BACpB;4BACD;gCACI,OAAO,EAAE,qBAAqB;gCAC9B,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,OAAO;6BACpB;4BACD;gCACI,OAAO,EAAE,wBAAwB;gCACjC,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,KAAK;6BAClB;4BACD;gCACI,OAAO,EAAE,8BAA8B;gCACvC,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,MAAM;6BACnB;yBACJ,CAAC;wBACd,OAAO,KAAK,CAAC;oBACjB,CAAC;oBAED,aAAa;wBACT,IAAI,KAAK,GAAG,CAAC;gCACO,OAAO,EAAE,sBAAsB;gCAC/B,KAAK,EAAE,WAAW;gCAClB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,gBAAgB;gCACzB,KAAK,EAAE,MAAM;gCACb,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,mBAAmB;gCAC5B,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,uBAAuB;gCAChC,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,MAAM;6BACnB;4BACD;gCACI,OAAO,EAAE,qBAAqB;gCAC9B,KAAK,EAAE,aAAa;gCACpB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,MAAM;6BACnB;yBACJ,CAAC;wBACd,OAAO,KAAK,CAAC;oBAEjB,CAAC;oBAED,oBAAoB;wBACQ,IAAI,KAAK,GAAG,CAAC;gCACjB,OAAO,EAAE,mCAAmC;gCAC5C,KAAK,EAAE,WAAW;gCAClB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,6BAA6B;gCACtC,KAAK,EAAE,MAAM;gCACb,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,gCAAgC;gCACzC,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,QAAQ;6BACrB;4BACD;gCACI,OAAO,EAAE,oCAAoC;gCAC7C,KAAK,EAAE,cAAc;gCACrB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,MAAM;6BACnB;4BACD;gCACI,OAAO,EAAE,kCAAkC;gCAC3C,KAAK,EAAE,aAAa;gCACpB,WAAW,EAAE,gBAAgB;gCAC7B,QAAQ,EAAE,MAAM;6BACnB;yBACJ,CAAC;wBACd,OAAO,KAAK,CAAC;oBAEjB,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;wBACvE,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBAlHY,sBAAW,cAkHvB,CAAA;YACL,CAAC,EApHgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAoH1B;QACL,CAAC,EAtHgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAsHvB;IACL,CAAC,EAxHgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAwHtB;AACL,CAAC,EA1HS,OAAO,KAAP,OAAO,QA0HhB"}
|
||||
@@ -0,0 +1,52 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Wizard {
|
||||
wizardApp() {
|
||||
let instance = this;
|
||||
let html = ` <!--Wizard div start popup -->
|
||||
<a href="javascript:;" class="btn btn-sm btn-primary hidden" data-toggle="modal" data-target="#wizard-multi-step"></a>
|
||||
<div id="wizard-multi-step" class="multi-step" data-wizard="Multi-step-form">
|
||||
</div><!--Wizard div end popup -->`;
|
||||
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
|
||||
let result = Unibase.Themes.Compact.Components.Index.Instance().currentTheme;
|
||||
let css = `<style id="wizard"> .multi-step .modal-header .modal-steps .step.completed .dot:before { background: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.current .dot {border-color: ${result.primaryColor} !important;} .multi-step .modal-header .modal-steps .step.completed:after { border-color: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.current:after { border-color: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.completed .dot { border-color: ${result.primaryColor} !important; }
|
||||
</style>`;
|
||||
$('head').append(css);
|
||||
$('#bizgaze_body').after(html);
|
||||
_fileCacheHelper.loadJsFile("libs/wizard/js/MultiStep.js", function () {
|
||||
_fileCacheHelper.loadCssFiles(["libs/wizard/css/MultiStep.min.css", "libs/wizard/css/MultiStep-theme.min.css"], null);
|
||||
eval(`$(document).ready(function () {
|
||||
$('.modal').MultiStep({
|
||||
data:[{
|
||||
label:'Company Details',
|
||||
content:'<ul class="d-flex flex-column font-weight-600"><li class="d-flex flex-column li_CompanyName pt-1 pb-20" id="li_CompanyName"><label for="txt_companyName" class="" id="lbl">Company Name<span class="text-danger"> *</span></label> <input type="text" id="txt_companyName" class="form-control floating-label-control shadow-none" placeholder="Company Name *" data-placeholder="Enter Company Name" data-validatename="Company Name" data-label="Company Name *"></li><li class="d-flex flex-column li_ShortCode pt-1 pb-20" id="li_ShortCode"><label for="txt_cmpyShortCode" class="" id="lbl">Company Short Code<span class="text-danger"> *</span></label> <input type="text" id="txt_cmpyShortCode" class="form-control floating-label-control shadow-none" placeholder="Company Short Code *" data-placeholder="Enter Company Short Code" data-validatename="Company Short Code" data-label="Company Short Code *"></li><li class="d-flex flex-column li_gst-number pt-1 pb-20" id="li_gst-number"><label for="txt_gstNumber" class="" id="lbl">GST Number<span class="text-danger"> *</span></label> <input type="text" id="txt_gstNumber" class="form-control floating-label-control shadow-none" placeholder="GST Number *" data-placeholder="Enter GST Number" data-validatename="GST Number" data-label="GST Number *"></li><li><ul class="p-2 d-flex flex-column"><li><p class="font-16 text-center text-dark">Upload Company Logo</p></li><li class="d-flex flex-column mx-auto"><div class="file position-relative d-flex justify-content-center mt-2" id="div_logo-File"><label for="txt_logoFile" id="lbl_logo" class="d-flex "><span class="w-50p"><img src="tenants/themes/compact/imgs/cloud.svg" class="img-fluid"></span></label><input type="file" class="d-none" id="txt_logoFile"></div><div style="margin-top:-15px;"><span class="text-dark" id="lblLogoFileName"></span><span class="text-dark hidden" for="txt_logoFile" id="lbl-logo-path"></span><input type="hidden" id="hf_logoPath" value=""></div></li></ul></li></ul>'
|
||||
},{
|
||||
label:'Address Details',
|
||||
content:'<ul class="d-flex flex-column"><li class="d-flex flex-column li_BranchName pt-1 pb-20" id="li_BranchName"><label for="txt_BranchName" class="font-weight-600" id="lbl">Branch Name<span class="text-danger"> *</span></label> <input type="text" id="txt_BranchName" class="form-control floating-label-control shadow-none" placeholder="Branch Name *" data-placeholder="Enter Branch Name" data-validatename="Branch Name" data-label="Branch Name *"></li><li class="d-flex flex-column li_ShortCode pt-1 pb-20" id="li_ShortCode"><label for="txt_ShortCode" class="font-weight-600" id="lbl">Short Code<span class="text-danger"> *</span></label> <input type="text" id="txt_ShortCode" class="form-control floating-label-control shadow-none" placeholder="Short Code *" data-placeholder="Enter Short Code" data-validatename="Short Code" data-label="Short Code *"></li><li class="d-flex flex-column li_Address pt-1 pb-20" id="li_Address"><label for="txt_Address" class="font-weight-600" id="lbl">Address<span class="text-danger"> *</span></label> <input type="text" id="txt_Address" class="form-control floating-label-control shadow-none" placeholder="Address *" data-placeholder="Enter Address" data-validatename="Address" data-label="Address *"></li><li><ul class="d-flex justify-content-between"><li class="d-flex flex-column li_CityName pt-1 pb-20 mr-20" id="li_CityName"><label for="txt_CityName" class="font-weight-600" id="lbl">City Name<span class="text-danger"> *</span></label> <input type="text" id="txt_CityName" class="form-control floating-label-control shadow-none" placeholder="City Name *" data-placeholder="Enter City Name" data-validatename="City Name" data-label="City Name *"></li><li class="d-flex flex-column li_PinCode pt-1 pb-20" id="li_PinCode"><label for="txt_PinCode" class="font-weight-600" id="lbl">Pin-Code<span class="text-danger"> *</span></label> <input type="text" id="txt_PinCode" class="form-control floating-label-control shadow-none" placeholder="Pin Code *" data-placeholder="Enter Pin Code" data-validatename="Pin Code" data-label="Pin Code *"></li></ul></li></ul>'
|
||||
}],
|
||||
finalLabel:'Confirmation',
|
||||
final:'<ul class="w-100 d-flex align-items-center flex-column justify-content-center"><li class="w-100 d-flex justify-content-center"><i class="fa-4x fa fa-check-circle text-success"></i></li><li class="mt-20 mb-1 text-center">Your Company information is successfully updated for more help<a class="ml-1" href="javascript:;">Click here</a></li></ul>',
|
||||
modalSize:'md'
|
||||
});
|
||||
$('[data-target="#wizard-multi-step"]').click();
|
||||
});`);
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new Unibase.Themes.Compact.Components.Wizard;
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Components.Wizard = Wizard;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
//# sourceMappingURL=wizard.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["wizard.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA+ChB;AA/CD,WAAU,OAAO;IACb,IAAiB,MAAM,CA6CtB;IA7CD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA2CvB;QA3CD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAyC1B;YAzCD,WAAiB,UAAU;gBACvB,MAAa,MAAM;oBACf,SAAS;wBACL,IAAI,QAAQ,GAAG,IAAI,CAAC;wBACpB,IAAI,IAAI,GAAG;;;uCAGI,CAAC;wBAChB,IAAI,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;wBAC3E,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC;wBAC7E,IAAI,GAAG,GAAG,wGAAwG,MAAM,CAAC,YAAY,0FAA0F,MAAM,CAAC,YAAY,8FAA8F,MAAM,CAAC,YAAY,4FAA4F,MAAM,CAAC,YAAY,6FAA6F,MAAM,CAAC,YAAY;4CAC9iB,CAAC;wBACrB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBACtB,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBAC/B,gBAAgB,CAAC,UAAU,CAAC,6BAA6B,EAAE;4BACvD,gBAAgB,CAAC,YAAY,CAAC,CAAC,mCAAmC,EAAE,yCAAyC,CAAC,EAAE,IAAI,CAAC,CAAC;4BACrH,IAAI,CAAC;;;;;;;;;;;;;;oCAcE,CAAC,CAAC;wBACd,CAAC,CAAC,CAAC;oBAEP,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;wBAClE,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBAvCY,iBAAM,SAuClB,CAAA;YACL,CAAC,EAzCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAyC1B;QACL,CAAC,EA3CgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA2CvB;IACL,CAAC,EA7CgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA6CtB;AACL,CAAC,EA/CS,OAAO,KAAP,OAAO,QA+ChB"}
|
||||
@@ -0,0 +1,65 @@
|
||||
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) {
|
||||
let Wizard;
|
||||
(function (Wizard) {
|
||||
let Manager;
|
||||
(function (Manager) {
|
||||
class WizardManager extends Unibase.Platform.Core.BaseManager {
|
||||
getCityName() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/cities/crm/cityautocomplete';
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
saveCompanyDetails(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/crm/Companies/updatecompanydetails';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
saveBranchDetails(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = '/apis/v4/bizgaze/crm/Branches/updateBranchdetails';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new WizardManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Manager.WizardManager = WizardManager;
|
||||
})(Manager = Wizard.Manager || (Wizard.Manager = {}));
|
||||
})(Wizard = Compact.Wizard || (Compact.Wizard = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"wizardmanager.js","sourceRoot":"","sources":["wizardmanager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAU,OAAO,CA6ChB;AA7CD,WAAU,OAAO;IACb,IAAiB,MAAM,CA2CtB;IA3CD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAyCvB;QAzCD,WAAiB,OAAO;YACpB,IAAiB,MAAM,CAsCtB;YAtCD,WAAiB,MAAM;gBACnB,IAAiB,OAAO,CAoCvB;gBApCD,WAAiB,OAAO;oBACpB,MAAa,aAAc,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW;wBAClD,WAAW;;gCACb,MAAM,GAAG,GAAG,6CAA6C,CAAC;gCAC1D,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;oCAChE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;wCACzB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;qCACjD;oCACD,OAAO,QAAQ,CAAC;gCACpB,CAAC,CAAC,CAAC;4BACP,CAAC;yBAAA;wBACK,kBAAkB,CAAC,GAAyD;;gCAC9E,MAAM,GAAG,GAAG,oDAAoD,CAAC;gCACjE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;oCACtE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE;wCAC1B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;qCACjD;oCACD,OAAO,QAAQ,CAAC;gCACpB,CAAC,CAAC,CAAC;4BACP,CAAC;yBAAA;wBACK,iBAAiB,CAAC,GAAwD;;gCAC5E,MAAM,GAAG,GAAG,mDAAmD,CAAC;gCAChE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;oCACtE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE;wCAC1B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;qCACjD;oCACD,OAAO,QAAQ,CAAC;gCACpB,CAAC,CAAC,CAAC;4BACP,CAAC;yBAAA;wBAED,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;gCAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;4BACzC,OAAO,IAAI,CAAC,SAAS,CAAC;wBAC1B,CAAC;qBACJ;oBAlCY,qBAAa,gBAkCzB,CAAA;gBACL,CAAC,EApCgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAoCvB;YACL,CAAC,EAtCgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAsCtB;QAEL,CAAC,EAzCgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAyCvB;IACL,CAAC,EA3CgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA2CtB;AACL,CAAC,EA7CS,OAAO,KAAP,OAAO,QA6ChB"}
|
||||
@@ -0,0 +1,21 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Wizard;
|
||||
(function (Wizard) {
|
||||
let Request;
|
||||
(function (Request) {
|
||||
class CompanyDetails {
|
||||
}
|
||||
Request.CompanyDetails = CompanyDetails;
|
||||
class BranchDetails {
|
||||
}
|
||||
Request.BranchDetails = BranchDetails;
|
||||
})(Request = Wizard.Request || (Wizard.Request = {}));
|
||||
})(Wizard = Compact.Wizard || (Compact.Wizard = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"wizardrequest.js","sourceRoot":"","sources":["wizardrequest.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAuBhB;AAvBD,WAAU,OAAO;IACb,IAAiB,MAAM,CAqBtB;IArBD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAmBvB;QAnBD,WAAiB,OAAO;YACpB,IAAiB,MAAM,CAiBtB;YAjBD,WAAiB,MAAM;gBACnB,IAAiB,OAAO,CAevB;gBAfD,WAAiB,OAAO;oBACpB,MAAa,cAAc;qBAI1B;oBAJY,sBAAc,iBAI1B,CAAA;oBACD,MAAa,aAAa;qBAQzB;oBARY,qBAAa,gBAQzB,CAAA;gBACL,CAAC,EAfgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAevB;YACL,CAAC,EAjBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAiBtB;QACL,CAAC,EAnBgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAmBvB;IACL,CAAC,EArBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAqBtB;AACL,CAAC,EAvBS,OAAO,KAAP,OAAO,QAuBhB"}
|
||||
@@ -0,0 +1,275 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
let Wizard;
|
||||
(function (Wizard_1) {
|
||||
class Wizard {
|
||||
constructor() {
|
||||
this.logoFileData = {};
|
||||
}
|
||||
wizardApp() {
|
||||
let instance = this;
|
||||
let html = ` <!--Wizard div start popup -->
|
||||
<a href="javascript:;" class="btn btn-sm btn-primary hidden" data-toggle="modal" data-target="#wizard-multi-step"></a>
|
||||
<div id="wizard-multi-step" class="multi-step" data-wizard="Multi-step-form">
|
||||
</div><!--Wizard div end popup -->`;
|
||||
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
|
||||
let result = Unibase.Themes.Compact.Components.Index.Instance().currentTheme;
|
||||
let css = `<style id="wizard"> .multi-step .modal-header .modal-steps .step.completed .dot:before { background: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.current .dot {border-color: ${result.primaryColor} !important;} .multi-step .modal-header .modal-steps .step.completed:after { border-color: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.current:after { border-color: ${result.primaryColor} !important; }.multi-step .modal-header .modal-steps .step.completed .dot { border-color: ${result.primaryColor} !important; }
|
||||
</style>`;
|
||||
$('head').append(css);
|
||||
$('#bizgaze_body + [data-target="#wizard-multi-step"]').remove();
|
||||
$('#bizgaze_body + [id="wizard-multi-step"]').remove();
|
||||
$('#bizgaze_body').after(html);
|
||||
_fileCacheHelper.loadJsFile("libs/wizard/js/MultiStep.js", function () {
|
||||
_fileCacheHelper.loadCssFiles(["libs/wizard/css/MultiStep.min.css", "libs/wizard/css/MultiStep-theme.min.css"], null);
|
||||
eval(`$(document).ready(function () {
|
||||
$('#wizard-multi-step').MultiStep({
|
||||
data:[{
|
||||
label:'Company Details',
|
||||
content:'<ul class="d-flex flex-column"><li class="d-flex flex-column li_CompanyName pt-1 pb-20" id="li_CompanyName"><label for="txt_companyName" class="" id="lbl">Company Name<span class="text-danger"> *</span></label> <input type="text" id="txt_companyName" class="form-control floating-label-control shadow-none" data-validation="true" placeholder="Company Name *" data-placeholder="Enter Company Name" data-validatename="Company Name" data-label="Company Name *" required></li><li class="d-flex flex-column li_ShortCode pt-1 pb-20" id="li_ShortCode"><label for="txt_cmpyShortCode" class="" id="lbl">Company Short Code<span class="text-danger"> *</span></label> <input type="text" id="txt_cmpyShortCode" class="form-control floating-label-control shadow-none" placeholder="Company Short Code *" data-validation="true" data-placeholder="Enter Company Short Code" data-validatename="Company Short Code" data-label="Company Short Code *" required></li><li class="d-flex flex-column li_gst-number pt-1 pb-20" id="li_gst-number"><label for="txt_gstNumber" class="" id="lbl">GST Number<span class="text-danger"> *</span></label> <input type="text" id="txt_gstNumber" class="form-control floating-label-control shadow-none" data-validation="true" placeholder="GST Number *" data-placeholder="Enter GST Number" data-validatename="GST Number" data-label="GST Number *" required maxlength="15"></li><li><ul class="p-2 d-flex flex-column"><li><p class="font-16 text-center text-dark">Upload Company Logo</p></li><li class="d-flex flex-column mx-auto" onchange="Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().uploadlogo(this);"><div class="file position-relative d-flex justify-content-center mt-2" id="div_logo-File"><label for="txt_logoFile" id="lbl_logo" class="d-flex "><span class="w-50p"><img src="tenants/themes/compact/imgs/cloud.svg" class="img-fluid"></span></label><input type="file" class="d-none" id="txt_logoFile"></div><div style="margin-top:-15px;"><span class="text-dark" id="lblLogoFileName"></span><span class="text-dark hidden" for="txt_logoFile" id="lbl-logo-path"></span><input type="hidden" id="hf_logoPath" value=""></div></li></ul></li></ul>'
|
||||
},{
|
||||
label:'Address Details',
|
||||
content:'<ul class="d-flex flex-column"><li class="d-flex flex-column li_BranchName pt-1 pb-20" id="li_BranchName"><label for="txt_BranchName" class="" id="lbl">Branch Name<span class="text-danger"> *</span></label> <input type="text" id="txt_BranchName" class="form-control floating-label-control shadow-none" data-validation="true" placeholder="Branch Name *" data-placeholder="Enter Branch Name" data-validatename="Branch Name" data-label="Branch Name *"></li><li class="d-flex flex-column li_ShortCode pt-1 pb-20" id="li_ShortCode"><label for="txt_ShortCode" class="" id="lbl">Short Code<span class="text-danger"> *</span></label> <input type="text" id="txt_ShortCode" class="form-control floating-label-control shadow-none" data-validation="true" placeholder="Short Code *" data-placeholder="Enter Short Code" data-validatename="Short Code" data-label="Short Code *"></li><li class="d-flex flex-column li_Address pt-1 pb-20" id="li_Address"><label for="txt_Address" class="" id="lbl">Address<span class="text-danger"> *</span></label> <input type="text" id="txt_Address" class="form-control floating-label-control shadow-none" placeholder="Address *" data-validation="true"data-placeholder="Enter Address" data-validatename="Address" data-label="Address *"></li><li><ul class="d-flex justify-content-between"><li class="w-45 d-flex flex-column li_CityName pt-1 pb-20 mr-20" id="li_CityName"><label for="txt_CityName" class="" id="lbl">City Name<span class="text-danger"> *</span></label> <select type="text" id="txt_CityName" class="form-control floating-label-control shadow-none" data-validation="true" placeholder="City Name *" data-placeholder="Enter City Name" data-validatename="City Name" data-label="City Name *"></select></li><li class="w-45 d-flex flex-column li_PinCode pt-1 pb-20" id="li_PinCode"><label for="txt_PinCode" class="" id="lbl">Pin-Code<span class="text-danger"> *</span></label> <input type="number" id="txt_PinCode" class="form-control floating-label-control shadow-none" placeholder="Pin Code *" data-validation="true" data-placeholder="Enter Pin Code" data-validatename="Pin Code" min="0" max="6" data-label="Pin Code *"></li></ul></li></ul>'
|
||||
}],
|
||||
finalLabel:'Confirmation',
|
||||
final:'<ul class="w-100 d-flex align-items-center flex-column justify-content-center"><li class="w-100 d-flex justify-content-center"><i class="fa-4x fa fa-check-circle text-success"></i></li><li class="mt-20 mb-1 text-center">Your Company information is successfully updated for more help<a class="ml-1" href="javascript:;">Click here</a></li></ul>',
|
||||
modalSize:'md'
|
||||
});
|
||||
Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().logoFileData = {};
|
||||
Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().autoComplete();
|
||||
$('[data-target="#wizard-multi-step"]').click();
|
||||
$('[data-isNext="true"]').on('click', function(){
|
||||
Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().validation();
|
||||
});
|
||||
Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().clickEvent();
|
||||
$('#txt_gstNumber').on('keydown', function(){
|
||||
$(this).addClass('text-uppercase');
|
||||
let gst_val = $(this).val();
|
||||
if(gst_val.length < 2){
|
||||
return numericOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 2) && (gst_val.length < 7)){
|
||||
return alphaOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 7) && (gst_val.length < 11)){
|
||||
return numericOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 11) && (gst_val.length < 12)){
|
||||
return alphaOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 12) && (gst_val.length < 13)){
|
||||
return numericOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 13) && (gst_val.length < 14)){
|
||||
return alphaOnly(event);
|
||||
}
|
||||
else if((gst_val.length >= 14) && (gst_val.length < 15)){
|
||||
return alphaNumeric(event);
|
||||
}
|
||||
})
|
||||
|
||||
function alphaOnly(event) {
|
||||
var key = event.keyCode;
|
||||
if(((key >= 65 && key <= 90) || key == 8) == false){
|
||||
MessageHelper.Instance().showError("Please Enter valid GST Number", "div_errroMessage");
|
||||
}
|
||||
else if((key >= 65 && key <= 90) || key == 8){
|
||||
if ($('#Bizgaze-messageInfo')) {
|
||||
$('#Bizgaze-messageInfo').click()
|
||||
}
|
||||
}
|
||||
return ((key >= 65 && key <= 90) || key == 8);
|
||||
};
|
||||
function numericOnly(event) {
|
||||
var key = event.keyCode;
|
||||
if(((key >= 47 && key <= 58) || key == 8 || (key > 95 && key < 106)) == false){
|
||||
MessageHelper.Instance().showError("Please Enter valid GST Number", "div_errroMessage");
|
||||
}
|
||||
else if((key >= 47 && key <= 58) || key == 8 || (key > 95 && key < 106)){
|
||||
if ($('#Bizgaze-messageInfo')) {
|
||||
$('#Bizgaze-messageInfo').click()
|
||||
}
|
||||
}
|
||||
return ((key > 47 && key < 58) || key == 8 || (key > 95 && key < 106));
|
||||
};
|
||||
function alphaNumeric(event) {
|
||||
var key = event.keyCode;
|
||||
return ((key > 47 && key < 58) || key == 8 || (key >= 65 && key <= 90));
|
||||
};
|
||||
});
|
||||
|
||||
`);
|
||||
});
|
||||
}
|
||||
validation() {
|
||||
let instance = Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().logoFileData;
|
||||
let validation = true;
|
||||
$('.step-content.active').find('[data-validation="true"]').each(function () {
|
||||
if ($(this).val() == '') {
|
||||
$(this).attr('style', 'border-bottom:1px solid rgb(251, 107, 91) !important');
|
||||
$(this).on('click', function () {
|
||||
$(this).attr('style', '');
|
||||
});
|
||||
validation = false;
|
||||
MessageHelper.Instance().showError("Please Enter manadatory", "div_errroMessage");
|
||||
}
|
||||
else if ($('.step-content.active').find('#div_logo-File').length > 0) {
|
||||
var regex = /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$/;
|
||||
if (instance == undefined || instance.FileData == undefined || instance.FileName == undefined) {
|
||||
validation = false;
|
||||
MessageHelper.Instance().showError("Please Upload Company Logo", "div_errroMessage");
|
||||
}
|
||||
else if (regex.test($("#txt_gstNumber").val().toString()) == false) {
|
||||
validation = false;
|
||||
MessageHelper.Instance().showError("Please Enter valid GST Number", "div_errroMessage");
|
||||
}
|
||||
}
|
||||
});
|
||||
if (validation) {
|
||||
if ($('#Bizgaze-messageInfo')) {
|
||||
$('#Bizgaze-messageInfo').click();
|
||||
}
|
||||
let i = Number($('.step-content.active').attr('data-step'));
|
||||
let j = i + 1;
|
||||
if (i == 3) {
|
||||
$('a.close-btn').click();
|
||||
Unibase.Platform.Membership.Infos.Identity.currentUser.settings.filter(function (x) { return x.settingName == "isloginfirsttime"; })[0].settingValue == false;
|
||||
Unibase.Themes.Compact.Components.Dashboard.Instance().appTourGuide();
|
||||
}
|
||||
if (i != 3) {
|
||||
$('[id="multi_Step-next"]').click();
|
||||
}
|
||||
}
|
||||
}
|
||||
uploadlogo(e) {
|
||||
let instance = this;
|
||||
const inputEl = document.getElementById('txt_logoFile');
|
||||
const fileType = inputEl.files[0].type.split('/').pop().toLowerCase();
|
||||
if (fileType != "jpeg" && fileType != "jpg" && fileType != "png" && fileType != "bmp" && fileType != "gif") {
|
||||
MessageHelper.Instance().showError('Please select a valid image file', 'layoutBuilderErrMsg');
|
||||
$("#logoUploadInput").val('');
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
const [file] = inputEl.files;
|
||||
let name;
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onloadend = function () {
|
||||
var base64String = reader.result.toString().replace(/^data:.+;base64,/, '');
|
||||
var fileReq = {
|
||||
FileData: base64String,
|
||||
FileName: inputEl.files[0].name,
|
||||
FileType: fileType,
|
||||
ByteData: null
|
||||
};
|
||||
instance.logoFileData = fileReq;
|
||||
$('[data-span_file="true"]').remove();
|
||||
$(inputEl).parents('#div_logo-File').after('<span data-span_file="true">' + inputEl.files[0].name + '</span>');
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
clickEvent() {
|
||||
let instance = this;
|
||||
instance.multiStep();
|
||||
$('#multi_Step-prev').on('click', function () {
|
||||
instance.multiStep();
|
||||
});
|
||||
}
|
||||
autoComplete() {
|
||||
Unibase.Themes.Compact.Wizard.Manager.WizardManager.Instance().getCityName().then(function (res) {
|
||||
let response = res.result, data = [];
|
||||
response.forEach(function (item, index) {
|
||||
data.push({ id: item.cityid, text: item.cityname });
|
||||
});
|
||||
$('#txt_CityName').select2({
|
||||
placeholder: "Select City",
|
||||
data: data
|
||||
});
|
||||
});
|
||||
}
|
||||
multiStep() {
|
||||
$('.step-content').each(function (index, item) {
|
||||
if (index == 0 && $(this).hasClass("active")) {
|
||||
$('#multi_Step-next').attr('onclick', 'Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().companyDetails()');
|
||||
}
|
||||
else if (index == 1 && $(this).hasClass("active")) {
|
||||
$('#multi_Step-next').attr('onclick', 'Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().BranchDetails()');
|
||||
}
|
||||
else if (index == 2 && $(this).hasClass("active")) {
|
||||
$('#multi_Step-next').attr('onclick', 'Unibase.Themes.Compact.Components.Wizard.Wizard.Instance().emptyMultiStep()');
|
||||
}
|
||||
});
|
||||
}
|
||||
emptyMultiStep() {
|
||||
$('a.close-btn').click();
|
||||
$('[id="wizard-multi-step"]').remove();
|
||||
$('[data-target="#wizard-multi-step"]').remove();
|
||||
}
|
||||
companyDetails() {
|
||||
let instance = this;
|
||||
if ($('#txt_companyName').val() != "" && $('#txt_cmpyShortCode').val() != "" && $('#txt_gstNumber').val() != 0) {
|
||||
let obj;
|
||||
obj = {
|
||||
CompanyName: $('#txt_companyName').val(),
|
||||
ShortCode: $('#txt_cmpyShortCode').val(),
|
||||
GstInNo: $('#txt_gstNumber').val(),
|
||||
FileName: instance.logoFileData.FileName,
|
||||
FileData: instance.logoFileData.FileData
|
||||
};
|
||||
Unibase.Themes.Compact.Wizard.Manager.WizardManager.Instance().saveCompanyDetails(obj).then(function (response) {
|
||||
if (response.status == 0) {
|
||||
instance.multiStep();
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.code, "div_errroMessage");
|
||||
$("p:nth-child(0)").addClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
}
|
||||
}
|
||||
BranchDetails() {
|
||||
let instance = this;
|
||||
console.log("Branch Details");
|
||||
let obj;
|
||||
obj = {
|
||||
AliasName: $('#txt_BranchName').val(),
|
||||
ShortCode: $('#txt_ShortCode').val(),
|
||||
PinCode: Number($('#txt_PinCode').val()),
|
||||
AddressName: $('#txt_Address').val(),
|
||||
CityName: $('#txt_CityName option:selected').text(),
|
||||
Addressline1: " ",
|
||||
CityId: Number($('#txt_CityName option:selected').val())
|
||||
};
|
||||
Unibase.Themes.Compact.Wizard.Manager.WizardManager.Instance().saveBranchDetails(obj).then(function (response) {
|
||||
if (response.status == 0) {
|
||||
instance.multiStep();
|
||||
}
|
||||
else {
|
||||
$('.step-content').removeClass('active');
|
||||
$("p:nth-child(1)").addClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new Unibase.Themes.Compact.Components.Wizard.Wizard;
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Wizard_1.Wizard = Wizard;
|
||||
})(Wizard = Components.Wizard || (Components.Wizard = {}));
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user