diff --git a/api_handler.go b/api_handler.go
index 787ef23..c7c2776 100644
--- a/api_handler.go
+++ b/api_handler.go
@@ -358,8 +358,7 @@ type StatesAndCountsResponse struct {
}
type WorkflowGetResponse struct {
- Supervisor *RiverJob `json:"supervisor"`
- Tasks []RiverJob `json:"tasks"`
+ Tasks []RiverJob `json:"tasks"`
}
func (a *apiHandler) WorkflowGet(rw http.ResponseWriter, req *http.Request) {
@@ -372,13 +371,10 @@ func (a *apiHandler) WorkflowGet(rw http.ResponseWriter, req *http.Request) {
return
}
- const workflowSupervisorJobKind = "WorkflowSupervisor"
-
dbJobs, err := a.queries.JobListWorkflow(ctx, db.JobListWorkflowParams{
- PaginationLimit: 1000,
- PaginationOffset: 0,
- WorkflowSupervisorKind: workflowSupervisorJobKind,
- WorkflowID: workflowID,
+ PaginationLimit: 1000,
+ PaginationOffset: 0,
+ WorkflowID: workflowID,
})
if err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
@@ -393,14 +389,7 @@ func (a *apiHandler) WorkflowGet(rw http.ResponseWriter, req *http.Request) {
jobs := internalJobsToSerializableJobs(dbJobs)
resp := WorkflowGetResponse{}
- if len(jobs) != 0 {
- startIndex := 0
- if jobs[0].Kind == workflowSupervisorJobKind {
- resp.Supervisor = &jobs[0]
- startIndex = 1
- }
- resp.Tasks = jobs[startIndex:]
- }
+ resp.Tasks = jobs
if err = json.NewEncoder(rw).Encode(resp); err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
diff --git a/internal/db/query.sql b/internal/db/query.sql
index 1e453a0..add88c5 100644
--- a/internal/db/query.sql
+++ b/internal/db/query.sql
@@ -19,7 +19,6 @@ FROM
WHERE
metadata @> jsonb_build_object('workflow_id', @workflow_id::text)
ORDER BY
- kind = @workflow_supervisor_kind::text DESC,
id ASC
LIMIT @pagination_limit::integer
OFFSET @pagination_offset::bigint;
diff --git a/internal/db/query.sql.go b/internal/db/query.sql.go
index ff5d299..920fca8 100644
--- a/internal/db/query.sql.go
+++ b/internal/db/query.sql.go
@@ -123,26 +123,19 @@ FROM
WHERE
metadata @> jsonb_build_object('workflow_id', $1::text)
ORDER BY
- kind = $2::text DESC,
id ASC
-LIMIT $4::integer
-OFFSET $3::bigint
+LIMIT $3::integer
+OFFSET $2::bigint
`
type JobListWorkflowParams struct {
- WorkflowID string
- WorkflowSupervisorKind string
- PaginationOffset int64
- PaginationLimit int32
+ WorkflowID string
+ PaginationOffset int64
+ PaginationLimit int32
}
func (q *Queries) JobListWorkflow(ctx context.Context, arg JobListWorkflowParams) ([]RiverJob, error) {
- rows, err := q.db.Query(ctx, jobListWorkflow,
- arg.WorkflowID,
- arg.WorkflowSupervisorKind,
- arg.PaginationOffset,
- arg.PaginationLimit,
- )
+ rows, err := q.db.Query(ctx, jobListWorkflow, arg.WorkflowID, arg.PaginationOffset, arg.PaginationLimit)
if err != nil {
return nil, err
}
diff --git a/ui/src/components/WorkflowDetail.tsx b/ui/src/components/WorkflowDetail.tsx
index 6a56def..de5bfc2 100644
--- a/ui/src/components/WorkflowDetail.tsx
+++ b/ui/src/components/WorkflowDetail.tsx
@@ -6,7 +6,7 @@ type WorkflowDetailProps = {
};
export default function WorkflowDetail({ workflow }: WorkflowDetailProps) {
- const { supervisor, tasks } = workflow;
+ const { tasks } = workflow;
return (
<>
ID:{" "}
-
- {supervisor.metadata.workflow_id}
-
+ {tasks[0].metadata.workflow_id}
{/* {capitalize(job.state)} */}