complexqa_frontend_core 2.3.1 → 2.5.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 (37) 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/typeObjectRepositoryElement.i18n.js +6 -0
  19. package/src/types/element_translate/typeTagRelation.i18n.js +6 -0
  20. package/src/types/family_elements/autotest_step_actions/autotestStepLocatorKind.js +2 -0
  21. package/src/types/family_elements/autotest_step_actions/autotestStepTargetNormalizer.js +2 -0
  22. package/src/types/family_elements/autotest_step_actions/typeAutotestStepActionVariants.js +162 -0
  23. package/src/types/family_elements/checklist/typeChecklist.js +70 -0
  24. package/src/types/family_elements/checklist/typeChecklistBase.js +63 -0
  25. package/src/types/family_elements/checklist/typeChecklistFolder.js +97 -0
  26. package/src/types/family_elements/checklist/typeChecklistItem.js +47 -0
  27. package/src/types/family_elements/checklist/typeChecklistItemBase.js +58 -0
  28. package/src/types/family_elements/checklist/typeChecklistResult.js +80 -0
  29. package/src/types/family_elements/checklist/typeChecklistResultItem.js +69 -0
  30. package/src/types/family_elements/typeAutotestStep.js +25 -5
  31. package/src/types/family_elements/typeCustomProperty.js +3 -1
  32. package/src/types/family_elements/typeProject.js +11 -0
  33. package/src/types/family_events/familyEvent.js +5 -0
  34. package/src/types/family_relation/typeBugRelation.js +5 -0
  35. package/src/types/family_relation/typeTagRelation.js +10 -0
  36. package/types/api/project_api.d.ts +11 -0
  37. package/types/types/family_elements/typeProject.d.ts +6 -0
@@ -35,6 +35,12 @@ export class typeAutotestStepClick extends typeAutotestStepLocatorAction
35
35
  static category = 'pointer';
36
36
  }
37
37
 
38
+ export class typeAutotestStepRightClick extends typeAutotestStepLocatorAction
39
+ {
40
+ static action_name = 'rightClick';
41
+ static category = 'pointer';
42
+ }
43
+
38
44
  export class typeAutotestStepDblclick extends typeAutotestStepLocatorAction
39
45
  {
40
46
  static action_name = 'dblclick';
@@ -53,6 +59,18 @@ export class typeAutotestStepFocus extends typeAutotestStepLocatorAction
53
59
  static category = 'pointer';
54
60
  }
55
61
 
62
+ export class typeAutotestStepBlur extends typeAutotestStepLocatorAction
63
+ {
64
+ static action_name = 'blur';
65
+ static category = 'pointer';
66
+ }
67
+
68
+ export class typeAutotestStepScrollIntoViewIfNeeded extends typeAutotestStepLocatorAction
69
+ {
70
+ static action_name = 'scrollIntoViewIfNeeded';
71
+ static category = 'pointer';
72
+ }
73
+
56
74
  export class typeAutotestStepFill extends typeAutotestStepLocatorValueAction
57
75
  {
58
76
  static action_name = 'fill';
@@ -65,10 +83,17 @@ export class typeAutotestStepType extends typeAutotestStepLocatorValueAction
65
83
  static category = 'input';
66
84
  }
67
85
 
86
+ export class typeAutotestStepPressSequentially extends typeAutotestStepLocatorValueAction
87
+ {
88
+ static action_name = 'pressSequentially';
89
+ static category = 'input';
90
+ }
91
+
68
92
  export class typeAutotestStepPress extends typeAutotestStepLocatorValueAction
69
93
  {
70
94
  static action_name = 'press';
71
95
  static category = 'input';
96
+ static target_need = 'optional';
72
97
  static value_field_key = 'key';
73
98
  }
74
99
 
@@ -90,6 +115,18 @@ export class typeAutotestStepSelectOption extends typeAutotestStepLocatorValueAc
90
115
  static category = 'input';
91
116
  }
92
117
 
118
+ export class typeAutotestStepClear extends typeAutotestStepLocatorAction
119
+ {
120
+ static action_name = 'clear';
121
+ static category = 'input';
122
+ }
123
+
124
+ export class typeAutotestStepSelectText extends typeAutotestStepLocatorAction
125
+ {
126
+ static action_name = 'selectText';
127
+ static category = 'input';
128
+ }
129
+
93
130
  export class typeAutotestStepWaitForSelector extends typeAutotestStepLocatorAction
