ru.coon 3.0.51 → 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,24 @@
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
+
8
+ # Version 3.0.52, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/290ca0d6e133cd9631aae34caa6f0c63ab449128)
9
+ * ## Features
10
+ * <span style='color:green'>feat: NEVA-974: Добавил возможность выбора нескольких файлов</span> ([2f49c5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2f49c53d5af263c1c7931497140faea164a94357))
11
+ * <span style='color:green'>feat: NEVA-974: Убрал вставляемый по дефолту заголовок, при интеграции в форму он не всегда нужен</span> ([c03ca9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c03ca9eb849b2011ce03dc0600e0ce39a0dd28b4))
12
+
13
+ * ## Fixes
14
+ * <span style='color:red'> UiCustomController title setup</span> ([c1d588], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c1d588bd0dcf2c1d91ff99644a94b8408a008c98))
15
+
16
+ * upd ([9204e3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9204e301a710bf0fb0d0742f88986cf281d62230))
17
+ * upd ([800934], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/800934ee0dfb8d8d4965fb46e1b34f686b59da4f))
18
+ * upd ([98cb3c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/98cb3c6330d03a5d0da6604c7884375a42b03993))
19
+ * upd ([bb5a58], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bb5a58174b8e00131cb673d27c42566df615c52c))
20
+ * update: CHANGELOG.md ([44a62d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/44a62d6492224a185291f9cd359bff3655b79991))
21
+
1
22
  # Version 3.0.51, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/64e72d95cacc2f81ab46d1d6d36728f73d0fa68e)
2
23
  * ## Features
