Commit graph

21 commits

Author SHA1 Message Date
ae1c653af6 Separate event dipslay from event slot display
Pull out the list of events into its own page sorted by name and show
the event slots in chronological order on the schedule page, with past
slots hidden by default.  This makes the content underneath the schedule
the most immediately useful to have in the moment, while the full list
is kept separately and in a predictable order.
2025-07-16 19:37:23 +02:00
e52972853d License under AGPL version 3 or later
I firmly believe in free software.

The application I'm making here have capabilities that I've not seen in
any system.  It presents itself as an opportunity to collaborate on a
tool that serves the people rather than corporations.  Whose incentives
are to help people rather, not make the most money.  And whose terms
ensure that these freedoms and incentives cannot be taken back or
subverted.

I license this software under the AGPL.
2025-06-30 18:58:24 +02:00
5144bf2b37 Allow shifts without a role
Allow a shift to have no role associated with it in order to simplify
conflict resolution around situations like a shift being created while
the role it was assoiated with was deleted. This also allows for shifts
that are freestanding to be created in case having a role doesn't make
sense for it.
2025-06-30 16:36:47 +02:00
f24dbae5eb Fix logic errors from mixing up client and server
All checks were successful
/ build (push) Successful in 1m33s
/ deploy (push) Successful in 16s
Fix discard and apiUpdate in Location, Role and Shift sometimes breaking
due to the field and serverField versions of the fields being mixed up.
2025-06-29 20:39:05 +02:00
da65103e05 Use toRaw when calling Set.difference
Vue's proxy handling interferres with the new Set methods causing them
to throw a TypeError when used on Set objects that are replaced by
proxies. Workaround by dropping the proxy when using these.

See https://github.com/vuejs/core/issues/11398
2025-06-27 18:52:16 +02:00
73b28834a1 Allow orphaned event and shit slots
When editing the slots of events and shifts there are certain situations
where the event or shift a slot should belong to becomes unclear or
difficult to reliably assign.  For example when adding a new slot in the
UI it may be desirable to do so before the user has input the event
or shift the slot should belong to.

In these cases, not being able to store the slot into the schedule makes
the UI logic needlessly complicated.  Allow slots to be added that do
not have its assiated relation linked up to make editing and handling
such scenarios easier.
2025-06-27 18:34:37 +02:00
985b8e0950 Refactor base types for entities and tombstones
Rename the base Entity type to ApiEntity, and the base EntityToombstone
to ApiTombstone to better reflect the reality that its only used in the
API interface and that the client and server types uses its own base if
any.

Remove EntityLiving and pull EntityTombstone out of of the base entity
type so that the types based on ApiEntity are always living entities and
if it's possible for it to contain tombstone this will be explicitly
told with the type including a union with ApiTombstone.

Refactor the types of the ClientEntity and ClientMap to better reflect
the types of the entities it stores and converts to/from.
2025-06-24 15:19:11 +02:00
e3ff872b5c Refactor ClientSchedule to mutable types
All checks were successful
/ build (push) Successful in 1m30s
/ deploy (push) Successful in 16s
Use a single mutable location, event, slot, etc, for each unique
resource that keeps track of the local editable client copy and
the server copy of the data contained in it.

This makes it much simpler to update these data structures as I can take
advantage of the v-model bindings in Vue.js and work with the system
instead of against it.
2025-06-24 00:07:18 +02:00
d48fb035b4 Remove type from Api serialisation of ClientMap
All checks were successful
/ build (push) Successful in 1m34s
/ deploy (push) Successful in 16s
Move the logic that converts the EntityClass of a map to a string and
then back into the class to the payload plugin in order to avoid a
circular dependency where the ClientMap needs to know the entity classes
and the entity classes needs to know the ClientMap.

