Iniit
This commit is contained in:
@@ -0,0 +1,323 @@
|
||||
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 Platform;
|
||||
(function (Platform) {
|
||||
let Sources;
|
||||
(function (Sources) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class AddSource extends Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["platform/sources/managers/sourcemanager.js", "platform/widgets/managers/widgetmanager.js", "tenants/themes/default/components/details/details.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = '<form id="Unibase_AddWidget" default="" data-validate="parsley" data-isdynamic="false">'
|
||||
+ '<div><div class="b-b bg-white header"><strong id="formName" class="text-dark">Add Source</strong>'
|
||||
+ '</div><div data-simplebar class="simple-scroll-bar scrollable"><div id="Unibase_ValidationSummary" class="clear mt-10"></div>'
|
||||
+ '<div class="card"><div class="card-body"><div class="row"><div class="col-sm-6"><input type="hidden" id="hf_sourcesettingid"/><input type="hidden" id="hf_txtSource"/><div class="floating-label-form-group-with-value"><label for="txt_Source">Source<span class="text-danger " id="spnApp"> *</span></label><select onchange="" id="txt_Source" class="form-control value-control floating-label-control required" data-placeholder="Select" placeholder="Select"></select></div></div>'
|
||||
+ '<div class="col-sm-6"><div class="floating-label-form-group"><label for="txt_Value">Value<span class="text-danger " id="spnPortlet"> *</span></label><input type="text" id=txt_Value class="form-control floating-label-control required" data-placeholder="Enter Value" placeholder="Value *" data-label="Value *"/></div></div><div class="col-sm-6"><div class="floating-label-form-group-with-value required"><input type="hidden" id="hf_txtAppDocType"/><label for="txt_appDocType">Doc Type<span class="text-danger " id="spnAppDocType"> *</span></label><select onchange="Unibase.Platform.Sources.Components.AddSource.Instance().loadDocProperties();" id="txt_DocType" class="form-control value-control floating-label-control required" data-placeholder="Select" placeholder="Select"></select></div></div><div class="col-sm-6"><input type="hidden" id="hf_txtDocProperty"/><div class="floating-label-form-group-with-value"><label for="txt_appDocType">Doc Property<span class="text-danger " id="spnAppDocProperty"> *</span></label><select onchange="" id="txt_DocProperty" class="form-control value-control floating-label-control required" data-placeholder="Select" placeholder="Select"></select></div></div><div class="col-sm-2 mt-30"><a class="btn btn-primary btn-center btn-sm text-white" id="btnAdd">Add</a></div></div></div></div><div class="card hidden" id="div_sourceDetails"><div class="card-header"><div class="row"><div class="col-sm-12"><div class="row"><strong class="col-sm-2">Source</strong><strong class="col-sm-2">value</strong><strong class="col-sm-3">Doc Type</strong><strong class="col-sm-3">Doc Property</strong></div></div></div></div><div class="card-body" id="div_sourceList"><div class="row"><ul class="col-sm-12 list-group ulSourceList"></ul></div></div></div></div></div><div id="div_dataApiFooter" class="bg-white modal-footer"><a class="btn btn-light btn-sm btn-center mr-auto btn-close" id="btnClose">Close</a><a class="btn btn-primary btn-center btn-sm text-white hidden" id="btnSave">Save</a></div></div></form>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
instance.loadSource();
|
||||
instance.loadAppDocTypes(Unibase.Themes.Providers.DetailHelper.installedAppId);
|
||||
$("#btnSave").click(function () {
|
||||
instance.saveSource($("#hf_sourcesettingid").val(), containerid);
|
||||
});
|
||||
$("#btnAdd").click(function () {
|
||||
instance.addSource();
|
||||
});
|
||||
}
|
||||
init() {
|
||||
var instance = this;
|
||||
instance.fileCacheHelper.loadJsFiles(["platform/sources/managers/sourcemanager.js", "platform/widgets/managers/widgetmanager.js"], function () {
|
||||
instance.render();
|
||||
});
|
||||
}
|
||||
render() {
|
||||
var instance = this;
|
||||
instance.navigationHelper.popup(0, '', Unibase.Platform.Sources.Components.AddSource.Instance(), function () {
|
||||
}, Platform.Helpers.Size.Large);
|
||||
instance.loadSource();
|
||||
instance.loadAppDocTypes(Unibase.Themes.Providers.DetailHelper.installedAppId);
|
||||
this.loadDetails();
|
||||
}
|
||||
loadSource() {
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/sources/autocomplete';
|
||||
AutoCompleteHelper.getHelper().Create("#txt_Source", "#hf_txtSource", url, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
}
|
||||
loadAppDocTypes(installedappid) {
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/appdoctypesautocomplete/installedappid/' + installedappid;
|
||||
AutoCompleteHelper.getHelper().Create("#txt_DocType", "#hf_txtAppDocType", url, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
}
|
||||
loadDocProperties() {
|
||||
$("#txt_DocProperty").val(null).trigger("change");
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/docpropertiesautocomplete/doctypeid/' + $("#txt_DocType").val();
|
||||
AutoCompleteHelper.getHelper().Create("#txt_DocProperty", "#hf_txtDocProperty", url, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
}
|
||||
validation() {
|
||||
var instance = this;
|
||||
let appcontrolid = "Unibase_AddWidget";
|
||||
let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
|
||||
if (result == false) {
|
||||
MessageHelper.Instance().showError("Mandatory fields are missing", "Unibase_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
saveSource(id, containerid) {
|
||||
var instance = this;
|
||||
var versionGuid = "";
|
||||
for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
|
||||
if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_versionguid") {
|
||||
versionGuid = obj.Value.toString();
|
||||
}
|
||||
}
|
||||
var postData = {
|
||||
RefGuid: versionGuid,
|
||||
InstalledAppId: Number(Unibase.Themes.Providers.DetailHelper.recordId),
|
||||
RefSourceId: Number($("#txt_Source").val()),
|
||||
Value: $("#txt_Value").val().toString(),
|
||||
SourceSettingId: Number(id),
|
||||
RefId: Number(Unibase.Themes.Providers.DetailHelper.recordId),
|
||||
DocTypeId: Number($("#txt_DocType").val()),
|
||||
DocPropertyId: Number($("#txt_DocProperty").val())
|
||||
};
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().addSource(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, "");
|
||||
}
|
||||
});
|
||||
}
|
||||
addSource() {
|
||||
var instance = this;
|
||||
var versionGuid = "";
|
||||
var getValidation = instance.validation();
|
||||
if (getValidation == true) {
|
||||
for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
|
||||
if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_versionguid") {
|
||||
versionGuid = obj.Value.toString();
|
||||
}
|
||||
}
|
||||
var postData = {
|
||||
RefGuid: versionGuid,
|
||||
InstalledAppId: Number(Unibase.Themes.Providers.DetailHelper.recordId),
|
||||
RefSourceId: Number($("#txt_Source").val()),
|
||||
Value: $("#txt_Value").val().toString(),
|
||||
RefId: Number(Unibase.Themes.Providers.DetailHelper.recordId),
|
||||
DocTypeId: Number($("#txt_DocType").val()),
|
||||
DocPropertyId: Number($("#txt_DocProperty").val())
|
||||
};
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().addSource(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
instance.loadDetails();
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, "");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
loadDetails() {
|
||||
var versionGuid = "";
|
||||
for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
|
||||
if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_versionguid") {
|
||||
versionGuid = obj.Value.toString();
|
||||
}
|
||||
}
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().getSourceSettings(versionGuid).then(function (response) {
|
||||
if (response.result.length > 0)
|
||||
$("#div_sourceDetails").removeClass("hidden");
|
||||
else
|
||||
$("#div_sourceDetails").addClass("hidden");
|
||||
$(".ulSourceList").html("").html("<li class='list-group-item ulSourceList-item hidden'></li>");
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var html = "";
|
||||
html += "<li class='list-group-item sourceSetting-" + response.result[i].SourceSettingId + "'>" +
|
||||
"<input type='hidden' id='hfSourceSettingId-" + response.result[i].SourceSettingId + "' value='" + response.result[i].SourceSettingId + "' />" +
|
||||
"<input type='hidden' id='hfRefGuid-" + response.result[i].SourceSettingId + "' value='" + response.result[i].RefGuid + "' />" +
|
||||
"<div class='row'>" +
|
||||
"<label class='col-sm-2 lblSourceName-" + response.result[i].SourceSettingId + "' style='overflow:hidden;word-wrap:break-word;'><span class='spn_sourceName font-bold'>" + response.result[i].SourceName + "</span></label>" +
|
||||
"<label class='col-sm-2 lblSourceValue-" + response.result[i].SourceSettingId + "' style='overflow:hidden;word-wrap:break-word;'><span class='font-bold'>" + response.result[i].Value + "</span></label>" +
|
||||
"<label class='col-sm-3 lblDoctypeName-" + response.result[i].SourceSettingId + "' style='overflow:hidden;word-wrap:break-word;'><span class='spn_DocTypeName font-bold'>" + response.result[i].DocTypeName + "</span></label>" +
|
||||
"<label class='col-sm-3 lblDocPropertyName-" + response.result[i].SourceSettingId + "' style='overflow:hidden;word-wrap:break-word;'><span class='spn_DocPropertyName font-bold'>" + response.result[i].DocPropertyName + "</span></label>" +
|
||||
"<div class='col-sm-2 pull-right input-group divButtons-" + response.result[i].SourceSettingId + "'>" +
|
||||
"<a class='btn btn-icon bg-info text-white' href='javascript:;' onclick='Unibase.Platform.Sources.Components.AddSource.Instance().editSetting(" + response.result[i].SourceSettingId + ");' title='Edit'><i class='fa fa-pencil'></i></a>" +
|
||||
"<a class='btn btn-icon btn-danger' href='javascript:;' onclick='Unibase.Platform.Sources.Components.AddSource.Instance().deleteSetting(" + response.result[i].SourceSettingId + ");' title='Delete'><i class='fa fa-trash-o'></i></a></div>" +
|
||||
"<div class='col-sm-2 hidden inpSourceName-" + response.result[i].SourceSettingId + "'><div class='floating-label-form-group'>" +
|
||||
"<select class='form-control required floating-label-control' value='" + response.result[i].SourceName + "' id='txtSourceName-" + response.result[i].SourceSettingId + "' placeholder='Select'></select>" +
|
||||
"<input id='hfSourceId-" + response.result[i].SourceSettingId + "' value=" + response.result[i].RefSourceId + " type='hidden' />" +
|
||||
"</div></div>" +
|
||||
"<div class='col-sm-2 hidden inpSourceValue-" + response.result[i].SourceSettingId + "'><div class='floating-label-form-group floating-label-form-group-with-value'>" +
|
||||
"<input id='txtSourceValue-" + response.result[i].SourceSettingId + "' class='form-control' value='" + response.result[i].Value + "' />" +
|
||||
"</div></div>" +
|
||||
"<div class='col-sm-3 hidden inpAppDoctype-" + response.result[i].SourceSettingId + "'><div class='floating-label-form-group'>" +
|
||||
"<select class='form-control required floating-label-control' value='" + response.result[i].DocTypeName + "' id='txtDocTypeName-" + response.result[i].SourceSettingId + "' placeholder='Select'></select>" +
|
||||
"<input id='hfDocTypeId-" + response.result[i].SourceSettingId + "' value=" + response.result[i].DocTypeId + " type='hidden' />" +
|
||||
"</div></div>" +
|
||||
"<div class='col-sm-3 hidden inpAppDocPropertytype-" + response.result[i].SourceSettingId + "'><div class='floating-label-form-group'>" +
|
||||
"<select class='form-control required floating-label-control' value='" + response.result[i].DocPropertyName + "' id='txtDocPropertyName-" + response.result[i].SourceSettingId + "' placeholder='Select'></select>" +
|
||||
"<input id='hfDocPropertyId-" + response.result[i].SourceSettingId + "' value=" + response.result[i].DocPropertyId + " type='hidden' />" +
|
||||
"</div></div>" +
|
||||
"<div class='col-sm-2 input-group divButtons2-" + response.result[i].SourceSettingId + " hidden'><div class='m-t'>" +
|
||||
"<a class='btn btn-icon bg-primary text-white btnUpdateSyncSett-" + response.result[i].SourceSettingId + "' href='javascript:;' onclick='Unibase.Platform.Sources.Components.AddSource.Instance().updateSetting(" + response.result[i].SourceSettingId + ");' title='Update'><i class='fa fa-save'></i></a>" +
|
||||
"<a class='btn btn-icon btn-warning' href='javascript:;' onclick='Unibase.Platform.Sources.Components.AddSource.Instance().cancel(" + response.result[i].SourceSettingId + ");' title='Cancel Update'><i class='fa fa-times'></i></a>" +
|
||||
"</div></div>" +
|
||||
"</div>" +
|
||||
"</li>";
|
||||
$(".ulSourceList-item:last").after(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
editSetting(sourceSettingId) {
|
||||
var element = document.getElementsByClassName("ulSourceList");
|
||||
$(element).find(".lblSourceName-" + sourceSettingId + "").addClass("hidden");
|
||||
$(element).find(".lblSourceValue-" + sourceSettingId + "").addClass("hidden");
|
||||
$(element).find(".lblDoctypeName-" + sourceSettingId + "").addClass("hidden");
|
||||
$(element).find(".lblDocPropertyName-" + sourceSettingId + "").addClass("hidden");
|
||||
$(element).find(".divButtons-" + sourceSettingId + "").addClass("hidden");
|
||||
$(element).find(".inpSourceName-" + sourceSettingId + "").removeClass("hidden");
|
||||
$(element).find(".inpSourceValue-" + sourceSettingId + "").removeClass("hidden");
|
||||
$(element).find(".inpAppDoctype-" + sourceSettingId + "").removeClass("hidden");
|
||||
$(element).find(".inpAppDocPropertytype-" + sourceSettingId + "").removeClass("hidden");
|
||||
$(element).find(".divButtons2-" + sourceSettingId + "").removeClass("hidden");
|
||||
var sourceName = $(element).find(".lblSourceName-" + sourceSettingId + "").find(".spn_sourceName").text();
|
||||
var sourceId = $(element).find("#hfSourceId-" + sourceSettingId).val().toString();
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/sources/autocomplete';
|
||||
AutoCompleteHelper.getHelper().Create("#txtSourceName-" + sourceSettingId, "#hfSourceId-" + sourceSettingId, url, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
var option = new Option(sourceName, sourceId, true);
|
||||
$("#txtSourceName-" + sourceSettingId).append(option);
|
||||
var docTypeName = $(element).find(".lblDoctypeName-" + sourceSettingId + "").find(".spn_DocTypeName").text();
|
||||
var docTypeId = $(element).find("#hfDocTypeId-" + sourceSettingId).val().toString();
|
||||
var installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
var docTypeUrl = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/appdoctypesautocomplete/installedappid/' + installedappid;
|
||||
AutoCompleteHelper.getHelper().Create("#txtDocTypeName-" + sourceSettingId, "#hfDocTypeId-" + sourceSettingId, docTypeUrl, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
var docTypeoption = new Option(docTypeName, docTypeId, true);
|
||||
$("#txtDocTypeName-" + sourceSettingId).append(docTypeoption);
|
||||
var docPropertyName = $(element).find(".lblDocPropertyName-" + sourceSettingId + "").find(".spn_DocPropertyName").text();
|
||||
var docPropertyId = $(element).find("#hfDocPropertyId-" + sourceSettingId).val().toString();
|
||||
var docPropertyUrl = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/docpropertiesautocomplete/doctypeid/' + docTypeId;
|
||||
AutoCompleteHelper.getHelper().Create("#txtDocPropertyName-" + sourceSettingId, "#hfDocPropertyId-" + sourceSettingId, docPropertyUrl, function (response) {
|
||||
var data = response;
|
||||
});
|
||||
var docPropertyoption = new Option(docPropertyName, docPropertyId, true);
|
||||
$("#txtDocPropertyName-" + sourceSettingId).append(docPropertyoption);
|
||||
}
|
||||
updateSetting(settingId) {
|
||||
var instance = this;
|
||||
var element = document.getElementsByClassName("ulSourceList");
|
||||
var sourceId = $(element).find("#hfSourceId-" + settingId + "").val();
|
||||
var sourceValue = $(element).find("#txtSourceValue-" + settingId + "").val();
|
||||
var sourceSettingId = $(element).find("#hfSourceSettingId-" + settingId + "").val();
|
||||
var refGuid = $(element).find("#hfRefGuid-" + settingId + "").val();
|
||||
var refid = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
var doctypeId = $(element).find("#hfDocTypeId-" + settingId + "").val();
|
||||
var docpropertyId = $(element).find("#hfDocPropertyId-" + settingId + "").val();
|
||||
var versionGuid = "";
|
||||
var postData = {
|
||||
SourceSettingId: Number(sourceSettingId),
|
||||
RefGuid: refGuid,
|
||||
InstalledAppId: Number(Unibase.Themes.Providers.DetailHelper.recordId),
|
||||
RefSourceId: Number(sourceId),
|
||||
RefId: refid,
|
||||
Value: sourceValue.toString(),
|
||||
DocTypeId: Number(doctypeId),
|
||||
DocPropertyId: Number(docpropertyId)
|
||||
};
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().addSource(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
instance.loadDetails();
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, "");
|
||||
}
|
||||
});
|
||||
}
|
||||
cancel(settingId) {
|
||||
var element = document.getElementsByClassName("ulSourceList");
|
||||
$(element).find(".inpSourceName-" + settingId + "").addClass("hidden");
|
||||
$(element).find(".inpSourceValue-" + settingId + "").addClass("hidden");
|
||||
$(element).find(".inpAppDoctype-" + settingId + "").addClass("hidden");
|
||||
$(element).find(".inpAppDocPropertytype-" + settingId + "").addClass("hidden");
|
||||
$(element).find(".divButtons2-" + settingId + "").addClass("hidden");
|
||||
$(element).find(".lblSourceName-" + settingId + "").removeClass("hidden");
|
||||
$(element).find(".lblSourceValue-" + settingId + "").removeClass("hidden");
|
||||
$(element).find(".lblDoctypeName-" + settingId + "").removeClass("hidden");
|
||||
$(element).find(".lblDocPropertyName-" + settingId + "").removeClass("hidden");
|
||||
$(element).find(".divButtons-" + settingId + "").removeClass("hidden");
|
||||
}
|
||||
deleteSetting(sourceSettingId) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().deleteSourceSetting(sourceSettingId).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
MessageHelper.Instance().showSuccess(response.message, "");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, "");
|
||||
}
|
||||
instance.loadDetails();
|
||||
});
|
||||
}
|
||||
loadEdit(sourceSettingId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
Unibase.Platform.Sources.Managers.SourceManager.Instance().deleteSourceSetting(0).then(function (response) { MessageHelper.Instance().showSuccess(response.message, ''); });
|
||||
var instance = this;
|
||||
instance.fileCacheHelper.loadJsFiles(["platform/sources/managers/sourcemanager.js", "platform/widgets/managers/widgetmanager.js"], null);
|
||||
instance.navigationHelper.popup(0, '', Unibase.Platform.Sources.Components.AddSource.Instance(), null, Platform.Helpers.Size.Large);
|
||||
$("#btnAdd").addClass("hidden");
|
||||
$("#div_sourceList").addClass("hidden");
|
||||
$("#btnSave").removeClass("hidden");
|
||||
instance.loadSource();
|
||||
yield Unibase.Platform.Sources.Managers.SourceManager.Instance().getSourceSetting(sourceSettingId).then(function (response) {
|
||||
var option = new Option(response.result.SourceName, response.result.RefSourceId, true);
|
||||
$("#txt_Source").append(option);
|
||||
$("#txt_Value").val(response.result.Value.toString());
|
||||
$("#hf_sourcesettingid").val(sourceSettingId);
|
||||
instance.loadAppDocTypes(Unibase.Themes.Providers.DetailHelper.installedAppId);
|
||||
$("#txt_DocType").append(new Option(response.result.DocTypeName, response.result.DocTypeId, true));
|
||||
instance.loadDocProperties();
|
||||
$("#txt_DocProperty").append(new Option(response.result.DocPropertyName, response.result.DocPropertyId, true));
|
||||
});
|
||||
$("#btnAdd").addClass("hidden");
|
||||
$("#div_sourceList").addClass("hidden");
|
||||
$("#btnSave").removeClass("hidden");
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new AddSource();
|
||||
}
|
||||
}
|
||||
Components.AddSource = AddSource;
|
||||
})(Components = Sources.Components || (Sources.Components = {}));
|
||||
})(Sources = Platform.Sources || (Platform.Sources = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,114 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Sources;
|
||||
(function (Sources) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class CreateSource extends Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["platform/sources/components/source.js", "platform/sources/managers/sourcemanager.js", "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "libs/summernote/summernote.min.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return ["libs/summernote/summernote.css"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = '<form id="frmUnibase_Source" default="" data-validate="parsley" data-isdynamic="false"><div class="b-b bg-white header"><input id="hf_SourceId" type="hidden" value="0"/><strong id="formName" class="text-dark">Create Source</strong></div><div data-simplebar class="simple-scroll-bar scrollable modal-body"><div id="Unibase_ValidationSummary" class="clear mt-10"></div><div class="card"><div class="card-body"><div class="row"><div class="col-sm-6"><div class="floating-label-form-group"><label>Source Name<span class="text-danger " id="spnSourceName"> *</span></label><input class="form-control value-control required floating-label-control" id="txtSourceName" placeholder="Source Name *" data-placeholder="Enter Source Name" data-label="Source Name *" value="" type="text"></div></div></div></div></div><div class="source-description"><div class="card"><div class="card-header"><strong class="text-dark">Description</strong></div><div class="card-body"><div class="type-control summernote" style="display: block;" id="summernote" data-propdoctypename="" placeholder = "Enter Description" data-placeholder="Enter Descrpition" data-label="Descrpition"></div></div></div></div></div><div id="div_sourceFooter" class="bg-white footer"><a class="btn btn-light btn-sm btn-center mr-auto btn-close" id="btnClose">Close</a><a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save</a></div></form>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance.fileCacheHelper.loadJsFiles(["platform/integrations/managers/integrationmanager.js", "libs/summernote/summernote.min.js"], null);
|
||||
instance.fileCacheHelper.loadCssFile("libs/summernote/summernote.css", null);
|
||||
instance.loadSummernote();
|
||||
instance.sourceManager = Sources.Managers.SourceManager.Instance();
|
||||
$("#btnSave").click(function () {
|
||||
let appcontrolid = "frmUnibase_Source";
|
||||
let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
|
||||
if (result == false) {
|
||||
MessageHelper.Instance().showError("Mandatory fields are missing", "Unibase_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
instance.save(id, containerid);
|
||||
}
|
||||
});
|
||||
}
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
|
||||
let instance = this;
|
||||
this.navigationHelper.popup(0, '', instance, function (containerid) {
|
||||
}, Platform.Helpers.Size.Auto);
|
||||
if (Pk_Value != 0) {
|
||||
$("#formName").text("Edit Source");
|
||||
CreateSource.Instance().edit(Pk_Value);
|
||||
}
|
||||
}
|
||||
loadSourceForm(iscreate) {
|
||||
var Pk_Value = 0;
|
||||
var instance = this;
|
||||
if (!iscreate) {
|
||||
Pk_Value = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
}
|
||||
this.navigationHelper.popup(0, '', Unibase.Platform.Sources.Components.CreateSource.Instance(), null, Platform.Helpers.Size.Large);
|
||||
if (Pk_Value != 0) {
|
||||
$("#formName").text("Edit Source");
|
||||
CreateSource.Instance().edit(Pk_Value);
|
||||
}
|
||||
}
|
||||
edit(recordId) {
|
||||
let instance = this;
|
||||
instance.sourceManager.getSource(recordId).then(function (response) {
|
||||
$("#hf_SourceId").val(response.result.SourceId);
|
||||
$("#txtSourceName").val(response.result.SourceName);
|
||||
$("#txt_Description").val(response.result.Description);
|
||||
$('#summernote').summernote('code', response.result.Description);
|
||||
});
|
||||
}
|
||||
save(pk_value, containerid) {
|
||||
let instance = this;
|
||||
var contents = $('#summernote').summernote('code');
|
||||
var plainText = $("<p>" + contents + "</p>").text();
|
||||
var postData = {
|
||||
SourceId: Number($("#hf_SourceId").val()),
|
||||
UniqueId: ("Unibase_Platform_Sources_" + $("#txtSourceName").val().toString()).replace(/\s/g, ''),
|
||||
SourceName: $("#txtSourceName").val().toString(),
|
||||
StageId: Number(0),
|
||||
Description: plainText
|
||||
};
|
||||
instance.sourceManager.saveSource(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
MessageHelper.Instance().showSuccess(response.message, "");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, "Unibase_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
loadSummernote() {
|
||||
$("#summernote").summernote({
|
||||
height: 100,
|
||||
minHeight: null,
|
||||
maxHeight: null,
|
||||
placeholder: "Enter Description",
|
||||
toolbar: [
|
||||
['font', ['bold', 'italic', 'underline']],
|
||||
['color', ['color']]
|
||||
]
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new CreateSource();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.CreateSource = CreateSource;
|
||||
})(Components = Sources.Components || (Sources.Components = {}));
|
||||
})(Sources = Platform.Sources || (Platform.Sources = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"source.js","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":"AAIA,IAAU,OAAO,CAyIhB;AAzID,WAAU,OAAO;IACb,IAAiB,QAAQ,CAuIxB;IAvID,WAAiB,QAAQ;QACrB,IAAiB,OAAO,CAqIvB;QArID,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAmI1B;YAnID,WAAiB,UAAU;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gBAAQ,QAuIxB;AACL,CAAC,EAzIS,OAAO,KAAP,OAAO,QAyIhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{jsFiles(){return["platform/sources/components/source.js","platform/sources/managers/sourcemanager.js","platform/forms/components/formviewer/formviewer.js","libs/parsley/parsley.min.js","libs/summernote/summernote.min.js"]}cssFiles(){return["libs/summernote/summernote.css"]}html(){return'<form id="frmUnibase_Source" default="" data-validate="parsley" data-isdynamic="false"><div class="b-b bg-white header"><input id="hf_SourceId" type="hidden" value="0"/><strong id="formName" class="text-dark">Create Source<\/strong><\/div><div data-simplebar class="simple-scroll-bar scrollable modal-body"><div id="Unibase_ValidationSummary" class="clear mt-10"><\/div><div class="card"><div class="card-body"><div class="row"><div class="col-sm-6"><div class="floating-label-form-group"><label>Source Name<span class="text-danger " id="spnSourceName"> *<\/span><\/label><input class="form-control value-control required floating-label-control" id="txtSourceName" placeholder="Source Name *" data-placeholder="Enter Source Name" data-label="Source Name *" value="" type="text"><\/div><\/div><\/div><\/div><\/div><div class="source-description"><div class="card"><div class="card-header"><strong class="text-dark">Description<\/strong><\/div><div class="card-body"><div class="type-control summernote" style="display: block;" id="summernote" data-propdoctypename="" placeholder = "Enter Description" data-placeholder="Enter Descrpition" data-label="Descrpition"><\/div><\/div><\/div><\/div><\/div><div id="div_sourceFooter" class="bg-white footer"><a class="btn btn-light btn-sm btn-center mr-auto btn-close" id="btnClose">Close<\/a><a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save<\/a><\/div><\/form>'}load(t,r){let u=this;u.fileCacheHelper.loadJsFiles(["platform/integrations/managers/integrationmanager.js","libs/summernote/summernote.min.js"],null);u.fileCacheHelper.loadCssFile("libs/summernote/summernote.css",null);u.loadSummernote();u.sourceManager=i.Managers.SourceManager.Instance();$("#btnSave").click(function(){let i=n.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation("frmUnibase_Source");if(i==!1)return MessageHelper.Instance().showError("Mandatory fields are missing","Unibase_ValidationSummary"),!1;u.save(t,r)})}loadForm(n,i){let r=this;this.navigationHelper.popup(0,"",r,function(){},t.Helpers.Size.Auto);i!=0&&($("#formName").text("Edit Source"),u.Instance().edit(i))}loadSourceForm(i){var r=0,f=this;i||(r=n.Themes.Providers.DetailHelper.recordId);this.navigationHelper.popup(0,"",n.Platform.Sources.Components.CreateSource.Instance(),null,t.Helpers.Size.Large);r!=0&&($("#formName").text("Edit Source"),u.Instance().edit(r))}edit(n){let t=this;t.sourceManager.getSource(n).then(function(n){$("#hf_SourceId").val(n.result.SourceId);$("#txtSourceName").val(n.result.SourceName);$("#txt_Description").val(n.result.Description);$("#summernote").summernote("code",n.result.Description)})}save(n,t){let i=this;var r=$("#summernote").summernote("code"),u=$("<p>"+r+"<\/p>").text(),f={SourceId:Number($("#hf_SourceId").val()),UniqueId:("Unibase_Platform_Sources_"+$("#txtSourceName").val().toString()).replace(/\s/g,""),SourceName:$("#txtSourceName").val().toString(),StageId:Number(0),Description:u};i.sourceManager.saveSource(f).then(function(n){if(n.errors==null)$("#"+t).modal("hide"),$("#"+t).remove(),MessageHelper.Instance().showSuccess(n.message,"");else return MessageHelper.Instance().showError(n.message,"Unibase_ValidationSummary"),!1})}loadSummernote(){$("#summernote").summernote({height:100,minHeight:null,maxHeight:null,placeholder:"Enter Description",toolbar:[["font",["bold","italic","underline"]],["color",["color"]]]})}static Instance(){return this.instance===undefined&&(this.instance=new u),this.instance}}r.CreateSource=u})(r=i.Components||(i.Components={}))})(i=t.Sources||(t.Sources={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,15 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Sources;
|
||||
(function (Sources) {
|
||||
let Infos;
|
||||
(function (Infos) {
|
||||
class Source {
|
||||
}
|
||||
Infos.Source = Source;
|
||||
})(Infos = Sources.Infos || (Sources.Infos = {}));
|
||||
})(Sources = Platform.Sources || (Platform.Sources = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"source.js","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAYhB;AAZD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAUxB;IAVD,WAAiB,QAAQ;QACrB,IAAiB,OAAO,CAQvB;QARD,WAAiB,OAAO;YACpB,IAAiB,KAAK,CAMrB;YAND,WAAiB,KAAK;gBAClB,MAAa,MAAM;iBAIlB;gBAJY,YAAM,SAIlB,CAAA;YACL,CAAC,EANgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAMrB;QACL,CAAC,EARgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QAQvB;IACL,CAAC,EAVgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUxB;AACL,CAAC,EAZS,OAAO,KAAP,OAAO,QAYhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.Source=t})(t=n.Infos||(n.Infos={}))})(t=n.Sources||(n.Sources={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isourcemanager.js","sourceRoot":"","sources":["isourcemanager.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1,95 @@
|
||||
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 Platform;
|
||||
(function (Platform) {
|
||||
let Sources;
|
||||
(function (Sources) {
|
||||
let Managers;
|
||||
(function (Managers) {
|
||||
class SourceManager extends Platform.Core.BaseManager {
|
||||
getSource(sourceId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/get/' + sourceId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
saveSource(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/save';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSourceSettings(refGuid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/getsourcesettings/' + refGuid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSourceSetting(sourceSettingId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/getsetting/' + sourceSettingId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
addSource(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/savesourcesetting';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
deleteSourceSetting(sourceSettingId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/sources/deletesourcesetting/id/' + sourceSettingId;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new SourceManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Managers.SourceManager = SourceManager;
|
||||
})(Managers = Sources.Managers || (Sources.Managers = {}));
|
||||
})(Sources = Platform.Sources || (Platform.Sources = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sourcemanager.js","sourceRoot":"","sources":["sourcemanager.ts"],"names":[],"mappings":";;;;;;;;;AAGA,IAAU,OAAO,CAiFhB;AAjFD,WAAU,OAAO;IACb,IAAiB,QAAQ,CA+ExB;IA/ED,WAAiB,QAAQ;QACrB,IAAiB,OAAO,CA6EvB;QA7ED,WAAiB,OAAO;YACpB,IAAiB,QAAQ,CA2ExB;YA3ED,WAAiB,QAAQ;gBACrB,MAAa,aAAc,SAAQ,SAAA,IAAI,CAAC,WAAW;oBACzC,SAAS,CAAC,QAAQ;;4BAEpB,MAAM,GAAG,GAAG,uCAAuC,GAAG,QAAQ,CAAC;4BAC/D,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;gCAEhE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;oC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CAAC,EA7EgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QA6EvB;IACL,CAAC,EA/EgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA+ExB;AACL,CAAC,EAjFS,OAAO,KAAP,OAAO,QAiFhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(n){let t;(function(t){let i;(function(t){class i extends n.Core.BaseManager{getSource(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/sources/get/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}saveSource(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/sources/save",n).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getSourceSettings(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/sources/getsourcesettings/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getSourceSetting(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/sources/getsetting/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}addSource(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/sources/savesourcesetting",n).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}deleteSourceSetting(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/sources/deletesourcesetting/id/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}static Instance(){return this._instance===undefined&&(this._instance=new i),this._instance}}t.SourceManager=i})(i=t.Managers||(t.Managers={}))})(t=n.Sources||(n.Sources={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,15 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Sources;
|
||||
(function (Sources) {
|
||||
let Requests;
|
||||
(function (Requests) {
|
||||
class Source {
|
||||
}
|
||||
Requests.Source = Source;
|
||||
})(Requests = Sources.Requests || (Sources.Requests = {}));
|
||||
})(Sources = Platform.Sources || (Platform.Sources = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"source.js","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAchB;AAdD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAYxB;IAZD,WAAiB,QAAQ;QACrB,IAAiB,OAAO,CAUvB;QAVD,WAAiB,OAAO;YACpB,IAAiB,QAAQ,CAQxB;YARD,WAAiB,QAAQ;gBACrB,MAAa,MAAM;iBAMlB;gBANY,eAAM,SAMlB,CAAA;YACL,CAAC,EARgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAQxB;QACL,CAAC,EAVgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QAUvB;IACL,CAAC,EAZgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAYxB;AACL,CAAC,EAdS,OAAO,KAAP,OAAO,QAchB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.Source=t})(t=n.Requests||(n.Requests={}))})(t=n.Sources||(n.Sources={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user