mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
BIG-58: add starts/ends with comparator option to advanced filter dropdown.
This commit is contained in:
@@ -29,6 +29,8 @@ export const getTextCompatators = () => [
|
||||
{ value: 'not_contain', label: intl.get('not_contain') },
|
||||
{ value: 'equal', label: intl.get('equals') },
|
||||
{ value: 'not_equal', label: intl.get('not_equals') },
|
||||
{ value: 'starts_with', label: intl.get('starts_with') },
|
||||
{ value: 'ends_with', label: intl.get('ends_with') },
|
||||
];
|
||||
|
||||
export const getDateCompatators = () => [
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
"not_equal": "ليس متساوي",
|
||||
"contain": "يحتوي",
|
||||
"not_contain": "لا يحتوي",
|
||||
"starts_with": "يبدأ بـ",
|
||||
"ends_with": "ينتهي بـ",
|
||||
"cash": "النقدية",
|
||||
"accrual": "الاستحقاق",
|
||||
"from": "من",
|
||||
|
||||
@@ -202,6 +202,8 @@
|
||||
"not_equal": "Not Equal",
|
||||
"contain": "Contain",
|
||||
"not_contain": "Not Contain",
|
||||
"starts_with": "Starts with",
|
||||
"ends_with": "Ends with",
|
||||
"cash": "Cash",
|
||||
"accrual": "Accrual",
|
||||
"from": "From",
|
||||
|
||||
@@ -255,6 +255,17 @@ export default abstract class DynamicFilterAbstructor
|
||||
return (builder) => {
|
||||
builder.whereNot(comparatorColumn, 'LIKE', `%${role.value}%`);
|
||||
};
|
||||
case COMPARATOR_TYPE.STARTS_WITH:
|
||||
case COMPARATOR_TYPE.START_WITH:
|
||||
return (builder) => {
|
||||
builder.where(comparatorColumn, 'LIKE', `${role.value}%`);
|
||||
};
|
||||
case COMPARATOR_TYPE.ENDS_WITH:
|
||||
case COMPARATOR_TYPE.END_WITH:
|
||||
return (builder) => {
|
||||
builder.where(comparatorColumn, 'LIKE', `%${role.value}`);
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,12 @@ export const COMPARATOR_TYPE = {
|
||||
AFTER: 'after',
|
||||
BEFORE: 'before',
|
||||
IN: 'in',
|
||||
|
||||
STARTS_WITH: 'starts_with',
|
||||
START_WITH: 'start_with',
|
||||
|
||||
ENDS_WITH: 'ends_with',
|
||||
END_WITH: 'end_with'
|
||||
};
|
||||
|
||||
export const FIELD_TYPE = {
|
||||
|
||||
Reference in New Issue
Block a user