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

Field Module Tasks missing schema #508

Closed perotta closed 1 year ago

perotta commented 2 years ago

Hi,

First of all, great job with Field Kit 2.0! This is amazing!

I tried installing https://github.com/farmOS/field-kit/releases/tag/field-module-tasks%402.0.0-alpha.1 on my self hosted farmOS 2.0 and it worked, but when I click on the "+" FAB I get a JS error image

Also, when I click on the other colored "+" buttons on the home screen (Activity, Input, Harvest....) I get a different JS error image

(I might just be doing something wrong) Any thoughts?

jgaehring commented 2 years ago

Can you confirm that you have the standard log types and JSON Schema enabled on your server?

You can check the /api/log/activity/resource/schema endpoint and should see something like this.

And are you connecting from https://farmos.app ?

perotta commented 2 years ago

connecting from https://farmos.app image

standard log types and JSON Schema enabled

`# drush pm-list


Package Name Status Version


Core Actions (action) Disabled 9.3.7
Core Aggregator (aggregator) Disabled 9.3.7
Core Automated Cron (automated_cron) Disabled 9.3.7
Core Ban (ban) Disabled 9.3.7
Web services HTTP Basic Authentication (basic_auth) Disabled 9.3.7
Core BigPipe (big_pipe) Disabled 9.3.7
Core Block (block) Enabled 9.3.7
Core Custom Block (block_content) Disabled 9.3.7
Core Book (book) Disabled 9.3.7
Core Breakpoint (breakpoint) Enabled 9.3.7
Core CKEditor (ckeditor) Disabled 9.3.7
Core (Experimental) CKEditor 5 (ckeditor5) Disabled 9.3.7
Core Color (color) Disabled 9.3.7
Core Comment (comment) Disabled 9.3.7
Core Configuration Manager (config) Enabled 9.3.7
Multilingual Configuration Translation (config_translation) Disabled 9.3.7
Core Contact (contact) Disabled 9.3.7
Core Content Moderation (content_moderation) Disabled 9.3.7
Multilingual Content Translation (content_translation) Disabled 9.3.7
Core Contextual Links (contextual) Disabled 9.3.7
Field types Datetime (datetime) Disabled 9.3.7
Field types Datetime Range (datetime_range) Disabled 9.3.7
Core Database Logging (dblog) Enabled 9.3.7
Core Internal Dynamic Page Cache (dynamic_page_cache) Disabled 9.3.7
Core Text Editor (editor) Disabled 9.3.7
Field types Entity Reference (entity_reference) Disabled 9.3.7
Core Field (field) Enabled 9.3.7
Core (Experimental) Field Layout (field_layout) Disabled 9.3.7
Core Field UI (field_ui) Enabled 9.3.7
Field types File (file) Enabled 9.3.7
Core Filter (filter) Enabled 9.3.7
Core Forum (forum) Disabled 9.3.7
Web services HAL (hal) Disabled 9.3.7
Core Help (help) Enabled 9.3.7
Core (Experimental) Help Topics (help_topics) Disabled 9.3.7
Core History (history) Disabled 9.3.7
Field types Image (image) Enabled 9.3.7
Core Inline Form Errors (inline_form_errors) Disabled 9.3.7
Web services JSON:API (jsonapi) Enabled 9.3.7
Multilingual Language (language) Disabled 9.3.7
Core Layout Builder (layout_builder) Disabled 9.3.7
Core Layout Discovery (layout_discovery) Enabled 9.3.7
Field types Link (link) Disabled 9.3.7
Multilingual Interface Translation (locale) Disabled 9.3.7
Core Media (media) Disabled 9.3.7
Core Media Library (media_library) Disabled 9.3.7
Core Custom Menu Links (menu_link_content) Disabled 9.3.7
Core Menu UI (menu_ui) Disabled 9.3.7
Migration Migrate (migrate) Enabled 9.3.7
Migration Migrate Drupal (migrate_drupal) Enabled 9.3.7
Core (Experimental) Migrate Drupal Multilingual (migrate_drupal_multilingual) Disabled 9.3.7
Migration Migrate Drupal UI (migrate_drupal_ui) Disabled 9.3.7
Core Node (node) Disabled 9.3.7
Field types Options (options) Enabled 9.3.7
Core Internal Page Cache (page_cache) Disabled 9.3.7
Core Path (path) Disabled 9.3.7
Core Path alias (path_alias) Enabled 9.3.7
Core Quick Edit (quickedit) Disabled 9.3.7
Core RDF (rdf) Disabled 9.3.7
Core Responsive Image (responsive_image) Disabled 9.3.7
Web services RESTful Web Services (rest) Enabled 9.3.7
Core Search (search) Disabled 9.3.7
Web services Serialization (serialization) Enabled 9.3.7
Core Settings Tray (settings_tray) Disabled 9.3.7
Core Shortcut (shortcut) Disabled 9.3.7
Core Testing (simpletest) Disabled 9.3.7
Core Statistics (statistics) Disabled 9.3.7
Core Syslog (syslog) Disabled 9.3.7
Core System (system) Enabled 9.3.7
Core Taxonomy (taxonomy) Enabled 9.3.7
Field types Telephone (telephone) Disabled 9.3.7
Field types Text (text) Enabled 9.3.7
Core Toolbar (toolbar) Enabled 9.3.7
Core Tour (tour) Disabled 9.3.7
Core Activity Tracker (tracker) Disabled 9.3.7
Core Update Manager (update) Enabled 9.3.7
Core User (user) Enabled 9.3.7
Core Views (views) Enabled 9.3.7
Core Views UI (views_ui) Enabled 9.3.7
Core Workflows (workflows) Disabled 9.3.7
Core (Experimental) Workspaces (workspaces) Disabled 9.3.7
farmOS Assets Animal asset (farm_animal) Enabled
farmOS Assets Compost asset (farm_compost) Enabled
farmOS Assets Equipment asset (farm_equipment) Enabled
farmOS Assets Group asset (farm_group) Enabled
farmOS Assets Land asset (farm_land) Enabled
farmOS Defaults farmOS Default Land Types (farm_land_types) Enabled
farmOS Assets Material asset (farm_material) Enabled
farmOS Assets Plant asset (farm_plant) Enabled
farmOS Assets Seed asset (farm_seed) Enabled
farmOS Assets Sensor asset (farm_sensor) Enabled
farmOS (Legacy) Sensor listener (farm_sensor_listener) Disabled
farmOS Assets Structure asset (farm_structure) Enabled
farmOS Defaults farmOS Default Structure Types (farm_structure_types) Enabled
farmOS Assets Water asset (farm_water) Enabled
farmOS farmOS API (farm_api) Enabled
Asset Asset (asset) Enabled
farmOS farmOS Data Stream (data_stream) Enabled
farmOS farmOS Data Stream Notification (data_stream_notification) Enabled
farmOS farmOS Entity (farm_entity) Enabled
farmOS farmOS Entity Fields (farm_entity_fields) Enabled
farmOS farmOS Entity Views (farm_entity_views) Enabled
farmOS farmOS Field (farm_field) Enabled
farmOS farmOS Field Kit (farm_fieldkit) Enabled
Testing farmOS Field Kit Test (farm_fieldkit_test) Disabled
farmOS farmOS Flags (farm_flag) Enabled
farmOS farmOS Text Format (farm_format) Enabled
farmOS farmOS Geo (farm_geo) Enabled
farmOS farmOS ID Tag (farm_id_tag) Enabled
farmOS farmOS Import (farm_import) Enabled
farmOS farmOS Import KML (farm_import_kml) Enabled
farmOS farmOS Inventory (farm_inventory) Enabled
farmOS farmOS KML (farm_kml) Enabled
farmOS farmOS Localization (farm_l10n) Disabled
farmOS farmOS Location (farm_location) Enabled
farmOS farmOS Log (farm_log) Enabled
farmOS farmOS Log Asset (farm_log_asset) Enabled
farmOS farmOS Log Quantity (farm_log_quantity) Enabled
farmOS farmOS Login (farm_login) Enabled
farmOS farmOS Map (farm_map) Enabled
farmOS Maps farmOS Mapbox (farm_map_mapbox) Enabled
farmOS farmOS Migrate (farm_migrate) Enabled
farmOS farmOS Owner (farm_owner) Enabled
Plan Plan (plan) Disabled
farmOS Quantity (quantity) Enabled
farmOS farmOS Quick Forms (farm_quick) Enabled
farmOS farmOS Report (farm_report) Enabled
farmOS farmOS Role (farm_role) Enabled
farmOS Defaults farmOS Default Roles (farm_role_roles) Enabled
farmOS farmOS Settings (farm_settings) Enabled
Testing farmOS Test (farm_test) Disabled
farmOS UI farmOS UI Action (farm_ui_action) Enabled
farmOS UI farmOS UI Breadcrumb (farm_ui_breadcrumb) Enabled
farmOS UI farmOS Dashboard (farm_ui_dashboard) Enabled
farmOS UI farmOS UI (farm_ui) Enabled
farmOS UI farmOS UI Help (farm_ui_help) Enabled
farmOS UI farmOS UI Location (farm_ui_location) Enabled
farmOS UI farmOS UI Map (farm_ui_map) Enabled
farmOS UI farmOS UI Menu (farm_ui_menu) Enabled
farmOS UI farmOS UI Metrics (farm_ui_metrics) Enabled
farmOS UI farmOS UI Theme (farm_ui_theme) Enabled
farmOS UI farmOS UI User (farm_ui_user) Enabled
farmOS UI farmOS UI Views (farm_ui_views) Enabled
farmOS farmOS Update (farm_update) Enabled
farmOS Logs Activity log (farm_activity) Enabled <---- farmOS Logs Birth log (farm_birth) Enabled <---- farmOS Logs Harvest log (farm_harvest) Enabled <---- farmOS Logs Input log (farm_input) Enabled <---- farmOS Logs Lab test log (farm_lab_test) Enabled <---- farmOS Logs Maintenance log (farm_maintenance) Enabled <---- farmOS Logs Medical log (farm_medical) Enabled
farmOS Logs Observation log (farm_observation) Enabled
farmOS Logs Seeding log (farm_seeding) Enabled
farmOS Logs Transplanting log (farm_transplanting) Enabled
farmOS Quantities Material quantity (farm_quantity_material) Enabled
farmOS Quantities Standard quantity (farm_quantity_standard) Enabled
farmOS Quick Forms Planting Quick Form (farm_quick_planting) Disabled
farmOS Taxonomies Animal type vocabulary (farm_animal_type) Enabled
farmOS Taxonomies Log categories vocabulary (farm_log_category) Enabled
farmOS Taxonomies Material types vocabulary (farm_material_type) Enabled
farmOS Taxonomies Plant type vocabulary (farm_plant_type) Enabled
farmOS Taxonomies Seasons vocabulary (farm_season) Enabled
farmOS Taxonomies Units vocabulary (farm_unit) Enabled
farmOS farmOS Field Kit Tasks (farm_fieldkit_tasks) Enabled
Administration Admin Toolbar (admin_toolbar) Enabled 8.x-2.5
Administration Admin Toolbar Links Access Filter (admin_toolbar_links_access_filter) Enabled 8.x-2.5
Administration Admin Toolbar Search (admin_toolbar_search) Disabled 8.x-2.5
Administration Admin Toolbar Extra Tools (admin_toolbar_tools) Disabled 8.x-2.5
Other Configuration Update Base (config_update) Enabled 8.x-1.7
Other Configuration Update Reports (config_update_ui) Disabled 8.x-1.7
Authentication Consumers (consumers) Enabled 8.x-1.11
Web services Serialization (CSV) (csv_serialization) Enabled 8.x-2.0
Date Date Popup (date_popup) Enabled 8.x-1.1
Other Entity (entity) Enabled 8.x-1.3
Media Entity Browser (entity_browser) Enabled 8.x-2.6
Media Entity Browser IEF (entity_browser_entity_form) Disabled 8.x-2.6
Media Entity Browser example (entity_browser_example) Disabled 8.x-2.6
Entity Reference Integrity Entity Reference Integrity (entity_reference_integrity) Enabled 8.x-1.1
Testing Entity Reference Integrity Enforce (entity_reference_integrity_enforce) Enabled 8.x-1.1
Field types Entity Reference Revisions (entity_reference_revisions) Enabled 8.x-1.9
Other Entity Reference validators (entity_reference_validators) Enabled 8.x-1.0-alpha2
Media EXIF Orientation (exif_orientation) Enabled 8.x-1.1
Field types Fraction (fraction) Enabled 2.1.0
Geofield Geofield (geofield) Enabled 8.x-1.37
Other Gin Toolbar (gin_toolbar) Disabled 8.x-1.0-beta20
Fields Inline Entity Form (inline_entity_form) Enabled 8.x-1.0-rc10
Other Inspire Tree (inspire_tree) Enabled 1.0.4
Web services JSON:API Extras (jsonapi_extras) Enabled 8.x-3.20
Web services JSON API Defaults (jsonapi_defaults) Enabled 8.x-3.20
Core JSON:API Schema (jsonapi_schema) Enabled 8.x-1.0-beta1 <---- Log Log (log) Enabled 2.0.2
Examples Migrate Example (migrate_example) Disabled 8.x-5.2
Migration Migrate Example Setup (migrate_example_setup) Disabled 8.x-5.2
Examples Migrate Example (Advanced) (migrate_example_advanced) Disabled 8.x-5.2
Migration Migrate Advanced Example Setup (migrate_example_advanced_setup) Disabled 8.x-5.2
Examples Migrate JSON Example (migrate_json_example) Disabled 8.x-5.2
Migration Migrate Plus (migrate_plus) Enabled 8.x-5.2
Migration Migrate Tools (migrate_tools) Enabled 8.x-5.1
Authentication Simple OAuth & OpenID Connect (simple_oauth) Enabled 5.0.6
Authentication Simple OAuth Extras (Deprecated) (simple_oauth_extras) Disabled 5.0.6
Other State Machine (state_machine) Enabled 8.x-1.6
Web services Subrequests (subrequests) Enabled 3.0.3
Other Token (token) Enabled 8.x-1.10
Views Views GeoJSON (views_geojson) Enabled 8.x-1.1
Core Bartik (bartik) Disabled 9.3.7
Core Claro (claro) Enabled 9.3.7
Core Classy (classy) Disabled 9.3.7
Core Olivero (olivero) Disabled 9.3.7
Core Seven (seven) Disabled 9.3.7
Core Stable (stable) Disabled 9.3.7
Core Stable 9 (stable9) Disabled 9.3.7
Core Stark (stark) Disabled 9.3.7
starterkit_theme (starterkit_theme) Disabled
Gin (gin) Enabled 8.x-3.0-alpha37


`

