ru.coon 2.5.46 → 2.5.48

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,17 @@
1
+ # Version 2.5.48, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ab1fb66dd225271b18992c928a288a9d5115ff7b)
2
+ * add decimal-light - arbitrary-precision Decimal type for JavaScript
3
+ fix Coon.format.MoneyFormat, zero always format as positive value ([09a4ad], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/09a4ad9879f025371db56475252ec93eeb52b265))
4
+ * HT-7447 feat: возможность создавать свойства команды с описанием ([cc129c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cc129c3265992db5f859f9e32fdc95cd8a3ad88f))
5
+ * HT-7594 При добавлении УУТЭ иногда значения характеристик с датами не отображаются ([2348bf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2348bf78876bcb5c0e81d37b36f89d5a85a7d9d4))
6
+ * update: CHANGELOG.md ([b7579a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b7579a137a55be1d35602720fa3aef2909b7b635))
7
+
8
+ # Version 2.5.47, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a3061f6bf3784b7dde9188ca397ea6534832223c)
9
+ * ## Fixes
10
+ * <span style='color:red'>fix promisifyCmd
11
+ fix ExecuteCommandPlugin - remove reject on failure if command hasnt erorHandler</span> ([f8c65b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f8c65b552adfb698809815fc5f2d80f3f5fdb5ee))
12
+
13
+ * update: CHANGELOG.md ([4d5a2a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4d5a2ac3120c4aba6a672256fc7cc977014f3591))
14
+
1
15
  # Version 2.5.46, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a60918e34030d42d694153e8a86fa2c13c97e3a0)
2
16
  * Update src/util.js ([da9c30], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da9c307688b60cfa198137929578f257e3d0645f))
3
17
  * HT-7570 Падает SelectionModelFeature ([df48e2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/df48e24511eec0e5572d30984fbf6d24ec2e09cd))
package/index.js CHANGED
@@ -7,6 +7,7 @@ import xAceJson from 'ace-builds/src-noconflict/mode-json5';
7
7
  import xAceLangTool from 'ace-builds/src-noconflict/ext-language_tools';
8
8
  import xAceSnippets from 'ace-builds/src-noconflict/snippets/snippets';
9
9
  import JSON5 from 'json5';
10
+ import Decimal from 'decimal.js-light';
10
11
  import {format as formatSQL} from 'sql-formatter';
11
12
  import 'extjs_iconpack';
12
13
  import 'ace-diff/dist/ace-diff.min.css';
@@ -24,7 +25,7 @@ import 'ace-builds/src-noconflict/snippets/pgsql';
24
25
 
25
26
  xAceEditor.config.set('basePath', '/node_modules/ace-builds/src-noconflict/');
26
27
 
27
- Object.assign(window, {JSON5, ace: xAceEditor});
28
+ Object.assign(window, {JSON5, ace: xAceEditor, Decimal});
28
29
 
