Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix: connectors of non-Kubernetes type were shown in perspective sele…
Browse files Browse the repository at this point in the history
…ct list
  • Loading branch information
aiwantaozi authored and shanewxy committed Nov 17, 2023
1 parent 1744a05 commit af772a7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/apis/perspective/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,13 @@ func (h Handler) CollectionRouteGetFieldValues(
*/
err := h.modelClient.Connectors().Query().
Modify(func(s *sql.Selector) {
s.SelectExpr(
sql.Expr(fmt.Sprintf(`%s AS label`, connector.FieldName)),
sql.Expr(fmt.Sprintf(`%s AS value`, connector.FieldID)),
)
s.
Where(
sql.EQ(connector.FieldCategory, types.ConnectorCategoryKubernetes)).
SelectExpr(
sql.Expr(fmt.Sprintf(`%s AS label`, connector.FieldName)),
sql.Expr(fmt.Sprintf(`%s AS value`, connector.FieldID)),
)
}).
Scan(req.Context, &pvalues)
if err != nil {
Expand Down

0 comments on commit af772a7

Please sign in to comment.