complexqa_frontend_core 2.3.1 → 2.4.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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/api/checklist_api.js +16 -0
  3. package/src/api/checklist_folder_api.js +16 -0
  4. package/src/api/checklist_item_api.js +16 -0
  5. package/src/api/checklist_result_api.js +16 -0
  6. package/src/api/checklist_result_item_api.js +16 -0
  7. package/src/api/index.js +10 -0
  8. package/src/api/project_api.js +13 -0
  9. package/src/index.js +5 -0
  10. package/src/types/element_translate/typeBugRelation.i18n.js +11 -0
  11. package/src/types/element_translate/typeChecklist.i18n.js +175 -0
  12. package/src/types/element_translate/typeChecklistFolder.i18n.js +108 -0
  13. package/src/types/element_translate/typeChecklistItem.i18n.js +119 -0
  14. package/src/types/element_translate/typeChecklistResult.i18n.js +217 -0
  15. package/src/types/element_translate/typeChecklistResultItem.i18n.js +170 -0
  16. package/src/types/element_translate/typeCustomProperty.i18n.js +6 -0
  17. package/src/types/element_translate/typeEvent.i18n.js +55 -0
  18. package/src/types/element_translate/typeTagRelation.i18n.js +6 -0
  19. package/src/types/family_elements/checklist/typeChecklist.js +70 -0
  20. package/src/types/family_elements/checklist/typeChecklistBase.js +63 -0
  21. package/src/types/family_elements/checklist/typeChecklistFolder.js +97 -0
  22. package/src/types/family_elements/checklist/typeChecklistItem.js +47 -0
  23. package/src/types/family_elements/checklist/typeChecklistItemBase.js +58 -0
  24. package/src/types/family_elements/checklist/typeChecklistResult.js +80 -0
  25. package/src/types/family_elements/checklist/typeChecklistResultItem.js +69 -0
  26. package/src/types/family_elements/typeCustomProperty.js +3 -1
  27. package/src/types/family_elements/typeProject.js +11 -0
  28. package/src/types/family_events/familyEvent.js +5 -0
  29. package/src/types/family_relation/typeBugRelation.js +5 -0
  30. package/src/types/family_relation/typeTagRelation.js +10 -0
  31. package/types/api/project_api.d.ts +11 -0
  32. package/types/types/family_elements/typeProject.d.ts +6 -0
