complexqa_frontend_core 1.17.13 → 1.18.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.17.13",
3
+ "version": "1.18.1",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -4,6 +4,7 @@ import { typeTestRun } from '../../../types/family_elements/typeTestRun.js';
4
4
  import { typeBug } from '../../../types/family_elements/typeBug.js';
5
5
  import { typeTestRunResult } from '../../../types/family_elements/typeTestRunResult.js';
6
6
  import { typeTestAccount } from '../../../types/family_elements/typeTestAccount.js';
7
+ import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
7
8
  import { typeTeamMember } from '../../../types/family_elements/typeTeamMember.js';
8
9
  import { typeTestCaseStep } from '../../../types/family_elements/typeTestCaseStep.js';
9
10
  import { typeUser } from '../../../types/family_elements/typeUser.js';
@@ -26,8 +27,9 @@ export const TABLE_ELEMENT_MODELS = {
26
27
  test_run : typeTestRun,
27
28
  bug : typeBug,
28
29
  test_run_result: typeTestRunResult,
29
- test_account : typeTestAccount,
30
- team_member : typeTeamMember,
30
+ test_account : typeTestAccount,
31
+ execution_context : typeExecutionContext,
32
+ team_member : typeTeamMember,
31
33
  test_case_step : typeTestCaseStep,
32
34
  user : typeUser,
33
35
  team : typeTeam,
@@ -0,0 +1,78 @@
1
+ import { typeExecutionContext } from '../../../types/family_context/typeExecutionContext.js';
2
+ import { UserService } from '../../../services/UserService.js';
3
+ import { createColumn, createGoToColumn, createPrimaryKeyColumn } from '../helpers/column_factory.js';
4
+ import { createListingFor, registerSection } from '../helpers/section_registry.js';
5
+
6
+ const FK_FIELDS = [
7
+ 'browser_context_id',
8
+ 'os_context_id',
9
+ 'screen_resolution_context_id',
10
+ 'device_context_id',
11
+ 'locale_context_id',
12
+ 'deployment_target_context_id',
13
+ 'test_account_id',
14
+ ];
15
+
16
+ function build_execution_context_listing_columns(locale)
17
+ {
18
+ const model = new typeExecutionContext();
19
+
20
+ return [
21
+ createPrimaryKeyColumn(model, locale, { is_editable: false }),
22
+ createColumn(model, locale, 'context_title', { width: '420', is_editable: true, is_required: false }),
23
+ ...FK_FIELDS.map((field) => createColumn(model, locale, field, { width: '200', is_editable: false })),
24
+ createColumn(model, locale, 'protocol', { width: '120', is_editable: true }),
25
+ createColumn(model, locale, 'host', { width: '200', is_editable: true }),
26
+ createColumn(model, locale, 'build_version', { width: '160', is_editable: true }),
27
+ createColumn(model, locale, 'created_at', { width: '170' }),
28
+ createGoToColumn(model, locale),
29
+ ];
30
+ }
31
+
32
+
33
+ function build_execution_context_details_columns(locale)
34
+ {
35
+ const model = new typeExecutionContext();
36
+ const fields = [
37
+ 'execution_context_id',
38
+ 'project_id',
39
+ 'team_id',
40
+ 'context_title',
41
+ ...FK_FIELDS,
42
+ 'protocol',
43
+ 'host',
44
+ 'base_url',
45
+ 'build_version',
46
+ 'context_snapshot',
47
+ 'custom_field_values',
48
+ 'created_at',
49
+ 'updated_at',
50
+ ];
51
+
52
+ const editableFields = new Set([ 'context_title', 'protocol', 'host', 'base_url', 'build_version' ]);
53
+
54
+ return fields.map((field, index) => createColumn(model, locale, field, {
55
+ sort_order : String(index + 1),
56
+ is_editable: editableFields.has(field),
57
+ is_sortable: false,
58
+ is_filter : false,
59
+ }));
60
+ }
61
+
62
+
63
+ /**
64
+ * Секции `execution_context`: `listing`, `details`.
65
+ *
66
+ * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
67
+ * @returns {void}
68
+ */
69
+ export function bootstrap_execution_context(config)
70
+ {
71
+ const locale = UserService.get_current_language();
72
+
73
+ registerSection(config, 'execution_context', 'listing', build_execution_context_listing_columns(locale), {
74
+ for: createListingFor([ 'project_id' ]),
75
+ });
76
+
77
+ registerSection(config, 'execution_context', 'details', build_execution_context_details_columns(locale));
78
+ }
@@ -5,6 +5,7 @@ import { bootstrap_test_case_step } from './sections/test_case_step.js';
5
5
  import { bootstrap_test_run } from './sections/test_run.js';
6
6
  import { bootstrap_test_run_result } from './sections/test_run_result.js';
7
7
  import { bootstrap_test_account } from './sections/test_account.js';
8
+ import { bootstrap_execution_context } from './sections/execution_context.js';
8
9
  import { bootstrap_team_member } from './sections/team_member.js';
9
10
  import { bootstrap_user } from './sections/user.js';
10
11
  import { bootstrap_team } from './sections/team.js';
@@ -110,6 +111,7 @@ export class TableConfiguration extends abstractAppConfiguration
110
111
  bootstrap_test_run(this.config);
111
112
  bootstrap_test_run_result(this.config);
112
113
  bootstrap_test_account(this.config);
114
+ bootstrap_execution_context(this.config);
113
115
  bootstrap_team_member(this.config);
114
116
  bootstrap_user(this.config);
115
117
  bootstrap_team(this.config);
@@ -16,6 +16,9 @@ export class typeExecutionContext extends familyGeneralElement
16
16
  project_id;
17
17
  team_id;
18
18
 
19
+ context_title;
20
+ context_description;
21
+
19
22
  browser_context_id;
20
23
  os_context_id;
21
24
  screen_resolution_context_id;
@@ -42,6 +45,8 @@ export class typeExecutionContext extends familyGeneralElement
42
45
  execution_context_id : 'integer | require',
43
46
  project_id : 'integer | require',
44
47
  team_id : 'integer | require',
48
+ context_title : 'string | optional',
49
+ context_description : 'string | StringHtml | optional',
45
50
  browser_context_id : 'integer | optional',
46
51
  os_context_id : 'integer | optional',
47
52
  screen_resolution_context_id: 'integer | optional',
@@ -84,6 +89,8 @@ export class typeExecutionContext extends familyGeneralElement
84
89
  attribute_name_translate_matrix = {
85
90
  en: {
86
91
  execution_context_id : 'ID',
92
+ context_title : 'Title',
93
+ context_description : 'Description',
87
94
  project_id : 'Project',
88
95
  team_id : 'Team',
89
96
  browser_context_id : 'Browser',
@@ -104,6 +111,8 @@ export class typeExecutionContext extends familyGeneralElement
104
111
  },
105
112
  ru: {
106
113
  execution_context_id : 'ID',
114
+ context_title : 'Название',
115
+ context_description : 'Описание',
107
116
  project_id : 'Проект',
108
117
  team_id : 'Команда',
109
118
  browser_context_id : 'Браузер',
@@ -145,4 +154,13 @@ export class typeExecutionContext extends familyGeneralElement
145
154
 
146
155
  return this;
147
156
  }
157
+
158
+
159
+ /**
160
+ * @returns {string}
161
+ */
162
+ get_element_name()
163
+ {
164
+ return this.context_title || String(this.execution_context_id ?? '');
165
+ }
148
166
  }