29
30
  Object.assign(Ext || {}, {
30
31
  xEchartsJs,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.46",
7
+ "version": "2.5.48",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -25,6 +25,7 @@
25
25
  "dependencies": {
26
26
  "ace-builds": "1.4.12",
27
27
  "ace-diff": "^3.0.3",
28
+ "decimal.js-light": "^2.5.1",
28
29
  "echarts": "^5.3.3",
29
30
  "extjs_iconpack": "1.3.15",
30
31
  "json5": "2.2.3",
@@ -18,12 +18,41 @@ Ext.define('Coon.command.ASyncBaseCommand', {
18
18
  makeLoadEventConfig: {
19
19
  buffer: 100,
20
20
  },
21
+ /**
22
+ * Функция, возвращающая список свойств команды.
23
+ * Свойства команды загружаются в редакторе отчетов в плагине для удобства конфигурирования команды.
24
+ * В случае, если в конфиге команды свойства будут отсутствовать, в конструкторе они будут добавлены со значениями по умолчанию.
25
+ * @example
26
+ * commandProperties: function() {
27
+ * return [
28
+ * {
29
+ * name: 'processIDAsCode', // имя свойства команды
30
+ * description: 'Параметр ...', // описание, которое отобразится в редакторе отчетов и будет полезно конфигуратору
31
+ * defaultValue: undefined, // значение по умолчанию для свойства команды
32
+ * },
33
+ * ]
34
+ * }
35
+ */
36
+ commandProperties: undefined,
21
37
 
22
38
  constructor: function(config) {
23
39
  this.isActive = false;
24
40
  this.requestCount = 0;
25
41
  this.executedRequestCount = 0;
26
42
  this.callParent([config]);
43
+
44
+ if (typeof this.commandProperties === 'function') {
45
+ Ext.applyIf(
46
+ config,
47
+ Object.fromEntries(
48
+ this.commandProperties().map(
49
+ (el) => [el.name, el.defaultValue]
50
+ )
51
+ )
52
+ );
53
+ }
54
+ Ext.apply(this, config);
55
+
27
56
  this.on('makeLoad', async function(params, jsonData, requestCount) {
28
57
  try {
29
58
  const isEnabled = this.requiredAuth && await Coon.common.component.Auth.isEnabled();
@@ -261,10 +261,10 @@ Ext.define('Coon.common.component.editor.DateTypeEditor', {
261
261
  const ns = Coon.report.model.CharacteristicBeanFields;
262
262
  this.mask = this.parseMask(record.get(ns.$mask));
263
263
  if (this.mask['valueFormat']) {
264
- this.record.set(ns.$value,
264
+ record.set(ns.$value,
265
265
  Ext.util.Format.dateRenderer(this.mask['valueFormat'])(value));
266
266
  }
267
- this.record.set(ns.$valueDescription,
267
+ record.set(ns.$valueDescription,
268
268
  Ext.util.Format.dateRenderer(this.mask['displayFormat'] || 'd.m.Y')(value));
269
269
  },
270
270
 
package/src/format.js CHANGED
@@ -118,8 +118,9 @@ Ext.define('Coon.format', {
118
118
  stringValue.length : (stringValue.indexOf('.') + 1));
119
119
  },
120
120
 
121
- MoneyFormat: function(v) {
122
- return this.bigNumFormat(v, '.', ' ', 2);
121
+ MoneyFormat: function(v, decSeparator, groupSeparator) {
122
+ const result = this.bigNumFormat(v, decSeparator || '.', groupSeparator || ' ', 2);
123
+ return Number.parseFloat(result) === 0 ? result.replace('-', '') : result;
123
124
  },
124
125
 
125
126
  comboRenderer: function(combo, customStyle) {
@@ -0,0 +1,7 @@
1
+ **спецификация:**
2
+
3
+ входные параметры:
4
+
5
+ - exportFileFormat [xls/pdf]
6
+ - allowUserSelectColumnsToUpload
7
+ - addToSearchButton добавить в кнопку "поиск", в этом случае в качестве параметра отправляем текущие параметры из FilterPanel(useRawFilterParams: true)
@@ -121,8 +121,6 @@ Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
121
121
  this.processError(e);
122
122
  Coon.log.error(ex);
123
123
  }
124
- } else {
125
- reject(e);
126
124
  }
127
125
  }, this);
128
126
 
package/src/util.js CHANGED
@@ -30,27 +30,21 @@ Ext.define('Coon.util', {
30
30
  },
31
31
 
32
32
  promisifyCmd(cls, ...args) {
33
- let alias = cls;
34
- if (Ext.isObject(cls)) {
35
- alias = cls.command;
36
- cls.getParamsFromObject = true;
37
- }
38
-
39
- let command;
40
- if (this.isCommand(alias)) {
41
- command = alias;
42
- } else {
43
- if (!Coon.util.isCommandAlias(alias)) {
44
- if (!this.isCommandClass(alias)) {
45
- throw new Error(alias + ' is not a command class!');
46
- }
47
- Coon.log.debug(alias, 'is not a command alias');
33
+ const getCommand = (cmd) => {
34
+ if (this.isCommand(cmd)) {
35
+ return cmd;
48
36
  }
49
- command = Ext.create(alias, {processError: true});
50
- }
51
- if (!command) {
52
- throw new Error('promisifyCmd command is invalid!');
53
- }
37
+ if (Ext.isObject(cmd) && (this.isCommandAlias(cmd.command) || this.isCommandClass(cmd.command))) {
38
+ args = cmd.params;
39
+ cmd.getParamsFromObject = true;
40
+ return Ext.create(cmd.command, {process: typeof cmd.process === 'boolean' ? cmd.process : true});
41
+ }
42
+ if (this.isCommandAlias(cmd) || this.isCommandClass(cmd)) {
43
+ return Ext.create(cmd, {process: true});
44
+ }
45
+ throw new Error(`promisifyCmd error: this command is neither an alias nor a class`);
46
+ };
47
+ const command = getCommand(cls);
54
48
  return new Promise((resolve, reject) => {
55
49
  if (cls.getParamsFromObject) {
56
50
  command.executeWith(cls.params);
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.5.46',
3
+ number: '2.5.48',
4
4
  });