@eqproject/eqp-dynamic-module 2.6.25 → 2.6.26

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.
@@ -5162,7 +5162,9 @@ class AddFormRecordComponent {
5162
5162
  // Controlla e spara il trigger se necessario
5163
5163
  checkTriggers(record) {
5164
5164
  var fireTrigger = true;
5165
+ GlobalService.debugLog("checkTriggers - inside checkTriggers()");
5165
5166
  if (this.form.Triggers != null) {
5167
+ GlobalService.debugLog("checkTriggers - have triggers in form");
5166
5168
  this.form.Triggers.forEach((trigger) => {
5167
5169
  fireTrigger = true;
5168
5170
  trigger.conditions.forEach((condition) => {
@@ -5175,45 +5177,56 @@ class AddFormRecordComponent {
5175
5177
  var recordValue = record[conditionKey];
5176
5178
  if (logicOperator == LogicOperator['='] && conditionValue != recordValue) {
5177
5179
  fireTrigger = false;
5180
+ this.logTrigger(trigger, condition, record);
5178
5181
  return;
5179
5182
  }
5180
5183
  if (logicOperator == LogicOperator['!='] && conditionValue == recordValue) {
5181
5184
  fireTrigger = false;
5185
+ this.logTrigger(trigger, condition, record);
5182
5186
  return;
5183
5187
  }
5184
5188
  if (logicOperator == LogicOperator['<'] && conditionValue <= recordValue) {
5185
5189
  fireTrigger = false;
5190
+ this.logTrigger(trigger, condition, record);
5186
5191
  return;
5187
5192
  }
5188
5193
  if (logicOperator == LogicOperator['<='] && conditionValue < recordValue) {
5189
5194
  fireTrigger = false;
5195
+ this.logTrigger(trigger, condition, record);
5190
5196
  return;
5191
5197
  }
5192
5198
  if (logicOperator == LogicOperator['>'] && conditionValue >= recordValue) {
5193
5199
  fireTrigger = false;
5200
+ this.logTrigger(trigger, condition, record);
5194
5201
  return;
5195
5202
  }
5196
5203
  if (logicOperator == LogicOperator['>='] && conditionValue > recordValue) {
5197
5204
  fireTrigger = false;
5205
+ this.logTrigger(trigger, condition, record);
5198
5206
  return;
5199
5207
  }
5200
5208
  if (logicOperator == LogicOperator['LIKE'] && recordValue.indexOf(conditionValue) == -1) {
5201
5209
  fireTrigger = false;
5210
+ this.logTrigger(trigger, condition, record);
5202
5211
  return;
5203
5212
  }
5204
5213
  if (logicOperator == LogicOperator['NOT LIKE'] && recordValue.indexOf(conditionValue) != -1) {
5205
5214
  fireTrigger = false;
5215
+ this.logTrigger(trigger, condition, record);
5206
5216
  return;
5207
5217
  }
5208
5218
  if (logicOperator == LogicOperator.Si && !recordValue) {
5209
5219
  fireTrigger = false;
5220
+ this.logTrigger(trigger, condition, record);
5210
5221
  return;
5211
5222
  }
5212
5223
  if (logicOperator == LogicOperator.No && recordValue) {
5213
5224
  fireTrigger = false;
5225
+ this.logTrigger(trigger, condition, record);
5214
5226
  return;
5215
5227
  }
5216
5228
  });
5229
+ GlobalService.debugLog("checkTriggers - fireTrigger? ", fireTrigger);
5217
5230
  if (fireTrigger) {
5218
5231
  // Il trigger va sparato. Valuto le funzioni interne
5219
5232
  var formulas = JSON.parse(JSON.stringify(trigger.formulas));
@@ -5229,11 +5242,17 @@ class AddFormRecordComponent {
5229
5242
  triggerToFire.trigger = trigger; // Il trigger
5230
5243
  triggerToFire.formulas = formulas; // Le formule inviate in input al modulo dinamico, valutate nel contesto del trigger e del record
5231
5244
  triggerToFire.userPatient = this.userID; // UserID
5245
+ GlobalService.debugLog("checkTriggers - Trigger Fired ", triggerToFire);
5232
5246
  this.fireTrigger.emit(triggerToFire);
5233
5247
  }
5234
5248
  });
5235
5249
  }
5236
5250
  }
5251
+ logTrigger(trigger, condition, record) {
5252
+ GlobalService.debugLog("checkTriggers - Condition that invalidated the trigger TRIGGER", trigger);
5253
+ GlobalService.debugLog("checkTriggers - Condition that invalidated the trigger CONDITION", condition);
5254
+ GlobalService.debugLog("checkTriggers - Condition that invalidated the trigger RECORD", record);
5255
+ }
5237
5256
  }
5238
5257
  AddFormRecordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AddFormRecordComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: UtilityHelperService }], target: i0.ɵɵFactoryTarget.Component });
