Commit Graph

361 Commits

Author SHA1 Message Date
D. Berge
65b33a6b0f Add Vue Markdown filters.
{{ '**strong** _em_' |markdown }} gives:
<p><strong>strong</strong> <em>em</em></p>

{{ '**strong** _em_' |markdownInline }} gives:
<strong>strong</strong> <em>em</em>
2021-05-15 01:57:45 +02:00
D. Berge
b8b5765b46 Split markdown Nunjucks filter into two new ones.
{{ '**strong** _em_' |markdown }} gives:
<p><strong>strong</strong> <em>em</em></p>

{{ '**strong** _em_' |markdownInline }} gives:
<strong>strong</strong> <em>em</em>
2021-05-15 01:57:45 +02:00
D. Berge
53f4e167f8 Update ‘marked’ version on server 2021-05-15 01:57:45 +02:00
D. Berge
3d8f524d4a Expose PDF output option in user interface 2021-05-15 01:57:45 +02:00
D. Berge
1e68676ac6 Add PDF output option for events log 2021-05-15 01:57:45 +02:00
D. Berge
2c2d594877 Add Selenium webdriver to backend.
Used for generating PDFs via a Firefox instance.
2021-05-15 01:57:45 +02:00
D. Berge
fae849aeab Send specific error message if HTML template not found 2021-05-15 01:57:45 +02:00
D. Berge
1d47495799 Adapt log view controls to small viewports 2021-05-15 01:57:45 +02:00
D. Berge
592632d669 Add timestamp filter to renderer 2021-05-15 01:57:45 +02:00
D. Berge
26c05b9e3c Add Markdown support to template renderer 2021-05-15 01:57:45 +02:00
D. Berge
3f9a40724d Add download menu to sequence logs.
The menu lets the user retrieve a sequence's events
in a variety of formats:

* JSON
* Seis+JSON
* GeoJSON
* HTML
2021-05-15 01:57:45 +02:00
D. Berge
a652a08815 Add GET endpoint for sequence events.
Provides a variety of formats:

* JSON
* Seis+JSON
* GeoJSON
* HTML
2021-05-15 01:57:45 +02:00
D. Berge
61ffd1b766 Refactor the function producing Seis+JSON into its own file.
For reuse.
2021-05-15 01:57:45 +02:00
D. Berge
d9f4583224 Implement GET middleware for events.
Produces a choice of outputs: JSON, GeoJSON, Seis+JSON and HTML.
2021-05-15 01:57:45 +02:00
D. Berge
95647337aa Add Nunjucks renderer.
The render function takes a JSON file and a Nunjucks
template and outputs a rendered version of the JSON
data according to the template.
2021-05-15 01:57:45 +02:00
D. Berge
142a820ed7 Process comment markers server-side.
Replace @POS@, @POSITION@ and @DMS@ in the remarks
with the event's position (sexagesimal degrees for
the last one).
2021-05-15 01:54:07 +02:00
D. Berge
30914b267a Set the right Content-Type for error outputs 2021-05-13 21:48:46 +02:00
D. Berge
f53c479262 Add option to assign colours to preplot lines.
A ‘Set colour…’ option is available from the context menu;
it presents a dialogue allowing the user to choose a colour
that will be assigned to that preplot line and used as the
background colour for the corresponding row on the table
(may also be used for other things).

Because there is a good chance that the user may decide to
colour a large number of lines and it is cumbersome to do
it one at a time, a multiple selection option has also been
added. The context menu then shows options which will apply
to all selected rows. At this time only the change colour
option is available, but it can be extended easily.
2021-05-10 00:22:57 +02:00
D. Berge
73a415a038 Return preplot metadata via the API 2021-05-10 00:21:56 +02:00
D. Berge
0b24e3224f Let calendar toolbar follow theme.
Fixes #80.
2021-05-09 21:23:34 +02:00
D. Berge
c271256015 Remember map view settings.
Save the layer and overlay selection + map zoom and
position per user per project in the browser's
localStorage.

Closes #96.
2021-05-09 15:29:17 +02:00
D. Berge
4887ddaa26 Do not update page location on map change.
Fixes #77.
See also #96.
2021-05-09 03:52:25 +02:00
D. Berge
788c582f98 Show planned sequences in status field of preplots table.
Closes #86.
2021-05-09 00:20:02 +02:00
D. Berge
df9f7f33cf Retrieve user data for LineList.
Fixes a bug in commit fd2e0399f8.
2021-05-09 00:16:08 +02:00
D. Berge
fd2e0399f8 Remember last applied number of table rows.
A hopefully sensible default is applied, but if the
user changes it, the last selected value is saved
in the browsers localStorage.

Preferences are saved per user, project and table. And
per browser, of course, as those are only saved locally.

