Commit Graph

1538 Commits

Author SHA1 Message Date
D. Berge
7ab6be5c67 Refactor <dougal-project-settings-binning/> 2024-05-01 10:40:04 +02:00
D. Berge
2f56d377c5 Refactor <dougal-project-settings-groups/> 2024-05-01 10:40:04 +02:00
D. Berge
d1c041995d Refactor <dougal-project-settings-name-id/> 2024-05-01 10:40:04 +02:00
D. Berge
399e86be87 Refactor the interface between ProjectSettings and subcomponents.
This is still not set in stone and not fully consistent from one
subcomponent to another, but the general idea is that instead of
passing everything in one property via v-model we use v-bind
instead with a variable list of props depending on the needs of
the subcomponent.

We listen for @input and a new @merge event in order to apply
any changes to the *local* configuration. The local configuration
then needs to be uploaded to the server via a separate step. We
might change this in a later commit, so that changes made in
subcomponents are automatically applied to the local configuration.
2024-05-01 10:40:04 +02:00
D. Berge
13f68d7314 deepValue with an empty path returns the object itself 2024-05-01 10:40:04 +02:00
D. Berge
80de0c1bb0 Modify deepSet() to allow appending to arrays 2024-05-01 10:40:04 +02:00
D. Berge
26a487aa47 Add json-builder component.
It displays a JSON object as a <v-treeview/>, with editing
capabilities.
2024-05-01 10:40:04 +02:00
D. Berge
53e7a06a18 Add Vue watch mixin to update a variable on changes to another.
To be used where adding .sync to props is not convenient for
one reason or another.
2024-05-01 10:40:04 +02:00
D. Berge
efe64f0a8c Implement PUT method for project configuration endpoint.
In short:

POST creates a new project
PUT overwrites a project configuration with a new one
PATCH merges the request body with the existing configuration
2024-05-01 10:40:04 +02:00
D. Berge
313e9687bd Bring all the lib/utils from the frontend to the backend.
The idea being that eventually we will symlink the lib/utils
directory so that the same routines are available on both the
frontend and the backend.
2024-05-01 10:40:04 +02:00
D. Berge
09fb653812 Strip whitespace 2024-05-01 10:40:04 +02:00
D. Berge
0137bd84d5 Add Vue component for configuring sailline CSV imports.
Sailline CSV imports are related to issue #264. Not yet implemented
server-side.
2024-05-01 10:40:04 +02:00
D. Berge
f82f2c78c7 Add Vue component for handling delimited strings.
<dougal-delimited-string-decoder/> is intended for providing a UI
for configuring text-delimited import settings (such as CSV imports).
2024-05-01 10:40:04 +02:00
D. Berge
9f1fc3d19c Make Vue component reusable.
This converts <dougal-fixed-width-format/> into a more reusable
<dougal-fixed-string-decoder/> component.
2024-05-01 10:40:04 +02:00
D. Berge
873d7cfea7 Add utility Vue components.
This commit adds <dougal-field-content/> and
<dougal-field-content-dialog/>, which can be
used to configure certain properties of an
object. Intended for use while editing project
configurations.
2024-05-01 10:40:04 +02:00
D. Berge
2fa9d99eeb Add YAML frontend dependency.
To download / upload configurations.
2024-05-01 10:40:04 +02:00
D. Berge
12b28cbb8d Add csv-parse dependency to frontend.
Also requires a Buffer polyfill.
2024-05-01 10:40:04 +02:00
D. Berge
436a9b8289 Add utility function to truncate long strings 2024-05-01 10:40:04 +02:00
D. Berge
b3dbc0f417 Add utility function to create HSL colours 2024-05-01 10:40:04 +02:00
D. Berge
6d417a9272 Add utility functions.
The functions are:

- deepMerge()   Merge two objects
- deepCompare() Loose deep comparison
- deepEqual()   Strict deep comparison
- deepSet()     Set nested object property value
- deepValue()   Retrive nested object property value
2024-05-01 10:40:04 +02:00
D. Berge
b74419f770 Reuse deepMerge.js from the backend libs 2024-05-01 10:40:04 +02:00
D. Berge
cae57e2a64 Ensure we get a fresh response 2024-05-01 10:40:04 +02:00
D. Berge
cd739e603f Fix configuration object data corruption 2024-05-01 10:40:04 +02:00
D. Berge
beeba966dd Cope with empty result 2024-05-01 10:40:04 +02:00
D. Berge
544c4ead76 Remove trailing slash from URL 2024-05-01 10:40:04 +02:00
D. Berge
4486fc4afc Improve contrast of new group item 2024-05-01 10:40:04 +02:00
D. Berge
a55d2cc6fc Update database templates to v0.4.5 2024-05-01 10:40:04 +02:00
D. Berge
402a3f9cce Add code for a ‘new project’ button to project list navigation.
This is currently disabled though (value in route/index.js is
commented out) as it is not possible at the moment to create
new projects fully from scratch from the frontend. See comment
on previous commit.

