ru.coon 2.5.49 → 2.5.50

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,4 +1,15 @@
1
+ # Version 2.5.50, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b79597948d4412d8613b028e5e07e49cfb173eb4)
2
+ * ## Features
3
+ * <span style='color:green'>feat: HT-7346: rename plugin</span> ([e06f2c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e06f2cd09c83890ca955c6a11d3071a8d31a1528))
4
+
5
+ * update: CHANGELOG.md ([9ca215], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9ca2159b8222b4953516c7720fc9f5dbe03e4337))
6
+
1
7
  # Version 2.5.49, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/322a8954fd81ce96ca3e60a23d7b46b4659f839b)
8
+ * ## Features
9
+ * <span style='color:green'>feat: HT-7346: select dock position (top or bottom)</span> ([45db87], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/45db8784c5594ea4add6dc701cd5deb0a2e592e3))
10
+ * <span style='color:green'>feat: HT-7346: add plugin</span> ([614610], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6146105ce74a3c4ab946da32dac3ab16aac848af))
11
+ * <span style='color:green'>feat: HT-7346: add plugin</span> ([e27670], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e27670eb8953cde6b5825b123d0f03d553c097a4))
12
+
2
13
  * ## Fixes
3
14
  * <span style='color:red'>fix Coon.util.promisifyCmd
4
15
  fix ReportPanel.loadData - abort previous request</span> ([03cfbd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/03cfbdf8eabc0a6fde879fa2ce52bd5126a823ee))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.49",
