Commit Graph

543 Commits

Author SHA1 Message Date
D. Berge
d048a19066 Implement info/put middleware 2021-05-20 18:18:13 +02:00
D. Berge
97ed9bcce4 Implement info/post middleware 2021-05-20 18:17:52 +02:00
D. Berge
316117cb83 Implement info.delete() database method.
It deletes a (possibly deeply nested) element in the
`info` table.
2021-05-20 18:16:26 +02:00
D. Berge
1d38f6526b Implement info.put() database method.
Replaces an existing element with a new one, or inserts it
if there is nothing to replace. The element may be deeply
nested inside a JSON object or array in the `info` table.

Works for both public.info and survey_?.info.
2021-05-20 18:14:43 +02:00
D. Berge
6feb7d49ee Implement info.post() database method.
It adds an element to a JSON array corresponding to a
key in the info table. Errors out if the value is not
an array.
2021-05-20 18:13:15 +02:00
D. Berge
ac51f72180 Ignore empty path parts in info.get() 2021-05-20 18:10:51 +02:00
D. Berge
86d3323869 Remove logging statement 2021-05-20 18:10:27 +02:00
D. Berge
b181e4f424 Let the user set the search path to no survey.
This is so that we can access tables in the `public`
schema which are overloaded by survey tables, as is
the case with `info`.
2021-05-20 18:08:03 +02:00
D. Berge
7917eeeb0b Add table info to schema.
This one is independent of any projects so it goes
into `public`.
2021-05-20 18:07:05 +02:00
D. Berge
b18907fb05 Merge branch '53-mark-points-as-not-to-be-acquired-ntba' into 'devel'
Resolve "Mark points as ‘not to be acquired’ (NTBA)"

Closes #53

See merge request wgp/dougal/software!9
2021-05-17 18:34:46 +00:00
D. Berge
3e1861fcf6 Update API description 2021-05-17 20:30:59 +02:00
D. Berge
820b0c2b91 Add set line complete / incomplete actions.
The following options are shown:

* Set line complete:

If a line has been partially shot and still has points
to be acquired.

This option marks remaining virgin points as NTBA=true.

* Set line incomplete:

If a line has been partially shot and remaining virgin
points have been marked as NTBA.

This option marks all points in the line as NTBA=false.

* Set line NTBA:

If a line has not been (successfully) shot at all, i.e.,
all points on the line are virgin.

This option marks the line itself as NTBA=true.

* Unset line NTBA:

If a line has been marked as NTBA.

This option clears the NTBA flag from the line.
2021-05-17 20:19:53 +02:00
D. Berge
57f4834da8 Add information about virgin and remaining points 2021-05-17 20:19:16 +02:00
D. Berge
08d33e293a React also on preplot point changes, not just lines 2021-05-17 20:18:33 +02:00
D. Berge
8e71b18225 Add complete to line PATCH options.
`complete` is a boolean.

If true, any virgin points remaining on the line
will be marked as `ntba=true`.

If false, *all* points on the line will be marked
as `ntba=false`.
2021-05-17 20:15:34 +02:00
D. Berge
f297458954 Report on virgin points and points to be acquired.
Virgin points are those that have not been acquired
(and processed) at least once.

Points to be acquired are virgin points that do not
have the `ntba` flag set.
2021-05-17 20:13:53 +02:00
D. Berge
eb28648e57 Remove bogus dependency 2021-05-17 17:18:35 +02:00
D. Berge
0c352512b0 Enable the ‘view on map’ log action item. 2021-05-17 17:14:58 +02:00
D. Berge
4d87506720 Show a map marker if position given in URL hash.
If the location URL contains a hash of either:

* #z/x/y
* #x/y

In the first case it will zoom and pan to the location;
in the second case it will only pan while maintaining the
current (or last used) zoom level.

If the location URL does not contain a hash in one of those
formats, the marker will be removed from the map.
2021-05-17 17:14:35 +02:00
D. Berge
20bce40dac Upgrade Vue components 2021-05-17 14:22:26 +02:00
D. Berge
cf79cf86ae Fix ‘this is undefined’ error 2021-05-16 21:38:31 +02:00
D. Berge
8e4f62e5be Reset snack message when hiding.
This is so that the same message will cause the snack
to be shown again.
2021-05-16 19:58:36 +02:00
D. Berge
a8850e5d0c Protect the /project/:project/meta route 2021-05-16 19:58:03 +02:00
D. Berge
b5a762b5e3 Merge branch '108-remove-edit-controls-for-read-only-users' into 'devel'
Resolve "Remove edit controls for read-only users"

