Skip to content

Commit 926e982

Browse files
committed
v2.0.0
1 parent e3bfddd commit 926e982

File tree

16 files changed

+258
-301
lines changed

16 files changed

+258
-301
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2013-2021, S. Andrew Sheppard, https://wq.io/
3+
Copyright (c) 2013-2022, S. Andrew Sheppard, https://wq.io/
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

data_wizard/static/app/js/wizard.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data_wizard/static/app/js/wizard.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data_wizard/static/data_wizard/js/progress-element.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data_wizard/templates/data_wizard/run_serializers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2>Data Format</h2>
1313
<ul class="messagelist">
1414
<li class="error">No serializers registered.</li>
1515
</ul>
16-
<p>See <a href="https://github.com/wq/django-data-wizard#target-model-registration">https://github.com/wq/django-data-wizard#target-model-registration</a> for more information.
16+
<p>See <a href="https://django-data-wizard.wq.io/overview/setup#target-model-registration">https://django-data-wizard.wq.io/overview/setup#target-model-registration</a> for more information.
1717
{% else %}
1818
<ul class="messagelist">
1919
<li class="warning">Select a format (serializer) to continue.</li>

packages/progress-element/README.md

+10-28
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1-
# @wq/progress-element
1+
[![@wq/progress-element][logo]][docs]
22

33
**@wq/progress-element** provides a simple way to create fetch()-powered auto-updating HTML5 [progress] elements. @wq/progress-element is meant to be used with a JSON web service that provides updates as to the current status of a long-running task. @wq/progress-element is primarily intended for (and bundled with) the [Django Data Wizard] package.
44

5-
## Installation
5+
### [Documentation][docs]
66

7-
```bash
8-
npm install @wq/progress-element
9-
```
7+
[**Installation**][installation]
8+
&bull;
9+
[**API**][api]
1010

11-
> Note: @wq/progress-element is designed for Django Data Wizard's Admin-style UI, and is enabled automatically by default. If you are using a wq framework / React UI, use [@wq/wizard] rather than @wq/progress-element.
12-
13-
#### API
14-
15-
@wq/progress-element scans the page for `<progress>` elements during initialization, and can be configured via `data-wq-*` attributes.
16-
17-
- `data-wq-url` configures the URL to use for the AJAX request to update the progress status.
18-
- `data-wq-interval` defines the polling frequency in seconds (default 0.5).
19-
- `data-wq-status` can be used to specify an element which will be used to display `error` or `message` attributes from the JSON response.
20-
21-
```xml
22-
<progress data-wq-url="/getstatus.json"
23-
data-wq-interval=0.25
24-
data-wq-status="status-info"></progress>
25-
<div id="status-info"></div>
26-
```
27-
28-
For older browsers, the `<progress>` bar will automatically fall back to text showing the current status.
29-
30-
@wq/progress-element automatically configures a [@wq/progress] client to start polling the web service. See [@wq/progress] for more details on the expected data structure.
11+
[logo]: https://django-data-wizard.wq.io/images/@wq/progress-element.svg
12+
[docs]: https://django-data-wizard.wq.io/@wq/progress-element
13+
[installation]: https://django-data-wizard.wq.io/@wq/progress-element#installation
14+
[api]: https://django-data-wizard.wq.io/@wq/progress-element#api
3115

3216
[progress]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
33-
[django data wizard]: https://github.com/wq/django-data-wizard
34-
[@wq/wizard]: https://github.com/wq/django-data-wizard/tree/main/packages/wizard
35-
[@wq/progress]: https://github.com/wq/django-data-progress/tree/main/packages/progress
17+
[Django Data Wizard]: https://django-data-wizard.wq.io/

packages/progress-element/package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/progress-element/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wq/progress-element",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"description": "fetch()-powered auto-updating HTML5 <progress> element",
55
"main": "src/progress.js",
66
"type": "module",
@@ -23,11 +23,11 @@
2323
"bugs": {
2424
"url": "https://github.com/wq/django-data-wizard/issues"
2525
},
26-
"homepage": "https://github.com/wq/django-data-wizard",
26+
"homepage": "https://django-data-wizard.wq.io/@wq/progress-element",
2727
"devDependencies": {
2828
"jquery": "^3.4.1"
2929
},
3030
"dependencies": {
31-
"@wq/progress": "^1.2.0"
31+
"@wq/progress": "^2.0.0"
3232
}
3333
}

packages/progress/README.md

+13-34
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
1-
# @wq/progress
1+
[![@wq/progress][logo]][docs]
22

33
**@wq/progress** provides a simple API client for auto-updating [progress] elements. @wq/progress is meant to be used with a JSON web service that provides updates as to the current status of a long-running task, such as the data import tasks in the [Django Data Wizard] package.
44

55
> Note: The jQuery and HTML `<progress>` integration has moved to a separate package, [@wq/progress-element]. wq framework / React UI integration is provided by [@wq/wizard].
66
7-
## Installation
7+
### [Documentation][docs]
88

