Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7079,10 +7079,15 @@ const CONST = {
STATUS: 'status',
SORT_BY: 'sortBy',
SORT_ORDER: 'sortOrder',
VIEW: 'view',
GROUP_BY: 'groupBy',
COLUMNS: 'columns',
LIMIT: 'limit',
},
VIEW: {
TABLE: 'table',
BAR: 'bar',
},
SYNTAX_FILTER_KEYS: {
TYPE: 'type',
STATUS: 'status',
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ type TaskSearchStatus = ValueOf<typeof CONST.SEARCH.STATUS.TASK>;
type SingularSearchStatus = ExpenseSearchStatus | ExpenseReportSearchStatus | InvoiceSearchStatus | TripSearchStatus | TaskSearchStatus;
type SearchStatus = SingularSearchStatus | SingularSearchStatus[];
type SearchGroupBy = ValueOf<typeof CONST.SEARCH.GROUP_BY>;
type SearchView = ValueOf<typeof CONST.SEARCH.VIEW>;
type TableColumnSize = ValueOf<typeof CONST.SEARCH.TABLE_COLUMN_SIZES>;
type SearchDatePreset = ValueOf<typeof CONST.SEARCH.DATE_PRESETS>;
type SearchWithdrawalType = ValueOf<typeof CONST.SEARCH.WITHDRAWAL_TYPE>;
Expand Down Expand Up @@ -247,6 +248,7 @@ type SearchQueryAST = {
sortBy: SearchColumnType;
sortOrder: SortOrder;
groupBy?: SearchGroupBy;
view: SearchView;
Comment thread
mateuuszzzzz marked this conversation as resolved.
filters: ASTNode;
policyID?: string[];
rawFilterList?: RawQueryFilter[];
Expand Down Expand Up @@ -327,6 +329,7 @@ export type {
SearchParams,
TableColumnSize,
SearchGroupBy,
SearchView,
SingularSearchStatus,
SearchDatePreset,
SearchWithdrawalType,
Expand Down
539 changes: 281 additions & 258 deletions src/libs/SearchParser/autocompleteParser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/libs/SearchParser/autocompleteParser.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// List fields where you cannot prefix it with "-" to negate it
const nonNegatableKeys = new Set([
"type", "keyword", "groupCurrency", "groupBy", "columns", "limit"
"type", "keyword", "groupCurrency", "groupBy", "columns", "limit", "view"
]);
}

Comment thread
mateuuszzzzz marked this conversation as resolved.
Expand Down
3 changes: 2 additions & 1 deletion src/libs/SearchParser/baseRules.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ has = "has"i {return "has"; }
is = "is"i {return "is"; }
purchaseAmount = "purchaseAmount"i / "purchase-amount"i {return "purchaseAmount"}
purchaseCurrency = "purchaseCurrency"i / "purchase-currency"i {return "purchaseCurrency"}
columns = "columns"i {
columns = "columns"i {
isColumnsContext = true;
return "columns";
}
view = "view"i {return "view"}

// Value transformation rules
values
Expand Down
Loading
Loading