ru.coon 3.0.52 → 3.0.53

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.md CHANGED
@@ -1,3 +1,10 @@
1
+ # Version 3.0.53, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/18d790002292ecd0650d868dca06ddcf668fcede)
2
+ * ## Features
3
+ * <span style='color:green'>feat: NEVA-974: bug fix. Передаю нужный контекст</span> ([22bb87], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/22bb870b28bdafac81dca86804b482e6e365c9c8))
4
+
5
+ * fetch заменен на Ext.Ajax.request. Related to HT-13796. ([6c255d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6c255d3663c735c36b304a9fd1f67b93b8b3b9f7))
6
+ * update: CHANGELOG.md ([b95dd9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b95dd96244579290f3c7c42f2bf32881a54ac96d))
7
+
1
8
  # Version 3.0.52, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/290ca0d6e133cd9631aae34caa6f0c63ab449128)
2
9
  * ## Features
3
10
  * <span style='color:green'>feat: NEVA-974: Добавил возможность выбора нескольких файлов</span> ([2f49c5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2f49c53d5af263c1c7931497140faea164a94357))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.52",
7
+ "version": "3.0.53",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -162,14 +162,6 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
162
162
  this.fireEvent('close');
163
163
  },
164
164
 
165
- getHeaders: function() {
166
- const token = localStorage.getItem('CSRFToken');
167
- return Ext.apply(this.headers, {
168
- 'X-CSRF-Token': token,
169
- 'Accept': 'application/json',
170
- });
171
- },
172
-
173
165
  getUrl: function() {
174
166
  return this.uploadURL;
175
167
  },
@@ -211,12 +203,15 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
211
203
  formData.append('upload', file);
212
204
  });
213
205
  const options = {
214
- method: 'POST',
215
- headers: this.getHeaders(),
216
- body: formData,
206
+ url: this.uploadURL,
207
+ rawData: formData,
208
+ headers: {
209
+ 'Content-Type': null,
210
+ },
211
+ withCredentials: true,
217
212
  };
218
213
  this.uploadForm.mask('Файл загружается на сервер...');
219
- fetch(this.uploadURL, options)
214
+ Ext.Ajax.request(options)
220
215
  .then(this.extractResponse.bind(this))
221
216
  .then(function(response) {
222
217
  this.uploadForm.unmask();
@@ -240,19 +235,16 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
240
235
 
241
236
  /**
242
237
  * Извлечение результата
243
- * fetch обращает внимание на заголовок ответа content-type. В зависимости от заголовка до данных можно получить доступ по разному.
244
238
  * @param {Object} response
245
239
  * @returns {Promise<{data: (*|*), isJsonFormat: boolean, statusText: *, ok, status: *}>}
246
240
  */
247
- extractResponse: async function(response) {
248
- const resText = await response.text();
249
- const isJsonFormat = this.isJsonFormat(resText);
241
+ extractResponse: async function({responseText, status, statusText}) {
250
242
  return {
251
- ok: response.ok,
252
- status: response.status,
253
- statusText: response.statusText,
254
- isJsonFormat,
255
- data: resText,
243
+ ok: statusText.toLowerCase() === 'ok',
244
+ status,
245
+ statusText,
246
+ isJsonFormat: this.isJsonFormat(responseText),
247
+ data: responseText,
256
248
  };
257
249
  },
258
250
 
@@ -152,9 +152,8 @@ Ext.define('Coon.report.plugin.grid.OpenApiButtonPlugin', {
152
152
  const data = Ext.JSON.decode(resp.responseText, true);
153
153
  me.component.unmask();
154
154
  Ext.isFunction(me.completeHandler) && me.completeHandler(data);
155
-
156
155
  if (me.reloadAfterComplete) {
157
- me.component.fireEvent('needReload', this.reloadAfterComplete);
156
+ me.component.fireEvent('needReload', me.reloadAfterComplete);
158
157
  }
159
158
  if (me.successMessage) {
160
159
  Ext.Msg.alert(this.successTitle ? me.successTitle : 'Успешное выполнение'
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.52',
3
+ number: '3.0.53',
4
4
  });