complexqa_frontend_core 1.19.1 → 1.19.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.1",
3
+ "version": "1.19.2",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -2,6 +2,7 @@ import { typeTestCase } from '../../../types/family_elements/typeTestCase.js';
2
2
  import { typeProject } from '../../../types/family_elements/typeProject.js';
3
3
  import { typeTestRun } from '../../../types/family_elements/typeTestRun.js';
4
4
  import { typeBug } from '../../../types/family_elements/typeBug.js';
5
+ import { typeBugRelation } from '../../../types/family_relation/typeBugRelation.js';
5
6
  import { typeTestRunResult } from '../../../types/family_elements/typeTestRunResult.js';
6
7
  import { typeTestAccount } from '../../../types/family_elements/typeTestAccount.js';
7
8
  import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
@@ -26,6 +27,7 @@ export const TABLE_ELEMENT_MODELS = {
26
27
  project : typeProject,
27
28
  test_run : typeTestRun,
28
29
  bug : typeBug,
30
+ bug_relation : typeBugRelation,
29
31
  test_run_result: typeTestRunResult,
30
32
  test_account : typeTestAccount,
31
33
  execution_context : typeExecutionContext,
@@ -0,0 +1,57 @@
1
+ import { typeBugRelation } from '../../../types/family_relation/typeBugRelation.js';
2
+ import { typeTestCase } from '../../../types/family_elements/typeTestCase.js';
3
+ import { UserService } from '../../../services/UserService.js';
4
+ import { createColumn, createGoToColumn } from '../helpers/column_factory.js';
5
+ import { createListingFor, registerSection } from '../helpers/section_registry.js';
6
+
7
+ /**
8
+ * Колонки связанных тест-кейсов на странице bug/details.
9
+ * Поля совпадают с test_case × listing, данные — через hydrate element_id.
10
+ *
11
+ * @param {string} locale
12
+ * @returns {import('../../../types/family_service/typeTableColumn.js').typeTableColumn[]}
13
+ */
14
+ function build_bug_relation_test_cases_columns(locale)
15
+ {
16
+ const relation_model = new typeBugRelation();
17
+ const test_case_model = new typeTestCase();
18
+ const columns = [];
19
+
20
+ const tcColumn = (field, overrides = {}) => createColumn(relation_model, locale, `element_id.${ field }`, {
21
+ header_field : field,
22
+ header_element_type : 'test_case',
23
+ is_editable : false,
24
+ ...overrides,
25
+ });
26
+
27
+ columns.push(tcColumn('test_case_id', { width: '60', default_sort: 'desc' }));
28
+ columns.push(tcColumn('test_case_title', {
29
+ width : '480',
30
+ is_required : true,
31
+ is_title : true,
32
+ }));
33
+ columns.push(tcColumn('assigned_to', { width: '220' }));
34
+ columns.push(tcColumn('test_case_time_to_execute', { width: '80', is_required: true }));
35
+ columns.push(tcColumn('test_case_complexity', { width: '80', is_required: true }));
36
+ columns.push(tcColumn('test_case_importance', { width: '80', is_required: true }));
37
+ columns.push(tcColumn('test_case_status', { width: '150', is_required: true }));
38
+ columns.push(createGoToColumn(test_case_model, locale, { field: 'element_id' }));
39
+
40
+ return columns;
41
+ }
42
+
43
+
44
+ /**
45
+ * Секции `bug_relation`: `test_cases`.
46
+ *
47
+ * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
48
+ * @returns {void}
49
+ */
50
+ export function bootstrap_bug_relation(config)
51
+ {
52
+ const locale = UserService.get_current_language();
53
+
54
+ registerSection(config, 'bug_relation', 'test_cases', build_bug_relation_test_cases_columns(locale), {
55
+ for: createListingFor([ 'bug_id', 'relation_type' ], { add: [ 'elements' ] }),
56
+ });
57
+ }
@@ -1,5 +1,6 @@
1
1
  import { abstractAppConfiguration } from '../abstract_app_configuration.js';
2
2
  import { bootstrap_bug } from './sections/bug.js';
3
+ import { bootstrap_bug_relation } from './sections/bug_relation.js';
3
4
  import { bootstrap_test_case } from './sections/test_case.js';
4
5
  import { bootstrap_test_case_step } from './sections/test_case_step.js';
5
6
  import { bootstrap_test_run } from './sections/test_run.js';
@@ -106,6 +107,7 @@ export class TableConfiguration extends abstractAppConfiguration
106
107
  }
107
108
 
108
109
  bootstrap_bug(this.config);
110
+ bootstrap_bug_relation(this.config);
109
111
  bootstrap_test_case(this.config);
110
112
  bootstrap_test_case_step(this.config);
111
113
  bootstrap_test_run(this.config);