@eqproject/eqp-dynamic-module 0.0.11 → 0.0.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.
Files changed (32) hide show
  1. package/bundles/eqproject-eqp-dynamic-module.umd.js +23 -17
  2. package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -1
  3. package/bundles/eqproject-eqp-dynamic-module.umd.min.js +1 -1
  4. package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -1
  5. package/eqproject-eqp-dynamic-module.metadata.json +1 -1
  6. package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +5 -2
  7. package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +20 -17
  8. package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +1 -1
  9. package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +1 -1
  10. package/esm2015/lib/models/fields/{testareaField.model.js → textareaField.model.js} +1 -1
  11. package/esm2015/lib/models/form.model.js +1 -1
  12. package/esm2015/lib/services/utilityHelper.services.js +1 -1
  13. package/esm2015/public-api.js +2 -2
  14. package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +5 -2
  15. package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +20 -17
  16. package/esm5/lib/components/private/add-form-field/add-form-field.component.js +1 -1
  17. package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +1 -1
  18. package/esm5/lib/models/fields/{testareaField.model.js → textareaField.model.js} +1 -1
  19. package/esm5/lib/models/form.model.js +1 -1
  20. package/esm5/lib/services/utilityHelper.services.js +1 -1
  21. package/esm5/public-api.js +2 -2
  22. package/fesm2015/eqproject-eqp-dynamic-module.js +23 -17
  23. package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
  24. package/fesm5/eqproject-eqp-dynamic-module.js +23 -17
  25. package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
  26. package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +1 -1
  27. package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +1 -2
  28. package/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.d.ts +1 -1
  29. package/lib/models/fields/{testareaField.model.d.ts → textareaField.model.d.ts} +0 -0
  30. package/lib/models/form.model.d.ts +1 -0
  31. package/package.json +1 -1
  32. package/public-api.d.ts +1 -1
@@ -769,6 +769,7 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
769
769
  this.context = new Context();
770
770
  this.showButtons = true;
771
771
  this.showTitle = true;
772
+ this.viewMode = FormTypeEnum.LIST;
772
773
  /**
773
774
  * Url del server da chiamare per recuperare, salvare o eliminare i record.
774
775
  * Usato per creare la configurazione di default degli endpoint da chiamare.
@@ -801,7 +802,6 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
801
802
  this.afterDeleteRecord = new EventEmitter();
802
803
  this.afterDuplicateRecord = new EventEmitter();
803
804
  this.form = new Form();
804
- this.viewMode = FormTypeEnum.LIST;
805
805
  this.FormTypeEnum = FormTypeEnum;
806
806
  }
807
807
  EqpDynamicModuleComponent.prototype.ngOnInit = function () {
@@ -986,6 +986,9 @@ var EqpDynamicModuleComponent = /** @class */ (function () {
986
986
  __decorate([
987
987
  Input()
988
988
  ], EqpDynamicModuleComponent.prototype, "showTitle", void 0);
989
+ __decorate([
990
+ Input()
991
+ ], EqpDynamicModuleComponent.prototype, "viewMode", void 0);
989
992
  __decorate([
990
993
  Input()
991
994
  ], EqpDynamicModuleComponent.prototype, "baseServerUrl", void 0);
@@ -1108,6 +1111,7 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1108
1111
  this.form = new Form();
1109
1112
  this.formID = null;
1110
1113
  this.innerFormManagment = false;
1114
+ this.orgaID = null;
1111
1115
  /**
1112
1116
  * Url del server da chiamare per recuerare, salvare o eliminare i record.
1113
1117
  * Usato per creare la configurazione di default degli endpoint da chiamare.
@@ -1454,29 +1458,28 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1454
1458
  * Metodo per salvare la form creata alla fine del wizard.
1455
1459
  * Se è stato configurato un endPoint per il salvataggio viene effettuata una chiamata al server passando l'oggeto da salvare
1456
1460
  * nel body della chiamata, altrimenti scatena l'evento "saveFormEvent".
1457
- * NOTA: Per comunicare correttamente con la parte server del modulo dinamico bisogna modificare l'array dei Fields.
1458
- * Al posto di passare un array di BaseField bisogna passare un array di oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
1459
1461
  */
1460
1462
  EqpDynamicModuleConfiguratorComponent.prototype.saveForm = function () {
1461
1463
  var _this = this;
1462
1464
  if (this.endPointConfiguration != null && this.endPointConfiguration.Forms.SaveEndPoint) {
1463
- // Copio la form da salvare per riwrappare i Fields in oggetti del tipo { FieldType: FieldTypeEnum, Value: BaseField }.
1464
- // Necessario per far funzionare correttamente il FieldConverter del server.
1465
- var formToSave_1 = JSON.parse(JSON.stringify(this.form));
1466
- /*formToSave.Fields = [];
1467
- this.form.Fields.forEach(field => {
1468
- formToSave.Fields.push({
1469
- FieldType: field.FieldType,
1470
- Value: JSON.parse(JSON.stringify(field))
1471
- });
1472
- });*/
1473
- formToSave_1.Fields = [];
1465
+ // Per far arrivare al server l'array di Field bisogna passarli su Any
1466
+ this.form.ObjectFields = [];
1474
1467
  this.form.Fields.forEach(function (field) {
1475
- var fld = UtilityHelperService.GetFieldType(field);
1476
- formToSave_1.Fields.push(fld);
1468
+ if (field.FieldType == FieldTypeEnum.Allegato) {
1469
+ var fldA = field;
1470
+ fldA.MetadataObjectFields = fldA.MetadataFields;
1471
+ fldA.MetadataFields = [];
1472
+ _this.form.ObjectFields.push(fldA);
1473
+ }
1474
+ else {
1475
+ _this.form.ObjectFields.push(field);
1476
+ }
1477
1477
  });
1478
+ this.form.Fields = null;
1479
+ this.form.OrgaID = this.orgaID;
1480
+ // chiamata effettiva
1478
1481
  var dynamicModuleParams = [
1479
- { ParamName: "Form", ParamValue: formToSave_1, ParamType: ParamTypeEnum['In Body'] }
1482
+ { ParamName: "Form", ParamValue: this.form, ParamType: ParamTypeEnum['In Body'] }
1480
1483
  ];
1481
1484
  this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint, dynamicModuleParams, function (res) {
1482
1485
  EqpDynamicModuleDialogService.Success("Form salvata con successo!");
@@ -1707,6 +1710,9 @@ var EqpDynamicModuleConfiguratorComponent = /** @class */ (function () {
1707
1710
  __decorate([
1708
1711
  Input()
1709
1712
  ], EqpDynamicModuleConfiguratorComponent.prototype, "innerFormManagment", void 0);
1713
+ __decorate([
1714
+ Input()
1715
+ ], EqpDynamicModuleConfiguratorComponent.prototype, "orgaID", void 0);
1710
1716
  __decorate([
1711
1717
  Input()
1712
1718
  ], EqpDynamicModuleConfiguratorComponent.prototype, "baseServerUrl", void 0);