94
131
  {
95
132
  static action_name = 'waitForSelector';
@@ -144,26 +181,151 @@ export class typeAutotestStepToHaveAttribute extends typeAutotestStepLocatorValu
144
181
  static has_expected_value = true;
145
182
  }
146
183
 
184
+ export class typeAutotestStepToBeHidden extends typeAutotestStepLocatorAction
185
+ {
186
+ static action_name = 'toBeHidden';
187
+ static group = 'expect';
188
+ static category = 'assert';
189
+ }
190
+
191
+ export class typeAutotestStepToBeEnabled extends typeAutotestStepLocatorAction
192
+ {
193
+ static action_name = 'toBeEnabled';
194
+ static group = 'expect';
195
+ static category = 'assert';
196
+ }
197
+
198
+ export class typeAutotestStepToBeDisabled extends typeAutotestStepLocatorAction
199
+ {
200
+ static action_name = 'toBeDisabled';
201
+ static group = 'expect';
202
+ static category = 'assert';
203
+ }
204
+
205
+ export class typeAutotestStepToBeChecked extends typeAutotestStepLocatorAction
206
+ {
207
+ static action_name = 'toBeChecked';
208
+ static group = 'expect';
209
+ static category = 'assert';
210
+ }
211
+
212
+ export class typeAutotestStepToBeEditable extends typeAutotestStepLocatorAction
213
+ {
214
+ static action_name = 'toBeEditable';
215
+ static group = 'expect';
216
+ static category = 'assert';
217
+ }
218
+
219
+ export class typeAutotestStepToBeFocused extends typeAutotestStepLocatorAction
220
+ {
221
+ static action_name = 'toBeFocused';
222
+ static group = 'expect';
223
+ static category = 'assert';
224
+ }
225
+
226
+ export class typeAutotestStepToBeEmpty extends typeAutotestStepLocatorAction
227
+ {
228
+ static action_name = 'toBeEmpty';
229
+ static group = 'expect';
230
+ static category = 'assert';
231
+ }
232
+
233
+ export class typeAutotestStepToContainText extends typeAutotestStepLocatorValueAction
234
+ {
235
+ static action_name = 'toContainText';
236
+ static group = 'expect';
237
+ static category = 'assert';
238
+ }
239
+
240
+ export class typeAutotestStepToHaveValue extends typeAutotestStepLocatorValueAction
241
+ {
242
+ static action_name = 'toHaveValue';
243
+ static group = 'expect';
244
+ static category = 'assert';
245
+ }
246
+
247
+ export class typeAutotestStepToHaveCount extends typeAutotestStepLocatorValueAction
248
+ {
249
+ static action_name = 'toHaveCount';
250
+ static group = 'expect';
251
+ static category = 'assert';
252
+ static value_field_key = 'count';
253
+ }
254
+
255
+ export class typeAutotestStepToHaveTitle extends typeAutotestStepAction
256
+ {
257
+ static action_name = 'toHaveTitle';
258
+ static group = 'expect';
259
+ static category = 'assert';
260
+ static value_need = 'required';
261
+ static value_field_key = 'title';
262
+ }
263
+
264
+ export class typeAutotestStepToHaveClass extends typeAutotestStepLocatorValueAction
265
+ {
266
+ static action_name = 'toHaveClass';
267
+ static group = 'expect';
268
+ static category = 'assert';
269
+ static value_field_key = 'class_name';
270
+ }
271
+
272
+ export class typeAutotestStepToHaveId extends typeAutotestStepLocatorValueAction
273
+ {
274
+ static action_name = 'toHaveId';
275
+ static group = 'expect';
276
+ static category = 'assert';
277
+ static value_field_key = 'dom_id';
278
+ }
279
+
280
+ export class typeAutotestStepToHaveCSS extends typeAutotestStepLocatorValueAction
281
+ {
282
+ static action_name = 'toHaveCSS';
283
+ static group = 'expect';
284
+ static category = 'assert';
285
+ static value_field_key = 'css_property';
286
+ static has_expected_value = true;
287
+ }
288
+
147
289
  export const AUTOTEST_STEP_ACTION_CLASSES = [
148
290
  typeAutotestStepGoto,
149
291
  typeAutotestStepGoBack,
150
292
  typeAutotestStepGoForward,
151
293
  typeAutotestStepReload,
152
294
  typeAutotestStepClick,
295
+ typeAutotestStepRightClick,
153
296
  typeAutotestStepDblclick,
154
297
  typeAutotestStepHover,
155
298
  typeAutotestStepFocus,
299
+ typeAutotestStepBlur,
300
+ typeAutotestStepScrollIntoViewIfNeeded,
156
301
  typeAutotestStepFill,
157
302
  typeAutotestStepType,
303
+ typeAutotestStepPressSequentially,
158
304
  typeAutotestStepPress,
159
305
  typeAutotestStepCheck,
160
306
  typeAutotestStepUncheck,
161
307
  typeAutotestStepSelectOption,
308
+ typeAutotestStepClear,
309
+ typeAutotestStepSelectText,
162
310
  typeAutotestStepWaitForSelector,
163
311
  typeAutotestStepWaitForURL,
164
312
  typeAutotestStepWaitForTimeout,
165
313
  typeAutotestStepToBeVisible,
314
+ typeAutotestStepToBeHidden,
315
+ typeAutotestStepToBeEnabled,
316
+ typeAutotestStepToBeDisabled,
317
+ typeAutotestStepToBeChecked,
318
+ typeAutotestStepToBeEditable,
319
+ typeAutotestStepToBeFocused,
320
+ typeAutotestStepToBeEmpty,
166
321
  typeAutotestStepToHaveText,
322
+ typeAutotestStepToContainText,
323
+ typeAutotestStepToHaveValue,
324
+ typeAutotestStepToHaveCount,
167
325
  typeAutotestStepToHaveURL,
326
+ typeAutotestStepToHaveTitle,
168
327
  typeAutotestStepToHaveAttribute,
328
+ typeAutotestStepToHaveClass,
329
+ typeAutotestStepToHaveId,
330
+ typeAutotestStepToHaveCSS,
169
331
  ];