@@ -0,0 +1,63 @@
1
+ import { familyTestDocumentation } from "../../core/1_familyTestDocumentation.js";
2
+
3
+
4
+ /**
5
+ * Базовый класс заголовка чек-листа и результата чек-листа.
6
+ * Одна таблица, тип записи - checklist_type. Только общие поля.
7
+ *
8
+ * Данные из конструктора раскладывают рабочие классы (typeChecklist, typeChecklistResult):
9
+ * поля наследника инициализируются после super(), поэтому раскладка здесь была бы перезаписана.
10
+ *
11
+ * @version v.0.1 (30/09/2026)
12
+ */
13
+ export class typeChecklistBase extends familyTestDocumentation
14
+ {
15
+ checklist_id;
16
+ checklist_type;
17
+ team_id;
18
+ project_id;
19
+ checklist_title;
20
+ checklist_description;
21
+ checklist_status;
22
+ assigned_to;
23
+ created_at;
24
+ updated_at;
25
+
26
+ primary_key = 'checklist_id';
27
+
28
+ structure_scheme = {
29
+ checklist_id : 'integer | require',
30
+ checklist_type : 'string | enum | require',
31
+ team_id : 'integer | require',
32
+ project_id : 'integer | require',
33
+ checklist_title : 'string | optional',
34
+ checklist_description: 'string | StringHtml | optional',
35
+ checklist_status : 'string | enum | require',
36
+ assigned_to : 'integer | typeUser | optional',
37
+ created_at : 'timestamp | require',
38
+ updated_at : 'timestamp | optional',
39
+ };
40
+
41
+ /** @type {Record<string, string[]>} */
42
+ available_enum_values = {
43
+ checklist_type: [ 'CHECKLIST', 'CHECKLIST_RESULT' ],
44
+ };
45
+
46
+
47
+ /**
48
+ * @param {object|false|undefined} data
49
+ */
50
+ constructor(data = false)
51
+ {
52
+ super();
53
+ }
54
+
55
+
56
+ /**
57
+ * @returns {string}
58
+ */
59
+ get_element_name()
60
+ {
61
+ return this.checklist_title;
62
+ }
63
+ }
@@ -0,0 +1,97 @@
1
+ import { is_object } from "../../../utils/utils.js";
2
+ import { familyTestDocumentation } from "../../core/1_familyTestDocumentation.js";
3
+ import { register_type_class } from "../../core/type_class_resolver.js";
4
+ import { typeChecklistFolder_i18n } from "../../element_translate/typeChecklistFolder.i18n.js";
5
+ import _ from 'underscore';
6
+
7
+
8
+ /**
9
+ * Папка чек-листов. Дерево через parent_checklist_folder_id. Результаты в папках не лежат.
10
+ *
11
+ * @version v.0.1 (30/09/2026)
12
+ */
13
+ export class typeChecklistFolder extends familyTestDocumentation
14
+ {
15
+ checklist_folder_id;
16
+ project_id;
17
+ team_id;
18
+ parent_checklist_folder_id;
19
+ checklist_folder_name;
20
+ created_at;
21
+ updated_at;
22
+
23
+ primary_key = 'checklist_folder_id';
24
+ api_key = 'checklist_folder';
25
+
26
+ structure_scheme = {
27
+ checklist_folder_id : 'integer | require',
28
+ project_id : 'integer | require',
29
+ team_id : 'integer | require',
30
+ parent_checklist_folder_id: 'integer | optional',
31
+ checklist_folder_name : 'string | optional',
32
+ created_at : 'timestamp | require',
33
+ updated_at : 'timestamp | optional',
34
+ };
35
+
36
+ create_scheme = [
37
+ 'project_id',
38
+ 'parent_checklist_folder_id',
39
+ 'checklist_folder_name',
40
+ ];
41
+
42
+ attribute_name_translate_matrix = typeChecklistFolder_i18n.attribute_name_translate_matrix;
43
+
44
+
45
+ /**
46
+ * @param {object|false|undefined} data
47
+ */
48
+ constructor(data = false)
49
+ {
50
+ super();
51
+
52
+ if (data && is_object(data))
53
+ {
54
+ _.mapObject(data, (value, key) =>
55
+ {
56
+ if (this.hasOwnProperty(key))
57
+ {
58
+ this[ key ] = value;
59
+ }
60
+ });
61
+ }
62
+
63
+ return this;
64
+ }
65
+
66
+
67
+ /**
68
+ * @returns {string}
69
+ */
70
+ get_element_name()
71
+ {
72
+ return this.checklist_folder_name || '';
73
+ }
74
+
75
+
76
+ /**
77
+ * FK checklist_folder_id на листинге чек-листа: ячейка берёт checklist_folder_name.
78
+ *
79
+ * @returns {object}
80
+ */
81
+ get_reference_meta()
82
+ {
83
+ return {
84
+ type_token : 'typeChecklistFolder',
85
+ api_namespace: '',
86
+ api_key : this.api_key,
87
+ primary_key : this.primary_key,
88
+ label_key : 'checklist_folder_name',
89
+ search : {
90
+ attribute: 'checklist_folder_name',
91
+ operator : 'LIKE',
92
+ },
93
+ };
94
+ }
95
+ }
96
+
97
+ register_type_class('typeChecklistFolder', typeChecklistFolder);
@@ -0,0 +1,47 @@
1
+ import { is_object } from "../../../utils/utils.js";
2
+ import { typeChecklistItemBase } from "./typeChecklistItemBase.js";
3
+ import { typeChecklistItem_i18n } from "../../element_translate/typeChecklistItem.i18n.js";
4
+ import _ from 'underscore';
5
+
6
+
7
+ /**
8
+ * Пункт чек-листа. Статуса нет.
9
+ *
10
+ * @version v.0.1 (30/09/2026)
11
+ */
12
+ export class typeChecklistItem extends typeChecklistItemBase
13
+ {
14
+ checklist_type = 'CHECKLIST';
15
+
16
+ api_key = 'checklist_item';
17
+
18
+ attribute_name_translate_matrix = typeChecklistItem_i18n.attribute_name_translate_matrix;
19
+
20
+ create_scheme = [
21
+ 'checklist_id',
22
+ 'item_text',
23
+ 'sort_order',
24
+ ];
25
+
26
+
27
+ /**
28
+ * @param {object|false|undefined} data
29
+ */
30
+ constructor(data = false)
31
+ {
32
+ super();
33
+
34
+ if (data && is_object(data))
35
+ {
36
+ _.mapObject(data, (value, key) =>
37
+ {
38
+ if (this.hasOwnProperty(key))
39
+ {
40
+ this[ key ] = value;
41
+ }
42
+ });
43
+ }
44
+
45
+ return this;
46
+ }
47
+ }
@@ -0,0 +1,58 @@
1
+ import { familyTestDocumentation } from "../../core/1_familyTestDocumentation.js";
2
+
3
+
4
+ /**
5
+ * Базовый класс строки: пункт чек-листа и отметка результата.
6
+ * Одна таблица, тип записи - checklist_type (равен типу родителя). Только общие поля.
7
+ *
8
+ * Данные из конструктора раскладывают рабочие классы (typeChecklistItem, typeChecklistResultItem).
9
+ *
10
+ * @version v.0.1 (30/09/2026)
11
+ */
12
+ export class typeChecklistItemBase extends familyTestDocumentation
13
+ {
14
+ checklist_item_id;
15
+ checklist_id;
16
+ checklist_type;
17
+ team_id;
18
+ sort_order;
19
+ item_text;
20
+ created_at;
21
+ updated_at;
22
+
23
+ primary_key = 'checklist_item_id';
24
+
25
+ structure_scheme = {
26
+ checklist_item_id: 'integer | require',
27
+ checklist_id : 'integer | require',
28
+ checklist_type : 'string | enum | require',
29
+ team_id : 'integer | require',
30
+ sort_order : 'integer | optional',
31
+ item_text : 'string | optional',
32
+ created_at : 'timestamp | require',
33
+ updated_at : 'timestamp | optional',
34
+ };
35
+
36
+ /** @type {Record<string, string[]>} */
37
+ available_enum_values = {
38
+ checklist_type: [ 'CHECKLIST', 'CHECKLIST_RESULT' ],
39
+ };
40
+
41
+
42
+ /**
43
+ * @param {object|false|undefined} data
44
+ */
45
+ constructor(data = false)
46
+ {
47
+ super();
48
+ }
49
+
50
+
51
+ /**
52
+ * @returns {string}
53
+ */
54
+ get_element_name()
55
+ {
56
+ return this.item_text;
57
+ }
58
+ }
@@ -0,0 +1,80 @@
1
+ import { is_object } from "../../../utils/utils.js";
2
+ import { typeChecklistBase } from "./typeChecklistBase.js";
3
+ import { typeChecklistResult_i18n } from "../../element_translate/typeChecklistResult.i18n.js";
4
+ import _ from 'underscore';
5
+
6
+
7
+ /**
8
+ * Результат чек-листа: копия чек-листа на момент прохождения.
9
+ * checklist_title и checklist_description - копия, не меняются.
10
+ * checklist_status вычисляется из отметок на бэкенде.
11
+ * Создается из чек-листа в статусе READY с хотя бы одним пунктом.
12
+ *
13
+ * @version v.0.1 (30/09/2026)
14
+ */
15
+ export class typeChecklistResult extends typeChecklistBase
16
+ {
17
+ checklist_type = 'CHECKLIST_RESULT';
18
+ initial_checklist_id;
19
+ execution_context_id;
20
+ checklist_comment;
21
+ completed_at;
22
+ checklist_items; // pseudo // relations - typeChecklistResultItem
23
+
24
+ api_key = 'checklist_result';
25
+
26
+ structure_scheme = {
27
+ ...this.structure_scheme,
28
+ initial_checklist_id: 'integer | optional',
29
+ execution_context_id: 'integer | require',
30
+ checklist_comment : 'string | StringHtml | optional',
31
+ completed_at : 'timestamp | optional',
32
+ };
33
+
34
+ create_scheme = [
35
+ 'initial_checklist_id',
36
+ 'execution_context_id',
37
+ 'assigned_to',
38
+ ];
39
+
40
+ /** @type {Record<string, string[]>} */
41
+ available_enum_values = {
42
+ ...this.available_enum_values,
43
+ checklist_status: [ 'PENDING', 'IN_PROGRESS', 'PASSED', 'FAILED', 'BLOCKED', 'SKIPPED' ],
44
+ };
45
+
46
+ /** @type {Record<string, string>} */
47
+ status_color = {
48
+ PENDING : '#C4B040',
49
+ IN_PROGRESS: '#546E7A',
50
+ PASSED : '#009688',
51
+ FAILED : '#E66565',
52
+ BLOCKED : '#FD9A4F',
53
+ SKIPPED : '#90A4AE',
54
+ };
55
+
56
+ attribute_name_translate_matrix = typeChecklistResult_i18n.attribute_name_translate_matrix;
57
+ enum_value_translate_matrix = typeChecklistResult_i18n.enum_value_translate_matrix;
58
+
59
+
60
+ /**
61
+ * @param {object|false|undefined} data
62
+ */
63
+ constructor(data = false)
64
+ {
65
+ super();
66
+
67
+ if (data && is_object(data))
68
+ {
69
+ _.mapObject(data, (value, key) =>
70
+ {
71
+ if (this.hasOwnProperty(key))
72
+ {
73
+ this[ key ] = value;
74
+ }
75
+ });
76
+ }
77
+
78
+ return this;
79
+ }
80
+ }
@@ -0,0 +1,69 @@
1
+ import { is_object } from "../../../utils/utils.js";
2
+ import { typeChecklistItemBase } from "./typeChecklistItemBase.js";
3
+ import { typeChecklistResultItem_i18n } from "../../element_translate/typeChecklistResultItem.i18n.js";
4
+ import _ from 'underscore';
5
+
6
+
7
+ /**
8
+ * Отметка результата: копия пункта + статус + комментарий.
9
+ * item_text и sort_order - копия, не меняются. Меняются только item_status и item_comment.
10
+ * Создается бэкендом при создании результата.
11
+ *
12
+ * @version v.0.1 (30/09/2026)
13
+ */
14
+ export class typeChecklistResultItem extends typeChecklistItemBase
15
+ {
16
+ checklist_type = 'CHECKLIST_RESULT';
17
+ item_status;
18
+ item_comment;
19
+
20
+ api_key = 'checklist_result_item';
21
+
22
+ structure_scheme = {
23
+ ...this.structure_scheme,
24
+ item_status : 'string | enum | require',
25
+ item_comment: 'string | StringHtml | optional',
26
+ };
27
+
28
+ create_scheme = [];
29
+
30
+ /** @type {Record<string, string[]>} */
31
+ available_enum_values = {
32
+ ...this.available_enum_values,
33
+ item_status: [ 'PENDING', 'PASSED', 'FAILED', 'BLOCKED', 'SKIPPED' ],
34
+ };
35
+
36
+ /** @type {Record<string, string>} */
37
+ status_color = {
38
+ PENDING: '#C4B040',
39
+ PASSED : '#009688',
40
+ FAILED : '#E66565',
41
+ BLOCKED: '#FD9A4F',
42
+ SKIPPED: '#90A4AE',
43
+ };
44
+
45
+ attribute_name_translate_matrix = typeChecklistResultItem_i18n.attribute_name_translate_matrix;
46
+ enum_value_translate_matrix = typeChecklistResultItem_i18n.enum_value_translate_matrix;
47
+
48
+
49
+ /**
50
+ * @param {object|false|undefined} data
51
+ */
52
+ constructor(data = false)
53
+ {
54
+ super();
55
+
56
+ if (data && is_object(data))
57
+ {
58
+ _.mapObject(data, (value, key) =>
59
+ {
60
+ if (this.hasOwnProperty(key))
61
+ {
62
+ this[ key ] = value;
63
+ }
64
+ });
65
+ }
66
+
67
+ return this;
68
+ }
69
+ }
@@ -64,7 +64,7 @@ export class typeCustomProperty extends familyTestDocumentation
64
64
  'sort_order',
