Iniit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class CustomDesign extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["bundle/index.kpi.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let html = '';
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div class="card h-160p"><ul class="h-100 d-flex justify-content-center align-items-center"><li class="d-flex justify-content-center font-34 font-weight-500"><span class="mx-2"><i class="la la-plus-circle"></i></span><span>Custom Design</span></li></ul></div>';
|
||||
}
|
||||
else {
|
||||
html = '<div class="col-12 DynamicHtml_' + containerid + '">' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().addCacheFiles(["platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/numberhelper/numberhelper.js"]);
|
||||
var Filter = [];
|
||||
var WidgetParameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
for (var w = 0; w < WidgetParameters.length; w++) {
|
||||
var ParameterName = WidgetParameters[w].Key;
|
||||
var ParameterValue = WidgetParameters[w].Value;
|
||||
Filter.push({
|
||||
ParameterName: ParameterName,
|
||||
ParameterValue: ParameterValue,
|
||||
ExpOp: Unibase.Platform.Core.Enums.ExpressionOperator.Equals
|
||||
});
|
||||
}
|
||||
let postdata = {
|
||||
ReportId: id[0].ReportId,
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
Filter: Filter,
|
||||
IsJson: true
|
||||
};
|
||||
Unibase.Platform.Analytics.Managers.ReportManager.Instance().getReportViewerData(postdata).then(function (res) {
|
||||
var templateScript = Handlebars.compile(id[0].StaticJsPath.replace(/\`/g, ''));
|
||||
var html = "";
|
||||
var data = JSON.parse(JSON.parse(res.result).Data);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
html += templateScript(data[i]);
|
||||
}
|
||||
$(".DynamicHtml_" + containerid).html(html);
|
||||
});
|
||||
$('.' + containerid).siblings('.line-loader').remove();
|
||||
$('.' + containerid).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new CustomDesign();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.CustomDesign = CustomDesign;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"customdesign.js","sourceRoot":"","sources":["customdesign.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAgFhB;AAhFD,WAAU,OAAO;IACb,IAAiB,MAAM,CA8EtB;IA9ED,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA4EvB;QA5ED,WAAiB,OAAO;YACpB,IAAiB,aAAa,CA0E7B;YA1ED,WAAiB,aAAa;gBAC1B,MAAa,YAAa,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,aAAa;oBASzD,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,CAAC,CAAC;oBAC5N,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,GAAG,EAAE,WAAW;wBACjB,IAAI,IAAI,GAAG,EAAE,CAAC;wBACd,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,KAAK,EAAE;4BACjC,IAAI,GAAG,qQAAqQ,CAAA;yBAC/Q;6BAAM;4BACH,IAAI,GAAG,iCAAiC,GAAG,WAAW,GAAG,IAAI;gCACzD,QAAQ,CAAC;yBAChB;wBAEA,OAAO,IAAI,CAAC;oBACjB,CAAC;oBAED,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ;wBAC1B,IAAI,QAAQ,GAAG,IAAI,CAAC;wBACpB,IAAI,MAAM,GAAG,EAAE,CAAC;wBAChB,IAAI,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;wBAEtJ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;4BAC9C,IAAI,aAAa,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;4BAC5C,IAAI,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;4BAC/C,MAAM,CAAC,IAAI,CAAC;gCACR,aAAa,EAAE,aAAa;gCAC5B,cAAc,EAAE,cAAc;gCAC9B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM;6BAC/D,CAAC,CAAA;yBACL;wBACD,IAAI,QAAQ,GAAG;4BACX,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ;4BACxB,IAAI,EAAE,CAAC;4BACP,QAAQ,EAAE,EAAE;4BACZ,MAAM,EAAE,MAAM;4BACd,MAAM,EAAE,IAAI;yBACf,CAAA;wBACD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG;4BACzG,IAAI,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;4BAC/E,IAAI,IAAI,GAAG,EAAE,CAAC;4BACd,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;4BACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gCAClC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;6BACnC;4BACD,CAAC,CAAC,eAAe,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAChD,CAAC,CAAC,CAAC;wBACH,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC;wBACvD,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;oBAG/C,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;wBACvC,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAxEY,0BAAY,eAwExB,CAAA;YACL,CAAC,EA1EgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA0E7B;QACL,CAAC,EA5EgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA4EvB;IACL,CAAC,EA9EgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA8EtB;AACL,CAAC,EAhFS,OAAO,KAAP,OAAO,QAgFhB"}
|
||||
@@ -0,0 +1,373 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class Default extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = "";
|
||||
if (id[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + id[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span class="biz-highlight-bg-color" id="hf-widget-title_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + id[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body py-0">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-30" id="widget_details_' + id[0].PortletWidgetId + '_col1">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col1 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col1"><ul class="list-group list-group-flush"><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Organization</span><span class="text-overflow text-right" title="shanvi">shanvi</span></li><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Cin</span><span class="text-overflow text-right" title="GCIN350">GCIN350</span></li></ul></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-30" id="widget_details_' + id[0].PortletWidgetId + '_col2">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col2 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col2"><ul class="list-group list-group-flush"><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Organization</span><span class="text-overflow text-right" title="shanvi">shanvi</span></li><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Cin</span><span class="text-overflow text-right" title="GCIN350">GCIN350</span></li></ul></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + id[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20 ml-5">' +
|
||||
'<span class="biz-highlight-bg-color" id="hf-widget-title_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + id[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body py-0">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-0" id="widget_details_' + id[0].PortletWidgetId + '_col1">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col1 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col1"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-0" id="widget_details_' + id[0].PortletWidgetId + '_col2">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col2 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col2"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this, list1 = '', list2 = '', count = 0, labelArray1 = [], labelArray2 = [];
|
||||
var result = response.result.Data;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
$("." + detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let iconhtml = '';
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let systemLock = Unibase.Themes.Compact.Components.Details.Instance().isSystemLock;
|
||||
if (!systemLock || (systemLock && response.result.AppConfiguration.ExcludeFromLock)) {
|
||||
if (response.result.AppConfiguration != null && response.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(response.result.AppConfiguration, response.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + response.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#div_detail_addnew_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, response.result.Data[0]);
|
||||
}
|
||||
$("#div_detail_addnew_" + portletwidgetid).html(iconhtml);
|
||||
var properties = response.result.DetailWidgetProperties;
|
||||
var titletoken = "";
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else
|
||||
var token = model.Value;
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength / 2);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
if (j == 0) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1 li:not(:first-child)').remove();
|
||||
}
|
||||
var replace = slicedarray[i];
|
||||
var data = null;
|
||||
if (result != null) {
|
||||
data = response.result.Data[0];
|
||||
}
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (response.result.Js != null || response.result.Js != "") {
|
||||
eval(response.result.Js);
|
||||
}
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == " " || token == "0 NA" || token == "0NA" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "01/01/1900 05:21:10" || token == "[object Object]" || token == "01/01/0001" || token == "0001/01/01" || token == "1901/01/01" || token == "01/01/1901" || token == "1901/01/01" || token == "01/01/1901" || token == "01/01/0001 12:01:00" || token == "01/01/0001 12:01" || token == "01/01/0001 00:00" || token == "01/01/0001 12:00:00 AM" || token == "01/01/0001 05:30:00 AM" || token == "0001-01-01T00:00:00") {
|
||||
token = "NA";
|
||||
}
|
||||
if (token == "true") {
|
||||
token = "True";
|
||||
}
|
||||
else if (token == "false") {
|
||||
token = "False";
|
||||
}
|
||||
else if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
titletoken = token;
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HL.replace(/href=/, '');
|
||||
if (href == "NA") {
|
||||
href = "javascript:;";
|
||||
target = "";
|
||||
}
|
||||
HL = '';
|
||||
}
|
||||
token = '<u><a href="' + href + '" ' + target + ' onclick="' + HL + '"><font class="text-ul text-dark">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != "") {
|
||||
list1 += '<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col1"><div class="d-flex justify-content-between align-items-center"><span class="col-5 pl-2 text-light">' + labelslice[j] + '</span><span class="text-overflow text-right d-none d-md-block" title="' + titletoken + '">' + token + '</span><span class="text-overflow text-right col-7 pr-0 d-md-none font-weight-600" title="' + titletoken + '">' + token + '</span></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list1 += '<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col1"><div class="d-flex justify-content-between align-items-center"><span class="text-overflow text-left" title="' + titletoken + '">' + token + '</span></div></li>';
|
||||
}
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col1`).html(list1);
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).empty();
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col1').css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col1').css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col1`).removeClass('px-30').addClass('px-10');
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
for (var j = i; j <= i; j++) {
|
||||
if (j == 0) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col2 li:not(:first-child)').remove();
|
||||
}
|
||||
var replace = tokenarray[i];
|
||||
data = response.result.Data[0];
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (response.result.Js != null || response.result.Js != "") {
|
||||
eval(response.result.Js);
|
||||
}
|
||||
if (token == "" || token == "0 NA" || token == "0NA" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "01/01/1900 05:21:10" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01" || token == "1901/01/01" || token == "01/01/1901" || token == "1901/01/01" || token == "01/01/1901" || token == "01/01/0001 12:01:00" || token == "01/01/0001 00:00" || token == "01/01/0001 12:00:00 AM" || token == "01/01/0001 05:30:00 AM") {
|
||||
token = "NA";
|
||||
}
|
||||
if (token == "true") {
|
||||
token = "True";
|
||||
}
|
||||
else if (token == "false") {
|
||||
token = "False";
|
||||
}
|
||||
else if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
titletoken = token;
|
||||
if (HyperLink[propertyarray[k]] != null && HyperLink[propertyarray[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyarray[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HL.replace(/href=/, '');
|
||||
if (href == "NA") {
|
||||
href = "javascript:;";
|
||||
target = "";
|
||||
}
|
||||
HL = '';
|
||||
}
|
||||
token = '<u><a href="' + href + '" ' + target + ' onclick="' + HL + '"><font class="text-ul text-dark">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelarray[j] != '') {
|
||||
list2 += '<li class="Twocolumn-listgroup-2-item Twocolumn-listgroup-2-addeditem li-' + propertyarray[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col2"> <div class="d-flex justify-content-between align-items-center "> <span class="col-5 pl-2 text-light">' + labelarray[j] + '</span> <span class="text-overflow text-right d-none d-md-block" title="' + titletoken + '">' + token + '</span> <span class="text-overflow text-right col-sm-7 pr-0 d-md-none" title="' + titletoken + '">' + token + '</span> </div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray2.push(labelarray[j]);
|
||||
list2 += '<li class="Twocolumn-listgroup-2-item Twocolumn-listgroup-2-addeditem li-' + propertyarray[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col2"> <div class="d-flex justify-content-between align-items-center "><span class="text-overflow" title="' + titletoken + '">' + token + '</span> </div></li>';
|
||||
}
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).html(list2);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col2').css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col2').css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray2.length == j) {
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).removeClass('px-30').addClass('px-10');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$('.' + detailContainer).siblings('.line-loader').remove();
|
||||
$('.' + detailContainer).removeClass('hidden');
|
||||
$("[title='na' i]").find("a").removeAttr("href");
|
||||
$("[title='na' i]").find("u").css("text-decoration", "none");
|
||||
$("[title='na' i]").find("font").text("NA");
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
else if (settingurltype == 10) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboard(" + config.LinkDashboardId + ",'" + config.DashboardName + "')";
|
||||
}
|
||||
else if (settingurltype == 11) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboardsInDashboard(" + config.LinkDashboardGroupId + ",0,true)";
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
this.instance = new Default();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.Default = Default;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class Detailwidgetsplitcolumn extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
debugger;
|
||||
var title = id[0].WidgetName;
|
||||
let html = '<section id="widget_details_' + id[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div id="hf-widget-title_' + id[0].PortletWidgetId + '" class="card-header"><h6>' + title + '</h6></div>' +
|
||||
'<div class="card-body row mx-0">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group no-borders list-group-flush" id="widget_details_' + id[0].PortletWidgetId + '_col1" style="list-style-type:disc">' +
|
||||
'<li class="list-group-item no-borders hidden" id="widget_details_item' + id[0].PortletWidgetId + '_col1"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadData(portletwidgetid, detailcontainer, parameters) {
|
||||
debugger;
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (result) {
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var tokenarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
var token = model.Value.replace(/\s/g, "");
|
||||
}
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray;
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
var replace = slicedarray[k];
|
||||
var data = result.result.Data[0];
|
||||
var templateScript = Handlebars.compile(replace);
|
||||
let token1 = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
for (var i = 0; i < token1.split("|").length; i++) {
|
||||
var token2 = token1.split("|")[i];
|
||||
if (token2 == "" || token2 == "null" || token2 == "Invalid date" || token2 == "1900/01/01" || token2 == "01/01/1900" || token2 == "[object Object]" || token2 == " " || token2 == "01/01/0001" || token2 == "0001/01/01" || token2 == "<p><br></p>") {
|
||||
token2 = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '');
|
||||
HL = '';
|
||||
}
|
||||
token2 = '<a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token2 + '</font></a>';
|
||||
}
|
||||
let list1 = `<li class="list-group-item no-borders Singlecolumn-NoBorder-listgroup-item Singlecolumn-NoBorder-listgroup-addeditem m-t-lg p-2 li-${propertyslice[k]}" style="border: none;display:list-item"> ${token2} </div></div></li>`;
|
||||
$('#widget_details_item' + portletwidgetid + '_col1:last').before(list1);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.' + detailcontainer).siblings('.line-loader').remove();
|
||||
$('.' + detailcontainer).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Detailwidgetsplitcolumn();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.Detailwidgetsplitcolumn = Detailwidgetsplitcolumn;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,272 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleColumn extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
var title = obj[0].WidgetName, html = "";
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush px-3" id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'<li class="d-flex justify-content-between align-items-center li-1 p-0 " style="border-top: 1px dashed black; font-size: 14px;"><span>Pan Number</span><span>GYJKL1234W</span></li><li class="d-flex justify-content-between align-items-center li-1 px-0 py-1 border-top" style="border-top: 1px dashed black; font-size: 14px;"><span>Aadhar Number</span><span>2022 5468 3466</span></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush " id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this, list = '', labelArray1 = [];
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let iconhtml = '';
|
||||
if (result.result.AppConfiguration != null && result.result.AppConfiguration.AppConfigurationId != '' && result.result.AppConfiguration.AppConfigurationId != undefined) {
|
||||
if (result.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(result.result.AppConfiguration, result.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + result.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
}
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, result.result.Data[0]);
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else {
|
||||
var token = model.Value;
|
||||
}
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01") {
|
||||
token = "NA";
|
||||
}
|
||||
if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '').replace('{{url}}', token);
|
||||
HL = '';
|
||||
}
|
||||
token = '<u class="text-primary"><a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != '') {
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-wrap justify-content-between align-items-center"><span class="label_name">' + labelslice[j] + '</span><span class="">' + token + '</span></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-wrap justify-content-between align-items-center"><span class="pr-0 text-left">' + token + '</span></div></div></li>';
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).html(list);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).removeClass('px-3');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('Widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleColumn();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleColumn = SingleColumn;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,273 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleColumnNoBorder extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
var title = obj[0].WidgetName, html = "";
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush px-3" id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'<li class="d-flex flex-column li-1 p-0"><span class="text-light-60 py-1">Pan Number</span><span>GYJKL1234W</span></li><li class="d-flex flex-column li-1 px-0 py-1"><span class="text-light-60 py-1">Aadhar Number</span><span>2022 5468 3466</span></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush " id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this, list = '', labelArray1 = [];
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let iconhtml = '';
|
||||
if (result.result.AppConfiguration != null && result.result.AppConfiguration.AppConfigurationId != '' && result.result.AppConfiguration.AppConfigurationId != undefined) {
|
||||
if (result.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(result.result.AppConfiguration, result.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + result.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
}
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, result.result.Data[0]);
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else {
|
||||
var token = model.Value;
|
||||
}
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = HtmlHelper.getHelper().decode(Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data));
|
||||
if (token == "" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01") {
|
||||
token = "NA";
|
||||
}
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '');
|
||||
HL = '';
|
||||
}
|
||||
token = '<u class="text- primary"><a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != '') {
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-1 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-column"><span class="text-light-60 py-1">' + labelslice[j] + '</span><span>' + token + '</span></div></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-1 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-column"><span class="pr-0 text-left">' + token + '</span></div></div></li>';
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).html(list);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li:first`).css({ "border-top": "0px solid black" });
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).removeClass('px-3');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('Widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleColumnNoBorder();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleColumnNoBorder = SingleColumnNoBorder;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,224 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleData extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let title = obj[0].WidgetName;
|
||||
let html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div class="card-header border-0 card-header-action pl-10"><strong><span class="biz-highlight-bg-color" id="hf-widget-title_' + obj[0].PortletWidgetId + '" >' + title + '</span></strong><div class="d-flex align-items-center card-action-wrap"><div class="d-flex" id="div_detail_addnew_' + obj[0].PortletWidgetId + '"></div></div></div>' +
|
||||
'<div class="card-body pt-5 pl-10 ">' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-12 ">' +
|
||||
'<div class="no-borders list-group-flush" id="widget_details_' + obj[0].PortletWidgetId + '_col1" style="border-top: none;">' +
|
||||
'<div class="no-borders hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col1"></div>' +
|
||||
'<div class="d-flex justify-content-between align-items-center li-undefined px-0 pt-1 pb-2" style="border-top: none;"><div style="width: 100%; overflow-wrap: break-word; border-top: 3px none rgb(102, 64, 178); font-size: 14px;"><span>Single Data</span></div></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this;
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
var token = model.Value.replace(/\s/g, "");
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray;
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = "NA";
|
||||
if (data != undefined) {
|
||||
token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == " " || token == "<p><br></p>" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01" || token == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
token = '<a onclick="' + HL + '"><font class="text-ul">' + token + '</font></a>';
|
||||
}
|
||||
}
|
||||
var text;
|
||||
try {
|
||||
if (token != undefined && token != null && token != "") {
|
||||
text = HtmlHelper.getHelper().decode(token);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
text = token;
|
||||
}
|
||||
let templateData = $('.portletwidget-item[data-widgetname="Template Text"]').length;
|
||||
let ModalHtml;
|
||||
if (templateData == 1) {
|
||||
debugger;
|
||||
if ($(window).width() < 767) {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 pl-1 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span class="template__text p-0"><a class="btn preview_templateText_mobile btn btn-outline-primary"><i class="fa fa-eye" aria-hidden="true"></i></a><a class="Edit_templateText_mobile btn-outline-primary btn mx-2"><i class="fa fa-pencil" aria-hidden="true"></i></a></span></div></div>';
|
||||
ModalHtml = `<div class="modal fade" id="TemplateTextmobile" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg modal-dialog-centered " role="document"> <div class="modal-content rounded-10 text-center bg-white"> <div class="modal-header" style="border-style: dashed;"> <h5 class="modal-title ml-auto">Template Text</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true" class="badge badge-soft-danger font-20 rounded-circle pb-2 px-2">×</span> </button> </div><div class="modal-body templatetext_body text-center p-2 pb-30 biz-custom-scrollbar h-100vh"> ` + text + ` </div></div></div></div>`;
|
||||
}
|
||||
else {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span class="template__text p-0">' + text + '</span></div></div>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span>' + text + '</span></div></div>';
|
||||
}
|
||||
$(detailContainer).find('#widget_details_item' + portletwidgetid + '_col1:first').next().remove();
|
||||
$(detailContainer).find('#widget_details_item' + portletwidgetid + '_col1:last').after(list1);
|
||||
$('.preview_templateText_mobile').click(function () {
|
||||
$("#_bizgaze_modal").html(ModalHtml);
|
||||
$('#TemplateTextmobile').modal();
|
||||
$('.templatetext_body *').css('font-size', '12px');
|
||||
});
|
||||
$('.Edit_templateText_mobile').click(function () {
|
||||
$('#btn_EditTemplate').trigger('click');
|
||||
});
|
||||
console.log(cssproperty[0].FontSize);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailProperty_' + portletwidgetid).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailProperty_' + portletwidgetid).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor });
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).css({ "background-color": cssproperty[0].BackgroundColor });
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailDesciption-listgroup-item').css({ "background-color": cssproperty[0].BackgroundColor });
|
||||
$(".detailDesciption-listgroup-item.detailDesciption-listgroup-addeditem").find("img").addClass("descimg img-fluid");
|
||||
$(".descimg").click(function () {
|
||||
if (screen.width < 1198) {
|
||||
let imgsrc = $(this).attr("src");
|
||||
let ModalHtml = ` <div class="modal fade" id="sessionsModal" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered " role="document" >
|
||||
<div class="modal-content rounded-10 text-center bg-white" >
|
||||
<div class="modal-header pa-15">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<div id="cmnDateFilterModalErrMsg" class="form-error-message ml-0 l-0"></div>
|
||||
</div>
|
||||
<div class="modal-body sessiontimeoutmodal text-center pb-30">
|
||||
<img src="` + imgsrc + `" class="img-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$("#_bizgaze_modal").append(ModalHtml);
|
||||
$('#sessionsModal').modal();
|
||||
$(`#newAccountFormCloseBtns`).off().click(function () {
|
||||
instance.navigationHelper.closePopUp();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleData();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleData = SingleData;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(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