Skip to content

Commit

Permalink
Fixed filter #1444
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Apr 21, 2020
1 parent c41ff06 commit 7c5783a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cvat-core/src/annotations-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { ArgumentError } = require('./exceptions');
class AnnotationsFilter {
constructor() {
// eslint-disable-next-line security/detect-unsafe-regex
this.operatorRegex = /(==|!=|<=|>=|>|<|~=)(?=(?:[^"]*(["])[^"]*\2)*[^"]*$)/g;
this.operatorRegex = /(==|!=|<=|>=|>|<)(?=(?:[^"]*(["])[^"]*\2)*[^"]*$)/g;
}

// Method splits expression by operators that are outside of any brackets
Expand Down Expand Up @@ -204,7 +204,7 @@ class AnnotationsFilter {
serverID: state.serverID,
clientID: state.clientID,
type: state.objectType,
shape: state.objectShape,
shape: state.shapeType,
occluded: state.occluded,
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function filtersHelpModalContent(
width, height, label, serverID, clientID, type, shape, occluded
<br />
<Text strong>Supported operators: </Text>
==, !=, &gt;, &gt;=, &lt;, &lt;=, ~=, (), &amp; and |
==, !=, &gt;, &gt;=, &lt;, &lt;=, (), &amp; and |
<br />
<Text strong>
If you have double quotes in your query string,
Expand All @@ -107,6 +107,7 @@ function filtersHelpModalContent(
<Title level={3}>Examples</Title>
<ul>
<li>label==&quot;car&quot; | label==[&quot;road sign&quot;]</li>
<li>shape == &quot;polygon&quot;</li>
<li>width &gt;= height</li>
<li>attr[&quot;Attribute 1&quot;] == attr[&quot;Attribute 2&quot;]</li>
<li>clientID == 50</li>
Expand Down

0 comments on commit 7c5783a

Please sign in to comment.