Feat v0.9.2 converter consolidation (#75)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Successful in 2m51s
CI/CD / test-sqlite (push) Successful in 3m1s
CI/CD / build-and-deploy (push) Successful in 1m17s
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Successful in 2m51s
CI/CD / test-sqlite (push) Successful in 3m1s
CI/CD / build-and-deploy (push) Successful in 1m17s
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #75.
This commit is contained in:
@@ -199,7 +199,7 @@ func (h *WorkflowInstanceHandler) enrichInstances(ctx context.Context, instances
|
||||
// SLA check from version snapshot
|
||||
ver, _ := h.stores.Workflows.GetVersion(ctx, inst.WorkflowID, inst.WorkflowVersion)
|
||||
if ver != nil {
|
||||
stages := parseSnapshotStagesForView(ver.Snapshot)
|
||||
stages, _ := models.ParseSnapshotStages(ver.Snapshot)
|
||||
for _, s := range stages {
|
||||
if s.Name == inst.CurrentStage {
|
||||
v.StageName = s.Name
|
||||
@@ -217,18 +217,6 @@ func (h *WorkflowInstanceHandler) enrichInstances(ctx context.Context, instances
|
||||
return views
|
||||
}
|
||||
|
||||
func parseSnapshotStagesForView(snapshot json.RawMessage) []models.WorkflowStage {
|
||||
var wrapped struct {
|
||||
Stages []models.WorkflowStage `json:"stages"`
|
||||
}
|
||||
if err := json.Unmarshal(snapshot, &wrapped); err == nil && len(wrapped.Stages) > 0 {
|
||||
return wrapped.Stages
|
||||
}
|
||||
var stages []models.WorkflowStage
|
||||
json.Unmarshal(snapshot, &stages)
|
||||
return stages
|
||||
}
|
||||
|
||||
// CancelTeamInstance cancels an instance belonging to a team workflow.
|
||||
// POST /api/v1/teams/:teamId/workflow-instances/:iid/cancel
|
||||
func (h *WorkflowInstanceHandler) CancelTeamInstance(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user