And my /api/log/activity/resource/schema

{"$schema":"https:\/\/json-schema.org\/draft\/2019-09\/hyper-schema","$id":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/schema","title":"Activity log","allOf":[{"type":"object","properties":{"type":{"$ref":"#definitions\/type"},"attributes":{"$ref":"#\/definitions\/attributes"},"relationships":{"$ref":"#\/definitions\/relationships"}}},{"$ref":"https:\/\/jsonapi.org\/schema#\/definitions\/resource"}],"definitions":{"type":{"const":"log--activity"},"attributes":{"description":"Entity attributes","type":"object","properties":{"drupal_internal__id":{"type":"integer","title":"ID"},"drupal_internal__revision_id":{"type":"integer","title":"Revision ID"},"langcode":{"type":"string","title":"Language"},"revision_created":{"type":"string","title":"Revision create time","format":"date-time","description":"The time that the current revision was created."},"revision_log_message":{"type":"string","title":"Revision log message","description":"Briefly describe the changes you have made.","default":""},"name":{"type":"string","title":"Name","maxLength":255,"description":"The name of the log. Leave this blank to automatically generate a name.","default":""},"timestamp":{"type":"string","title":"Timestamp","format":"date-time","description":"Timestamp of the event being logged."},"status":{"type":"string","title":"Status","maxLength":255,"description":"Indicates the status of the log."},"created":{"type":"string","title":"Authored on","format":"date-time","description":"The time that the log was created."},"changed":{"type":"string","title":"Changed","format":"date-time","description":"The time the log was last edited."},"default_langcode":{"type":"boolean","title":"Default translation","description":"A flag indicating whether this is the default translation.","default":true},"revision_default":{"type":"boolean","title":"Default revision","description":"A flag indicating whether this was a default revision when it was saved."},"revision_translation_affected":{"type":"boolean","title":"Revision translation affected","description":"Indicates if the last edit of a translation belongs to current revision."},"data":{"type":"string","title":"Data","maxLength":255},"notes":{"type":"object","properties":{"value":{"type":"string","title":"Text"},"format":{"type":"string","title":"Text format"}},"required":["value"],"title":"Notes"},"flag":{"type":"array","title":"Flags","description":"Add flags to enable better sorting and filtering of records.","items":{"type":"string","title":"Text value"}},"is_group_assignment":{"type":"boolean","title":"Is group assignment","description":"If this log is a group assignment, any referenced assets will become members of the groups referenced below."},"geometry":{"type":"object","properties":{"value":{"type":"string","title":"Geometry"},"geo_type":{"type":"string","title":"Geometry Type"},"lat":{"type":"number","title":"Centroid Latitude"},"lon":{"type":"number","title":"Centroid Longitude"},"left":{"type":"number","title":"Left Bounding"},"top":{"type":"number","title":"Top Bounding"},"right":{"type":"number","title":"Right Bounding"},"bottom":{"type":"number","title":"Bottom Bounding"},"geohash":{"type":"string","title":"Geohash"},"latlon":{"type":"string","title":"LatLong Pair"}},"title":"Geometry","description":"Add geometry data to this log to describe where it took place."},"is_movement":{"type":"boolean","title":"Is movement","description":"If this log is a movement, then all assets referenced by it will be located in the referenced locations and\/or geometry at the time the log takes place. The log must be complete in order for the movement to take effect."},"quick":{"type":"array","title":"Quick form","description":"References the quick form that was used to create this record.","items":{"type":"string","title":"Text value","maxLength":255}}},"required":["drupal_internal__id","drupal_internal__revision_id","status","revision_translation_affected"],"additionalProperties":false},"relationships":{"description":"Entity relationships","properties":{"log_type":{"type":"object","properties":{"data":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["log_type--log_type"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"string","title":"Log type ID"}}}},"title":"Log type","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/log_type\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"revision_user":{"type":"object","properties":{"data":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["user--user"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"User ID"}}}},"title":"Revision user","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/revision_user\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"uid":{"type":"object","properties":{"data":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["user--user"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"User ID"}}}},"title":"Authored by","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/uid\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"category":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["taxonomy_term--log_category"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"Taxonomy term ID"}}}}},"title":"Log category","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/category\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"file":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["file--file"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"object","properties":{"target_id":{"type":"integer","title":"File ID"},"display":{"type":"boolean","title":"Display","description":"Flag to control whether this file should be displayed when viewing content"},"description":{"type":"string","title":"Description"}},"required":["target_id"]}}}}},"title":"Files","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/file\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"image":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["file--file"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"object","properties":{"target_id":{"type":"integer","title":"File ID"},"alt":{"type":"string","title":"Alternative text","description":"Alternative image text, for the image\\\u0027s \\\u0027alt\\\u0027 attribute."},"title":{"type":"string","title":"Title","description":"Image title text, for the image\\\u0027s \\\u0027title\\\u0027 attribute."},"width":{"type":"integer","title":"Width","description":"The width of the image in pixels."},"height":{"type":"integer","title":"Height","description":"The height of the image in pixels."}},"required":["target_id"]}}}}},"title":"Images","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/image\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"group":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["asset--group"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"Asset ID"}}}}},"title":"Groups","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/group\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"location":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource"},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128}}}}},"title":"Location","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/location\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"asset":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource"},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128}}}}},"title":"Assets","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/asset\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"quantity":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource"},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128}}}}},"title":"Quantity","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/quantity\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"owner":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["user--user"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"User ID"}}}}},"title":"Assigned to","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/owner\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]},"equipment":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","title":"Referenced resource","enum":["asset--equipment"]},"id":{"type":"string","title":"Resource ID","format":"uuid","maxLength":128},"meta":{"type":"integer","title":"Asset ID"}}}}},"title":"Equipment used","links":[{"href":"{instanceHref}","rel":"related","targetMediaType":"application\/vnd.api+json","targetSchema":"https:\/\/farmos.mydomain.secret\/api\/log\/activity\/resource\/relationships\/equipment\/related\/schema","templatePointers":{"instanceHref":"\/links\/related\/href"},"templateRequired":["instanceHref"]}]}},"type":"object","additionalProperties":false}}}

jgaehring commented 2 years ago

Ok, yea, this looks like some kind of bug I have not seen in local development. This is still a preliminary release so it hasn't been fully tested in the wild yet. @mstenta, when you get a chance, it would be good to have the latest release of the Tasks module on https://test.farmos.dev so we can look at this.

The only other thing I might suggest for now, @perotta, is to clear all site data and try logging in again. In Chrome the best way to do that is to open dev tools, go to the "Application" tab, select "Storage" from the left menu, then click "Clear site data".

image

I doubt that will have much effect, but if you had logged in to farmos.app using farmOS v1 in the past, there could be some stale data or static assets conflicting with the newest version. I've tested for this as best I can and haven't found any issues, but it's a slight possibility.

perotta commented 2 years ago

Thanks for the quick answer. I tried clearing the site data but It didn't help.

Also, it might not be a bug on Field Kit 2.0 or Tasks Field Module, but some weird bug on my farmOS installation instead, because it's a pretty old install that I migrated to 2.0 on January.

I just don't know how to replicate/debug from now. Or if I should just try exporting my data and restart from a fresh install

jgaehring commented 2 years ago

Oh, what version of farmOS do you have installed?

That might matter, too, because there were some late changes that effected Field Kit. I'm struggling to recall when the last such change was, but I know it must at least be 2.0.0-beta.x, not an alpha.

I'm also happy to chat in live time, perhaps later today if I don't get pulled away, or later this week if you're around. Feel free to ping me in the farmOS matrix chat: https://matrix.to/#/#farmOS:matrix.org. I'm @jgaehring there as well. Or we can use the dev Jitsi, https://meet.jit.si/farmos-dev. I'm also hoping to make this week's community and dev calls, if you're available for either of those: https://farmos.discourse.group/t/farmos-community-calls/972

mstenta commented 2 years ago

@mstenta, when you get a chance, it would be good to have the latest release of the Tasks module on https://test.farmos.dev/ so we can look at this.

Oh yes! Slipped between the cracks... :-)

