@everymatrix/stage-mm-verification-report 1.0.40 → 1.0.41
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/main.js +15 -9
- package/main.js.map +1 -1
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -58144,7 +58144,8 @@ var AppComponent = class _AppComponent {
|
|
|
58144
58144
|
}
|
|
58145
58145
|
const tpl = this.templateSignal();
|
|
58146
58146
|
const all = this.allFieldsSignal();
|
|
58147
|
-
this.
|
|
58147
|
+
const visibleFields = this.visibleFieldsSignal();
|
|
58148
|
+
this.buildFilterForm(all, visibleFields, tpl?.input_params.fieldValues);
|
|
58148
58149
|
this.showReportTable.set(false);
|
|
58149
58150
|
this.tableLoading = false;
|
|
58150
58151
|
this.effectRef.destroy();
|
|
@@ -58263,13 +58264,14 @@ var AppComponent = class _AppComponent {
|
|
|
58263
58264
|
});
|
|
58264
58265
|
return columns;
|
|
58265
58266
|
}
|
|
58266
|
-
buildFilterForm(all, values) {
|
|
58267
|
+
buildFilterForm(all, visibleFields, values) {
|
|
58267
58268
|
this.filterForm = new FormGroup({});
|
|
58268
58269
|
const fieldsToExclude = [
|
|
58269
58270
|
"verification_updated_date",
|
|
58270
58271
|
"documents_expiry_date",
|
|
58271
58272
|
"documents_created_date"
|
|
58272
58273
|
];
|
|
58274
|
+
const visibleFieldsIds = visibleFields.map((item) => item.field_id);
|
|
58273
58275
|
all.forEach((field) => {
|
|
58274
58276
|
let def = values && values[field.field_id] || null;
|
|
58275
58277
|
const validators = [];
|
|
@@ -58279,7 +58281,7 @@ var AppComponent = class _AppComponent {
|
|
|
58279
58281
|
def = this.domainLookupsSignal().map((l) => l.lookup_key);
|
|
58280
58282
|
}
|
|
58281
58283
|
}
|
|
58282
|
-
if (!values && field.field_data_type === "TIMESTAMP" && !fieldsToExclude.includes(field.field_id)) {
|
|
58284
|
+
if (!values && field.field_data_type === "TIMESTAMP" && !fieldsToExclude.includes(field.field_id) && visibleFieldsIds.includes(field.field_id)) {
|
|
58283
58285
|
def = {
|
|
58284
58286
|
alias: "custom",
|
|
58285
58287
|
start: (0, import_moment2.default)().startOf("day").toDate(),
|
|
@@ -58543,7 +58545,7 @@ var AppComponent = class _AppComponent {
|
|
|
58543
58545
|
show_last_verification: true
|
|
58544
58546
|
};
|
|
58545
58547
|
this.filterForm.reset(defaults);
|
|
58546
|
-
this.
|
|
58548
|
+
this.applyDefaultValues(true, false);
|
|
58547
58549
|
this.filterForm.markAsPristine();
|
|
58548
58550
|
this.filterForm.markAsUntouched();
|
|
58549
58551
|
}
|
|
@@ -58618,7 +58620,7 @@ var AppComponent = class _AppComponent {
|
|
|
58618
58620
|
applyConfigurationFields(event2) {
|
|
58619
58621
|
this.isTemplateSaved.set(false);
|
|
58620
58622
|
this.visibleFieldsSignal.set(event2.fieldsToShow);
|
|
58621
|
-
this.
|
|
58623
|
+
this.applyDefaultValues(false, true);
|
|
58622
58624
|
}
|
|
58623
58625
|
applyDocumentField() {
|
|
58624
58626
|
const fieldsMap = {
|
|
@@ -58660,7 +58662,7 @@ var AppComponent = class _AppComponent {
|
|
|
58660
58662
|
}
|
|
58661
58663
|
this.scrollHeight = isPanelOpened ? 350 : 400;
|
|
58662
58664
|
}
|
|
58663
|
-
|
|
58665
|
+
applyDefaultValues(onClearFilters = false, onApplyConfigurationFields = false) {
|
|
58664
58666
|
if (!this.filterForm || !this.visibleFieldsSignal())
|
|
58665
58667
|
return;
|
|
58666
58668
|
const fieldsToExclude = [
|
|
@@ -58668,15 +58670,19 @@ var AppComponent = class _AppComponent {
|
|
|
58668
58670
|
"documents_expiry_date",
|
|
58669
58671
|
"documents_created_date"
|
|
58670
58672
|
];
|
|
58671
|
-
const
|
|
58673
|
+
const visibleFields = this.visibleFieldsSignal();
|
|
58674
|
+
const filteredVisibleFields = visibleFields.filter((item) => !fieldsToExclude.includes(item.field_id));
|
|
58672
58675
|
Object.keys(this.filterForm.controls).forEach((control) => {
|
|
58673
|
-
const
|
|
58674
|
-
|
|
58676
|
+
const visibleField = visibleFields.find((item) => item["field_id"] == control);
|
|
58677
|
+
const filteredVisibleField = filteredVisibleFields.find((item) => item["field_id"] == control);
|
|
58678
|
+
if (visibleField && filteredVisibleField && filteredVisibleField["field_data_type"] === "TIMESTAMP" && (!this.getControl(control)?.value && onClearFilters || onApplyConfigurationFields && !this.getControl(control)?.touched && !this.getControl(control)?.dirty)) {
|
|
58675
58679
|
this.filterForm.controls[control].reset({
|
|
58676
58680
|
alias: "custom",
|
|
58677
58681
|
start: (0, import_moment2.default)().startOf("day").toDate(),
|
|
58678
58682
|
end: (0, import_moment2.default)().endOf("day").toDate()
|
|
58679
58683
|
});
|
|
58684
|
+
} else if (onApplyConfigurationFields && !visibleField && this.getControl(control)?.value && control !== "show_last_verification") {
|
|
58685
|
+
this.filterForm.controls[control].reset();
|
|
58680
58686
|
}
|
|
58681
58687
|
});
|
|
58682
58688
|
}
|