5239
5258
  AddFormRecordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AddFormRecordComponent, selector: "add-form-record", inputs: { configurations: "configurations", endPointConfiguration: "endPointConfiguration", userID: "userID", orgaID: "orgaID", formID: "formID", form: "form", record: "record", onlyView: "onlyView", isDuplicate: "isDuplicate", inConfig: "inConfig", showAllFields: "showAllFields", QueryEditorComponent: "QueryEditorComponent" }, outputs: { saveRecordEvent: "saveRecordEvent", afterSaveRecordEvent: "afterSaveRecordEvent", out: "out", fireTrigger: "fireTrigger" }, viewQueries: [{ propertyName: "fieldTemplate", predicate: ["fieldTemplate"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"loader\">\r\n\r\n <div class=\"row eqp-dynamic-module-title add-form-record-header\" *ngIf=\"showTitle\">\r\n <div class=\"col-md-12\">\r\n <span>{{form.Name}}</span>\r\n </div>\r\n </div>\r\n\r\n <form [formGroup]=\"formForm\" class=\"add-form-record-form\">\r\n\r\n <!-- VISUALIZZAZIONE SEMPLICE -->\r\n <ng-container *ngIf=\"form.FormScalarType == FormScalarTypeEnum.Semplice\" [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: form.Fields }\" class=\"add-form-record-semplice\">\r\n </ng-container>\r\n\r\n <!-- VISUALIZZAZIONE A STEPPER -->\r\n <mat-horizontal-stepper linear *ngIf=\"form.FormScalarType == FormScalarTypeEnum['A step']\"\r\n class=\"add-form-record-stepper\">\r\n <mat-step *ngFor=\"let group of form.FormFieldsGroups; let i = index; let first = first; let last = last\">\r\n <ng-template matStepLabel>\r\n {{group.Name}}\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n\r\n <div class=\"mt-2 d-flex justify-content-end add-form-record-buttons\">\r\n <button *ngIf=\"!first\" class=\"mr-2 previous\" mat-raised-button matStepperPrevious>\r\n Precedente\r\n </button>\r\n <button *ngIf=\"!last\" class=\"button-next\" color=\"primary\" mat-raised-button matStepperNext>\r\n Successivo\r\n </button>\r\n <button *ngIf=\"last && showSaveButton\" (click)=\"saveOrExitForm(false)\" class=\"button-next\"\r\n color=\"primary\" mat-raised-button>\r\n Salva\r\n </button>\r\n </div>\r\n\r\n </mat-step>\r\n </mat-horizontal-stepper>\r\n\r\n <!-- VISUALIZZAZIONE A TAB -->\r\n <mat-tab-group *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In tab']\" class=\"add-form-record-tab\">\r\n <mat-tab *ngFor=\"let group of form.FormFieldsGroups\" [label]=\"group.Name\">\r\n <div class=\"mt-3\">\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </div>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n <!-- VISUALIZZAZIONE AD ACCORDION -->\r\n <mat-accordion multi *ngIf=\"form.FormScalarType == FormScalarTypeEnum['In accordion']\"\r\n class=\"add-form-record-accordion\">\r\n <mat-expansion-panel *ngFor=\"let group of form.FormFieldsGroups\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{group.Name}}\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <ng-container [ngTemplateOutlet]=\"fieldTemplates\"\r\n [ngTemplateOutletContext]=\"{ fields: fieldGroups[group.Name] }\">\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </form>\r\n\r\n <div class=\"row mt-2 add-form-record-buttons\"\r\n *ngIf=\"(showBackButton || showSaveButton) && form.FormScalarType != FormScalarTypeEnum['A step']\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"mr-2\" mat-raised-button type=\"button\" *ngIf=\"showBackButton\" (click)=\"saveOrExitForm(true)\">\r\n Annulla\r\n </button>\r\n <button class=\"mr-2\" mat-raised-button color=\"primary\" type=\"button\" *ngIf=\"showSaveButton\"\r\n (click)=\"saveOrExitForm(false)\" [disabled]=\"formForm.invalid || formForm.disabled || isSaving\">\r\n <span *ngIf=\"!isSaving\">Salva</span>\r\n <span *ngIf=\"isSaving\">Salvataggio in Corso...</span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n</ng-container>\r\n\r\n\r\n\r\n<!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM -->\r\n<ng-template #fieldTemplates let-fields='fields'>\r\n <div class=\"row\" *ngIf=\"formloaded\">\r\n <div class=\"mt-2\" *ngFor=\"let field of fields\"\r\n [ngClass]=\"utilityService.getFieldSyleClass(field, showAllFields)\">\r\n <dynamic-module-field-fix #fieldTemplate [field]=\"field\" [QueryEditorComponent]=\"QueryEditorComponent\" [form]=\"form\" [record]=\"record\" [endPointConfiguration]=\"endPointConfiguration\" [userID]=\"userID\" [inConfig]=\"inConfig\"\r\n (recordChange)=\"onRecordChange()\">\r\n </dynamic-module-field-fix>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".visibility_hidden{display:none}.visibility_transparent{visibility:hidden}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i12.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i12.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i12.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "directive", type: i12.MatStepperNext, selector: "button[matStepperNext]", inputs: ["type"] }, { kind: "directive", type: i12.MatStepperPrevious, selector: "button[matStepperPrevious]", inputs: ["type"] }, { kind: "component", type: i4$4.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i4$4.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i6$2.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i6$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6$2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i6$2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DynamicModuleFieldFixComponent, selector: "dynamic-module-field-fix", inputs: ["endPointConfiguration", "field", "form", "record", "inConfig", "userID", "QueryEditorComponent"], outputs: ["recordChange", "out"] }] });