3
24
  * <span style='color:green'>feat: NEVA-974: Доработка передачи в сервиз загрузки файлов обязательного параметра fileTypeId</span> ([5154fb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5154fbb972d7b84a0d880babe97b81fb16f9001c))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.51",
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"
@@ -129,7 +129,7 @@ Ext.define('Coon.app.viewPort.CenterView', {
129
129
  this.add(component);
130
130
 
131
131
  component.on('titlechange', function(_, title) {
132
- title = title || '<span style="color:red">ошибка</span>';
132
+ title = title || Coon.format.withHint('<span style="color:red">---</span>', 'заголовок не задан');
133
133
  if (typeof title !== 'string') {
134
134
  if (typeof title.getTitle !== 'function') {
135
135
  return;
@@ -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
 
@@ -161,7 +161,8 @@ Ext.define('Coon.common.panel.WindowWrap', {
161
161
  this.doClose();
162
162
  }, this);
163
163
 
164
- this.content.on('titlechange', function(view, title) {
164
+ this.content.on('titlechange', function(_, title) {
165
+ title = title || Coon.format.withHint('<span style="color:red">---</span>', 'заголовок не задан');
165
166
  if (typeof title !== 'string') {
166
167
  if (typeof title.getTitle !== 'function') {
167
168
  return;
@@ -114,7 +114,7 @@ Ext.define('Coon.common.panel.dropzone.UniversalMultiUploadForm', {
114
114
  const docElem = document.documentElement;
115
115
  const y = window.innerHeight|| docElem.clientHeight;
116
116
  this.height = y > 0 ? y * 0.8 : 600;
117
- this.title = this.title || 'Форма загрузки данных';
117
+ // this.title = this.title || 'Форма загрузки данных';
118
118
  this.buttons = this.createButtons();
119
119
  this.uploadForm = Ext.create('Ext.form.Panel', {
120
120
  reference: 'formPanelRef',
@@ -15,7 +15,7 @@ Ext.define('Coon.common.panel.dropzone.UploadDropZone', {
15
15
  <span><i class="fa fa-cloud-upload-alt icon-upload" style=""></i></span>
16
16
  ${this.baseText}
17
17
  </div>
18
- <input name="files[]" type="file" class="file-input" />
18
+ <input name="files[]" type="file" multiple class="file-input" />
19
19
  </div>`);
20
20
  this.callParent();
21
21
  },
@@ -169,7 +169,7 @@ Ext.define('Coon.report.component.report.NorthPanel', {
169
169
  Ext.merge(this, properties);
170
170
  this.filterPlugins.push({
171
171
  ptype: 'EnterConfirmFormPlugin',
172
- confirmHandler: this.reportPanel ? Ext.bind(this.reportPanel.filterHandler, this.reportPanel) : Ext.emptyFn,
172
+ confirmHandler: report ? Ext.bind(report.filterHandler, report) : Ext.emptyFn,
173
173
  });
174
174
  this.filterPlugins.push(Ext.apply({
175
175
  ptype: 'FormFieldFocusPlugin',
@@ -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 : 'Успешное выполнение'
@@ -140,29 +140,66 @@ Ext.define('Coon.uielement.component.UiCustomController', {
140
140
  return staticPlace === 'end' ? `${contextPart}${delimiterPart}${staticPart}` : `${staticPart}${delimiterPart}${contextPart}`;
141
141
  },
142
142
 
143
- setCustomPanelTitle(title) {
143
+ getComponentTitle() {
144
144
  const componentTitle = this.getView().componentTitle;
145
- if (!title && Ext.isObject(componentTitle) && (componentTitle.static || componentTitle.context)) {
145
+ return Ext.isObject(componentTitle) &&
146
+ (componentTitle.static || componentTitle.context) &&
147
+ componentTitle;
148
+ },
149
+
150
+ setCustomPanelTitle() {
151
+ const setupTitle = (title, options = {}) => {
152
+ const view = this.getView();
153
+ if (!typeof title === 'string') {
154
+ return;
155
+ }
156
+ title = title || Coon.format.withHint('<span style="color:red">---</span>', 'заголовок не задан');
157
+ view.titleText = title;
158
+ if (
159
+ view.tab && typeof view.tab.setTooltip === 'function'
160
+ ) {
161
+ this.getView().tab.setTooltip(title);
162
+ }
163
+ if (!options.silent) {
164
+ view.fireEvent('titlechange', this.getView(), title);
165
+ }
166
+ };
167
+
168
+ const componentTitle = this.getComponentTitle();
169
+ if (componentTitle) {
146
170
  const {static: staticText, context} = componentTitle;
147
171
  const testContext = /^[a-zA-Z._]+$/;
148
172
  if (typeof context === 'string' && testContext.test(context)) {
149
- this.getViewModel().bind(`{${context}}`, function(contextValue, ...args) {
150
- this.setCustomPanelTitle(
151
- this.makeComponentTitle(staticText, contextValue)
173
+ this.getViewModel().bind(`{${context}}`, function(contextValue) {
174
+ setupTitle(
175
+ this.makeComponentTitle(staticText, contextValue),
176
+ {silent: true}
152
177
  );
153
178
  }, this);
154
179
  } else {
155
- this.setCustomPanelTitle(
156
- this.makeComponentTitle(staticText)
180
+ setupTitle(
181
+ this.makeComponentTitle(staticText),
182
+ {silent: true}
157
183
  );
158
184
  }
159
- return;
185
+ } else {
186
+ let title = this.getView().getTitle();
187
+ if (Ext.isObject(title) && typeof title.getTitle === 'function') {
188
+ title = title.getTitle();
189
+ }
190
+ setupTitle(title);
160
191
  }
192
+ },
193
+
194
+ setupTitle(title, options = {}) {
161
195
  if (!typeof title === 'string') {
162
196
  return;
163
197
  }
198
+ title = title || Coon.format.withHint('<span style="color:red">---</span>', 'заголовок не задан');
164
199
  this.getView().titleText = title;
165
- this.getView().fireEvent('titlechange', this.getView(), title);
200
+ if (!options.silent) {
201
+ this.getView().fireEvent('titlechange', this.getView(), title);
202
+ }
166
203
  if (
167
204
  this.getView().tab &&
168
205
  typeof this.getView().tab.setTooltip === 'function'
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.51',
3
+ number: '3.0.53',
4
4
  });