complexqa_frontend_core 1.20.1 → 1.20.3

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.20.1",
3
+ "version": "1.20.3",
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
+ }
@@ -5,17 +5,9 @@ import { typeExecutionContext } from '../../../types/family_context/typeExecutio
5
5
  import { typeBug } from '../../../types/family_elements/typeBug.js';
6
6
  import { UserService } from '../../../services/UserService.js';
7
7
  import { createColumn, createGoToColumn } from '../helpers/column_factory.js';
8
+ import { get_execution_context_listing_field_specs } from '../helpers/execution_context_listing_fields.js';
8
9
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
9
10
 
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
-
19
11
  /**
20
12
  * Колонки связанных тест-кейсов на странице bug/details.
21
13
  * Поля совпадают с test_case × listing, данные — через hydrate element_id.
@@ -144,7 +136,6 @@ function build_bug_relation_execution_contexts_columns(locale)
144
136
  {
145
137
  const relation_model = new typeBugRelation();
146
138
  const context_model = new typeExecutionContext();
147
- const columns = [];
148
139
 
149
140
  const ecColumn = (field, overrides = {}) => createColumn(relation_model, locale, `element_id.${ field }`, {
150
141
  header_field : field,
@@ -153,20 +144,10 @@ function build_bug_relation_execution_contexts_columns(locale)
153
144
  ...overrides,
154
145
  });
155
146
 
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;
147
+ return [
148
+ ...get_execution_context_listing_field_specs().map(({ field, overrides }) => ecColumn(field, overrides)),
149
+ createGoToColumn(context_model, locale, { field: 'element_id' }),
150
+ ];
170
151
  }
171
152
 
172
153
 
@@ -1,6 +1,8 @@
1
1
  import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
2
2
  import { UserService } from '../../../services/UserService.js';
3
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';
5
+ import { build_bug_relation_bugs_columns } from './bug_relation.js';
4
6
  import { createListingFor, registerSection } from '../helpers/section_registry.js';
5
7
 
6
8
  const FK_FIELDS = [
@@ -12,18 +14,30 @@ const FK_FIELDS = [
12
14
  'deployment_target_context_id',
13
15
  ];
14
16
 
17
+ const EXECUTION_CONTEXT_EDITABLE_FIELDS = new Set([
18
+ 'context_title',
19
+ ...FK_FIELDS,
20
+ 'protocol',
21
+ 'host',
22
+ 'build_version',
23
+ ]);
24
+
15
25
  function build_execution_context_listing_columns(locale)
16
26
  {
17
27
  const model = new typeExecutionContext();
18
28
 
19
29
  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' }),
30
+ ...get_execution_context_listing_field_specs().map(({ field, overrides }) => {
31
+ if (field === 'execution_context_id')
32
+ {
33
+ return createPrimaryKeyColumn(model, locale, { is_editable: false, ...overrides });
34
+ }
35
+
36
+ return createColumn(model, locale, field, {
37
+ is_editable: EXECUTION_CONTEXT_EDITABLE_FIELDS.has(field),
38
+ ...overrides,
39
+ });
40
+ }),
27
41
  createGoToColumn(model, locale),
28
42
  ];
29
43
  }
@@ -93,7 +107,7 @@ function build_execution_context_picker_columns(locale)
93
107
 
94
108
 
95
109
  /**
96
- * Секции `execution_context`: `listing`, `details`, `picker`.
110
+ * Секции `execution_context`: `listing`, `details`, `picker`, `bugs`.
97
111
  *
98
112
  * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
99
113
  * @returns {void}
@@ -110,5 +124,9 @@ export function bootstrap_execution_context(config)
110
124
  for: createListingFor([ 'project_id' ]),
111
125
  });
112
126
 
127
+ registerSection(config, 'execution_context', 'bugs', build_bug_relation_bugs_columns(locale), {
128
+ for: createListingFor([ 'relation_type', 'element_id' ], { add: [ 'bugs' ] }),
129
+ });
130
+
113
131
  registerSection(config, 'execution_context', 'details', build_execution_context_details_columns(locale));
114
132
  }