Just to confirm, it is field-module-tasks@2.0.0-alpha.1.zip from https://github.com/farmOS/field-kit/releases/tag/field-module-tasks%402.0.0-alpha.1?

jgaehring commented 2 years ago

Just to confirm, it is field-module-tasks@2.0.0-alpha.1.zip from https://github.com/farmOS/field-kit/releases/tag/field-module-tasks%402.0.0-alpha.1?

Yep! that's the one

mstenta commented 2 years ago

Done! I haven't tested anything, but it installed successfully. I also uninstalled the old farm_fieldkit_tasks_test module.

perotta commented 2 years ago

(sorry, this is a dup of the dm I sent you on matrix, that's new for me so I wasn't sure if the message got to you) I was trying to run Field Kit App locally to see if I could get more useful debugging info but I couldn't start the dev setup

I clone the repo, npm install and npm start (it works) but when I open my localhost:8080 it crashes before opening the app image

image

I've researched this morning and it seems vite and axios are incompatible? https://github.com/vitejs/vite/issues/174

So I'm wondering how it works on your dev setup?

jgaehring commented 2 years ago

As I mentioned in chat, I goofed on the configuration, basically I did exactly what the warning here says not to do:

https://vitejs.dev/config/#optimizedeps-exclude

This was originally done to accomodate my local configuration where I was using npm-link with farmOS.js, but that broke dev dependencies installed normally from the npm registry. So changing

  optimizeDeps: {
    exclude: ['@farmos.org/farmos-map', 'farmos'],
  },