Closes #41.
2021-05-08 21:54:55 +02:00
D. Berge
db733ceef8 Add key to feed items 2021-05-08 21:54:06 +02:00
D. Berge
f905eb3fdf Upgrade Vuetify to latest version 2021-05-08 21:53:31 +02:00
D. Berge
e707887702 Change colour of planned lines on map.
As magenta is already used for the real-time track.
2021-05-08 20:36:19 +02:00
D. Berge
c0ace1fe07 Make check mark green if non-leaf QC item has no children.
If a test passes for all items, show the (single) check mark
and colour it green.

Leaf nodes always have their check mark in the default colour.

Related to #90.
2021-05-08 04:08:37 +02:00
D. Berge
7bb3a3910b Show development activity log.
A button in the help dialogue takes the user to the
/feed/… frontend URL, where the latest development
activity is shown, taken from the GitLab RSS feed
for the project.
2021-05-08 00:46:31 +02:00
D. Berge
983113b6cc Add flag to api action to fetch non-JSON data.
If {text:true} or another truthy value is passed as the
`text` option, the api action will use Response.text()
instead of Response.json().
2021-05-08 00:44:05 +02:00
D. Berge
ff66c9a88d Handle planner sequence value for first line in prospect.
The next sequence to shoot is normally retrieved from the
database via getSequence(), but it returns false if no
sequences have been shot yet.

In that case we use a default value of `1` to build the
name of the planned line.

Fixes #81
Fixes #82
2021-05-08 00:20:15 +02:00
D. Berge
56d30d48c5 Adapt help dialogue to small viewports 2021-05-07 23:52:36 +02:00
D. Berge
f87aa08246 Check if gun data missing for entire line.
The `sequences` object now carries the attribute
`has_smsrc_data`, a boolean which is true iff
there is at least one `smsrc` record in the raw
shots metadata.

This is used by:

1. A new sequence-wise test which reports if gun
   data is missing for the entire sequence.

2. The individual `missing_gun_data` test which
   is inhibited if `has_smsrc_data` for the
   corresponding sequence is false.

Closes #93.
2021-05-07 14:04:48 +02:00
D. Berge
ea499a645b Update package dependencies 2021-05-07 14:04:12 +02:00
D. Berge
6e5584a433 Make the QC double-tick green if all items accepted.
Closes #90.
2021-05-07 13:38:26 +02:00
D. Berge
0a4df0793d Update package dependencies 2021-05-07 13:37:44 +02:00
D. Berge
3c4a558e02 Serve OpenAPI document on API root.
When a client makes a request for `/` (the root of
the API), the OpenAPI description is served in an
appropriate format according to the `Accept` request
header, as follows:

Accept: text/html => HTML version
Accept: application/json => JSON version
Accept: * => YAML version
2020-12-29 16:20:57 +01:00
D. Berge
76001cffe1 Create HTML version of OpenAPI doc on install.
When running `npm install`, a self-contained HTML document
with the contents of the OpenAPI specification is saved as
openapi.html in the same directory as openapi.yaml.
2020-12-29 16:18:53 +01:00
D. Berge
45a9c5aa07 Document login and logout endpoints 2020-10-23 17:28:41 +02:00
D. Berge
f926184471 Add label descriptions to API spec 2020-10-23 15:14:52 +02:00
D. Berge
5ffd3712cf Merge branch '61-user-authentication' into devel 2020-10-23 15:14:09 +02:00
D. Berge
80451796e1 Convert expiry time to milliseconds for set-cookie 2020-10-23 14:59:45 +02:00
D. Berge
141d5805ae Reissue user login tokens when close to expiring 2020-10-23 14:50:35 +02:00
D. Berge
b4decd018a Add API documentation 2020-10-23 11:09:08 +02:00
D. Berge
46d489c91f Fix metadata retrieval from preplots 2020-10-23 11:01:38 +02:00
D. Berge
8a0bcc5cb4 Change HTTP response status from 201 to 204 2020-10-23 11:00:56 +02:00
D. Berge
6896d8bc87 Change sequence renumbering behaviour.
By default, change just the number of the sequence
being edited. It is checked for conflict with other
planned sequences but not with anything already acquired.

If the user ticks the ‘shift all’ checkbox, then all
planned sequences are shifted by the same amount.
2020-10-15 19:07:27 +02:00
D. Berge
80b463fbb7 Change default sequence assignment for planned lines.
If there are other lines in the planner, we increment the
highest numbered sequence in the planner by one.

If there are no planned lines, we take the highest numbered
raw sequence and increment by one.
2020-10-15 19:05:14 +02:00
D. Berge
59aaacbeee Apply access restrictions to writable routes 2020-10-12 19:43:07 +02:00