@@ -0,0 +1,70 @@
1
+ import { is_object } from "../../../utils/utils.js";
2
+ import { typeChecklistBase } from "./typeChecklistBase.js";
3
+ import { typeChecklist_i18n } from "../../element_translate/typeChecklist.i18n.js";
4
+ import "./typeChecklistFolder.js";
5
+ import _ from 'underscore';
6
+
7
+
8
+ /**
9
+ * Чек-лист: документ (справочник). Лежит в папке, правится автором.
10
+ * С багом не связывается.
11
+ *
12
+ * @version v.0.1 (30/09/2026)
13
+ */
14
+ export class typeChecklist extends typeChecklistBase
15
+ {
16
+ checklist_type = 'CHECKLIST';
17
+ checklist_folder_id;
18
+ checklist_items; // pseudo // relations - typeChecklistItem
19
+
20
+ api_key = 'checklist';
21
+
22
+ structure_scheme = {
23
+ ...this.structure_scheme,
24
+ checklist_folder_id: 'integer | typeChecklistFolder | optional',
25
+ };
26
+
27
+ create_scheme = [
28
+ 'project_id',
29
+ 'checklist_title',
30
+ 'checklist_folder_id',
31
+ ];
32
+
33
+ /** @type {Record<string, string[]>} */
34
+ available_enum_values = {
35
+ ...this.available_enum_values,
36
+ checklist_status: [ 'DRAFT', 'READY', 'ARCHIVED' ],
37
+ };
38
+
39
+ /** @type {Record<string, string>} */
40
+ status_color = {
41
+ DRAFT : '#C4B040',
42
+ READY : '#009688',
43
+ ARCHIVED: '#E0E0E0',
44
+ };
45
+
46
+ attribute_name_translate_matrix = typeChecklist_i18n.attribute_name_translate_matrix;
47
+ enum_value_translate_matrix = typeChecklist_i18n.enum_value_translate_matrix;
48
+
49
+
50
+ /**
51
+ * @param {object|false|undefined} data
52
+ */
53
+ constructor(data = false)
54
+ {
55
+ super();
56
+
57
+ if (data && is_object(data))
58
+ {
59
+ _.mapObject(data, (value, key) =>
60
+ {
61
+ if (this.hasOwnProperty(key))
62
+ {
63
+ this[ key ] = value;
64
+ }
65
+ });
66
+ }
67
+
68
+ return this;
69
+ }
70
+ }
@@ -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
+ }