The only place that doesn't know the type of the entities stored in the
client map is the payload reviver, so it makes sense to keep this logic
contained to the payload plugin.
2025-06-23 18:17:23 +02:00
b1053a95ba Fix import statements
Remove unused or unneeded imports and change imports of luxon APIs to
use the wrapper.
2025-06-23 12:54:09 +02:00
6336ccdb96 Implement mutable mapping for client entities
Create a simple Map like class for storing and keeping track of client
entities that are synced from the server and have local editable state.
This will form the basis for storing entities on the client and should
replace the immutable concept used be the ClientSchedule class.
2025-06-23 00:28:58 +02:00
5edea4dd72 Implement ClientUser based on a new concept
Create a new mutable ClientEntity type and implement ClientUser on top
of it. The mutable concept is intended to replace the immutable concept
used by the ClientSchedule entities as updating immutable types in a
deep interconnected structure is a lot of hassle for little benefit.
2025-06-23 00:28:58 +02:00
bb450fd583 Refactor to use ClientSchedule on client
Use the ClientSchedule data structure for deserialising and tracking
edit state on the client instead of trying to directly deal with the
ApiSchedule type which is not build for ease of edits or rendering.
2025-06-14 19:22:53 +02:00
ce9f758f84 Implement editing of slots in ClientSchedule
Implement tracking of time slots along with editing and restoration of
singularly edited time slots.  This provides a simpler interface to work
with when rendering tables of time slots that can be edited than
directly manipulating events and shifts containing an array of slots.
2025-06-14 19:12:31 +02:00
fad1bb2482 Ignore updatedAt timestamp when comparing entities
All checks were successful
/ build (push) Successful in 1m28s
/ deploy (push) Successful in 16s
To determine if the entity received from the server is the same as the
entity the client has the equals method is use.  To avoid problems with
clients that have incorrect clocks the timestamp is overriden with the
server's time when the entities are saved on the server.

This means that the entities received back from the server when the
client saves will have different timestamps than what the client set.
Ignore the updatedAt timestamp when comparing entities for equality so
that the update logic correctly replaces entities that only differ by
the update timestamp.
2025-06-13 21:06:48 +02:00
8c63c1cfbb Fix sanity checks failing on deleted entities
If the event/shift that a location/role was referencing had been marked
for deletion the sanity check would incorrectly refuse to delete the
event/role.  Fix by ignoring deleted events/shifts.
2025-06-13 20:51:24 +02:00
61734d4152 Add editing of client schedule entities
Add utility methods to more easily edit the fields of a single entity in
the schedule, along with a modification flag and is modified utility to
check for changes having been made.
2025-06-13 20:49:04 +02:00
faffe48706 Use TypeScript private modifier for methods
The Vue Ref system and assiated proxies does not work with the native
EcmaScript private fields, replace them with the TypeScript access
modifiers which are regular fields under the hood.
2025-06-13 17:04:55 +02:00
e100555304 Implement ClientSchedule state tracking class
All checks were successful
/ build (push) Successful in 2m16s
/ deploy (push) Successful in 16s
Write the logic of keeping track of location modifications and applying
updates from the server into the ClientSchedule class.  This should
serve as the foundation for replacing the prototype in-component update
logic which have turned into an unmaintainable spagetti.
2025-06-12 21:48:50 +02:00
fe06d0d6bd Refactor API types and sync logic
All checks were successful
/ build (push) Successful in 2m5s
/ deploy (push) Successful in 16s
Rename and refactor the types passed over the API to be based on an
entity that's either living or a tombstone.  A living entity has a
deleted property that's either undefined or false, while a tombstone
has a deleted property set to true.  All entities have a numeric id
and an updatedAt timestamp.

To sync entities, an array of replacements are passed around. Living
entities are replaced with tombstones when they're deleted. And
tombstones are replaced with living entities when restored.
2025-06-11 21:05:17 +02:00
399a4d2ca5 Add account based filtering of the schedule
Some checks failed
/ build (push) Has been cancelled
/ deploy (push) Has been cancelled
Implement personal filtering of the schedule based on events marked as
being interested in and filtering based on assigned crew for events.
2025-03-15 22:47:32 +01:00