-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fix desks template filter #4376
Fix desks template filter #4376
Conversation
@@ -41,7 +41,12 @@ export class MoreTemplates extends React.PureComponent<IProps, IState> { | |||
deskCriteria.push({[templateDesks]: {$in: [currentDeskId]}}); | |||
} | |||
|
|||
const criteria = {$or: [{$or: deskCriteria}, {user: sdApi.user.getCurrentUserId()}]}; | |||
const criteria = { |
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.
can you use ISuperdeskQuery
as here?
the logic also seems off inside criteria
. I'd expect it to be
$or: [deskCriteria, {user: sdApi.user.getCurrentUserId()}]
why double $ors?
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 can't use ISuperdeskQuery
, since we're working on the where
filter which we don't do anything for in the ISuperdeskQuery
or toElasticQuery
. About the or
- is because deskCriteria
is an array of options.
scripts/core/query-formatting.ts
Outdated
case '$exists': | ||
return {terms: {exists: {[field]: value}}}; | ||
case '$notExists': | ||
return {terms: {must_not: {exists: {[field]: value}}}}; |
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.
let's remove notExists
if we can do the same via $exists: false
04772e9
into
superdesk:authoring-react-post-broadcasting
SDESK-7085