Skip to content

Commit

Permalink
Add support for filtering by client tags in Web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii authored and raunaqmorarka committed Jan 15, 2025
1 parent bf08dfa commit 13e51e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.net.URI;
import java.util.Optional;
import java.util.Set;

import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.requireNonNull;
Expand All @@ -53,6 +54,7 @@ public class TrimmedBasicQueryInfo
private final Optional<ErrorCode> errorCode;
private final Optional<QueryType> queryType;
private final RetryPolicy retryPolicy;
private final Optional<Set<String>> clientTags;

public TrimmedBasicQueryInfo(BasicQueryInfo queryInfo)
{
Expand All @@ -79,6 +81,7 @@ public TrimmedBasicQueryInfo(BasicQueryInfo queryInfo)
this.queryStats = requireNonNull(queryInfo.getQueryStats(), "queryStats is null");
this.queryType = requireNonNull(queryInfo.getQueryType(), "queryType is null");
this.retryPolicy = requireNonNull(queryInfo.getRetryPolicy(), "retryPolicy is null");
this.clientTags = Optional.ofNullable(queryInfo.getSession().getClientTags());
}

@JsonProperty
Expand Down Expand Up @@ -183,6 +186,12 @@ public RetryPolicy getRetryPolicy()
return retryPolicy;
}

@JsonProperty
public Optional<Set<String>> getClientTags()
{
return clientTags;
}

@Override
public String toString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,13 @@ export class QueryList extends React.Component {
) {
return true
}

if (
query.clientTags &&
query.clientTags.some((clientTag) => clientTag.toLowerCase().indexOf(term) !== -1)
) {
return true
}
}, this)
}
}
Expand Down Expand Up @@ -810,7 +817,7 @@ export class QueryList extends React.Component {
<input
type="text"
className="form-control form-control-small search-bar"
placeholder="User, source, query ID, query state, resource group, error name, or query text"
placeholder="User, source, query ID, query state, resource group, error name, query text or client tags"
onChange={this.handleSearchStringChange}
value={this.state.searchString}
/>
Expand Down

0 comments on commit 13e51e1

Please sign in to comment.