< 142023-05-15⋎16 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
06:31*heartburn has quit (Ping timeout: 260 seconds)
06:32*heartburn has joined
07:49Ujeeee[m]is there any example of a module that add column to the table view of assets. I really want to add inventory (qty) column in table view of plant asset
11:37mstenta[m]Ujeeee: that is a bit tricky for a number of reasons, but would make a good feature request for farmOS core IMO
11:38mstenta[m]If you wanted to experiment with it, I would probably recommend enabling the Views UI module and creating a new View to experiment with
11:39mstenta[m]All lists of assets/logs/etc in farmOS are created as "Views" in Drupal
11:39mstenta[m]Views is essentially a UI for building a database query, along with options for how to display the results (in our case we use the "table" display for most UIs)
11:40mstenta[m]farmOS core comes with a default "farmOS Assets" View, which is what defines all the columns that you're seeing when you go to Records > Assets > Plants
11:40mstenta[m]Technically you can edit that View directly yourself in the UI and try adding the column you want
11:40mstenta[m]HOWEVER
11:40mstenta[m]This is not the best way to do it from a long term maintenance perspective
11:41mstenta[m]Because: if farmOS core changes that View itself in the future, you won't get those changes - you are essentially maintaining a fork of that View configuration in your own instance
11:41mstenta[m](ALSO: Definitely disable the farm_update module if you plan to experiment with changing farmOS core config - that module is responsible for automatically reverting changes to automate updates)
11:42mstenta[m]One option that gives you a lot of freedom: if you enable the `views_ui` module, and go to Administration > Structure > Views, you can create your own View - separate from the farmOS core one
11:42mstenta[m]You can do whatever you want to your own Views, without worrying about conflicting with core Views
11:43mstenta[m]You can also add them to the main menu
11:43mstenta[m]So: perhaps you could try creating a "Plant inventory" View, which is focused on giving yourself an overview of your plant inventories
11:44mstenta[m]One thing I am not sure of though, off the top of my head, is: there may not be an "Inventory" field available to Views. That might require writing a Views plugin.
11:44mstenta[m]Views plugins are essentially little bits of PHP that describe to Views how to get the data necessary from the database or farmOS API
11:45mstenta[m]In the case of inventory, it is calculated based on logs using the asset.inventory service
11:45mstenta[m]farmos.org/development/module/services/#
11:45mstenta[m]So it may require a bit of coding to wire that up, I'm not sure
11:46mstenta[m]> Ujeeee: that is a bit tricky for a number of reasons, but would make a good feature request for farmOS core IMO
11:46mstenta[m]It would be great for farmOS core to offer this "Inventory" column by default IMO
11:46mstenta[m]There are some considerations there too, though...
11:47mstenta[m]For one, not everyone needs it, so it would add to an already crowded list of columns
11:47mstenta[m]There has been some brainstorming around that problem more generally though - perhaps farmOS core could provide some configuration to allow users to enable/disable the columns they want to see
11:48mstenta[m]Then we could make the inventory column available without worrying about cluttering the page too much for everyone
11:50mstenta[m]> example of a module that add column to the table view of assets
11:50mstenta[m]Lastly, I will also say: yes it is also possible for a module to *alter* the list of columns in an existing View. This is a nice option too because it doesn't require changing core code/configuration at all, so you aren't "maintaining a fork" like I described above. It is definitely an advanced technique, though, and requires some deep understanding of how Views works to achieve it. The core `farm_ui_views` module uses this technique to
11:50mstenta[m]automatically add bundle-specific fields: github.com/farmOS/farmOS/blob/482d790555
11:52mstenta[m]> So: perhaps you could try creating a "Plant inventory" View, which is focused on giving yourself an overview of your plant inventories
11:52mstenta[m]This is probably the best place to start - because it has the lowest risk of conflicting with core code, doesn't require any module development, and will give you some experience with the power of Views :-)
12:36mstenta[m]jgaehring symbioquine paul121 wotnak: github.com/farmOS/farmOS-community-blog/
12:36*explore has quit (Quit: Connection closed for inactivity)
12:36mstenta[m]Sorry it took me so long to get the account set up :-)
12:36mstenta[m]I think the top priority is just setting up something for the blog previews
12:37mstenta[m]We can also talk about moving farmOS.org and farmOS.app over to this account as a next step, but that's not urgent
12:37mstenta[m](are there others?)
14:50mstenta[m]Making it look easy wotnak haha
14:54mstenta[m]We should merge the views field plugin bit of that into core IMO
14:54mstenta[m]> One thing I am not sure of though, off the top of my head, is: there may not be an "Inventory" field available to Views. That might require writing a Views plugin.
14:54mstenta[m]thanks for answering this questions!
14:54mstenta[m]s/questions/question/
15:08*wotnak[m] has joined
15:14mstenta[m]> added to the PR
15:14mstenta[m]Thanks paul121! I'll take a closer look today... in the meantime it looks like this breaks one of the new tests
15:15mstenta[m]github.com/farmOS/farmOS/actions/runs/49
15:15*sent a code block: libera.ems.host/_matrix/media/v3/downloa
15:44*explore has joined
16:16*calbasi[m] has quit (Remote host closed the connection)
17:31*Mims[m] has joined
17:31Mims[m]I'm a student and i would like to create a project with farmOs
17:31Mims[m]Hii
17:31Mims[m]can someone show me how installation is that
17:31Mims[m]done*
17:31mstenta[m]Hi Mims welcome to the chat :-)
17:32mstenta[m]Have you seen the docs on farmOS.org?
17:32mstenta[m]If you want to set up a local development environment, I would recommend starting here: farmos.org/development/environment/
17:33mstenta[m]And when you are ready to host a production instance with real data, the official installation/hosting docs are here: farmos.org/hosting/install/
17:33mstenta[m]If you run into a trouble, or have any questions, feel free to ask here in the chat, or start a forum topic: farmOS.discourse.group (there are some folks on the forum who aren't in the chat and vice versa)
17:34Mims[m]thank you
17:34mstenta[m]What kind of project are you thinking about?
17:35Mims[m]farm traceability app
17:35mstenta[m]Cool! Might be worth searching the forum - traceability is a common topic :-)
17:36Mims[m]okay. thanks for your time
19:39*heartburn has quit (Ping timeout: 264 seconds)
19:47*heartburn has joined
20:06mstenta[m]wotnak: the blog PR previews are a game changer!!! 🚀
20:09mstenta[m]Now I just need to figure out how to make embedded MP4s work 😅
20:12mstenta[m]I wonder if we need to add support for that in our Gatsby.js setup?
20:17mstenta[m]Initially I tried ![description](./video.mp4) but the build failed with an error about unsupported types
20:17mstenta[m]So then I tried `<video>` tags with a relative path to the file, but I don't think the build process puts the file in the right place
20:18mstenta[m]I'll open a bug report and leave notes there
20:19mstenta[m]I suppose this may actually be a github.com/farmOS/farmOS.org issue, not a github.com/farmOS/farmOS-community-blog issue, huh?
20:32mstenta[m]github.com/farmOS/farmOS.org/issues/75

< 142023-05-15⋏16 >