Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit 0aea0ca

Browse files
author
Timo A. Hummel
committed
Merge pull request #643 from partkeepr/PartKeepr-640
Added comment filter, fixes #640
2 parents 9d7341b + 9910a86 commit 0aea0ca

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
5252
statusFilter: null,
5353
conditionFilter: null,
5454
internalPartNumberFilter: null,
55+
commentFilter: null,
5556

5657
/**
5758
* Initializes the component
@@ -96,7 +97,8 @@ Ext.define('PartKeepr.PartFilterPanel', {
9697
this.footprintFilter,
9798
this.statusFilter,
9899
this.conditionFilter,
99-
this.internalPartNumberFilter
100+
this.internalPartNumberFilter,
101+
this.commentFilter
100102
]
101103
};
102104

@@ -184,6 +186,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
184186

185187
this.conditionFilter.setValue("");
186188
this.internalPartNumberFilter.setValue("");
189+
this.commentFilter.setValue("");
187190

188191
this.onApply();
189192
},
@@ -442,6 +445,11 @@ Ext.define('PartKeepr.PartFilterPanel', {
442445
anchor: '100%'
443446
});
444447

448+
this.commentFilter = Ext.create("Ext.form.field.Text", {
449+
fieldLabel: i18n("Comment"),
450+
anchor: '100%'
451+
});
452+
445453
},
446454
/**
447455
* Applies the filter parameters to the passed extraParams object.
@@ -601,6 +609,14 @@ Ext.define('PartKeepr.PartFilterPanel', {
601609
value: "%" + this.internalPartNumberFilter.getValue() + "%"
602610
}));
603611
}
612+
613+
if (this.commentFilter.getValue() !== "") {
614+
filters.push(Ext.create("Ext.util.Filter", {
615+
property: 'comment',
616+
operator: "LIKE",
617+
value: "%" + this.commentFilter.getValue() + "%"
618+
}));
619+
}
604620
return filters;
605621
}
606622
});

0 commit comments

Comments
 (0)