@netgrif/components-core 6.0.2-rc.3 → 6.0.2
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/bundles/netgrif-components-core.umd.js +68 -11
- package/bundles/netgrif-components-core.umd.js.map +1 -1
- package/bundles/netgrif-components-core.umd.min.js +1 -1
- package/bundles/netgrif-components-core.umd.min.js.map +1 -1
- package/esm2015/lib/panel/abstract/panel-with-immediate-data.js +5 -1
- package/esm2015/lib/resources/engine-endpoint/task-resource.service.js +2 -1
- package/esm2015/lib/resources/interface/data-groups.js +1 -1
- package/esm2015/lib/resources/interface/immediate-data.js +1 -1
- package/esm2015/lib/task/services/task-data.service.js +10 -4
- package/esm2015/lib/task-content/model/task-fields.js +2 -0
- package/esm2015/lib/task-content/public-api.js +2 -1
- package/esm2015/lib/task-content/services/task-content.service.js +46 -9
- package/esm5/lib/panel/abstract/panel-with-immediate-data.js +7 -1
- package/esm5/lib/resources/engine-endpoint/task-resource.service.js +2 -1
- package/esm5/lib/resources/interface/data-groups.js +1 -1
- package/esm5/lib/resources/interface/immediate-data.js +1 -1
- package/esm5/lib/task/services/task-data.service.js +10 -4
- package/esm5/lib/task-content/model/task-fields.js +2 -0
- package/esm5/lib/task-content/public-api.js +2 -1
- package/esm5/lib/task-content/services/task-content.service.js +53 -9
- package/fesm2015/netgrif-components-core.js +59 -11
- package/fesm2015/netgrif-components-core.js.map +1 -1
- package/fesm5/netgrif-components-core.js +68 -11
- package/fesm5/netgrif-components-core.js.map +1 -1
- package/lib/resources/interface/data-groups.d.ts +4 -0
- package/lib/resources/interface/immediate-data.d.ts +6 -0
- package/lib/task-content/model/task-fields.d.ts +7 -0
- package/lib/task-content/public-api.d.ts +1 -0
- package/lib/task-content/services/task-content.service.d.ts +6 -6
- package/netgrif-components-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -6418,6 +6418,7 @@ var TaskResourceService = /** @class */ (function (_super) {
|
|
|
6418
6418
|
};
|
|
6419
6419
|
if (dataGroupResource.parentTaskId !== undefined) {
|
|
6420
6420
|
dataGroupObject.parentTaskId = dataGroupResource.parentTaskId;
|
|
6421
|
+
dataGroupObject.parentTransitionId = dataGroupResource.parentTransitionId;
|
|
6421
6422
|
dataGroupObject.parentTaskRefId = dataGroupResource.parentTaskRefId;
|
|
6422
6423
|
dataGroupObject.nestingLevel = dataGroupResource.nestingLevel;
|
|
6423
6424
|
}
|
|
@@ -14789,6 +14790,12 @@ var PanelWithImmediateData = /** @class */ (function (_super) {
|
|
|
14789
14790
|
return { value: immediate.value.defaultValue, icon: undefined, type: immediate.type };
|
|
14790
14791
|
case 'multichoice':
|
|
14791
14792
|
return { value: immediate.value.map(function (it) { return it.defaultValue; }).join(', '), icon: undefined, type: immediate.type };
|
|
14793
|
+
case 'enumeration_map':
|
|
14794
|
+
return { value: immediate.options[immediate.value].defaultValue, icon: undefined, type: immediate.type };
|
|
14795
|
+
case 'multichoice_map':
|
|
14796
|
+
return { value: immediate.value.map(function (it) {
|
|
14797
|
+
return immediate.options[it].defaultValue;
|
|
14798
|
+
}).join(', '), icon: undefined, type: immediate.type };
|
|
14792
14799
|
case 'file':
|
|
14793
14800
|
return { value: (_a = immediate.value) === null || _a === void 0 ? void 0 : _a.name, icon: 'insert_drive_file', type: immediate.type };
|
|
14794
14801
|
case 'fileList':
|
|
@@ -23536,11 +23543,15 @@ var TaskContentService = /** @class */ (function () {
|
|
|
23536
23543
|
// todo actions owner zbytočný?
|
|
23537
23544
|
var frontendActions = chFields.taskId === this.task.stringId && chFields[TaskContentService.FRONTEND_ACTIONS_KEY];
|
|
23538
23545
|
Object.keys(chFields).forEach(function (changedField) {
|
|
23539
|
-
if (!!_this.taskFieldsIndex[chFields.taskId] && !!_this.taskFieldsIndex[chFields.taskId]
|
|
23540
|
-
|
|
23546
|
+
if (!!_this.taskFieldsIndex[chFields.taskId] && !!_this.taskFieldsIndex[chFields.taskId].fields
|
|
23547
|
+
&& !!_this.taskFieldsIndex[chFields.taskId].fields[changedField]) {
|
|
23548
|
+
_this.updateField(chFields, _this.taskFieldsIndex[chFields.taskId].fields[changedField], frontendActions);
|
|
23541
23549
|
}
|
|
23542
23550
|
else if (_this.isFieldInTaskRef(changedField)) {
|
|
23543
|
-
_this.
|
|
23551
|
+
var taskId = _this.getReferencedTaskId(changedField);
|
|
23552
|
+
if (!!taskId && !!_this.taskFieldsIndex[taskId] && !!_this.taskFieldsIndex[taskId].fields
|
|
23553
|
+
&& !!_this.taskFieldsIndex[taskId].fields[changedField])
|
|
23554
|
+
_this.updateReferencedField(chFields, _this.taskFieldsIndex[taskId].fields[changedField], frontendActions);
|
|
23544
23555
|
}
|
|
23545
23556
|
});
|
|
23546
23557
|
this.$shouldCreate.next(this._task.dataGroups);
|
|
@@ -23548,8 +23559,7 @@ var TaskContentService = /** @class */ (function () {
|
|
|
23548
23559
|
};
|
|
23549
23560
|
TaskContentService.prototype.updateField = function (chFields, field, frontendActions) {
|
|
23550
23561
|
var _this = this;
|
|
23551
|
-
if (this._fieldConverterService.resolveType(field) === FieldTypeResource.TASK_REF
|
|
23552
|
-
|| this.isFieldInTaskRef(field.stringId)) {
|
|
23562
|
+
if (this._fieldConverterService.resolveType(field) === FieldTypeResource.TASK_REF) {
|
|
23553
23563
|
this._taskDataReloadRequest$.next(frontendActions ? frontendActions : undefined);
|
|
23554
23564
|
return;
|
|
23555
23565
|
}
|
|
@@ -23568,8 +23578,10 @@ var TaskContentService = /** @class */ (function () {
|
|
|
23568
23578
|
field.behavior = updatedField.behavior[_this._task.transitionId];
|
|
23569
23579
|
}
|
|
23570
23580
|
else {
|
|
23571
|
-
|
|
23572
|
-
|
|
23581
|
+
var transitionId = _this.getReferencedTransitionId(field.stringId);
|
|
23582
|
+
if (!!transitionId && transitionId !== '' && updatedField.behavior[transitionId])
|
|
23583
|
+
field.behavior = updatedField.behavior[transitionId];
|
|
23584
|
+
break;
|
|
23573
23585
|
}
|
|
23574
23586
|
break;
|
|
23575
23587
|
case 'choices':
|
|
@@ -23605,6 +23617,26 @@ var TaskContentService = /** @class */ (function () {
|
|
|
23605
23617
|
field.update();
|
|
23606
23618
|
});
|
|
23607
23619
|
};
|
|
23620
|
+
TaskContentService.prototype.updateReferencedField = function (chFields, field, frontendActions) {
|
|
23621
|
+
var _this = this;
|
|
23622
|
+
if (this._fieldConverterService.resolveType(field) === FieldTypeResource.TASK_REF) {
|
|
23623
|
+
this._taskDataReloadRequest$.next(frontendActions ? frontendActions : undefined);
|
|
23624
|
+
return;
|
|
23625
|
+
}
|
|
23626
|
+
var updatedField = chFields[field.stringId];
|
|
23627
|
+
Object.keys(updatedField).forEach(function (key) {
|
|
23628
|
+
switch (key) {
|
|
23629
|
+
case 'behavior':
|
|
23630
|
+
var transitionId = _this.getReferencedTransitionId(field.stringId);
|
|
23631
|
+
if (!!transitionId && transitionId !== '' && updatedField.behavior[transitionId])
|
|
23632
|
+
field.behavior = updatedField.behavior[transitionId];
|
|
23633
|
+
break;
|
|
23634
|
+
default:
|
|
23635
|
+
field[key] = updatedField[key];
|
|
23636
|
+
}
|
|
23637
|
+
field.update();
|
|
23638
|
+
});
|
|
23639
|
+
};
|
|
23608
23640
|
/**
|
|
23609
23641
|
* Performs the specific frontend action.
|
|
23610
23642
|
*
|
|
@@ -23624,7 +23656,26 @@ var TaskContentService = /** @class */ (function () {
|
|
|
23624
23656
|
var _this = this;
|
|
23625
23657
|
return !!this.taskFieldsIndex &&
|
|
23626
23658
|
Object.keys(this.taskFieldsIndex)
|
|
23627
|
-
.some(function (taskId) { return taskId !== _this.task.stringId && _this.taskFieldsIndex[taskId][changedField]; });
|
|
23659
|
+
.some(function (taskId) { return taskId !== _this.task.stringId && _this.taskFieldsIndex[taskId].fields[changedField]; });
|
|
23660
|
+
};
|
|
23661
|
+
TaskContentService.prototype.getReferencedTransitionId = function (changedField) {
|
|
23662
|
+
var _this = this;
|
|
23663
|
+
if (!!this.taskFieldsIndex) {
|
|
23664
|
+
var taskFieldsIndexId = Object.keys(this.taskFieldsIndex).find(function (taskId) {
|
|
23665
|
+
return Object.keys(_this.taskFieldsIndex[taskId].fields).includes(changedField);
|
|
23666
|
+
});
|
|
23667
|
+
return this.taskFieldsIndex[taskFieldsIndexId].transitionId;
|
|
23668
|
+
}
|
|
23669
|
+
return undefined;
|
|
23670
|
+
};
|
|
23671
|
+
TaskContentService.prototype.getReferencedTaskId = function (changedField) {
|
|
23672
|
+
var _this = this;
|
|
23673
|
+
if (!!this.taskFieldsIndex) {
|
|
23674
|
+
return Object.keys(this.taskFieldsIndex).find(function (taskId) {
|
|
23675
|
+
return Object.keys(_this.taskFieldsIndex[taskId].fields).includes(changedField);
|
|
23676
|
+
});
|
|
23677
|
+
}
|
|
23678
|
+
return undefined;
|
|
23628
23679
|
};
|
|
23629
23680
|
TaskContentService.FRONTEND_ACTIONS_KEY = '_frontend_actions';
|
|
23630
23681
|
TaskContentService.VALIDATE_FRONTEND_ACTION = 'validate';
|
|
@@ -24194,6 +24245,8 @@ var TaskDataService = /** @class */ (function (_super) {
|
|
|
24194
24245
|
dataGroups.forEach(function (group) {
|
|
24195
24246
|
var dataGroupParentCaseId = group.parentCaseId === undefined ? _this._safeTask.caseId : group.parentCaseId;
|
|
24196
24247
|
var parentTaskId = group.parentTaskId === undefined ? _this._safeTask.stringId : group.parentTaskId;
|
|
24248
|
+
var parentTransitionId = group.parentTransitionId === undefined ?
|
|
24249
|
+
_this._safeTask.transitionId : group.parentTransitionId;
|
|
24197
24250
|
if (dataGroupParentCaseId !== _this._safeTask.caseId) {
|
|
24198
24251
|
if (!_this._taskContentService.referencedTaskAndCaseIds[dataGroupParentCaseId]) {
|
|
24199
24252
|
_this._taskContentService.referencedTaskAndCaseIds[dataGroupParentCaseId] = [group.parentTaskId];
|
|
@@ -24210,8 +24263,12 @@ var TaskDataService = /** @class */ (function (_super) {
|
|
|
24210
24263
|
if (group.fields.length > 0 && !_this._taskContentService.taskFieldsIndex[parentTaskId]) {
|
|
24211
24264
|
_this._taskContentService.taskFieldsIndex[parentTaskId] = {};
|
|
24212
24265
|
}
|
|
24266
|
+
if (group.fields.length > 0 && !_this._taskContentService.taskFieldsIndex[parentTaskId].fields) {
|
|
24267
|
+
_this._taskContentService.taskFieldsIndex[parentTaskId].fields = {};
|
|
24268
|
+
}
|
|
24213
24269
|
group.fields.forEach(function (field) {
|
|
24214
|
-
_this._taskContentService.taskFieldsIndex[parentTaskId]
|
|
24270
|
+
_this._taskContentService.taskFieldsIndex[parentTaskId].transitionId = parentTransitionId;
|
|
24271
|
+
_this._taskContentService.taskFieldsIndex[parentTaskId].fields[field.stringId] = field;
|
|
24215
24272
|
field.valueChanges().subscribe(function () {
|
|
24216
24273
|
if (_this.wasFieldUpdated(field)) {
|
|
24217
24274
|
if (field instanceof DynamicEnumerationField) {
|
|
@@ -24378,7 +24435,7 @@ var TaskDataService = /** @class */ (function (_super) {
|
|
|
24378
24435
|
try {
|
|
24379
24436
|
for (var fieldIdsOfRequest_1 = (e_2 = void 0, __values(fieldIdsOfRequest)), fieldIdsOfRequest_1_1 = fieldIdsOfRequest_1.next(); !fieldIdsOfRequest_1_1.done; fieldIdsOfRequest_1_1 = fieldIdsOfRequest_1.next()) {
|
|
24380
24437
|
var fieldId = fieldIdsOfRequest_1_1.value;
|
|
24381
|
-
var field = this._taskContentService.taskFieldsIndex[taskId][fieldId];
|
|
24438
|
+
var field = this._taskContentService.taskFieldsIndex[taskId].fields[fieldId];
|
|
24382
24439
|
if (field === undefined) {
|
|
24383
24440
|
this._log.error("Unexpected state. Datafield " + fieldId + " of task " + taskId + " in setData request is not present in the task.");
|
|
24384
24441
|
return false;
|
|
@@ -24586,7 +24643,7 @@ var TaskDataService = /** @class */ (function (_super) {
|
|
|
24586
24643
|
var _this = this;
|
|
24587
24644
|
Object.keys(body).forEach(function (taskId) {
|
|
24588
24645
|
Object.keys(body[taskId]).forEach(function (fieldId) {
|
|
24589
|
-
_this._taskContentService.taskFieldsIndex[taskId][fieldId].waitingForResponse = false;
|
|
24646
|
+
_this._taskContentService.taskFieldsIndex[taskId].fields[fieldId].waitingForResponse = false;
|
|
24590
24647
|
});
|
|
24591
24648
|
});
|
|
24592
24649
|
};
|