Closes #108

See merge request wgp/dougal/software!8
2021-05-16 17:56:35 +00:00
D. Berge
418f1a00b8 Hide edit controls from ready-only users 2021-05-16 19:55:31 +02:00
D. Berge
0d9f7ac4ec Add privilege level getters to Vuex.
* writeaccess: true if user can change data.
* adminaccess: true if user is an administrator.
2021-05-16 19:53:24 +02:00
D. Berge
76c9c3ef2a Assign (some) offline navdata to a survey.
There is no concept of ‘current survey’ in Dougal, and
assigning navigation data to a particular survey is full
of edge cases but sometimes it is necessary or at least
convenient to do so.

This commit implements once such strategy, which consists
of checking the distance to the preplots of all active
surveys (well, those that do have preplots anyway) and
picking the nearest one.

To reduce load, we only do this every once in a while as
governed by the `offline_survey_detect_interval` option
in the configuration.

This strategy is only active if the configuration option
`offline_survey_heuristics == "nearest_preplot"` for the
corresponding navigation header.
2021-05-16 03:16:19 +02:00
D. Berge
ef798860cd Add collect filter to template renderer.
This filter can collect attributes from items having the
same key into a single item.

Can be used in templates like this:

{% for Entry in Sequence.Entries |
   collect("ShotPointId", ["EntryType", "Comment"]) %}

to avoid duplicating shotpoint numbers.
2021-05-15 20:07:02 +02:00
D. Berge
e57c362d94 Fix error with timestamp filter (again) 2021-05-15 20:06:36 +02:00
D. Berge
7605b11fdb Fix error with timestamp Nunjucks filter 2021-05-15 18:59:47 +02:00
D. Berge
84e791fc66 Add more sequence information to SeisJSON file 2021-05-15 18:37:32 +02:00
D. Berge
3e2126cc32 Add option to download reports from sequence list.
The context menu includes options to download the sequence
report in different formats.
2021-05-15 17:12:41 +02:00
D. Berge
b0f4559b83 Allow direct downloading of sequence reports.
If the `download` or `d` query parameter is supplied (even
without any value), the response will include a
`Content-Disposition: attachment` header. A filename will
also be suggested.
2021-05-15 17:10:28 +02:00
D. Berge
c7e2e18cc8 Merge branch '84-produce-human-readable-versions-of-json-structured-sequence-data-exports-sse' into 'devel'
Resolve "Produce human-readable versions of JSON structured sequence data exports (SSE)"

Closes #84

See merge request wgp/dougal/software!7
2021-05-15 13:07:07 +00:00
D. Berge
42697fe91d Provide a default replacement for @POS@ markers 2021-05-15 01:57:46 +02:00
D. Berge
900d7f7a3e Ensure that a geometry exists 2021-05-15 01:57:46 +02:00
D. Berge
f1953807db Add position filters to Vue.
Given some text and an item containing a Point geometry,
the `position` filter replaces occurences of @POS@ or
@POSITION@ with the item's geometry (it has to be lat/lon).

Occurrences of @DMS@ are replaced with the position in
sexagesimal degrees.

This can be used anywhere a Vue filter can. However, we
have used it in the event comments edit dialogue. The positions
are replaced before saving the comment to the database.
2021-05-15 01:57:46 +02:00
D. Berge
814e071698 Add Markdown support to map tooltips 2021-05-15 01:57:46 +02:00
D. Berge
2aba132220 Add Markdown support to preplot lines comments 2021-05-15 01:57:46 +02:00
D. Berge
15a802227d Add Markdown support to planned lines comments 2021-05-15 01:57:46 +02:00
D. Berge
6745757712 Add Markdown support to log comments 2021-05-15 01:57:45 +02:00
D. Berge
9ff76867c9 Add Markdown support to sequence list comments 2021-05-15 01:57:45 +02:00
D. Berge
e8811560de Add global .markdown class.
It changes textareas to be monospaced.
2021-05-15 01:57:45 +02:00
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