[02:31:05] | * heartburn has quit (Ping timeout: 260 seconds) |
[02:32:47] | * heartburn has joined #farmos |
[03:49:39] | <Ujeeee[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 |
[07:37:09] | <mstenta[m]> | Ujeeee: that is a bit tricky for a number of reasons, but would make a good feature request for farmOS core IMO |
[07:38:54] | <mstenta[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 |
[07:39:08] | <mstenta[m]> | All lists of assets/logs/etc in farmOS are created as "Views" in Drupal |
[07:39:34] | <mstenta[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) |
[07:40:03] | <mstenta[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 |
[07:40:28] | <mstenta[m]> | Technically you can edit that View directly yourself in the UI and try adding the column you want |
[07:40:30] | <mstenta[m]> | HOWEVER |
[07:40:44] | <mstenta[m]> | This is not the best way to do it from a long term maintenance perspective |
[07:41:12] | <mstenta[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 |
[07:41:42] | <mstenta[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) |
[07:42:32] | <mstenta[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 |
[07:42:47] | <mstenta[m]> | You can do whatever you want to your own Views, without worrying about conflicting with core Views |
[07:43:00] | <mstenta[m]> | You can also add them to the main menu |
[07:43:23] | <mstenta[m]> | So: perhaps you could try creating a "Plant inventory" View, which is focused on giving yourself an overview of your plant inventories |
[07:44:34] | <mstenta[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. |
[07:44:56] | <mstenta[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 |
[07:45:23] | <mstenta[m]> | In the case of inventory, it is calculated based on logs using the asset.inventory service |
[07:45:42] | <mstenta[m]> | https://farmos.org/development/module/services/#asset-inventory-service |
[07:45:55] | <mstenta[m]> | So it may require a bit of coding to wire that up, I'm not sure |
[07:46:39] | <mstenta[m]> | > Ujeeee: that is a bit tricky for a number of reasons, but would make a good feature request for farmOS core IMO |
[07:46:39] | <mstenta[m]> | It would be great for farmOS core to offer this "Inventory" column by default IMO |
[07:46:51] | <mstenta[m]> | There are some considerations there too, though... |
[07:47:07] | <mstenta[m]> | For one, not everyone needs it, so it would add to an already crowded list of columns |
[07:47:46] | <mstenta[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 |
[07:48:08] | <mstenta[m]> | Then we could make the inventory column available without worrying about cluttering the page too much for everyone |
[07:50:58] | <mstenta[m]> | > example of a module that add column to the table view of assets |
[07:50:58] | <mstenta[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 |
[07:50:58] | <mstenta[m]> | automatically add bundle-specific fields: https://github.com/farmOS/farmOS/blob/482d79055515df05ce0ce09bba7056ce0a... |
[07:52:38] | <mstenta[m]> | > So: perhaps you could try creating a "Plant inventory" View, which is focused on giving yourself an overview of your plant inventories |
[07:52:38] | <mstenta[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 :-) |
[08:36:05] | <mstenta[m]> | jgaehring symbioquine paul121 wotnak: https://github.com/farmOS/farmOS-community-blog/pull/13#issuecomment-154... |
[08:36:10] | * explore has quit (Quit: Connection closed for inactivity) |
[08:36:17] | <mstenta[m]> | Sorry it took me so long to get the account set up :-) |
[08:36:52] | <mstenta[m]> | I think the top priority is just setting up something for the blog previews |
[08:37:10] | <mstenta[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 |
[08:37:24] | <mstenta[m]> | (are there others?) |
[10:50:13] | <mstenta[m]> | Making it look easy wotnak haha |
[10:54:13] | <mstenta[m]> | We should merge the views field plugin bit of that into core IMO |
[10:54:43] | <mstenta[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. |
[10:54:43] | <mstenta[m]> | thanks for answering this questions! |
[10:54:50] | <mstenta[m]> | s/questions/question/ |
[11:08:40] | * wotnak[m] has joined #farmos |
[11:14:41] | <mstenta[m]> | > added to the PR |
[11:14:41] | <mstenta[m]> | Thanks paul121! I'll take a closer look today... in the meantime it looks like this breaks one of the new tests |
[11:15:41] | <mstenta[m]> | https://github.com/farmOS/farmOS/actions/runs/4963182904/jobs/8911997044... |
[11:15:42] | <mstenta[m]> | ACTION sent a code block: https://libera.ems.host/_matrix/media/v3/download/libera.chat/85ac64eddc... |
[11:44:09] | * explore has joined #farmos |
[12:16:02] | * calbasi[m] has quit (Remote host closed the connection) |
[13:31:15] | * Mims[m] has joined #farmos |
[13:31:16] | <Mims[m]> | I'm a student and i would like to create a project with farmOs |
[13:31:16] | <Mims[m]> | Hii |
[13:31:23] | <Mims[m]> | can someone show me how installation is that |
[13:31:35] | <Mims[m]> | done* |
[13:31:58] | <mstenta[m]> | Hi Mims welcome to the chat :-) |
[13:32:05] | <mstenta[m]> | Have you seen the docs on farmOS.org? |
[13:32:35] | <mstenta[m]> | If you want to set up a local development environment, I would recommend starting here: https://farmos.org/development/environment/ |
[13:33:02] | <mstenta[m]> | And when you are ready to host a production instance with real data, the official installation/hosting docs are here: https://farmos.org/hosting/install/ |
[13:33:44] | <mstenta[m]> | If you run into a trouble, or have any questions, feel free to ask here in the chat, or start a forum topic: https://farmOS.discourse.group (there are some folks on the forum who aren't in the chat and vice versa) |
[13:34:14] | <Mims[m]> | thank you |
[13:34:43] | <mstenta[m]> | What kind of project are you thinking about? |
[13:35:08] | <Mims[m]> | farm traceability app |
[13:35:54] | <mstenta[m]> | Cool! Might be worth searching the forum - traceability is a common topic :-) |
[13:36:33] | <Mims[m]> | okay. thanks for your time |
[15:39:47] | * heartburn has quit (Ping timeout: 264 seconds) |
[15:47:48] | * heartburn has joined #farmos |
[16:06:16] | <mstenta[m]> | wotnak: the blog PR previews are a game changer!!! 🚀 |
[16:09:27] | <mstenta[m]> | Now I just need to figure out how to make embedded MP4s work 😅 |
[16:12:36] | <mstenta[m]> | I wonder if we need to add support for that in our Gatsby.js setup? |
[16:17:30] | <mstenta[m]> | Initially I tried ![description](./video.mp4) but the build failed with an error about unsupported types |
[16:17:58] | <mstenta[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 |
[16:18:10] | <mstenta[m]> | I'll open a bug report and leave notes there |
[16:19:18] | <mstenta[m]> | I suppose this may actually be a github.com/farmOS/farmOS.org issue, not a github.com/farmOS/farmOS-community-blog issue, huh? |
[16:32:41] | <mstenta[m]> | https://github.com/farmOS/farmOS.org/issues/75 |