Design for the `Calculate` tab of the OpenQuake platform

Registered by Lars Butler

This blueprint defines the UI layout and functions and backend services required to implement a `Calculate` user interface in the OpenQuake Platform.

See whiteboard for general design outline.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Whiteboard

----------
UI
----------

Layout sketch: https://docs.google.com/a/openquake.org/drawings/d/1A_Ws_njOTWHL1djFr0XJS6fzKsrLdw-YXKjKweEulfE/edit

General:
- Add `Calculate` link and page
- Leaflet based map, with Context Ribbon (above) and Layer Tree (left)
- Ribbon contains `Browse Calculations...` and `New Calculation...` buttons

Browse Calculations:
- jQueryUI dialog
- Upon opening fetches a list of the available `artifact_group` records with `group_type`=="calculation"
  - List has two columns: "name" and "status"
  - Future optimization: paginate, don't loading everything at once
- select one, click View
  - When View is clicked, close dialog and load calculation into Layer Tree
- Only one calculation can be viewed at a time
  - For the first iteration, anyway
  - In this future, we may want to show multiple calculations

New Calculation:
- jQueryUI dialog
- Get the "run calculation" form from oq-engine-server
- User uploads input models
- User runs calculation
- The base calculation artifact is immediately available in the Browse Calculations dialog
- Each calculation `artifact_group` contains _at least_ (at any given time, even while the calculation is in progress) 1 `artifact`: the calculation profile, as JSON (see https://github.com/gem/oq-engine-server/blob/487fe589fc3ae6207b7b52d417c48174707dd7c2/engine_api.md#get-v1calchazardcalc_id, https://github.com/gem/oq-engine-server/blob/487fe589fc3ae6207b7b52d417c48174707dd7c2/engine_api.md#get-v1calcriskcalc_id)
  - This artifact is renderable in the map (the calculation geometry, etc.)
  - We could also have a button to open a dialog and view the calculation properties

----------
Backend
----------

Icebox:
- add `artifact_group` and `artifact_group_link` tables
- `artifact_group` fields:
  - name
  - group_type ("map", "calculation", etc.)
  - user_id (FK to Django auth_user table)
- `artifact_group_link` fields:
  - artifact_group_id (FK)
  - artifact_id (FK)
- GET /icebox/artifact_groups
- GET /icebox/artifact_group/:group_id
- Update `import` API method (https://github.com/gem/oq-platform/blob/geonode2-integration/openquakeplatform/openquakeplatform/icebox/icebox_api.md#post-iceboxartifactsimport) to also save an artifact for the calculation profile, as JSON

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.