@osimatic/helpers-js 1.0.60 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG CHANGED
@@ -45,4 +45,7 @@ FormHelper.getFormErrorTextBis(...) -> FormHelper.getFormErrorText(...)
45
45
  FormHelper.displayFormErrorsFromXhr(form, btnSubmit, xhr) -> FormHelper.displayFormErrors(form, btnSubmit, xhr.responseJSON)
46
46
 
47
47
  1.0.35 :
48
- ajout méthode HTTPRequest.init() (charge le polyfill de fetch)
48
+ ajout méthode HTTPRequest.init() (charge le polyfill de fetch)
49
+
50
+ 1.0.61
51
+ DataTable.displayErrorFromXhr -> DataTable.displayError
package/data_table.js CHANGED
@@ -268,10 +268,6 @@ class DataTable {
268
268
  // }
269
269
  }
270
270
 
271
- static displayErrorFromXhr(div, jqxhr, defaultMessage) {
272
- this.displayError(div, JSON.parse(jqxhr.responseJSON), defaultMessage);
273
- }
274
-
275
271
  static displayError(div, data, defaultMessage) {
276
272
  var error = null;
277
273
  if (data != null) {
package/file.js CHANGED
@@ -111,7 +111,7 @@ class Img {
111
111
  // $(img).attr('src', urlCreator.createObjectURL(data));
112
112
  Img.setBlobToImg($(img), data);
113
113
  },
114
- error: (jqxhr, status, exception) => console.log('request failure. Status: '+status+'Exception: '+exception),
114
+ error: (jqxhr, status, errorThrown) => HTTPRequest.logJqueryRequestFailure(jqxhr, status, errorThrown),
115
115
  });
116
116
  }
117
117
 
@@ -95,13 +95,13 @@ class ImportFromCsv {
95
95
 
96
96
  requestImportData(dataToImport,
97
97
  // fonction callback en cas d'erreur de formulaire
98
- function (jqxhr) {
99
- console.log(jqxhr.responseJSON);
100
- if (typeof jqxhr.responseJSON['import_list'] !== 'undefined') {
101
- formMatching.find('div.errors').html(jqxhr.responseJSON['import_list']).removeClass('hide');
98
+ (json) => {
99
+ console.log(json);
100
+ if (typeof json['import_list'] !== 'undefined') {
101
+ formMatching.find('div.errors').html(json['import_list']).removeClass('hide');
102
102
  }
103
103
  else {
104
- formMatching.find('div.errors').html(ImportFromCsv.getErrorsHtmlOfImportData(jqxhr.responseJSON, divResult)).removeClass('hide');
104
+ formMatching.find('div.errors').html(ImportFromCsv.getErrorsHtmlOfImportData(json, divResult)).removeClass('hide');
105
105
  }
106
106
  formMatching.find('button[type="submit"]').buttonLoader('reset');
107
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"