@eqproject/eqp-dynamic-module 2.7.37 → 2.8.0
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/esm2020/lib/components/private/dbgetter/dbgetter.component.mjs +27 -12
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +26 -11
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +26 -11
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/private/dbgetter/dbgetter.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4410,9 +4410,10 @@ class DbgetterComponent {
|
|
|
4410
4410
|
this.haveRelations = false;
|
|
4411
4411
|
this.reload = true;
|
|
4412
4412
|
this.relations = new Array();
|
|
4413
|
+
this.backupQuestionFields = null;
|
|
4413
4414
|
}
|
|
4414
4415
|
ngOnInit() {
|
|
4415
|
-
console.log("INSIDE DBGETTER", this.form, this.record, this.field, this.QueryEditorComponent);
|
|
4416
|
+
//console.log("INSIDE DBGETTER", this.form, this.record, this.field, this.QueryEditorComponent);
|
|
4416
4417
|
if (this.QueryEditorComponent != null) {
|
|
4417
4418
|
this.QueryEditorComponent.inputParams.config.mode = QueryEditorModeEnum.RESULT;
|
|
4418
4419
|
this.QueryEditorComponent.inputParams.config.field = this.field;
|
|
@@ -4421,6 +4422,13 @@ class DbgetterComponent {
|
|
|
4421
4422
|
if (this.field.DataGetter.DataGetterValue.openedFields.find(x => x.QueryPropertyValue == '?') != null) {
|
|
4422
4423
|
// Il campo ha almeno un valore con "?"
|
|
4423
4424
|
this.haveQuestions = true;
|
|
4425
|
+
//console.log("CHECKING BACKUPS OPENED FIELDS....", this.backupQuestionFields);
|
|
4426
|
+
if (this.backupQuestionFields == null) {
|
|
4427
|
+
this.backupQuestionFields = new Array();
|
|
4428
|
+
this.field.DataGetter.DataGetterValue.openedFields.forEach((rqf) => {
|
|
4429
|
+
this.backupQuestionFields.push(rqf.PropertyName);
|
|
4430
|
+
});
|
|
4431
|
+
}
|
|
4424
4432
|
}
|
|
4425
4433
|
if (this.field.DataGetter.DataGetterValue.openedFields.find(x => x.QueryPropertyValue.indexOf('!') != -1) != null) {
|
|
4426
4434
|
// Il campo ha almeno un valore con "!nomerelazione"
|
|
@@ -4428,17 +4436,17 @@ class DbgetterComponent {
|
|
|
4428
4436
|
this.field.DataGetter.DataGetterValue.openedFields.filter(x => x.QueryPropertyValue.indexOf('!') != -1).forEach((fieldWithRelation) => {
|
|
4429
4437
|
var fieldRelated = fieldWithRelation.QueryPropertyValue.replace("!", "");
|
|
4430
4438
|
if (this.record[fieldRelated] == null) {
|
|
4431
|
-
console.log("this.record[fieldRelated] E' NULL", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4439
|
+
//console.log("this.record[fieldRelated] E' NULL", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4432
4440
|
this.relations.push({ field: fieldRelated, loaded: false, actualvalue: this.record[fieldRelated] });
|
|
4433
4441
|
this.checkRelations();
|
|
4434
4442
|
this.interval = setInterval(() => {
|
|
4435
|
-
console.log("this.record[fieldRelated] CHECK", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4443
|
+
//console.log("this.record[fieldRelated] CHECK", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4436
4444
|
var currentRelation = this.relations.find(x => x.field == fieldRelated);
|
|
4437
4445
|
if (currentRelation != null) {
|
|
4438
4446
|
// Gestione dei cambi di valore dei campi relazionati
|
|
4439
4447
|
// Il campo relazionato INIZIALMENTE NON E' NULL, e cambia valore in qualcosa che NON E' NULL
|
|
4440
4448
|
if (currentRelation.actualvalue != null && this.record[fieldRelated] != null && this.record[fieldRelated] != currentRelation.actualvalue) {
|
|
4441
|
-
console.log("this.record[fieldRelated] HA CAMBIATO VALORE!!", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4449
|
+
//console.log("this.record[fieldRelated] HA CAMBIATO VALORE!!", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4442
4450
|
currentRelation.actualvalue = this.record[fieldRelated];
|
|
4443
4451
|
currentRelation.loaded = true;
|
|
4444
4452
|
fieldWithRelation.QueryPropertyValue = this.record[fieldRelated];
|
|
@@ -4447,16 +4455,20 @@ class DbgetterComponent {
|
|
|
4447
4455
|
}
|
|
4448
4456
|
// Il campo relazionato INIZIALMENTE NON E' NULL, e cambia valore IN NULL
|
|
4449
4457
|
else if (currentRelation.actualvalue != null && this.record[fieldRelated] == null) {
|
|
4450
|
-
console.log("this.record[fieldRelated] E' TORNATO AD ESSERE NULL!! :(", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4458
|
+
//console.log("this.record[fieldRelated] E' TORNATO AD ESSERE NULL!! :(", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4451
4459
|
currentRelation.actualvalue = this.record[fieldRelated];
|
|
4452
4460
|
currentRelation.loaded = true;
|
|
4453
4461
|
fieldWithRelation.QueryPropertyValue = "!" + fieldRelated;
|
|
4454
4462
|
this.record[this.field.Name] = null;
|
|
4463
|
+
// Recupero Backup
|
|
4464
|
+
this.backupQuestionFields.forEach((bof) => {
|
|
4465
|
+
this.field.DataGetter.DataGetterValue.openedFields.find(x => x.PropertyName == bof).QueryPropertyValue = "?";
|
|
4466
|
+
});
|
|
4455
4467
|
this.reloadComponent();
|
|
4456
4468
|
}
|
|
4457
4469
|
// Il campo relazionato INIZIALMENTE E' NULL, e cambia valore
|
|
4458
4470
|
else if (currentRelation.actualvalue == null && this.record[fieldRelated] != null) {
|
|
4459
|
-
console.log("this.record[fieldRelated] NON E' PIU' NULL!! :)", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4471
|
+
//console.log("this.record[fieldRelated] NON E' PIU' NULL!! :)", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4460
4472
|
currentRelation.actualvalue = this.record[fieldRelated];
|
|
4461
4473
|
currentRelation.loaded = true;
|
|
4462
4474
|
fieldWithRelation.QueryPropertyValue = this.record[fieldRelated];
|
|
@@ -4464,10 +4476,10 @@ class DbgetterComponent {
|
|
|
4464
4476
|
}
|
|
4465
4477
|
this.checkRelations();
|
|
4466
4478
|
}
|
|
4467
|
-
},
|
|
4479
|
+
}, 200);
|
|
4468
4480
|
}
|
|
4469
4481
|
else {
|
|
4470
|
-
console.log("this.record[fieldRelated] NON E' NULL!! :)", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4482
|
+
//console.log("this.record[fieldRelated] NON E' NULL!! :)", this.field.Name, fieldRelated, this.record[fieldRelated], this.record);
|
|
4471
4483
|
fieldWithRelation.QueryPropertyValue = this.record[fieldRelated] != null ? this.record[fieldRelated] : '';
|
|
4472
4484
|
this.relations.push({ field: fieldRelated, loaded: true, actualvalue: this.record[fieldRelated] });
|
|
4473
4485
|
this.checkRelations();
|
|
@@ -4490,17 +4502,20 @@ class DbgetterComponent {
|
|
|
4490
4502
|
}
|
|
4491
4503
|
}
|
|
4492
4504
|
reloadComponent() {
|
|
4493
|
-
console.log("RELOAD COMPONENT CALLED", this.record, this.QueryEditorComponent.inputParams.config.record);
|
|
4505
|
+
//console.log("RELOAD COMPONENT CALLED", this.record, this.QueryEditorComponent.inputParams.config.record);
|
|
4494
4506
|
this.reload = false;
|
|
4495
4507
|
this.QueryEditorComponent.inputParams.config.record = this.record;
|
|
4496
4508
|
this.QueryEditorComponent.inputParams.config.field = this.field;
|
|
4497
|
-
setTimeout(() => {
|
|
4509
|
+
setTimeout(() => {
|
|
4510
|
+
this.reload = true;
|
|
4511
|
+
//console.log("RELOADED QUERYEDITOR");
|
|
4512
|
+
}, 3000);
|
|
4498
4513
|
}
|
|
4499
4514
|
checkRelations() {
|
|
4500
4515
|
this.relationsLoaded = this.relations.find(x => x.loaded) != null;
|
|
4501
4516
|
}
|
|
4502
4517
|
onExternalSQLResultOut(ev) {
|
|
4503
|
-
console.log("Risultato dell'elaborazione del query editor: onExternalSQLResultOut", ev);
|
|
4518
|
+
//console.log("Risultato dell'elaborazione del query editor: onExternalSQLResultOut", ev);
|
|
4504
4519
|
if (ev.Behaviours.indexOf("send-out") != -1) {
|
|
4505
4520
|
this.out.emit(ev);
|
|
4506
4521
|
}
|