Skip to content

Commit

Permalink
Show next run for Schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
wsan3 committed May 15, 2024
1 parent 530d896 commit b3f3ea7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cypress/fixtures/schedules.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"updated_by": "CookieCat",
"scheduled_at": 0,
"branch": "main",
"error": ""
"error": "",
"next_run": 1685037152
},
{
"id": 2,
Expand Down Expand Up @@ -125,6 +126,7 @@
"updated_by": "CookieCat",
"scheduled_at": 0,
"branch": "main",
"error": "unable to trigger build for schedule Hourly: unable to schedule build: unable to compile pipeline configuration for github/octocat: 1 error occurred: * no \"version:\" YAML property provided"
"error": "unable to trigger build for schedule Hourly: unable to schedule build: unable to compile pipeline configuration for github/octocat: 1 error occurred: * no \"version:\" YAML property provided",
"next_run": 1685037152
}
]
5 changes: 5 additions & 0 deletions cypress/integration/schedules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ context('Schedules', () => {
cy.get('[data-label=scheduled-at]').should('exist');
});
});
it('should show next run', () => {
cy.get('@dailySchedule').within(() => {
cy.get('[data-label=next-run]').should('exist');
});
});
it('should show updated by', () => {
cy.get('@dailySchedule').within(() => {
cy.get('[data-label=updated-by]').contains('CookieCat');
Expand Down
9 changes: 9 additions & 0 deletions src/elm/Pages/Org_/Repo_/Schedules.elm
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ tableHeaders =
, ( Nothing, "enabled" )
, ( Nothing, "branch" )
, ( Nothing, "last scheduled at" )
, ( Nothing, "next run" )
, ( Nothing, "updated by" )
, ( Nothing, "updated at" )
]
Expand Down Expand Up @@ -391,6 +392,14 @@ viewSchedule zone org repo schedule =
[ text <| Util.humanReadableDateTimeWithDefault zone schedule.scheduled_at
]
}
, Components.Table.viewItemCell
{ dataLabel = "next-run"
, parentClassList = []
, itemClassList = []
, children =
[ text <| Util.humanReadableDateTimeWithDefault zone schedule.next_run
]
}
, Components.Table.viewItemCell
{ dataLabel = "updated-by"
, parentClassList = []
Expand Down
2 changes: 2 additions & 0 deletions src/elm/Vela.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,7 @@ type alias Schedule =
, updated_by : String
, branch : String
, error : String
, next_run : Int
}


Expand Down Expand Up @@ -1606,6 +1607,7 @@ decodeSchedule =
|> optional "updated_by" string ""
|> optional "branch" string ""
|> optional "error" string ""
|> optional "next_run" int 0


decodeSchedules : Decoder (List Schedule)
Expand Down

0 comments on commit b3f3ea7

Please sign in to comment.