-
Notifications
You must be signed in to change notification settings - Fork 1
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
Backend for the state of the regulation editor #26
Conversation
A quick note for me: Currently, most actions that do not directly modify an |
…regulations-state
… within the same action.
0f543da
to
b03a8a0
Compare
This seems to be working now. There might be a few things that we need to solve down the line, but we'll merge it and work on new stuff in separate PRs. |
This PR implements the backend for tracking and validating the state of the model edited in the regulations editor. It is synchronized with the frontend using events.
The events supported by the main
ModelState
struct are listed in thesrc/aeon_events.ts
file.Before reviewing and merging this, finishing at least some of the following things would be nice. However, (except for the first one?), they can be addressed via some subsequent PR.
ModelState
events into "two groups" - (A) those for adding new objects (regulations, variables) and (B) those for modifying/removing the existing objects. This would enable us to fix some issues with paths and payloads. Events of group A would have a more general path, such as ['model', 'regulation', 'add'], and carry a JSON payload fully encoding some prepared structure (such asRegulationData
). Events of group B would have more specific paths encoding the specific object, such as ['model', 'regulation', 'regulator_id', 'target_id', 'remove']. The payload of these events could then be just a single value or even be empty sometimes (now, all the IDs are also part of the payload, making it "bloated").ModelState
and add tests for the some remaining cases.src/aeon_events.ts
reflecting the previous points.refresh
part of theSessionState
API forModelState
. There is a placeholder currently, and all the "getter" events should be added.