stash
This commit is contained in:
parent
4671860fa4
commit
18a3e40435
7 changed files with 43 additions and 11 deletions
|
|
@ -33,7 +33,7 @@ export default {
|
|||
},
|
||||
fallbackSrc: {
|
||||
type: String,
|
||||
default: '/assets/img/avatars/avatar.png'
|
||||
default: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+CjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEyIiBmaWxsPSIjY2VkNGRhIi8+CjxjaXJjbGUgY3g9IjEyIiBjeT0iOS41IiByPSI0IiBmaWxsPSIjZmZmZmZmIi8+CjxwYXRoIGQ9Ik00IDIwLjJDNCAxNi4yIDcuNiAxMy41IDEyIDEzLjVzOCAyLjcgOCA2Ljd2MC4zSDR2LTAuM3oiIGZpbGw9IiNmZmZmZmYiLz4KPC9zdmc+Cg=='
|
||||
},
|
||||
width: {
|
||||
type: [String, Number],
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ export default {
|
|||
},
|
||||
|
||||
totalSteps() {
|
||||
return this.stepDefinitions.length || this.workflowInstance?.total_steps || 1;
|
||||
return this.stepDefinitions.length || 1;
|
||||
},
|
||||
|
||||
currentStepDefinition() {
|
||||
|
|
@ -314,6 +314,7 @@ export default {
|
|||
...mapActions([
|
||||
'fetchActiveWorkflows',
|
||||
'updateWorkflow',
|
||||
'updateWorkflowStep',
|
||||
'deleteWorkflow'
|
||||
]),
|
||||
|
||||
|
|
@ -338,11 +339,20 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
navigateToStep(step) {
|
||||
async navigateToStep(step) {
|
||||
const stepStr = String(step);
|
||||
// For navigation, we need to validate the step exists in step definitions
|
||||
const stepExists = this.stepDefinitions.some(step => step.step === stepStr);
|
||||
if (stepExists || (step >= 1 && step <= this.totalSteps)) {
|
||||
try {
|
||||
await this.updateWorkflowStep({
|
||||
workflowId: this.id,
|
||||
currentStep: stepStr,
|
||||
payload: this.workflowInstance.payload
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error persisting workflow step:', error);
|
||||
}
|
||||
this.$router.push({
|
||||
name: 'workflow-detail',
|
||||
params: { id: this.id, step: stepStr }
|
||||
|
|
|
|||
|
|
@ -248,11 +248,11 @@ export default {
|
|||
}
|
||||
},
|
||||
async viewWorkflowDetails(workflow) {
|
||||
console.log('Viewing details for workflow:', workflow);
|
||||
const currentStep = workflow.current_step ||
|
||||
workflow.payload?.current_step ||
|
||||
getWorkflow(workflow.name)?.stepDefinitions?.[0]?.step ||
|
||||
"initial";
|
||||
const currentStep = String(
|
||||
workflow.current_step ||
|
||||
getWorkflow(workflow.slug)?.stepDefinitions?.[0]?.step ||
|
||||
1
|
||||
);
|
||||
|
||||
this.$router.push({
|
||||
name: 'workflow-detail',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue