Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multiple vehicles #425

Merged
merged 19 commits into from
Oct 15, 2024

Conversation

sgronlund
Copy link
Contributor

@sgronlund sgronlund commented Jul 10, 2024

Hello!

The following pull request attempts to add support for multiple vehicles and types of vehicles within the journal system. Tests have been added to check for this feature, and following are images of how the "new" system looks. This is marked as a draft for the moment, as I'll do some finishing touches before I am completely satisfied.

image
image
image
image
image
image

sgronlund added 14 commits May 15, 2024 16:52
These fileds indicate whether an user has an agreement of a particular
type. This change is done to support the upcoming agreement change which
allow for a user to either use bocken, the electric bike *hornet* or
both.
A user which has an agreement type which does not match that of bocken
cannot create a journal entry, if not checked a person with only a
agreement that applies to hornet could add entries which would be
incorrect.
made migration to initiliaze data and such but no real work in replacing
the logic in journal entries and such
need to test and further fix the front-end so that the automatically
filled trips are fixed
Added code for fetching the latest status of all of the vehicles
dynamically so that it mimics previous behaviour with only a single
vehicle
Show the main group and the vehicle driven for the reports so that it is
"easier" to collect statistics.
Updated tests for journalentryform to use vehicle, also added tests
which check if the user can or can not drive a particular vehicle etc.
@sgronlund sgronlund marked this pull request as ready for review July 11, 2024 12:57
@sgronlund sgronlund changed the title feat (WIP): add support for multiple vehicles feat: add support for multiple vehicles Jul 11, 2024
Now fetches the attribute based on the vehicle id which is stored in the
DOM, technically has support for unlimited vehicles but might not as
fool proof.
If there were no entries the code didn't fetch the meter stats from the
vehicle objects, now it does :)
@HSandqvist
Copy link

HSandqvist commented Oct 13, 2024

Just curious, does UTN plan on having more vehicles or is this just a feature (a welcomed one)? @sgronlund

@sgronlund
Copy link
Contributor Author

Just curious, does UTN plan on having more vehicles or is this just a feature (a welcoming one)? @sgronlund

This is implemented since UTN has in fact introduced more vehicles, an electric bike to be exact.

Copy link
Contributor

@elsareuter elsareuter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fungerar fint!

@sgronlund
Copy link
Contributor Author

sgronlund commented Oct 15, 2024

@elsareuter Lint error så ska bara göra en snabb commit som fixar de 😸

@elsareuter elsareuter merged commit c385e99 into UTNkar:development Oct 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants