-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/workflow container (part 2) #277
Conversation
@@ -240,80 +241,80 @@ export default { | |||
} | |||
}); | |||
}, | |||
onBaseApiUrlChange(baseAPIURL) { | |||
fetchTaskList() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code moved into alphabetical order. No changes in function except taskListName coming from props instead of referencing from the workflow.
this.wfLoading = true; | ||
|
||
return this.$http(baseAPIURL) | ||
.then( | ||
wf => { | ||
this.workflow = wf; | ||
this.$emit('setWorkflow', wf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow execution stored in vuex
@@ -144,17 +148,14 @@ export default { | |||
this.summary.result = undefined; | |||
this.summary.wfStatus = undefined; | |||
this.summary.workflow = undefined; | |||
|
|||
this.$emit('clearWorkflow'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow execution stored in vuex
[WORKFLOW_EXECUTION_PENDING_TASKS]: (_, getters) => [ | ||
...getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES], | ||
...getters[WORKFLOW_EXECUTION_PENDING_CHILDREN], | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow pending tasks data (used in future PR for pending tab)
this.clearState(); | ||
}, | ||
async onHistoryUrlChange(historyUrl) { | ||
const workflowInfo = await this.fetchWorkflowInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow execution now polled while workflow is running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
historyUrl will change when received new page token for history API.
@@ -144,17 +148,14 @@ export default { | |||
this.summary.result = undefined; | |||
this.summary.wfStatus = undefined; | |||
this.summary.workflow = undefined; | |||
|
|||
this.$emit('clearWorkflow'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it clean the wf state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. It will clear all data for the workflow in the vuex store.
'WORKFLOW_EXECUTION_PENDING_CHILDREN'; | ||
export const WORKFLOW_EXECUTION_PENDING_TASK_COUNT = | ||
'WORKFLOW_EXECUTION_PENDING_TASK_COUNT'; | ||
export const WORKFLOW_EXECUTION_PENDING_TASKS = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may want to have one for pending decision as well in the future, if possible, like we already do for the CLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. I couldn't see it being returned in the current API but it is the plan once this is returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe('workflow getters', () => { | ||
describe('when calling getters[WORKFLOW_EXECUTION]', () => { | ||
describe('and state.workflow.execution is defined', () => { | ||
const state = { | ||
workflow: { | ||
execution: { | ||
executionKey: 'executionValue', | ||
}, | ||
}, | ||
}; | ||
|
||
it('should return the value from state.workflow.execution', () => { | ||
const getters = initGetters({ getterFns, state }); | ||
const output = getters[WORKFLOW_EXECUTION]; | ||
|
||
expect(output.executionKey).toEqual('executionValue'); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff to cover the functionality!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, does vuex use just ajax to poll for the wf info? In the future, we may consider to push from the Cadence server via websockets on updates(if any), to optimize.
Vuex is just a store for data returned by the API. Currently the application is using ajax to poll and will then store in the vuex store. websockets could work in the future when the API supports it. |
Added
Changed