NB: projects may be created fully from scratch by making an API
request with a suitable YAML / JSON configuration file, thusly:

curl -vs "https://[hostname]/api/project" -X POST \
    -H "Content-Type: application/yaml"
    --data-binary @/path/to/configuration.yaml
2024-05-01 10:40:04 +02:00
D. Berge
1801fdb052 Add project creation details component.
This is not usable at the moment as the backend requires even
more details, such as binning parameters, which this dialogue
does not provide.

It might be a matter of relaxing the rules on the backend or,
perhaps more likely, rethinking the project creation / editing
frontend. Maybe refactoring the frontend so that saves are done
in one go for the whole configuration as opposed to piecemeal as
currently done might make it easier to work on a configuration
(especially a new one) fully offline.
2024-05-01 10:40:04 +02:00
D. Berge
be904d8a00 Add ‘groups’ column to ProjectList table 2024-05-01 10:40:04 +02:00
D. Berge
2131cdf0c1 Add project cloning option to ProjectList 2024-05-01 10:40:04 +02:00
D. Berge
15242de2d9 Add configuration settings tab to project navigation bar.
Only for admin users.
2024-05-01 10:40:04 +02:00
D. Berge
b4aed52976 Add project settings cloning component.
Asks for the new ID, name and root file path.
2024-05-01 10:40:04 +02:00
D. Berge
1b85b5cd4b Remove cloning control stub.
Cloning takes place from the project list, we don't really need
to duplicate that functionality here for the time being.
2024-05-01 10:40:04 +02:00
D. Berge
f157f49312 Use project list from Vuex 2024-05-01 10:40:04 +02:00
D. Berge
3d42ce6fbc Add context menu with ‘Edit project settings’ option 2024-05-01 10:40:04 +02:00
D. Berge
4595dddc24 Add ProjectSettings view 2024-05-01 10:40:04 +02:00
D. Berge
642f5a7585 Add project configuration components.
The configuration settings are quite complex so we divide the
GUI into modular components.
2024-05-01 10:40:04 +02:00
D. Berge
e7c29ba14c Add file browsing components.
Essentially, these are a file selection dialog.
2024-05-01 10:40:04 +02:00
D. Berge
d919fb12db Add control to filter out archived projects in ProjectList 2024-05-01 10:40:04 +02:00
D. Berge
c21f9c239e Merge branch '304-refresh-authentication-status-for-connected-users' into 'devel'
Resolve "Refresh authentication status for connected users"

Closes #304

See merge request wgp/dougal/software!56
2024-05-01 08:23:14 +00:00
D. Berge
2fb1c5fdcc Process incoming JWT WebSocket messages 2024-05-01 10:20:09 +02:00
D. Berge
c6b99563d9 Send a request for new credentials at regular intervals.
Every five minutes, a message is sent via WebSocket to ask the
server for a refreshed JWT token.
2024-05-01 10:19:00 +02:00
D. Berge
76a90df768 Send "Authorization: Bearer …" on API requests.
We need this because we might have more recent credentials than
those in the cookie store.
2024-05-01 10:15:26 +02:00
D. Berge
ea8ea12429 Add JWT Vuex getter 2024-05-01 10:14:55 +02:00
D. Berge
7bd2319cd7 Allow setting credentials directly via the Vuex store.
Until now, credentials were set indirectly by reading the browser's
cookie store. This change allows us to receive credentials via other
mechanisms, notably WebSockets.
2024-05-01 10:13:14 +02:00
D. Berge
a9270157ea Process JWT messages over WebSockets 2024-05-01 10:06:35 +02:00
D. Berge
d2f94dbb88 Refactor JWT token verification 2024-05-01 10:05:48 +02:00
D. Berge
1056122fff Fix missing parenthesis 2024-04-28 18:37:30 +02:00
D. Berge
9bd0aca18f Add debugging statements to ETag middleware 2023-11-04 10:45:50 +01:00