complexqa_frontend_core 1.19.9 → 1.20.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.19.9",
3
+ "version": "1.20.1",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,11 +1,21 @@
1
1
  import { typeBugRelation } from '../../../types/family_relation/typeBugRelation.js';
2
2
  import { typeTestCase } from '../../../types/family_elements/typeTestCase.js';
3
3
  import { typeTestRunResult } from '../../../types/family_elements/typeTestRunResult.js';
4
+ import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
4
5
  import { typeBug } from '../../../types/family_elements/typeBug.js';
5
6
  import { UserService } from '../../../services/UserService.js';
6
7
  import { createColumn, createGoToColumn } from '../helpers/column_factory.js';
7
8
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
8
9
 
10
+ const EXECUTION_CONTEXT_FK_FIELDS = [
11
+ 'browser_context_id',
12
+ 'os_context_id',
13
+ 'screen_resolution_context_id',
14
+ 'device_context_id',
15
+ 'locale_context_id',
16
+ 'deployment_target_context_id',
17
+ ];
18
+
9
19
  /**
10
20
  * Колонки связанных тест-кейсов на странице bug/details.
11
21
  * Поля совпадают с test_case × listing, данные — через hydrate element_id.
@@ -124,7 +134,44 @@ function build_bug_relation_test_run_results_columns(locale)
124
134
 
125
135
 
126
136
  /**
127
- * Секции `bug_relation`: `test_cases`, `bugs`, `test_run_results`.
137
+ * Колонки связанных контекстов выполнения на странице bug/details.
138
+ * Поля совпадают с execution_context × listing, данные — через hydrate element_id.
139
+ *
140
+ * @param {string} locale
141
+ * @returns {import('../../../types/family_service/typeTableColumn.js').typeTableColumn[]}
142
+ */
143
+ function build_bug_relation_execution_contexts_columns(locale)
144
+ {
145
+ const relation_model = new typeBugRelation();
146
+ const context_model = new typeExecutionContext();
147
+ const columns = [];
148
+
149
+ const ecColumn = (field, overrides = {}) => createColumn(relation_model, locale, `element_id.${ field }`, {
150
+ header_field : field,
151
+ header_element_type : 'execution_context',
152
+ is_editable : false,
153
+ ...overrides,
154
+ });
155
+
156
+ columns.push(ecColumn('execution_context_id', { width: '60', default_sort: 'desc' }));
157
+ columns.push(ecColumn('context_title', {
158
+ width : '420',
159
+ is_required : false,
160
+ is_title : true,
161
+ }));
162
+ columns.push(...EXECUTION_CONTEXT_FK_FIELDS.map((field) => ecColumn(field, { width: '200' })));
163
+ columns.push(ecColumn('protocol', { width: '120' }));
164
+ columns.push(ecColumn('host', { width: '200' }));
165
+ columns.push(ecColumn('build_version', { width: '160' }));
166
+ columns.push(ecColumn('created_at', { width: '170', is_required: true }));
167
+ columns.push(createGoToColumn(context_model, locale, { field: 'element_id' }));
168
+
169
+ return columns;
170
+ }
171
+
172
+
173
+ /**
174
+ * Секции `bug_relation`: `test_cases`, `bugs`, `test_run_results`, `execution_contexts`.
128
175
  *
129
176
  * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
130
177
  * @returns {void}
@@ -141,6 +188,10 @@ export function bootstrap_bug_relation(config)
141
188
  for: createListingFor([ 'bug_id', 'relation_type' ], { add: [ 'elements' ] }),
142
189
  });
143
190
 
191
+ registerSection(config, 'bug_relation', 'execution_contexts', build_bug_relation_execution_contexts_columns(locale), {
192
+ for: createListingFor([ 'bug_id', 'relation_type' ], { add: [ 'elements' ] }),
193
+ });
194
+
144
195
  registerSection(config, 'bug_relation', 'bugs', build_bug_relation_bugs_columns(locale), {
145
196
  for: createListingFor([ 'relation_type', 'element_id' ], { add: [ 'bugs' ] }),
146
197
  });
@@ -1,6 +1,6 @@
1
1
  import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
2
2
  import { UserService } from '../../../services/UserService.js';
3
- import { createColumn, createGoToColumn, createPrimaryKeyColumn } from '../helpers/column_factory.js';
3
+ import { createColumn, createGoToColumn, createPrimaryKeyColumn, createRowSelectColumn } from '../helpers/column_factory.js';
4
4
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
5
5
 
6
6
  const FK_FIELDS = [
@@ -65,7 +65,35 @@ function build_execution_context_details_columns(locale)
65
65
 
66
66
 
67
67
  /**
68
- * Секции `execution_context`: `listing`, `details`.
68
+ * Колонки выбора контекста выполнения (диалог связывания на bug/details).
69
+ * Без goto; context_title шире listing на 50px.
70
+ *
71
+ * @param {string} locale
72
+ * @returns {import('../../../types/family_service/typeTableColumn.js').typeTableColumn[]}
73
+ */
74
+ function build_execution_context_picker_columns(locale)
75
+ {
76
+ const model = new typeExecutionContext();
77
+
78
+ return [
79
+ createRowSelectColumn(),
80
+ createColumn(model, locale, 'context_title', {
81
+ width : '470',
82
+ is_editable : false,
83
+ is_required : true,
84
+ is_sortable : false,
85
+ is_filter : false,
86
+ }),
87
+ createColumn(model, locale, 'protocol', { width: '120', is_editable: false, is_sortable: false, is_filter: false }),
88
+ createColumn(model, locale, 'host', { width: '200', is_editable: false, is_sortable: false, is_filter: false }),
89
+ createColumn(model, locale, 'build_version', { width: '160', is_editable: false, is_sortable: false, is_filter: false }),
90
+ createColumn(model, locale, 'created_at', { width: '170', is_required: true, is_sortable: false, is_filter: false }),
91
+ ];
92
+ }
93
+
94
+
95
+ /**
96
+ * Секции `execution_context`: `listing`, `details`, `picker`.
69
97
  *
70
98
  * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
71
99
  * @returns {void}
@@ -78,5 +106,9 @@ export function bootstrap_execution_context(config)
78
106
  for: createListingFor([ 'project_id' ]),
79
107
  });
80
108
 
109
+ registerSection(config, 'execution_context', 'picker', build_execution_context_picker_columns(locale), {
110
+ for: createListingFor([ 'project_id' ]),
111
+ });
112
+
81
113
  registerSection(config, 'execution_context', 'details', build_execution_context_details_columns(locale));
82
114
  }
@@ -3,7 +3,7 @@ import _ from 'underscore';
3
3
  import { familyRelation } from '../core/1_familyRelation.js';
4
4
 
5
5
  /**
6
- * Связь бага с сущностью TMS: test case, test run, test run result.
6
+ * Связь бага с сущностью TMS / контекстом выполнения.
7
7
  *
8
8
  * @see docs/Relations/bug-relation-docs.MD
9
9
  *
@@ -24,9 +24,18 @@ export class typeBugRelation extends familyRelation
24
24
  api_key = 'bug_relation';
25
25
 
26
26
  static relation_target_map = {
27
- test_case_id : { type_token: 'typeTestCase', primary_key: 'test_case_id', api_key: 'test_case' },
28
- test_run_id : { type_token: 'typeTestRun', primary_key: 'test_run_id', api_key: 'test_run' },
29
- test_run_result_id: { type_token: 'typeTestRunResult', primary_key: 'test_run_result_id', api_key: 'test_run_result' },
27
+ test_case_id : { type_token: 'typeTestCase', primary_key: 'test_case_id', api_key: 'test_case' },
28
+ test_run_id : { type_token: 'typeTestRun', primary_key: 'test_run_id', api_key: 'test_run' },
29
+ test_run_result_id : {
30
+ type_token : 'typeTestRunResult',
31
+ primary_key: 'test_run_result_id',
32
+ api_key : 'test_run_result'
33
+ },
34
+ execution_context_id: {
35
+ type_token : 'typeExecutionContext',
36
+ primary_key: 'execution_context_id',
37
+ api_key : 'execution_context'
38
+ },
30
39
  };
31
40
 
32
41
  structure_scheme = {
@@ -49,14 +58,16 @@ export class typeBugRelation extends familyRelation
49
58
  enum_value_translate_matrix = {
50
59
  relation_type: {
51
60
  en: {
52
- test_case_id : 'Test case',
53
- test_run_id : 'Test run',
54
- test_run_result_id: 'Test run result',
61
+ test_case_id : 'Test case',
62
+ test_run_id : 'Test run',
63
+ test_run_result_id : 'Test run result',
64
+ execution_context_id: 'Execution context',
55
65
  },
56
66
  ru: {
57
- test_case_id : 'Тест-кейс',
58
- test_run_id : 'Прогон',
59
- test_run_result_id: 'Результат прогона',
67
+ test_case_id : 'Тест-кейс',
68
+ test_run_id : 'Прогон',
69
+ test_run_result_id : 'Результат прогона',
70
+ execution_context_id: 'Контекст выполнения',
60
71
  },
61
72
  },
62
73
  };