farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
59 stars 38 forks source link

Equipment #449

Closed jgaehring closed 2 years ago

jgaehring commented 3 years ago

Need to figure out how to handle equipment in the Tasks module prior to beta release. Currently we're using a stub for schema evaluation, which only provides the farmOS "base fields" for each entity type. This is fine, b/c to-date the Tasks module is only really using those base fields. The equipment field on logs is the one exception, however.

The long term solution is of course to replace that stub (farmOS/farmOS.js#26), but that might not be feasible for beta release, so it's worth considering if there could be some sort of stop-gap solution for the time being.

mstenta commented 3 years ago

We can probably consider this "minor" or "edge case" because the Equipment module will be installed by default in farmOS 2.x. So it will really only be an issue if someone explicitly chooses to disable it. (Not to downplay the importance of a proper fix here... just putting it into context for prioritization purposes.)

jgaehring commented 3 years ago

We can probably consider this "minor" or "edge case" because the Equipment module will be installed by default in farmOS 2.x.

At the very least, however, we'll need to add equipment to the base fields listed in our stub:

https://github.com/jgaehring/farmOS.js/blob/5578f087ac3080fa86732cd1c930a6c81e294a42/src/utils/baseFieldDefaults.js

jgaehring commented 3 years ago

from https://github.com/farmOS/farmOS-client/issues/448#issuecomment-847867647:

Although come to think of it, this could be an issue for 2.x as well ... The mother field on logs is not a base field, so as long as we're using that stub this issue will probably persist for 2.x as well.

Actually this won't be an issue because mother is a base field of birth logs, so that field is guaranteed to exist, and can be hard-coded in Field Kit.

The difference with "Equipment" is that it is added to all logs... and only if the equipment module is enabled.

Not exactly, b/c the stub circumvents any base field info we might be getting from the server, so we'll need to change how the stub works in farmOS.js. That still might be easier in the short-term, but it definitely pushes the needle a little more toward replacing the stub altogether, sooner rather than later.

jgaehring commented 2 years ago

Might as well bang out #226 while we're at it with this one too.

jgaehring commented 2 years ago

This has been resolved since the schema stubs were replaced (farmOS/farmOS.js#26).