wasabee-project / Wasabee-IITC

ENL DrawTools and Op Management
Apache License 2.0
30 stars 21 forks source link

#338 - Handle case where same key is in multiple capsules for an agent #339

Closed bgillock closed 2 years ago

bgillock commented 2 years ago

For #338, this change will allow for the display of a key in multiple capsules for a single agent. Will also allow for 1) changing the capsule name, 2) changing the number of keys in the capsule, 3) no capsule name entered, and 4) if a count of 0 is entered, the capsule name is forced to be "".

bgillock commented 2 years ago

The capsule name is passed to the server in the opKeyPromise called before the keyOnHand method. I have confirmed the capsule is removed from the operation on the server when this code is in place. Nulling the capsule name in operation.ts is needed to make the dialog reflect the state of the server (ie. capsule removed for the key).

le-jeu commented 2 years ago

This about the case where we will support multiple capsules per portal right ? If I have multiple capsules A and B for the same portal, it's not possible to change the value of one of the capsule, since the KoH lookup doesn't check the capsule name. And if the value is set to 0, we need the capsule name to remove the entry from the KoH array. the KoH shouldn't hold empty entries (and if it does, we need to fix it)

bgillock commented 2 years ago

Not sure this PR is needed anymore as I cannot have more than one capsule for a key using dev. Before the fix in the server this was possible and this PR was designed to support those cases. Seems the ops with multiple capsules per key were purged so as far as I know, the situation does not exist, hence no need for this PR.

cloudkucooland commented 2 years ago

The server change (removing capID from the database unique key) was to make the clients behave as they did before.

Long term we need to support multiple capsules sanely. The full team will need to discuss the best way of doing this. I think this PR is as good as any place for that conversation to happen.

bgillock commented 2 years ago

Please see issue #330 where some user stories are presented. I believe that would be a better place to elaborate on handling of capsules. This is a PR, with and is tied to the current solution, which obviously is not adequate.