Skip to content

Commit

Permalink
Add cron schedule to workflow summary page (#526)
Browse files Browse the repository at this point in the history
* add cron schedule to workflow summary page

* fix linting issue
  • Loading branch information
Assem-Uber authored Sep 11, 2023
1 parent a45534c commit cc5ae88
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions client/containers/workflow/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default {
input: undefined,
isWorkflowRunning: undefined,
parentWorkflowRoute: undefined,
cronSchedule: undefined,
result: undefined,
wfStatus: undefined,
workflow: undefined,
Expand Down Expand Up @@ -147,6 +148,7 @@ export default {
this.history.loading = undefined;
this.summary.input = undefined;
this.summary.cronSchedule = undefined;
this.summary.isWorkflowRunning = undefined;
this.summary.parentWorkflowRoute = undefined;
this.summary.result = undefined;
Expand Down Expand Up @@ -395,6 +397,7 @@ export default {
:display-workflow-id="displayWorkflowId"
:domain="domain"
:input="summary.input"
:cronSchedule="summary.cronSchedule"
:isWorkflowRunning="summary.isWorkflowRunning"
:parentWorkflowRoute="summary.parentWorkflowRoute"
:result="summary.result"
Expand Down
2 changes: 2 additions & 0 deletions client/containers/workflow/helpers/get-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const getSummary = ({ clusterName, events, isWorkflowRunning, workflow }) => {
return {
input: undefined,
isWorkflowRunning,
cronSchedule: undefined,
parentWorkflowRoute: undefined,
result: undefined,
wfStatus: undefined,
Expand Down Expand Up @@ -77,6 +78,7 @@ const getSummary = ({ clusterName, events, isWorkflowRunning, workflow }) => {

return {
input,
cronSchedule: firstEvent.details.cronSchedule,
isWorkflowRunning,
parentWorkflowRoute,
result,
Expand Down
7 changes: 6 additions & 1 deletion client/routes/workflow/summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
'input',
'isWorkflowRunning',
'parentWorkflowRoute',
'cronSchedule',
'result',
'runId',
'timeFormat',
Expand Down Expand Up @@ -250,6 +251,10 @@ export default {
</router-link>
</dd>
</div>
<div class="cron-schedule" v-if="cronSchedule">
<dt>Cron Schedule</dt>
<dd>{{ cronSchedule }}</dd>
</div>
<div class="task-list">
<dt>Task List</dt>
<dd>
Expand Down Expand Up @@ -318,7 +323,7 @@ section.workflow-summary
margin-bottom 1em
dt
padding 0 4px
.run-id, .task-list, .workflow-id, .workflow-name
.run-id, .task-list, .workflow-id, .workflow-name, .cron-schedule
dd
font-weight 300
font-family monospace-font-family
Expand Down
1 change: 1 addition & 0 deletions client/test/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default {
eventType: 'WorkflowExecutionStarted',
eventId: 1,
details: {
cronSchedule: '30 * * * *',
workflowType: {
name: 'email-daily-summaries',
},
Expand Down
6 changes: 6 additions & 0 deletions client/test/workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ describe('Workflow', () => {

summaryEl.should.not.have.descendant('.parent-workflow');

summaryEl
.querySelector('.cron-schedule dd')
.should.have.text('30 * * * *');

summaryEl
.querySelector('.workflow-status dd')
.should.contain.text('running');
Expand Down Expand Up @@ -869,6 +873,7 @@ describe('Workflow', () => {
startDetails
.textNodes('dl.details dt')
.should.deep.equal([
'cronSchedule',
'workflowType.name',
'taskList.name',
'input',
Expand All @@ -878,6 +883,7 @@ describe('Workflow', () => {
startDetails
.textNodes('dl.details dd')
.should.deep.equal([
'30 * * * *',
'email-daily-summaries',
'ci-task-queue',
inputPreText,
Expand Down

0 comments on commit cc5ae88

Please sign in to comment.