to

  optimizeDeps: {
    exclude: ['@farmos.org/farmos-map'],
    include: ['axios'],
  },

seems to work whether using npm-link or not.

I've pushed a commit (a5d61c4) with this change up to my fork, but may open a PR and test this out in a preview build on Netlify to make sure this doesn't break anything in production before merging. In the meantime, @perotta, feel free to try that out in your own setup, either by pulling from my fork or making those changes directly, and see if that resolves things on your end too.

paul121 commented 1 year ago

Also, when I click on the other colored "+" buttons on the home screen (Activity, Input, Harvest....) I get a different JS error

Shoot, I think I am experiencing this second bug seen in this initial report from @perotta. There were no network errors fetching the schemas. Here is the error from the console:

vendor.d1327d16.js:4 TypeError: Cannot read properties of undefined (reading 'user')
    at Proxy.addLog (index.js:1:21087)
    at Ze.e.createElementBlock.e.createElementVNode.e.createElementVNode.e.createElementVNode.onClick.n.<computed>.n.<computed> (index.js:1:23689)
    at Wn (vendor.d1327d16.js:4:656)
    at Or (vendor.d1327d16.js:4:735)
    at HTMLDivElement.r (vendor.d1327d16.js:4:55785)
paul121 commented 1 year ago

There aren't too many usages of user in field-module-tasks. Maybe we need this ?. optional chaining in the Tasks.vue ?:

