Skip to content

Commit b6a4cbd

Browse files
committed
Add ability to have a failed state and links
1 parent a277339 commit b6a4cbd

File tree

6 files changed

+99
-14
lines changed

6 files changed

+99
-14
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ to see the live progress of the job.
4141

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

44+
## User Experience Tips
45+
46+
### Overriding Redirection Location
47+
48+
Redirecting users to `site.com/upload/progress/<jobSignature>/<jobId>` displays
49+
a running status of the job. If the job successes, a *Continue* button for users
50+
is activated. By default the continue button will redirect the user back, this
51+
behaviour can be overriden by using a `ContinueLink` query param on the original
52+
link.
53+
54+
```
55+
site.com/upload/progress/<jobSignature>/<jobId>?ContinueLink=/thanks/
56+
```
57+
58+
Likewise, you can set a different link for the button if the job fails, stalls
59+
or some other error occurs.
60+
61+
```
62+
site.com/upload/progress/<jobSignature>/<jobId>?FailureLink=/error/
63+
```
64+
65+
4466
## Long Running Single Progress Jobs
4567

4668
Due to the design of queued jobs, the progress indicator (currentStep) is only

client/dist/js/queuedjobprogressfield.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/dist/js/queuedjobprogressfield.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/bundles/queuedjobprogressfield.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ window.jQuery.entwine('ss', ($) => {
6767
progress.removeClass('progress-bar-animated')
6868

6969
// fire a global window event for listeners
70-
$('body').trigger('queuedjob-finished')
70+
$('body').trigger('queuedjob-finished', [
71+
status: resp.Status
72+
]);
7173
}
7274

7375
$(self).parents('.field').find('.messages').html(resp.Messages);

0 commit comments

Comments
 (0)