Skip to content

Commit

Permalink
Improve error messages, use unique message id's
Browse files Browse the repository at this point in the history
  • Loading branch information
wkramer committed Jun 12, 2024
1 parent 134473d commit 6cecbb9
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/components/workflows/WorkflowsControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,25 @@ function showMapTool() {
function showErrorMessage(message: string) {
alertStore.addAlert({
id: `workflow-${userId.value}`,
id: `workflow-error-${userId.value}`,
type: 'error',
message,
active: true,
})
}
function showStartMessage(message: string) {
alertStore.addAlert({
id: `workflow-start-${userId.value}`,
type: 'success',
message,
active: true,
})
}
function showSuccessMessage(message: string) {
alertStore.addAlert({
id: `workflow-${userId.value}`,
id: `workflow-success-${userId.value}`,
type: 'success',
message,
active: true,
Expand All @@ -387,16 +396,21 @@ async function startWorkflow() {
if (workflowType === WorkflowType.ProcessData) {
setTimeout(() => {
if (error) return
showSubmittedSuccesfully()
}, 1000)
showStartMessage(
'Task submitted successfully. Your file will be available for download shortly.',
)
}, 500)
}
closeDialog()
await workflowsStore.startWorkflow(workflowType, filter)
if (workflowType === WorkflowType.ProcessData) {
showSuccessMessage('Download completed')
showSuccessMessage('File download completed')
} else {
showSubmittedSuccesfully()
showStartMessage(
'Workflow submitted successfully. You can monitor the task progress using the System Monitor.',
)
}
} catch (e) {
error = true
Expand All @@ -410,12 +424,6 @@ async function startWorkflow() {
}
}
function showSubmittedSuccesfully() {
showSuccessMessage(
'Workflow submitted successfully. Monitor task progress using System Monitor.',
)
}
function getRunTaskFilter(): PartialRunTaskFilter {
const description = 'Test run'
return {
Expand Down

0 comments on commit 6cecbb9

Please sign in to comment.