Skip to content

Commit

Permalink
Add ability to have a failed state and links
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Dec 13, 2018
1 parent a277339 commit b6a4cbd
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 14 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ to see the live progress of the job.

![demo-web](demo-web.png)

## User Experience Tips

### Overriding Redirection Location

Redirecting users to `site.com/upload/progress/<jobSignature>/<jobId>` displays
a running status of the job. If the job successes, a *Continue* button for users
is activated. By default the continue button will redirect the user back, this
behaviour can be overriden by using a `ContinueLink` query param on the original
link.

```
site.com/upload/progress/<jobSignature>/<jobId>?ContinueLink=/thanks/
```

Likewise, you can set a different link for the button if the job fails, stalls
or some other error occurs.

```
site.com/upload/progress/<jobSignature>/<jobId>?FailureLink=/error/
```


## Long Running Single Progress Jobs

Due to the design of queued jobs, the progress indicator (currentStep) is only
Expand Down
2 changes: 1 addition & 1 deletion client/dist/js/queuedjobprogressfield.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/js/queuedjobprogressfield.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion client/src/bundles/queuedjobprogressfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ window.jQuery.entwine('ss', ($) => {
progress.removeClass('progress-bar-animated')

// fire a global window event for listeners
$('body').trigger('queuedjob-finished')
$('body').trigger('queuedjob-finished', [
status: resp.Status
]);
}

$(self).parents('.field').find('.messages').html(resp.Messages);
Expand Down
Loading

0 comments on commit b6a4cbd

Please sign in to comment.