ru.coon 2.7.31 → 2.7.33

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,15 @@
1
+ # Version 2.7.33, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e47cc0c267a947daeb5624b8f174b5a8a8e22375)
2
+ * ## Fixes
3
+ * <span style='color:red'> add requiredAuth property support for MainUploadPanel, BFL-13506</span> ([cf56d8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cf56d8856ffd43090110911e176e3ca37ee7c050))
4
+
5
+ * update: CHANGELOG.md ([80aedf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/80aedfb364555f00fb354d3cd444718756546ffe))
6
+
7
+ # Version 2.7.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/40925f0ca399d6d5da42511e20b8c7fa10acadaf)
8
+ * ## Features
9
+ * <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))
10
+
11
+ * update: CHANGELOG.md ([1e8b7b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e8b7b6e038fb0ea66ce786f648af3e4934afc11))
12
+
1
13
  # Version 2.7.31, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b6fab6651c567feee5d735e2fd1af27ea315d393)
2
14
  * ## Features
3
15
  * <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.33",
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
+ });
@@ -80,6 +80,21 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
80
80
  }, this.formConfig));
81
81
  this.items = [this.uploadForm];
82
82
  this.callParent();
83
+ if (this.requiredAuth) {
84
+ return this.checkAuth();
85
+ }
86
+ },
87
+
88
+ async checkAuth() {
89
+ const isEnabled = await Coon.common.component.Auth.isEnabled();
90
+ try {
91
+ if (isEnabled && ! await Coon.common.component.Auth.handleAuthorization()) {
92
+ this.mask('Не удалось авторизоваться');
93
+ throw new Error('Не удалось авторизоваться');
94
+ }
95
+ } catch (ex) {
96
+ Coon.log.log(ex);
97
+ }
83
98
  },
84
99
 
85
100
  createButtons: function() {
@@ -8,6 +8,7 @@ Ext.define('Coon.report.component.EXTJSReportUploadForm', {
8
8
  alternateClassName: 'Sigma.common.components.report.list.EXTJSReportUploadForm',
9
9
 
10
10
  title: 'Импорт отчета',
11
+ requiredAuth: true,
11
12
  uploadFieldLabel: 'Файл с отчетом',
12
13
  uploadURL: 'ReportFormImport/import',
13
14
  allowMultipleUpload: false,
@@ -6,6 +6,7 @@ Ext.define('Coon.report.component.EXTJSUiPanelUploadForm', {
6
6
  'Coon.CustomXMLReader'
7
7
  ],
8
8
  useXhr: true,
9
+ requiredAuth: true,
9
10
  title: 'Импорт настраиваемой панели',
10
11
  uploadFieldLabel: 'Файл с панелью',
11
12
  uploadURL: 'UIElement/import',
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.33',
4
4
  });
@@ -1,5 +0,0 @@
1
- Ext.define('Coon.common.field.checkbox.RoundCheckbox', {
2
- extend: 'Ext.form.field.Checkbox',
3
- cls: 'RoundCheckbox',
4
- xtype: ['roundcheckbox', 'RoundCheckbox'],
5
- });
@@ -1,48 +0,0 @@
1
- .x-form-fieldCheckbox {
2
- .x-form-field {
3
- position: relative;
4
- }
5
-
6
- .x-form-field label {
7
- background-color: #fff;
8
- border: 1px solid #ccc;
9
- border-radius: 50%;
10
- cursor: pointer;
11
- height: 28px;
12
- left: 0;
13
- position: absolute;
14
- top: 0;
15
- width: 28px;
16
- }
17
-
18
- .x-form-field label:after {
19
- border: 2px solid #fff;
20
- border-top: none;
21
- border-right: none;
22
- content: "";
23
- height: 6px;
24
- left: 7px;
25
- opacity: 0;
26
- position: absolute;
27
- top: 8px;
28
- transform: rotate(-45deg);
29
- width: 12px;
30
- }
31
-
32
- .x-form-field input[type="checkbox"] {
33
- visibility: hidden;
34
- }
35
-
36
- .x-form-field input[type="checkbox"]:checked + label {
37
- background-color: #66bb6a;
38
- border-color: #66bb6a;
39
- }
40
-
41
- .x-form-field input[type="checkbox"]:checked + label:after {
42
- opacity: 1;
43
- }
44
-
45
- .x-form-item-body, .x-form-cb-wrap-inner {
46
- margin: 0 auto;
47
- }
48
- }
@@ -1,23 +0,0 @@
1
- Ext.define('Coon.nav.MenuLoader', {
2
- singleton: true,
3
-
4
- isLoaded: false,
5
-
6
- load() {
7
- return Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
8
- .then((data) => {
9
- if (Array.isArray(data.list)) {
10
- this.uiElementMap = data.list.reduce();
11
- }
12
- this.isLoaded = true;
13
- });
14
- },
15
-
16
- get() {
17
-
18
- },
19
-
20
- isValidMenuItem(uiEmentId) {
21
- return this.uiElementMap.has(uiEmentId);
22
- },
23
- });
@@ -1,7 +0,0 @@
1
- **спецификация:**
2
-
3
- входные параметры:
4
-
5
- - exportFileFormat [xls/pdf]
6
- - allowUserSelectColumnsToUpload
7
- - addToSearchButton добавить в кнопку "поиск", в этом случае в качестве параметра отправляем текущие параметры из FilterPanel(useRawFilterParams: true)