ru.coon 2.7.31 → 2.7.32

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,9 @@
1
+ # Version 2.7.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/40925f0ca399d6d5da42511e20b8c7fa10acadaf)
2
+ * ## Features
3
+ * <span style='color:green'>feat: HT-8492: create new type field</span> ([0657da], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0657da1e4ba8e54a47eaca571cf71596c8107c7c))
4
+
5
+ * update: CHANGELOG.md ([1e8b7b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e8b7b6e038fb0ea66ce786f648af3e4934afc11))
6
+
1
7
  # Version 2.7.31, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b6fab6651c567feee5d735e2fd1af27ea315d393)
2
8
  * ## Features
3
9
  * <span style='color:green'>feat: HT-8131 add TreeNestingToolbarButtonPlugin</span> ([15ec59], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/15ec59a4f41473a5d0cd8a174c641875ec95418b))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.31",
7
+ "version": "2.7.32",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,139 @@
1
+ Ext.define('Coon.common.field.PeriodByReportField', {
2
+ extend: 'Coon.report.component.SimplestReportCombo',
3
+ xtype: 'PeriodByReportField',
4
+ config: {
5
+ periodEndName: undefined,
6
+ periodStart: undefined,
7
+ periodEnd: undefined,
8
+ dateFormatDB: 'Y-m',
9
+ /* defaultValueOpt: {
10
+ key: 'IS_DEFAULT',
11
+ value: 'Y',
12
+ },*/
13
+ defaultValueOpt: undefined,
14
+ },
15
+ setInitDateToEnd: false,
16
+ triggers: {
17
+ back: {
18
+ cls: 'x-fa fa-arrow-left',
19
+ handler: (cmp) => {
20
+ cmp.goBack();
21
+ },
22
+ },
23
+ forward: {
24
+ cls: 'x-fa fa-arrow-right',
25
+ handler: (cmp) => {
26
+ cmp.goForward();
27
+ },
28
+ },
29
+ },
30
+
31
+ goBack(setValToRef) {
32
+ if (!this.getValue()) {
33
+ return;
34
+ }
35
+ const store = this.getStore();
36
+ const curRecordPosition = store.find(this.valueField, this.getValue());
37
+ if (curRecordPosition >= 0 && curRecordPosition < (store.getData().length - 1)) {
38
+ const rec = store.getAt(curRecordPosition + 1);
39
+ rec && this.select(rec);
40
+ if (setValToRef) {
41
+ this.getPeriodStart() && this.getPeriodStart().setValue(rec.get(this.valueField));
42
+ this.getPeriodEnd() && this.getPeriodEnd().setValue(rec.get(this.valueField));
43
+ }
44
+ return;
45
+ }
46
+ if (this.getPeriodStart()) {
47
+ this.getPeriodStart().fireEvent('goBack', true);
48
+ return;
49
+ }
50
+ },
51
+
52
+ goForward(setValToRef) {
53
+ if (!this.getValue()) {
54
+ return;
55
+ }
56
+ const store = this.getStore();
57
+ const curRecordPosition = store.find(this.valueField, this.getValue());
58
+ if (curRecordPosition > 0) {
59
+ const rec = store.getAt(curRecordPosition - 1);
60
+ rec && this.select(rec);
61
+ return;
62
+ }
63
+ },
64
+
65
+ doInit(startDate) {
66
+ if (startDate && Ext.isDate(new Date(startDate))) {
67
+ this.setStartDate(startDate);
68
+ }
69
+ },
70
+
71
+ setStartDate(value) {
72
+ this.setValue(value);
73
+ },
74
+
75
+ setEndDate(value) {
76
+ const field = this.getEndField();
77
+ field && field.setValue(value);
78
+ },
79
+
80
+ getEndField() {
81
+ if (!this.getPeriodEndName()) {
82
+ return null;
83
+ };
84
+ const ownerCmp = this.up('FilterPanel') || this.up('[dataId=FilterPanel]') || this.up();
85
+ let cmpQuery = [];
86
+ if (ownerCmp) {
87
+ cmpQuery = Ext.ComponentQuery.query(`[name=${this.getPeriodEndName()}]`, ownerCmp);
88
+ }
89
+ return cmpQuery.length && this.setPeriodEnd(cmpQuery[0]) && cmpQuery[0];
90
+ },
91
+
92
+ onStoreLoad(store) {
93
+ if (this.getValue()) {
94
+ return;
95
+ }
96
+ const opt = this.getDefaultValueOpt();
97
+ let number = 0;
98
+ if (opt && opt.key && opt.value) {
99
+ number = store.find(opt.key, opt.value);
100
+ } else if (this.getPeriodEndName()) {
101
+ number = store.find(this.valueField, Ext.Date.format(new Date(), this.getDateFormatDB()));
102
+ }
103
+ if (this.getPeriodEndName()) {
104
+ this.setInitDateToEnd = true;
105
+ }
106
+ this.select(this.getStore().getAt(number >= 0 ? number : 0));
107
+ },
108
+
109
+ initComponent: function() {
110
+ this.callParent();
111
+ this.on('goForward', this.goForward, this);
112
+ this.on('goBack', this.goBack, this);
113
+ this.on('change', () => {
114
+ const startDate = this.getValue();
115
+ const fieldEndDate = this.getEndField();
116
+ if (fieldEndDate && startDate) {
117
+ fieldEndDate.setPeriodStart(this);
118
+ const endDate = fieldEndDate.getValue();
119
+ const filters = fieldEndDate.getStore().getFilters();
120
+
121
+ const fn = (item) => {
122
+ return item.get(fieldEndDate.valueField) >= this.getValue();
123
+ };
124
+ filters.remove(fn);
125
+ filters.add(fn);
126
+ if (this.setInitDateToEnd) {
127
+ this.setInitDateToEnd = false;
128
+ fieldEndDate.setValue(startDate);
129
+ fieldEndDate.getValue();
130
+ return;
131
+ }
132
+ if (startDate > endDate) {
133
+ fieldEndDate.setValue(startDate);
134
+ }
135
+ }
136
+ }, this);
137
+ this.getStore().on('load', this.onStoreLoad, this);
138
+ },
139
+ });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.31',
3
+ number: '2.7.32',
4
4
  });