complexqa_frontend_core 1.7.2 → 1.7.4
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/api/api_abstract_element_class.js +33 -0
- package/publish/types/family_elements/0_familyGeneralElement.js +29 -0
- package/publish/types/family_elements/typeProject.js +6 -0
- package/publish/types/family_elements/typeTestCase.js +0 -1
- package/publish/types/family_elements/typeTestCaseStep.js +0 -1
package/package.json
CHANGED
|
@@ -169,6 +169,39 @@ export class ApiAbstractElementClass
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* @version v.0.1 (08/03/2026)
|
|
175
|
+
* @param payload
|
|
176
|
+
*/
|
|
177
|
+
async clone_element(payload)
|
|
178
|
+
{
|
|
179
|
+
if (!this.module_prefix)
|
|
180
|
+
{
|
|
181
|
+
throw new Error('Error #181-1152 in ApiAbstractClass');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (this.stage === 'development')
|
|
185
|
+
{
|
|
186
|
+
return {
|
|
187
|
+
response: payload,
|
|
188
|
+
payload : payload
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let url = `/${ this.api_prefix }/${ this.module_prefix }/clone_element`;
|
|
193
|
+
|
|
194
|
+
payload = this.handle_request_payload(payload);
|
|
195
|
+
let response = this.api_request(url, payload);
|
|
196
|
+
response = this.handle_response(response);
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
response: response,
|
|
200
|
+
payload : payload
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
172
205
|
/**
|
|
173
206
|
*
|
|
174
207
|
* @version v.0.1 (26/05/2024)
|
|
@@ -467,6 +467,35 @@ export class familyGeneralElement
|
|
|
467
467
|
{
|
|
468
468
|
element = this;
|
|
469
469
|
}
|
|
470
|
+
|
|
471
|
+
let payload = {};
|
|
472
|
+
|
|
473
|
+
payload[this.get_primary_key()] = element[this.get_primary_key()];
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* {Api} ApiService
|
|
478
|
+
*/
|
|
479
|
+
return ApiService[this.api_key].clone_element(payload).then((response) =>
|
|
480
|
+
{
|
|
481
|
+
if (typeof callback?.success === 'function')
|
|
482
|
+
{
|
|
483
|
+
callback?.success({ response, payload })
|
|
484
|
+
}
|
|
485
|
+
}).catch((error) =>
|
|
486
|
+
{
|
|
487
|
+
echo({ error });
|
|
488
|
+
if (typeof callback?.error === 'function')
|
|
489
|
+
{
|
|
490
|
+
callback?.error({ error, payload })
|
|
491
|
+
}
|
|
492
|
+
}).finally((response) =>
|
|
493
|
+
{
|
|
494
|
+
if (typeof callback?.final === 'function')
|
|
495
|
+
{
|
|
496
|
+
callback?.final({ response, payload })
|
|
497
|
+
}
|
|
498
|
+
});
|
|
470
499
|
}
|
|
471
500
|
|
|
472
501
|
|