9-
```bash
10-
npm install @wq/progress
11-
```
9+
[**Installation**][installation]
10+
&bull;
11+
[**API**][api]
1212

13-
#### API
13+
[logo]: https://django-data-wizard.wq.io/images/@wq/progress.svg
14+
[docs]: https://django-data-wizard.wq.io/@wq/progress
15+
[installation]: https://django-data-wizard.wq.io/@wq/progress#installation
16+
[api]: https://django-data-wizard.wq.io/@wq/progress#api
1417

15-
@wq/progress should be configured with a url and polling interval, as well as up to three custom callback functions (`onComplete`, `onFail`, and `onProgress`). The callback functions will be passed the most recent JSON data from the web service.
16-
17-
```javascript
18-
// src/index.js
19-
import { Progress } from '@wq/progress';
20-
21-
const progress = new Progress({
22-
url: 'http://some-web-service/',
23-
interval: 0.5,
24-
onProgress(data) {
25-
console.log(data);
26-
},
27-
});
28-
29-
progress.start();
30-
```
31-
32-
@wq/progress assumes a specific structure for the data from the web service. The following attributes should be specified on the returned JSON object:
33-
34-
- `total`: the total number of items being processed
35-
- `current`: the rank of the currently processing item. (`current / total` will be used to determine the % complete)
36-
- `status`: A text status indicating task state. A status of `"SUCCESS"` or `"FAILURE"` will cause polling to cease and the `onComplete` or `onFailure` callbacks to be called. The status names were originally based on [Celery's state names][celery-states], though Celery is no longer required for [Django Data Wizard].
37-
- `error` or `message`: Will be displayed with the `data-wq-status` option.
38-
39-
[django data wizard]: https://github.com/wq/django-data-wizard
40-
[@wq/progress-element]: https://github.com/wq/django-data-wizard/tree/main/packages/progress-element
41-
[@wq/wizard]: https://github.com/wq/django-data-wizard/tree/main/packages/wizard
42-
[celery-states]: http://docs.celeryproject.org/en/latest/userguide/tasks.html#states
18+
[progress]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
19+
[Django Data Wizard]: https://django-data-wizard.wq.io/
20+
[@wq/progress-element]: https://django-data-wizard.wq.io/@wq/progress-element
21+
[@wq/wizard]: https://django-data-wizard.wq.io/@wq/wizard

packages/progress/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wq/progress",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"description": "Progress tracking client for monitoring server tasks",
55
"main": "src/progress.js",
66
"type": "module",
@@ -22,5 +22,5 @@
2222
"bugs": {
2323
"url": "https://github.com/wq/django-data-wizard/issues"
2424
},
25-
"homepage": "https://github.com/wq/django-data-wizard"
25+
"homepage": "https://django-data-wizard.wq.io/@wq/progress"
2626
}

packages/wizard/README.md

+10-42
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,17 @@
1-
# @wq/wizard
1+
[![@wq/wizard][logo]][docs]
22

33
**@wq/wizard** is a [@wq/app plugin][plugins] providing a complete React UI for the [Django Data Wizard] package.
44

5-
## Installation
5+
### [Documentation][docs]
66

7-
### wq.app for PyPI
7+
[**Installation**][installation]
8+
&bull;
9+
[**API**][api]
810

9-
When using Django Data Wizard together with [wq.app]'s [wq.js] build, update app/js/{project_name}.js to import and register wizard.js, which is provided by data_wizard's static/app/js directory.
10-
11-
```bash
12-
pip install wq.app data-wizard
13-
```
14-
15-
```javascript
16-
import wq from './wq.js';
17-
import config from './data/config.js';
18-
import wizard from './wizard.js';
19-
20-
wq.use([wizard]);
21-
22-
wq.init(config).then(...);
23-
```
24-
25-
### @wq/app for npm
26-
27-
When using @wq/app for npm, install and import the @wq/wizard npm package.
28-
29-
```bash
30-
npm install @wq/wizard
31-
```
32-
33-
```javascript
34-
import app from '@wq/app';
35-
import material from '@wq/material';
36-
import mapgl from '@wq/map-gl';
37-
import wizard from '@wq/wizard';
38-
import config from './config';
39-
40-
app.use([material, mapgl, wizard]);
41-
42-
app.init(config).then(...);
43-
```
11+
[logo]: https://django-data-wizard.wq.io/images/@wq/wizard.svg
12+
[docs]: https://django-data-wizard.wq.io/@wq/wizard
13+
[installation]: https://django-data-wizard.wq.io/@wq/wizard#installation
14+
[api]: https://django-data-wizard.wq.io/@wq/wizard#api
4415

4516
[plugins]: https://wq.io/plugins/
46-
[django data wizard]: https://github.com/wq/django-data-wizard
47-
[wq.app]: https://wq.io/wq.app/
48-
[wq.js]: https://wq.io/wq
49-
[@wq/app]: https://wq.io/@wq/app
17+
[Django Data Wizard]: https://django-data-wizard.wq.io/

0 commit comments

Comments
 (0)