Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

provider.import.js 4.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Integrations;
  6. (function (Integrations) {
  7. let Components;
  8. (function (Components) {
  9. class ProviderImport extends Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return [];
  12. }
  13. jsFiles() {
  14. return ['platform/integrations/managers/integrationmanager.js', 'platform/integrations/components/provider.import.js', "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', 'platform/core/helpers/file/filehelper.js'];
  15. }
  16. html(id, containerid) {
  17. return '<form id="form_Import" default="" data-validate="parsley" data-isdynamic="false">'
  18. + '<div><div class="b-b bg-white header"><strong id="formName" class="text-dark">Provider Import</strong>'
  19. + '</div><div data-simplebar class="simple-scroll-bar scrollable import-export-body" ><div class="card card-body"><div id="div_validationSummary" class="clear"></div><div id="div_importexport" class=""><div class="" id = "importexportsection"><div class="" id="div_Import"><input type="file" id="import_File" class="bg-light d-none d-sm-block required"><hr /> <a href="javascript:;" id="fileUpload" class="btn btn-warning text-white">Upload</a></div><div class="hidden" id="div_Export"><span id="sp_formName"></span><a href="javascript:;" id="fileExport" class="btn btn-primary text-white">Download</a></div></div></div></div></div><div class="bg-white footer" ><button id="btn_CloseImport" class="btn btn-secondary btn-sm mr-auto btn-close">Close</button></div></div></form>';
  20. }
  21. load(id, containerid, callback) {
  22. $("#btn_Import").click(function () {
  23. $("#importexportsection").removeClass("hidden");
  24. $("#div_Import").removeClass("hidden");
  25. });
  26. $('#import_File').change(function (e) {
  27. Unibase.Platform.Helpers.FileHelper.Instance().getBase64(e).then(function (response) {
  28. Unibase.Platform.Integrations.Components.ProviderImport.FileInfo = response;
  29. });
  30. });
  31. $("#fileUpload").click(function () {
  32. let appcontrolid = "form_Import";
  33. let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
  34. if (result == false) {
  35. alert("Plase Select File");
  36. return false;
  37. }
  38. else {
  39. var postData = Unibase.Platform.Integrations.Components.ProviderImport.FileInfo;
  40. Unibase.Platform.Integrations.Managers.IntegrationManager.Instance().importProvider(postData).then(function (response) {
  41. if (response.errors == null) {
  42. $('#' + containerid).modal('hide');
  43. $('#' + containerid).remove();
  44. MessageHelper.Instance().showSuccess(response.message, "");
  45. }
  46. else {
  47. MessageHelper.Instance().showError(response.message, "div_validationSummary");
  48. }
  49. });
  50. }
  51. });
  52. }
  53. importProvider() {
  54. this.navigationHelper.popup(0, '', Unibase.Platform.Integrations.Components.ProviderImport.Instance(), null, Platform.Helpers.Size.Large);
  55. }
  56. static Instance() {
  57. if (this.instance === undefined) {
  58. this.instance = new ProviderImport();
  59. }
  60. return this.instance;
  61. }
  62. }
  63. Components.ProviderImport = ProviderImport;
  64. })(Components = Integrations.Components || (Integrations.Components = {}));
  65. })(Integrations = Platform.Integrations || (Platform.Integrations = {}));
  66. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  67. })(Unibase || (Unibase = {}));