-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reestablish the model filters #700
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ var parseUserSearchQuery = function (aUserListQuery, aQuery) { | |
fullWordMatchFields: [] | ||
}); | ||
}; | ||
exports.parseCommentSearchQuery = parseCommentSearchQuery; | ||
exports.parseUserSearchQuery = parseUserSearchQuery; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already exported once... so matched it with it's function... this is the bug mentioned. |
||
|
||
var parseRemovedItemSearchQuery = function (aRemovedItemListQuery, aQuery) { | ||
parseModelListSearchQuery(aRemovedItemListQuery, aQuery, { | ||
|
@@ -140,7 +140,7 @@ var parseRemovedItemSearchQuery = function (aRemovedItemListQuery, aQuery) { | |
fullWordMatchFields: ['model'] | ||
}); | ||
}; | ||
exports.parseCommentSearchQuery = parseCommentSearchQuery; | ||
exports.parseRemovedItemSearchQuery = parseRemovedItemSearchQuery; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already exported twice... so matched it with it's function... this is the bug mentioned. |
||
|
||
exports.applyDiscussionCategoryFilter = function (aDiscussionListQuery, aOptions, aCatergorySlug) { | ||
if (aCatergorySlug === 'all') { | ||
|
@@ -281,6 +281,104 @@ exports.applyUserListQueryDefaults = function (aUserListQuery, aOptions, aReq) { | |
}); | ||
}; | ||
|
||
var removedItemUserListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Users', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'User' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemUserListQueryDefaults = removedItemUserListQueryDefaults; | ||
exports.applyRemovedItemUserListQueryDefaults = function (aRemovedItemUserListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemUserListQuery, aOptions, aReq, removedItemUserListQueryDefaults); | ||
}; | ||
|
||
var removedItemScriptListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Scripts', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Script' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemScriptListQueryDefaults = removedItemScriptListQueryDefaults; | ||
exports.applyRemovedItemScriptListQueryDefaults = function (aRemovedItemScriptListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemScriptListQuery, aOptions, aReq, removedItemScriptListQueryDefaults); | ||
}; | ||
|
||
var removedItemCommentListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Comments', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Comment' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemCommentListQueryDefaults = removedItemCommentListQueryDefaults; | ||
exports.applyRemovedItemCommentListQueryDefaults = function (aRemovedItemCommentListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemCommentListQuery, aOptions, aReq, removedItemCommentListQueryDefaults); | ||
}; | ||
|
||
var removedItemDiscussionListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Discussions', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Discussion' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemDiscussionListQueryDefaults = removedItemDiscussionListQueryDefaults; | ||
exports.applyRemovedItemDiscussionListQueryDefaults = function (aRemovedItemDiscussionListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemDiscussionListQuery, aOptions, aReq, removedItemDiscussionListQueryDefaults); | ||
}; | ||
|
||
var removedItemFlagListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Flags', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Flag' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemFlagListQueryDefaults = removedItemFlagListQueryDefaults; | ||
exports.applyRemovedItemFlagListQueryDefaults = function (aRemovedItemFlagListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemFlagListQuery, aOptions, aReq, removedItemFlagListQueryDefaults); | ||
}; | ||
|
||
var removedItemGroupListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Groups', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Group' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemGroupListQueryDefaults = removedItemGroupListQueryDefaults; | ||
exports.applyRemovedItemGroupListQueryDefaults = function (aRemovedItemGroupListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemGroupListQuery, aOptions, aReq, removedItemGroupListQueryDefaults); | ||
}; | ||
|
||
var removedItemVoteListQueryDefaults = { | ||
defaultSort: '-removed', | ||
parseSearchQueryFn: parseRemovedItemSearchQuery, | ||
searchBarPlaceholder: 'Search Removed Items in Votes', | ||
searchBarFormHiddenVariables: [ | ||
{ name: 'byModel', value: 'Vote' } | ||
], | ||
filterFlaggedItems: false | ||
} | ||
exports.removedItemVoteListQueryDefaults = removedItemVoteListQueryDefaults; | ||
exports.applyRemovedItemVoteListQueryDefaults = function (aRemovedItemVoteListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemVoteListQuery, aOptions, aReq, removedItemVoteListQueryDefaults); | ||
}; | ||
|
||
exports.applyRemovedItemListQueryDefaults = function (aRemovedItemListQuery, aOptions, aReq) { | ||
applyModelListQueryDefaults(aRemovedItemListQuery, aOptions, aReq, { | ||
defaultSort: '-removed', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also didn't know what to put in the parm list where the
null
is... it does work if I do/.*/
in R70 above however it (always) transfers that to the QSP which is probably undesirable which is why I ended up doing the R84 conditional above to ensure the default to all models. Putting in'{ $in [...] }'
(the dot, dot, dot meaning all the model names) doesn't like thefindOrDefaultIfNull
routine as it puts the single quotes in the condition which can't happen... and of course take them out and the V8 JavaScript debugger throws an exception.