7
+ "version": "2.5.50",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,99 @@
1
+ Ext.define('Coon.uielement.plugin.UnifiedButtonToolbarPluginn', {
2
+ extend: 'Ext.AbstractPlugin',
3
+ alias: 'plugin.UnifiedButtonToolbarPluginn',
4
+ uses: [],
5
+ controller: null,
6
+ windowClose: false,
7
+ compareCash: false,
8
+ configurePanelWizardForFormEditor: 'UnifiedButtonToolbarPluginnConfigPanelFormEditor',
9
+
10
+ init: function(view) {
11
+ this.controller = view && view.getController();
12
+ this.controller.on('generateHash', this.generateHash, this);
13
+ this.controller.callDialog = this.callDialog.bind(this);
14
+ const window = view.up('WindowWrap');
15
+ if (window) {
16
+ window.on('beforeclose', this.onBeforeCloseWindow, this);
17
+ }
18
+ this.controller.standardToolbar = Ext.create('Ext.toolbar.Toolbar', {
19
+ dock: this.dock,
20
+ items: [
21
+ '->',
22
+ {
23
+ xtype: 'button',
24
+ reference: 'standardSaveButton',
25
+ text: 'Сохранить',
26
+ handler: this.save.bind(this, false),
27
+ }
28
+ ],
29
+ });
30
+ if (this.dock === 'bottom') {
31
+ view.dockedItems.add(this.controller.standardToolbar);
32
+ } else {
33
+ view.dockedItems.insert(0, this.controller.standardToolbar);
34
+ }
35
+ },
36
+ onBeforeCloseWindow() {
37
+ this.save(true);
38
+ },
39
+ callDialog() {
40
+ Ext.Msg.show({
41
+ title: 'Сохранить изменения?',
42
+ message: 'Были обнаружены изменения, сохранить их?',
43
+ buttons: Ext.Msg.YESNOCANCEL,
44
+ icon: Ext.Msg.QUESTION,
45
+ fn: function(btn) {
46
+ if (btn === 'yes') {
47
+ this.callSaveHandler(true);
48
+ } else if (btn === 'no') {
49
+ this.closeWindow();
50
+ }
51
+ },
52
+ });
53
+ },
54
+ closeWindow() {
55
+ this.controller.getView().up('WindowWrap').close();
56
+ },
57
+ save(windowClose) {
58
+ this.windowClose = windowClose;
59
+ if (this.prepareBeanHandlerName &&
60
+ this.controller[this.prepareBeanHandlerName] &&
61
+ typeof this.controller[this.prepareBeanHandlerName] === 'function') {
62
+ this.compareCash = true;
63
+ this.controller[this.prepareBeanHandlerName].call();
64
+ }
65
+ },
66
+ generateHash(params) {
67
+ if (params && Ext.isObject(params)) {
68
+ if (this.compareCash === true) {
69
+ this.compareCash = false;
70
+ const currentHash = Coon.util.generateHashFromObj(params);
71
+ if (this.controller.savedDataHash !== currentHash) {
72
+ if (this.windowClose) {
73
+ this.callDialog();
74
+ } else {
75
+ this.callSaveHandler();
76
+ }
77
+ }
78
+ } else {
79
+ this.controller.savedDataHash = Coon.util.generateHashFromObj(params);
80
+ }
81
+ }
82
+ },
83
+ async callSaveHandler(closeAfterSave) {
84
+ if (
85
+ this.saveHandlerName &&
86
+ this.controller[this.saveHandlerName] &&
87
+ typeof this.controller[this.saveHandlerName] === 'function'
88
+ ) {
89
+ if (this.controller[this.saveHandlerName] instanceof Promise) {
90
+ await this.controller[this.saveHandlerName].call(this.controller);
91
+ } else {
92
+ this.controller[this.saveHandlerName].call(this.controller);
93
+ }
94
+ if (closeAfterSave) {
95
+ this.closeWindow();
96
+ }
97
+ }
98
+ },
99
+ });
@@ -0,0 +1,100 @@
1
+ Ext.define('Coon.uielement.plugin.configPanel.UnifiedButtonToolbarPluginConfigPanelFormEditor', {
2
+ extend: 'Ext.panel.Panel',
3
+ alias: 'widget.UnifiedButtonToolbarPluginConfigPanelFormEditor',
4
+ description: 'Добавляет стандартный тулбар',
5
+ viewModel: {
6
+ data: {
7
+ saveHandlerName: '',
8
+ prepareBeanHandlerName: '',
9
+ dock: 'bottom',
10
+ },
11
+ },
12
+ layout: {
13
+ type: 'vbox',
14
+ align: 'stretch',
15
+ },
16
+ items: [
17
+ {
18
+ xtype: 'pluginDescriptionLabel',
19
+ bind: {
20
+ value: '{description}',
21
+ },
22
+ },
23
+ {
24
+ xtype: 'comboBtnWrapper',
25
+ combobox: {
26
+ xtype: 'BaseComboBox',
27
+ fieldLabel: 'Функция сохранения данных',
28
+ labelWidth: 60,
29
+ flex: 1,
30
+ loadOnRender: false,
31
+ hideMode: 'offsets',
32
+ allowBlank: false,
33
+ store: 'codeHandlers',
34
+ bind: {
35
+ value: '{saveHandlerName}',
36
+ },
37
+ valueField: 'id',
38
+ displayField: 'id',
39
+ },
40
+ },
41
+ {
42
+ xtype: 'comboBtnWrapper',
43
+ combobox: {
44
+ xtype: 'BaseComboBox',
45
+ fieldLabel: 'Функция подготовки данных для сохранения',
46
+ labelWidth: 60,
47
+ flex: 1,
48
+ loadOnRender: false,
49
+ hideMode: 'offsets',
50
+ allowBlank: false,
51
+ store: 'codeHandlers',
52
+ bind: {
53
+ value: '{prepareBeanHandlerName}',
54
+ },
55
+ valueField: 'id',
56
+ displayField: 'id',
57
+ },
58
+ },
59
+ {
60
+ xtype: 'segmentedbutton',
61
+ allowMultiple: false,
62
+ reference: 'segmentDock',
63
+ bind: {
64
+ value: '{dock}',
65
+ },
66
+ items: [{
67
+ text: 'Отобразить внизу',
68
+ value: 'bottom',
69
+ }, {
70
+ text: 'Отобразить вверху',
71
+ value: 'top',
72
+ }],
73
+ }
74
+ ],
75
+ getData: function() {
76
+ return this.getConfiguration();
77
+ },
78
+ setData: function(data) {
79
+ data && this.doInit(data);
80
+ },
81
+ doInit: function(config) {
82
+ this.getViewModel().set('description', this.description);
83
+ for (const parameterName in config) {
84
+ if (!config.hasOwnProperty(parameterName) || parameterName === 'ptype') {
85
+ continue;
86
+ }
87
+ this.getViewModel().set(parameterName, config[parameterName]);
88
+ }
89
+ },
90
+ getConfiguration: function() {
91
+ const result = {};
92
+ const vm = this.getViewModel();
93
+ ['saveHandlerName', 'prepareBeanHandlerName', 'dock'].forEach((el) => {
94
+ if (vm.get(el)) {
95
+ result[el] = vm.get(el);
96
+ }
97
+ });
98
+ return result;
99
+ },
100
+ });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.5.49',
3
+ number: '2.5.50',
4
4
  });