65
65
  ];
66
66
 
67
- /** @type {Record<string, string[]>} */
67
+ /** @type {Record<string, string[]>} */
68
68
  available_enum_values = {
69
69
  element_type: typeCustomProperty.get_element_type_values(),
70
70
  value_type : typeCustomProperty.get_value_type_values(),
@@ -90,6 +90,8 @@ export class typeCustomProperty extends familyTestDocumentation
90
90
  'test_account',
91
91
  'execution_context',
92
92
  'text_document',
93
+ 'checklist_id',
94
+ 'checklist_result_id',
93
95
  ];
94
96
  }
95
97
 
@@ -179,6 +179,17 @@ export class typeProject extends familyGeneralElement
179
179
  }
180
180
 
181
181
 
182
+ /**
183
+ * @param {number|false} [project_id]
184
+ * @param {object} [callback]
185
+ * @returns {Promise<any>}
186
+ */
187
+ async get_checklist_structure(project_id = false, callback = {})
188
+ {
189
+ return this._get_project_structure('get_checklist_structure', project_id, callback);
190
+ }
191
+
192
+
182
193
  /**
183
194
  *
184
195
  * @version v.0.1 (05/06/2025)
@@ -70,6 +70,11 @@ export class familyEvent extends familyGeneralElement
70
70
  'execution_context',
71
71
  'browser_tools_util_execution',
72
72
  'browser_tools_screenshot_multi',
73
+ 'checklist',
74
+ 'checklist_result',
75
+ 'checklist_item',
76
+ 'checklist_result_item',
77
+ 'checklist_folder',
73
78
  ];
74
79
  }
75
80
  }
@@ -37,6 +37,11 @@ export class typeBugRelation extends familyRelation
37
37
  primary_key: 'execution_context_id',
38
38
  api_key : 'execution_context'
39
39
  },
40
+ checklist_id: {
41
+ type_token : 'typeChecklistResult',
42
+ primary_key: 'checklist_id',
43
+ api_key : 'checklist_result'
44
+ },
40
45
  };
41
46
 
42
47
  structure_scheme = {
@@ -84,6 +84,16 @@ export class typeTagRelation extends familyRelation
84
84
  primary_key: 'object_repository_folder_id',
85
85
  api_key : 'object_repository_folder',
86
86
  },
87
+ checklist_id: {
88
+ type_token : 'typeChecklist',
89
+ primary_key: 'checklist_id',
90
+ api_key : 'checklist',
91
+ },
92
+ checklist_result_id: {
93
+ type_token : 'typeChecklistResult',
94
+ primary_key: 'checklist_id',
95
+ api_key : 'checklist_result',
96
+ },
87
97
  };
88
98
 
89
99
  structure_scheme = {
@@ -49,5 +49,16 @@ export class ProjectApi extends ApiAbstractElementClass {
49
49
  response: any;
50
50
  payload: any;
51
51
  }>;
52
+ /**
53
+ *
54
+ * All checklists + folders
55
+ *
56
+ * @version v.1.0 (01/10/2026)
57
+ * @param payload
58
+ */
59
+ get_checklist_structure(payload: any): Promise<{
60
+ response: any;
61
+ payload: any;
62
+ }>;
52
63
  }
53
64
  import { ApiAbstractElementClass } from "./api_abstract_element_class.js";
@@ -187,6 +187,12 @@ export class typeProject extends familyGeneralElement {
187
187
  * @returns {Promise<any>}
188
188
  */
189
189
  get_text_document_structure(project_id?: number | false, callback?: object): Promise<any>;
190
+ /**
191
+ * @param {number|false} [project_id]
192
+ * @param {object} [callback]
193
+ * @returns {Promise<any>}
194
+ */
195
+ get_checklist_structure(project_id?: number | false, callback?: object): Promise<any>;
190
196
  /**
191
197
  *
192
198
  * @version v.0.1 (05/06/2025)