complexqa_frontend_core 1.19.9 → 1.20.2

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.2",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Спецификация data-колонок execution_context × listing (без goto).
3
+ * Единый источник для listing и вложенных таблиц (bug_relation.execution_contexts).
4
+ *
5
+ * @returns {Array<{ field: string, overrides: import('./column_factory.js').ColumnOverrides }>}
6
+ */
7
+ export function get_execution_context_listing_field_specs()
8
+ {
9
+ return [
10
+ { field: 'execution_context_id', overrides: { width: '60', default_sort: 'desc' } },
11
+ { field: 'context_title', overrides: { width: '420', is_required: false, is_title: true } },
12
+ { field: 'browser_context_id', overrides: { width: '200' } },
13
+ { field: 'os_context_id', overrides: { width: '200' } },
14
+ { field: 'screen_resolution_context_id', overrides: { width: '200' } },
15
+ { field: 'device_context_id', overrides: { width: '200' } },
16
+ { field: 'locale_context_id', overrides: { width: '200' } },
17
+ { field: 'deployment_target_context_id', overrides: { width: '200' } },
18
+ { field: 'protocol', overrides: { width: '120' } },
19
+ { field: 'host', overrides: { width: '200' } },
20
+ { field: 'build_version', overrides: { width: '160' } },
21
+ { field: 'created_at', overrides: { width: '170' } },
22
+ ];
23
+ }
@@ -1,9 +1,11 @@
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';
8
+ import { get_execution_context_listing_field_specs } from '../helpers/execution_context_listing_fields.js';
7
9
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
8
10
 
