1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- var Unibase;
- (function (Unibase) {
- let Platform;
- (function (Platform) {
- let Integrations;
- (function (Integrations) {
- let Components;
- (function (Components) {
- class ServiceIntegrator extends Platform.Core.BaseComponent {
- cssFiles() {
- return ["libs/summernote/summernote.css"];
- }
- jsFiles() {
- return ["platform/integrations/components/serviceintegrator.js", "platform/integrations/components/createserviceprovider.js", "platform/integrations/managers/integrationmanager.js", "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "libs/summernote/summernote.min.js", "platform/integrations/enums/integratortype.js"];
- }
- html(id, containerid) {
- let html = '<form id="frmUnibase_InputParameters" default="" data-validate="parsley" data-isdynamic="false"><div class="b-b bg-white header"><input id="hf_ServiceIntegratorId" type="hidden" value="0"/><input id="hf_container" type="hidden" value="0"/><strong id="formName" class="text-dark">Input Settings</strong><a class="btn btn-sm ml-auto"><i class="ti-help-alt" title="help" href="javascript:;" target="_blank"></i></a><input id="hf_fromIntegration" type="hidden" value="false"/></div><div data-simplebar class="simple-scroll-bar scrollable integrator-body"><div id="Unibase_ValidationSummary" class="clear mt-10"></div><div class="card"><div class="card-body"><div class="" id="div_InputSettings"></div></div></div></div></div><div id="div_dataApiFooter" 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="btn_execute">Execute</a></div></form>';
- return html;
- }
- load(id, containerid, callback) {
- var instance = this;
- $("#btn_execute").click(function () {
- var serviceIntegratorId = $("#hf_ServiceIntegratorId").val();
- Unibase.Platform.Integrations.Components.CreateServiceProvider.Instance().saveSettings(containerid, serviceIntegratorId, ServiceIntegrator.isDownload);
- });
- }
- loadInputSettings(serviceIntegratorId, serviceId, integratorType, isDownload) {
- var instance = this;
- ServiceIntegrator.isDownload = isDownload;
- instance.fileCacheHelper.loadJsFile("platform/integrations/managers/integrationmanager.js", null);
- bootbox.confirm("Do you want to Execute this service?", function (result) {
- if (result == true) {
- Unibase.Platform.Integrations.Managers.IntegrationManager.Instance().getinputsettings(serviceIntegratorId, true).then(function (response) {
- $("#hf_ServiceIntegratorId").val(serviceIntegratorId);
- if (response.result.length > 0) {
- instance.navigationHelper.popup(0, '', Unibase.Platform.Integrations.Components.ServiceIntegrator.Instance(), null, Platform.Helpers.Size.Medium);
- $("#hf_ServiceIntegratorId").val(serviceIntegratorId);
- var settinghtml = "";
- for (let i = 0; i < response.result.length; i++) {
- var data = response.result[i];
- settinghtml += '<div class="row item-row ml-30 col-sm-12 mt-10 mb-2">' +
- '<input type="hidden" class=" hf_Header_Service" id="hf_Header_Service_' + i + '"" value=' + data.ServiceSettingId + '>' +
- '<input type="hidden" class="hf_Header_ServiceId" id="hf_Header_ServiceId_' + i + '"" value=' + data.ServiceId + '>' +
- '<input type="hidden" class="hf_Header_SettingTypeId" id="hf_Header_SettingTypeId_' + i + '"" value=' + data.SettingTypeId + '>' +
- '<div class="focus col-sm-5" id="div_ConfigKey_Collection">' +
- '<input class="form-control txt_ConfigKey_Collection readonly" type="text" id="txt_ConfigKey_Collection_' + i + '" placeholder="Enter Key" data-label="Key" data-isdynamic="false" data-placeholder="Key" autocomplete="false" value=' + data.SettingName + '>' +
- '</div>' +
- '<div class="focus col-sm-5" id="div_ConfigValue_Collection">' +
- '<input class="form-control txt_ConfigValue_Collection" type="text" id="txt_ConfigValue_Collection_' + i + '" placeholder="Enter Value" data-label="Value" data-isdynamic="false" data-placeholder="Value" autocomplete="false" value=' + data.SettingValue + '>' +
- '</div>' +
- '</div>';
- }
- $("#div_InputSettings").html(settinghtml);
- }
- else {
- Unibase.Platform.Integrations.Components.CreateServiceProvider.Instance().saveSettings("", serviceIntegratorId, isDownload);
- }
- });
- }
- });
- }
- loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
- var instance = this;
- }
- static Instance() {
- return new ServiceIntegrator();
- }
- }
- ServiceIntegrator.isDownload = false;
- Components.ServiceIntegrator = ServiceIntegrator;
- })(Components = Integrations.Components || (Integrations.Components = {}));
- })(Integrations = Platform.Integrations || (Platform.Integrations = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|