complexqa_frontend_core 1.17.11 → 1.17.12
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 +1 -1
- package/publish/app_configuration/table/helpers/column_factory.js +1 -0
- package/publish/app_configuration/table/helpers/column_locale.js +66 -0
- package/publish/app_configuration/table/helpers/table_element_models.js +26 -0
- package/publish/app_configuration/table/sections/team_member.js +7 -11
- package/publish/app_configuration/table/sections/test_run_result.js +11 -13
- package/publish/app_configuration/table/table_base_config.js +2 -24
- package/publish/app_configuration/table/table_configuration.js +7 -5
- package/publish/types/family_service/typeTableColumn.js +5 -0
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export function createColumn(model, locale, field, overrides = {})
|
|
|
30
30
|
|
|
31
31
|
return new typeTableColumn({
|
|
32
32
|
...COLUMN_DEFAULTS,
|
|
33
|
+
header_field,
|
|
33
34
|
header_name: overrides.header_name ?? header_model.get_attribute_name_translate(header_field, locale),
|
|
34
35
|
field,
|
|
35
36
|
...overrides,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { typeTableColumn } from '../../../types/family_service/typeTableColumn.js';
|
|
2
|
+
import { typeTableConfiguration } from '../../../types/family_service/typeTableConfiguration.js';
|
|
3
|
+
import { TABLE_ELEMENT_MODELS } from './table_element_models.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {typeTableColumn} column
|
|
7
|
+
* @param {string} element_type
|
|
8
|
+
* @param {string} lang
|
|
9
|
+
* @returns {typeTableColumn}
|
|
10
|
+
*/
|
|
11
|
+
export function localizeTableColumn(column, element_type, lang)
|
|
12
|
+
{
|
|
13
|
+
if (column.column_kind !== 'data' || !column.header_field)
|
|
14
|
+
{
|
|
15
|
+
return column;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const model_key = column.header_element_type || element_type;
|
|
19
|
+
const ModelClass = TABLE_ELEMENT_MODELS[ model_key ];
|
|
20
|
+
|
|
21
|
+
if (!ModelClass)
|
|
22
|
+
{
|
|
23
|
+
return column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const model = new ModelClass();
|
|
27
|
+
const header_name = model.get_attribute_name_translate(column.header_field, lang);
|
|
28
|
+
|
|
29
|
+
return new typeTableColumn({
|
|
30
|
+
header_name : header_name,
|
|
31
|
+
field : column.field,
|
|
32
|
+
width : column.width,
|
|
33
|
+
sort_order : column.sort_order,
|
|
34
|
+
cell_classes : column.cell_classes,
|
|
35
|
+
default_sort : column.default_sort,
|
|
36
|
+
is_sortable : column.is_sortable,
|
|
37
|
+
is_filter : column.is_filter,
|
|
38
|
+
is_hide : column.is_hide,
|
|
39
|
+
is_editable : column.is_editable,
|
|
40
|
+
column_kind : column.column_kind,
|
|
41
|
+
is_required : column.is_required,
|
|
42
|
+
is_title : column.is_title,
|
|
43
|
+
header_element_type : column.header_element_type,
|
|
44
|
+
header_field : column.header_field,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {{ config: typeTableConfiguration }} section
|
|
51
|
+
* @param {string} element_type
|
|
52
|
+
* @param {string} lang
|
|
53
|
+
*/
|
|
54
|
+
export function localizeTableSection(section, element_type, lang)
|
|
55
|
+
{
|
|
56
|
+
const config = section.config;
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
config: new typeTableConfiguration({
|
|
60
|
+
columns : config.columns.map((column) => localizeTableColumn(column, element_type, lang)),
|
|
61
|
+
for : config.for,
|
|
62
|
+
contained_element_type : config.contained_element_type,
|
|
63
|
+
documentation : config.documentation,
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { typeTestCase } from '../../../types/family_elements/typeTestCase.js';
|
|
2
|
+
import { typeProject } from '../../../types/family_elements/typeProject.js';
|
|
3
|
+
import { typeTestRun } from '../../../types/family_elements/typeTestRun.js';
|
|
4
|
+
import { typeBug } from '../../../types/family_elements/typeBug.js';
|
|
5
|
+
import { typeTestRunResult } from '../../../types/family_elements/typeTestRunResult.js';
|
|
6
|
+
import { typeTestAccount } from '../../../types/family_elements/typeTestAccount.js';
|
|
7
|
+
import { typeTeamMember } from '../../../types/family_elements/typeTeamMember.js';
|
|
8
|
+
import { typeTestCaseStep } from '../../../types/family_elements/typeTestCaseStep.js';
|
|
9
|
+
import { typeUser } from '../../../types/family_elements/typeUser.js';
|
|
10
|
+
import { typeTeam } from '../../../types/family_elements/typeTeam.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Модели сущностей для таблиц (row id, перевод заголовков колонок).
|
|
14
|
+
*/
|
|
15
|
+
export const TABLE_ELEMENT_MODELS = {
|
|
16
|
+
test_case : typeTestCase,
|
|
17
|
+
project : typeProject,
|
|
18
|
+
test_run : typeTestRun,
|
|
19
|
+
bug : typeBug,
|
|
20
|
+
test_run_result: typeTestRunResult,
|
|
21
|
+
test_account : typeTestAccount,
|
|
22
|
+
team_member : typeTeamMember,
|
|
23
|
+
test_case_step : typeTestCaseStep,
|
|
24
|
+
user : typeUser,
|
|
25
|
+
team : typeTeam,
|
|
26
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { typeTeamMember } from '../../../types/family_elements/typeTeamMember.js';
|
|
2
|
-
import { typeUser } from '../../../types/family_elements/typeUser.js';
|
|
3
2
|
import { UserService } from '../../../services/UserService.js';
|
|
4
3
|
import { createColumn } from '../helpers/column_factory.js';
|
|
5
4
|
import { createListingFor, registerSection } from '../helpers/section_registry.js';
|
|
@@ -7,29 +6,26 @@ import { createListingFor, registerSection } from '../helpers/section_registry.j
|
|
|
7
6
|
function build_team_member_listing_columns(locale)
|
|
8
7
|
{
|
|
9
8
|
const model = new typeTeamMember();
|
|
10
|
-
const user_model = new typeUser();
|
|
11
9
|
|
|
12
10
|
return [
|
|
13
11
|
createColumn(model, locale, 'user_id.first_name', {
|
|
14
|
-
|
|
12
|
+
header_field: 'first_name',
|
|
15
13
|
width : '200',
|
|
16
14
|
is_filter : false,
|
|
17
15
|
is_editable : false,
|
|
18
|
-
header_element_type: 'user',
|
|
19
16
|
}),
|
|
20
17
|
createColumn(model, locale, 'user_id.last_name', {
|
|
21
|
-
|
|
18
|
+
header_field: 'last_name',
|
|
22
19
|
width : '200',
|
|
23
20
|
is_filter : false,
|
|
24
21
|
is_editable : false,
|
|
25
|
-
header_element_type: 'user',
|
|
26
22
|
}),
|
|
27
23
|
createColumn(model, locale, 'user_id.email', {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
header_field : 'email',
|
|
25
|
+
header_element_type : 'user',
|
|
26
|
+
width : '200',
|
|
27
|
+
is_filter : false,
|
|
28
|
+
is_editable : false,
|
|
33
29
|
}),
|
|
34
30
|
createColumn(model, locale, 'team_member_status', { width: '160', is_filter: false, is_editable: true }),
|
|
35
31
|
createColumn(model, locale, 'member_role', { width: '200', is_filter: false, is_editable: true }),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { typeTestRunResult } from '../../../types/family_elements/typeTestRunResult.js';
|
|
2
|
-
import { typeTestCase } from '../../../types/family_elements/typeTestCase.js';
|
|
3
2
|
import { UserService } from '../../../services/UserService.js';
|
|
4
3
|
import { createColumn, createGoToColumn, createPrimaryKeyColumn, createRowSelectColumn } from '../helpers/column_factory.js';
|
|
5
4
|
import { createListingFor, registerSection } from '../helpers/section_registry.js';
|
|
@@ -7,7 +6,6 @@ import { createListingFor, registerSection } from '../helpers/section_registry.j
|
|
|
7
6
|
function build_test_run_result_listing_columns(locale, { include_select = true } = {})
|
|
8
7
|
{
|
|
9
8
|
const model = new typeTestRunResult();
|
|
10
|
-
const test_case_model = new typeTestCase();
|
|
11
9
|
const columns = [];
|
|
12
10
|
|
|
13
11
|
if (include_select)
|
|
@@ -16,10 +14,11 @@ function build_test_run_result_listing_columns(locale, { include_select = true }
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
columns.push(createColumn(model, locale, 'test_case_id.test_case_title', {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
header_field : 'test_case_title',
|
|
18
|
+
header_element_type : 'test_case',
|
|
19
|
+
width : '480',
|
|
20
|
+
is_editable : false,
|
|
21
|
+
is_required : true,
|
|
23
22
|
}));
|
|
24
23
|
columns.push(createColumn(model, locale, 'assigned_to', { width: '220', is_editable: true, is_required: true }));
|
|
25
24
|
columns.push(createColumn(model, locale, 'created_at', { width: '170', is_required: true }));
|
|
@@ -35,16 +34,15 @@ function build_test_run_result_listing_columns(locale, { include_select = true }
|
|
|
35
34
|
function build_test_run_result_todo_columns(locale)
|
|
36
35
|
{
|
|
37
36
|
const model = new typeTestRunResult();
|
|
38
|
-
const test_case_model = new typeTestCase();
|
|
39
|
-
|
|
40
37
|
return [
|
|
41
38
|
createPrimaryKeyColumn(model, locale),
|
|
42
39
|
createColumn(model, locale, 'test_case_id.test_case_title', {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
header_field : 'test_case_title',
|
|
41
|
+
header_element_type : 'test_case',
|
|
42
|
+
width : '480',
|
|
43
|
+
is_editable : false,
|
|
44
|
+
is_required : true,
|
|
45
|
+
is_title : true,
|
|
48
46
|
}),
|
|
49
47
|
createColumn(model, locale, 'assigned_to', { width: '220', is_editable: true, is_required: true }),
|
|
50
48
|
createColumn(model, locale, 'test_result_status', { width: '150', is_editable: true, is_required: true }),
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import { LOCALE_AG_GRID_RU } from '../locale_table_ru.js';
|
|
2
2
|
import { LOCALE_AG_GRID_EG } from '../table_locale_ar.js';
|
|
3
|
-
import {
|
|
4
|
-
import { typeProject } from '../../types/family_elements/typeProject.js';
|
|
5
|
-
import { typeTestRun } from '../../types/family_elements/typeTestRun.js';
|
|
6
|
-
import { typeBug } from '../../types/family_elements/typeBug.js';
|
|
7
|
-
import { typeTestRunResult } from '../../types/family_elements/typeTestRunResult.js';
|
|
8
|
-
import { typeTestAccount } from '../../types/family_elements/typeTestAccount.js';
|
|
9
|
-
import { typeTeamMember } from '../../types/family_elements/typeTeamMember.js';
|
|
10
|
-
import { typeTestCaseStep } from '../../types/family_elements/typeTestCaseStep.js';
|
|
11
|
-
import { typeUser } from '../../types/family_elements/typeUser.js';
|
|
12
|
-
import { typeTeam } from '../../types/family_elements/typeTeam.js';
|
|
13
|
-
|
|
14
|
-
const ROW_NODE_MODELS = {
|
|
15
|
-
test_case : typeTestCase,
|
|
16
|
-
project : typeProject,
|
|
17
|
-
test_run : typeTestRun,
|
|
18
|
-
bug : typeBug,
|
|
19
|
-
test_run_result: typeTestRunResult,
|
|
20
|
-
test_account : typeTestAccount,
|
|
21
|
-
team_member : typeTeamMember,
|
|
22
|
-
test_case_step : typeTestCaseStep,
|
|
23
|
-
user : typeUser,
|
|
24
|
-
team : typeTeam,
|
|
25
|
-
};
|
|
3
|
+
import { TABLE_ELEMENT_MODELS } from './helpers/table_element_models.js';
|
|
26
4
|
|
|
27
5
|
/**
|
|
28
6
|
* Базовые опции ag-grid, общие для всех таблиц.
|
|
@@ -84,7 +62,7 @@ export class TableBaseConfig
|
|
|
84
62
|
return function (data)
|
|
85
63
|
{
|
|
86
64
|
let id = 0;
|
|
87
|
-
const ModelClass =
|
|
65
|
+
const ModelClass = TABLE_ELEMENT_MODELS[ element_type ];
|
|
88
66
|
|
|
89
67
|
if (ModelClass)
|
|
90
68
|
{
|
|
@@ -9,6 +9,7 @@ import { bootstrap_team_member } from './sections/team_member.js';
|
|
|
9
9
|
import { bootstrap_user } from './sections/user.js';
|
|
10
10
|
import { bootstrap_team } from './sections/team.js';
|
|
11
11
|
import { bootstrap_project } from './sections/project.js';
|
|
12
|
+
import { localizeTableSection } from './helpers/column_locale.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Реестр конфигураций таблиц (ag-grid).
|
|
@@ -47,21 +48,22 @@ export class TableConfiguration extends abstractAppConfiguration
|
|
|
47
48
|
* @param {string} section
|
|
48
49
|
* @param {string} lang
|
|
49
50
|
*
|
|
50
|
-
* @todo - header_name модифицируем под локаль
|
|
51
51
|
*/
|
|
52
|
-
static get_config(element_type, section, lang)
|
|
52
|
+
static get_config(element_type, section, lang = 'en')
|
|
53
53
|
{
|
|
54
54
|
if (!this.state.loaded)
|
|
55
55
|
{
|
|
56
56
|
this.bootstrap();
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const section_config = this.config?.[ element_type ]?.[ section ];
|
|
60
|
+
|
|
61
|
+
if (!section_config)
|
|
60
62
|
{
|
|
61
|
-
return
|
|
63
|
+
return false;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
return
|
|
66
|
+
return localizeTableSection(section_config, element_type, lang || 'en');
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
|