9
11
  /**
@@ -124,7 +126,33 @@ function build_bug_relation_test_run_results_columns(locale)
124
126
 
125
127
 
126
128
  /**
127
- * Секции `bug_relation`: `test_cases`, `bugs`, `test_run_results`.
129
+ * Колонки связанных контекстов выполнения на странице bug/details.
130
+ * Поля совпадают с execution_context × listing, данные — через hydrate element_id.
131
+ *
132
+ * @param {string} locale
133
+ * @returns {import('../../../types/family_service/typeTableColumn.js').typeTableColumn[]}
134
+ */
135
+ function build_bug_relation_execution_contexts_columns(locale)
136
+ {
137
+ const relation_model = new typeBugRelation();
138
+ const context_model = new typeExecutionContext();
139
+
140
+ const ecColumn = (field, overrides = {}) => createColumn(relation_model, locale, `element_id.${ field }`, {
141
+ header_field : field,
142
+ header_element_type : 'execution_context',
143
+ is_editable : false,
144
+ ...overrides,
145
+ });
146
+
147
+ return [
148
+ ...get_execution_context_listing_field_specs().map(({ field, overrides }) => ecColumn(field, overrides)),
149
+ createGoToColumn(context_model, locale, { field: 'element_id' }),
150
+ ];
151
+ }
152
+
153
+
154
+ /**
155
+ * Секции `bug_relation`: `test_cases`, `bugs`, `test_run_results`, `execution_contexts`.
128
156
  *
129
157
  * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
130
158
  * @returns {void}
@@ -141,6 +169,10 @@ export function bootstrap_bug_relation(config)
141
169
  for: createListingFor([ 'bug_id', 'relation_type' ], { add: [ 'elements' ] }),
142
170
  });
143
171
 
172
+ registerSection(config, 'bug_relation', 'execution_contexts', build_bug_relation_execution_contexts_columns(locale), {
173
+ for: createListingFor([ 'bug_id', 'relation_type' ], { add: [ 'elements' ] }),
174
+ });
175
+
144
176
  registerSection(config, 'bug_relation', 'bugs', build_bug_relation_bugs_columns(locale), {
145
177
  for: createListingFor([ 'relation_type', 'element_id' ], { add: [ 'bugs' ] }),
146
178
  });
@@ -1,6 +1,7 @@
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
+ import { get_execution_context_listing_field_specs } from '../helpers/execution_context_listing_fields.js';
4
5
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
5
6
 
6
7
  const FK_FIELDS = [
@@ -12,18 +13,30 @@ const FK_FIELDS = [
12
13
  'deployment_target_context_id',
13
14
  ];
14
15
 
16
+ const EXECUTION_CONTEXT_EDITABLE_FIELDS = new Set([
17
+ 'context_title',
18
+ ...FK_FIELDS,
19
+ 'protocol',
20
+ 'host',
21
+ 'build_version',
22
+ ]);
23
+
15
24
  function build_execution_context_listing_columns(locale)
16
25
  {
17
26
  const model = new typeExecutionContext();
18
27
 
19
28
  return [
20
- createPrimaryKeyColumn(model, locale, { is_editable: false }),
21
- createColumn(model, locale, 'context_title', { width: '420', is_editable: true, is_required: false }),
22
- ...FK_FIELDS.map((field) => createColumn(model, locale, field, { width: '200', is_editable: true })),
23
- createColumn(model, locale, 'protocol', { width: '120', is_editable: true }),
24
- createColumn(model, locale, 'host', { width: '200', is_editable: true }),
25
- createColumn(model, locale, 'build_version', { width: '160', is_editable: true }),
26
- createColumn(model, locale, 'created_at', { width: '170' }),
29
+ ...get_execution_context_listing_field_specs().map(({ field, overrides }) => {
30
+ if (field === 'execution_context_id')
31
+ {
32
+ return createPrimaryKeyColumn(model, locale, { is_editable: false, ...overrides });
33
+ }
34
+
35
+ return createColumn(model, locale, field, {
36
+ is_editable: EXECUTION_CONTEXT_EDITABLE_FIELDS.has(field),
37
+ ...overrides,
38
+ });
39
+ }),
27
40
  createGoToColumn(model, locale),
28
41
  ];
29
42
  }
@@ -65,7 +78,35 @@ function build_execution_context_details_columns(locale)
65
78
 
66
79
 
67
80
  /**
68
- * Секции `execution_context`: `listing`, `details`.
81
+ * Колонки выбора контекста выполнения (диалог связывания на bug/details).
82
+ * Без goto; context_title шире listing на 50px.
83
+ *
84
+ * @param {string} locale
85
+ * @returns {import('../../../types/family_service/typeTableColumn.js').typeTableColumn[]}
86
+ */
87
+ function build_execution_context_picker_columns(locale)
88
+ {
89
+ const model = new typeExecutionContext();
90
+
91
+ return [
92
+ createRowSelectColumn(),
93
+ createColumn(model, locale, 'context_title', {
94
+ width : '470',
95
+ is_editable : false,
96
+ is_required : true,
97
+ is_sortable : false,
98
+ is_filter : false,
99
+ }),
100
+ createColumn(model, locale, 'protocol', { width: '120', is_editable: false, is_sortable: false, is_filter: false }),
101
+ createColumn(model, locale, 'host', { width: '200', is_editable: false, is_sortable: false, is_filter: false }),
102
+ createColumn(model, locale, 'build_version', { width: '160', is_editable: false, is_sortable: false, is_filter: false }),
103
+ createColumn(model, locale, 'created_at', { width: '170', is_required: true, is_sortable: false, is_filter: false }),
104
+ ];
105
+ }
106
+
107
+
108
+ /**
109
+ * Секции `execution_context`: `listing`, `details`, `picker`.
69
110
  *
70
111
  * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
71
112
  * @returns {void}
@@ -78,5 +119,9 @@ export function bootstrap_execution_context(config)
78
119
  for: createListingFor([ 'project_id' ]),
79
120
  });
80
121
 
122
+ registerSection(config, 'execution_context', 'picker', build_execution_context_picker_columns(locale), {
123
+ for: createListingFor([ 'project_id' ]),
124
+ });
125
+
81
126
  registerSection(config, 'execution_context', 'details', build_execution_context_details_columns(locale));
82
127
  }
@@ -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
  };