https://github.com/farmOS/field-kit/blob/8cb35618e04412d7bb615f1a11cb4a94b438cf49/packages/field-module-tasks/src/components/TasksWidget.vue#L53-L57

https://github.com/farmOS/field-kit/blob/8cb35618e04412d7bb615f1a11cb4a94b438cf49/packages/field-module-tasks/src/components/Tasks.vue#L31-L35

asereq commented 1 year ago

Similar problem here. I tried installing https://github.com/farmOS/field-kit/releases/tag/field-module-tasks%402.0.0-alpha.1 on my self hosted farmOS 2.0 and it worked, but when I click on the "+" FAB I get a JS error: Error: Cannot find a schema for the log type: [object MouseEvent].

Also, when I click on the other colored "+" buttons on the home screen (Activity, Input, Harvest....) I get a different JS error TypeError: this.profile is undefined

I have the latest version of farmOS and use firefox as a web client. Any suggestions?

jgaehring commented 1 year ago

Hi @perotta and @asereq, thank you so much for your patience. I just deployed the fix from #513 on https://develop.farmos.app. It is working for me there, as well as in my local development environment. If you are able to test from that domain against your farmOS servers, let me know what results you see.

In the meantime, @paul121, I will take a look at the other issue re: the user id.

jgaehring commented 1 year ago

Oh, the FAB issue, sorry I forgot that was kind of a known issue. Unlike in 1.0, we're going to require a specific log type be selected before being directed to the Edit screen. Just need to implement something like a speed dial or menu transition. I will just hardcode 'activity' as the type for now, which I should have done sooner, b/c it was causing the click event to get passed as the type instead:

https://github.com/farmOS/field-kit/blob/ca66fa939692cdeaa46c2926285141cc906d137a/packages/field-module-tasks/src/components/TasksAll.vue#L65-L66

That commit's just on my fork for now, but I will merge it into develop once I test it, then it should be available for alpha.8 very soon, but I want to charge ahead w/ development for now so probably won't be releasing/deploying a new version just for these changes right now. Also gonna close this issue for now, but we can reopen if there are still any other problems here I haven't addressed.