Commit graph

14 commits

Author SHA1 Message Date
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
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