Skip to content

Commit

Permalink
Remove sorting of risk score for now
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Sep 10, 2024
1 parent 9a68b6f commit 414a600
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions internal/v1/graphv1/schema/applications.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ enum ApplicationOrderField {
"Order applications by the name of the environment."
ENVIRONMENT

"Order applications by the risk score."
RISK_SCORE

"Order applications by the deployment time."
DEPLOYMENT_TIME
}
3 changes: 1 addition & 2 deletions internal/v1/workload/application/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ const (
ApplicationOrderFieldName ApplicationOrderField = "NAME"
ApplicationOrderFieldStatus ApplicationOrderField = "STATUS"
ApplicationOrderFieldEnvironment ApplicationOrderField = "ENVIRONMENT"
ApplicationOrderFieldRiskScore ApplicationOrderField = "RISK_SCORE"
ApplicationOrderFieldDeploymentTime ApplicationOrderField = "DEPLOYMENT_TIME"
)

func (e ApplicationOrderField) IsValid() bool {
switch e {
case ApplicationOrderFieldStatus, ApplicationOrderFieldName, ApplicationOrderFieldEnvironment, ApplicationOrderFieldRiskScore, ApplicationOrderFieldDeploymentTime:
case ApplicationOrderFieldStatus, ApplicationOrderFieldName, ApplicationOrderFieldEnvironment, ApplicationOrderFieldDeploymentTime:
return true
}
return false
Expand Down
6 changes: 3 additions & 3 deletions internal/v1/workload/application/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func ListForTeam(ctx context.Context, teamSlug slug.Slug, page *pagination.Pagin
slices.SortStableFunc(ret, func(a, b *Application) int {
return modelv1.Compare(a.EnvironmentName, b.EnvironmentName, orderBy.Direction)
})
case ApplicationOrderFieldRiskScore:
panic("not implemented yet")
case ApplicationOrderFieldDeploymentTime:
panic("not implemented yet")
slices.SortStableFunc(ret, func(a, b *Application) int {
return modelv1.Compare(a.EnvironmentName, b.EnvironmentName, orderBy.Direction)
})
case ApplicationOrderFieldStatus:
panic("not implemented yet")
}
Expand Down

0 comments on commit 414a600

Please sign in to comment.