▣🔗 Asset Link dev log

I’ve now released version 0.5.4 with the following change-log;

[0.5.4] - 2022-08-23

Added

  • Add a connection status description to the bottom of the sync tray
  • Add a menu to the bottom of the sync tray with an option to clear all local data
  • Add support for the some operator when querying entity relationships
  • Add a widget decorator for the asset name that shows the asset groups

Changed

  • Improved styling of asset selector to make the search results scroll and fit the page better
  • Improve service-worker cache-clearing/unregistering behavior
  • Load all asset relationships when loading assets
  • Improved how asset location is loaded/displayed/refreshed
  • Change the asset location to be a widget decorator on the asset name
  • Change the asset location/group to be links to the related location/group asset(s)
  • Move the “Asset:” prefix inside a span of the asset name render widget so widget decorator plugins can modify/hide it

Fixed

  • Show the asset search weight text under each search result
  • Fix loading of schemas so it works with latest Drupal JSON:API schema data
  • Fix reloading plugin lists so the skipCache parameter also skips the service worker cache
  • Fix a bug with the initial value of the Orbit.js request queue autoProcess setting
  • Fix a bug with the sync icon showing the wrong value when no network connection is available
  • Fix warnings from Cookie SameSite attribute
  • Fix warnings from non-function default slot in JS plugin component declarations
  • Fix warnings from non-numeric boot progress values
  • Fix warning for name of emitted event on the asset page
  • Fix styling of asset selector to have a minimum size for the list of search results
  • Fix more bad references to assetLink.connectionStatus.isOnline
  • Fix data-flow for the in-memory Orbit.js source so the initial call to assetLink.assetTypes() can return data
  • Remove cacheOnly behavior from asset name locations/groups wiget decorators since it was producing stale results
  • Add key param to asset page asset resolver to ensure the page updates when navigating from one asset to another

[0.5.3] - 2022-08-17

Added

  • Implement service worker refresh UI to cleanly update the PWA
  • Add reload plugin button to the manage plugins page
  • Add a more specific warning message for asset proximity search when location permissions are denied

Fixed

  • Re-add service-worker.js which got lost in the migration work
  • Fixed logic to connect/disconnect Orbit.js JSON:API source queries based on online/offline status
  • Fix reloading plugins so the skipCache parameter also skips the service worker cache
  • Fix handling of dev certs when proxying https farmOS instances for development
  • Actually show messages that are pushed into assetLink.vm.messages

[0.5.2] - 2022-08-16

Added

  • Better docs for IAssetLink/IAssetLinkUI/IFarmOSConnectionStatus interfaces
  • Data access and simple asset action plugin tutorials

Changed

  • Moved EventBus implementation to assetlink-plugin-api package to make documentation easier
  • Include Vue runtime compiler in PWA/Sidecar builds

Screenshots

2 Likes

I’ve now released version 0.6.0 with the following change-log;

[0.6.0] - 2022-08-30

Added

  • Add a CodeEditor component based on CodeMirror 5
  • Add the ability to enable/disable plugins by URL
  • Add support for plugins stored (not just cached) locally in indexeddb
  • Add the ability to create/edit plugins by writing their source code inside Asset Link
  • Add a default plugin which shows the parent/child hierarchy of assets

Changed

  • Depend on the source files for the assetlink-plugin-api package rather than its bundle in the PWA/Sidecar so that code splitting will work correctly

Fixed

  • Apply Drupal 10 fixes from Automated Drupal 10 compatibility fixes [#3305281] | Drupal.org
  • Clean up old default plugin files and config entities on building
  • Fix bug in connection status detection to honor all “^2” versions, not just the dev “2.x” version
  • Fix a bug with plugin reference tracking not dropping to zero correctly
  • Fix a bug with plugin source not being set when plugins produce certain errors
  • Fix a bug where plugins would get incorrectly fetched via HTTP after they are already loaded/cached
  • Fix a bug with plugins not being loaded correctly when first added to the local plugin list

Screenshots

Editing an existing plugin:

Creating a new plugin based on a tutorial from the documentation:

Viewing the parent/child hierarchy of an asset:

1 Like

I’ve now released version 0.6.1 with the following change-log;

[0.6.1] - 2022-08-31

Added

  • Make it simpler for other modules to provide default Asset Link plugins without their own controllers/routing

Changed

  • More aggressively rely on indexeddb caching in preference to network/worker caching

Fixed

  • Cleaned up some warnings and unnecessary logging
  • Fixed a bug with how different browsers handle ‘indexeddb://’ plugin urls - #2
  • Fixed a bug with how extra plugin lists are stored/updated - #3
  • Don’t cache requests to /api used to check connectivity/login status

Links

3 Likes

I’ve now released version 0.6.2 with the following change-log;

[0.6.2] - 2022-09-03

Added

  • Add support for creating/uploading ‘file–file’ entities as part of changing asset relationships
  • Add a photo input widget to make capturing or providing image files easier
  • Add a pane to the asset visual carousel for uploading asset images

Changed

  • Autofocus the text search input when searching for assets
  • Improve the styling of the asset visual carousel so the controls are easier to see
  • Improve how asset photos are loaded so the ‘file–file’ entity can come from the local cache if available
  • Improved plugin model documentation

Fixed

  • Change how relationship schemas are loaded so they are valid as Orbit.js models
  • Remove example plugin that should not have been checked in

Screenshots

Demo of new photo capture widget and offline photo capture/storage for later upload;

2 Likes

I’ve now released version 0.6.3 with the following change-log;

[0.6.3] - 2022-09-04

Added

  • Create a new component to render decoratable entity name text

Changed

  • Set the page title in index.html and upon route changes
  • Refactored the asset name rendering to distinguish page title and asset name decorators
  • Set the route title for the asset and manage plugins pages
  • Change the archived asset name icon to use a unicode icon that can also be rendered as the document.title
  • Use the entity name component to render asset names in the asset selector component
  • Use the entity name component to render asset names in the asset hierarchy dialog

Screenshots

Demo showing the page title updating live as an asset is unarchived/archived

1 Like

I’ve now released version 0.7.1 with the following change-log;

[0.7.1] - 2022-09-09

Added

  • Added entity selection component
  • Support custom styles in Vue plugins
  • Expose currently logged in user id via the connection status detector
  • Add support for creating/uploading ‘file–file’ entities as part of creating/updating entities

Changed

  • Generalized asset searching/resolution functionality to work for all entity types

Fixed

  • Fix dev server proxy for default plugins repo to pass through module-scoped plugin urls
  • Fix loading of asset relationship type enums to always be undefined or a non-empty list
  • Fix warnings from OpenInFarmOSMetaActionProvider
  • Fix searching by entity UUID
  • Fix PhotoInput to only show capture button when it is supported
  • Fix JSON:API permission issue so non-admin users can upload files
  • Fix race condition where Orbit.js queries/updates can fail while online/offline status is changing
  • Hide the edit action for plugins without loaded source code e.g. disabled plugins
2 Likes

I’ve now released version 0.7.3 with the following change-log (0.7.2 works, but I realized that the release size was getting ridiculous because of some stale artifacts. 0.7.3 fixes that.);

[0.7.3] - 2022-09-10

Fixed

  • Clean up stale files as part of release GitHub action to reduce release/install size

[0.7.2] - 2022-09-10

Added

  • Add slot to ‘add plugin’ FAB menu so plugins can define their own buttons there
  • Add a list of group members to the asset page when viewing group assets
  • Add a list of location occupants to the asset page when viewing location assets

Changed

  • Support double-clicking on an result in the EntitySearch component to choose it immediately
  • Improve reactivity of asynchronously defined plugin functionality - slots/widgets/etc

Fixed

  • Fix MoveAssetActionProvider to use the new EntitySearch component and resolve a minor warning
  • Fix Sidecar FloatingSidebar to use newly generalized EntityResolver component
  • Fix styling of manage plugins page so ‘add plugin’ FAB does not obscure plugin tree actions
  • Fix Orbit.js ‘some’ queries to use Drupal JSON:API ‘IN’ operator

Screenshots

2 Likes

I’ve now released version 0.7.4 with the following change-log;

[0.7.4] - 2022-10-09

Added

  • Add the ability to navigate by clicking on group members and location occupants on the asset page
  • Add a entity searcher plugin to find entities by their old farmOS 1.x urls
  • Accept pasted images in PhotoInput component
  • Expose the AssetLink.fetch method to help support non-JSON:API or certain advanced use-cases

Fixed

  • Fix a bug where group members or location occupants not in the cache would break the display on the asset page
  • Fix styling of search tabs so up to 5 can fit reasonably well
  • Fix the exception types in BarrierAwareOrbitSourceDecorator
  • Fix the resource field path inflector for Orbit.js so it doesn’t ‘dasherize’ relationships like ‘plant_type’

Removed

  • Remove the default routes/views for the home and about pages to open those route paths up for plugins in the future
3 Likes

I’ve now released version 0.7.5 with the following change-log;

[0.7.5] - 2022-10-18

Changed

  • Move the precaching out into a plugin since some use-cases will likely require precaching customization

Fixed

  • Fix the hook_entity_create_access implementation name so our file upload fix actually works
2 Likes

I’ve now released version 0.7.6 with the following change-log;

[0.7.6] - 2022-10-21

Added

  • Emit the ‘changed:assetLogs’ event when inventory quantities referencing an asset change
  • Add a plugin to show asset inventory quantities as badges in the asset page title

Changed

  • Perform precaching with lower priority than other JSON:API requests
  • Perform precaching requests serially to avoid blocking all browser request threads
  • Debounce search requests to no more than 1 per 500ms

Fixed

  • Fix orbit.js record updated listener so it works when multiple update operations occur together
  • Set the default plugin config entity yml ‘user_defined’ property to null to avoid that appearing in the config sync updates report

Screenshots

2 Likes

Mentioned earlier in this thread by @walt and @mstenta, Asset Link could be available on Farmier if Asset Link was tagged beta.

@Symbioquine, I just wonder if there are plans for this, and if so, do you have a rough time estimate for it?
It looks very useful, and would be nice to know this for my further use of FarmOS.

3 Likes

Thanks for the interest @pat! It’s slow going, but yes, I’m still working on Asset Link.

The decision about if/when it becomes available on Farmier is up to Mike obviously, but the idea of waiting for at least a beta release seems wise. Right now I can only recommend it to folks who are interested in experimenting in non-critical settings or perhaps contributing.

At the moment, I’ve been experimenting with a bit of an abstraction layer over Orbit.js that takes care of some higher-level caching concerns which will allow Asset Link to scale to many more use-cases with reasonable performance. The problem is that Orbit.js does a good job with caching and offline data access at an individual entity (asset/log/etc) level, but doesn’t - for example - know about the connection between logs or the semantics of the Drupal changed timestamp that all entities have. If I can make an API on top of Orbit.js which all queries/changes pass through that knows about those things, then Asset Link can make much faster decisions about whether it needs to talk to the server for a given bit of data - or when offline whether the data it already has is potentially complete enough to show.

Unfortunately, I’m probably farther from an Alpha release than I thought I was at the end of the Summer. The above with involve some pretty fundamental changes to the current Asset Link API.

I will try to keep this topic a bit better updated though. It helps to hear from folks who are interested in Asset Link!

3 Likes

Ok, thats cool. I understand there’s more work to be done. Then I might try to set it up for a test in the meantime.
I’m glad to hear it might happen.

Is it translateable in the same way as FarmOS?
I can do a Norwegian translation if it get’s so far.

1 Like

I’ve now released version 0.8.2 with the following change-logs;

[0.8.2] - 2023-01-29

Fixed

  • Fix bug with Webpack resolution of Quasar Dialog plugin - breaking all dialogs

[0.8.1] - 2023-01-29

Fixed

  • Fix bug with options handling injecting fetch into the AssetLink class

[0.8.0] - 2023-01-29

Added

  • Add support for slot showIf predicates using jmespath
  • Add support for widget decorator vue template shorthand
  • Add support for slot shorthand context multiplexer
  • Add some basic smoke testing of AssetLink initialization and entity resolution
  • Add a AssetLink::halt method and test to show that resolving a cached asset involves no http requests

Changed

  • Automatically group requests via subrequests #1
  • Refactor entity model loading into a separate class and add tests
  • Refactor farm data access out into a new Asset Link core
  • Change Orbit.js JSON:API request timeout from 10s to 5s
  • Propagate transforms from memory to remote source synchronously

Fixed

  • Fix bug where changed events wouldn’t be honored by the EntityResolver component
  • Fix handling of farmOS installations that are at subpaths rather than ‘/’
  • Fix handling of internal plugin data representation so it can be loaded in tests
  • Fix handling of Orbit.js query failures to avoid gumming up internal request queues
  • Cleaned up some unnecessary logging
  • Fixed task failure propagation in OrbitPriorityTaskQueue
  • Fixed handling of fetch requests that throw exceptions in SubrequestsGroupingRequestFetcher

Plugin Code Features

For full descriptions see Asset Link Plugin API docs Extension Model

Slot Predicate Shorthand

<template
    alink-slot[com.example.farmos_asset_link.slots.v0.my_slot]="toolbar-item(weight: 200, showIf: 'pageName == `asset-page`')">
  <q-btn flat dense to="/another/asset-link-page" icon="mdi-alarm-bell"></q-btn>
</template>

image

Slot Multiplexing Shorthand

<script setup>
const props = defineProps({
  symbol: {
    type: String,
    required: true,
  },
});
</script>

<template alink-slot[com.example.farmos_asset_link.slots.v0.my_slot]=
          'toolbar-item(multiplexContext: "[`\\uD83D\\uDE48`, `\\uD83D\\uDE49`, `\\uD83D\\uDE4A`][*].{ symbol: @ }")'>
  <q-btn flat dense to="/another/asset-link-page" :label="props.symbol"></q-btn>
</template>

image

The above example is only slightly complicated by the detail that we’re using an array literal of unicode characters that must be represented with two escape characters. See Surrogate Pair Calculator etc. For most practical purposes one would actually be using JMESPath to transform the original context, not hard-code unicode characters, but it is still a fun example - thus included here.

More practically, here is another example showing the image relationships on an asset being multiplexed into multiple contexts - each of which is rendered as text in a div;

<script setup>
const props = defineProps({
  imgRef: {
    type: Object,
    required: true,
  },
});
</script>

<template alink-slot[com.example.farmos_asset_link.slots.v0.image_ids]=
    'page-slot(showIf: "pageName == `asset-page`", multiplexContext: "asset.relationships.image.data[*].{ imgRef: @ }")'>
  <div>Image: {{ props.imgRef.type }} - {{ props.imgRef.id }}</div>
</template>

image

Widget Decorator Shorthand

<template
    alink-widget-decorator[com.example.farmos_asset_link.widget_decorator.v0.asset_name_with_peace_sign]
      ="asset-name(weight: 150, appliesIf: 'asset.attributes.status != `archived`')">
  <span><slot></slot> &#9774;</span>
</template>

image

2 Likes

I’ve now released version 0.10.0 with the following change-logs;

0.10.0 - 2023-02-05

Added

  • Added a updates DLQ and improved UX of sync icon/tray to show queries and allow retrying/deleting failed updates

Changed

  • Change the entity resolver component to use q-inner-loading so core Asset Link UI remains usable
  • Move the top toolbar sync icon to the far left and make the sync tray appear under the toolbar
  • Set the current timestamp in the query/update options so we can tell when queries were originally created
  • Make location and groups asset title decorators query those relationships from the entity source, not its cache

Fixed

  • Fix bug with useServiceWorkerUX.js when not running the service worker (i.e. in dev mode)
  • Fix AssetPageTitleWithGroupsWidgetDecorator plugin to not break when group assets/relationships are disabled
  • Fix MoveAssetActionProvider plugin to filter the current asset out of possible move destinations
  • Fix whitespace in test geometry comparison
  • Fix how retry errors are stored so they don’t break the tests due to fake-indexeddb serialization differences
  • Fix retry logic so retries do not happen after AssetLink instance is halted
  • Fix how change events are fired upon Orbit.js updates - was broken by recent refactoring
  • Fix location occupants slot provider plugin such that a given occupant with only appear once

0.9.0 - 2023-02-02

Changed

  • Move logic for farmOS data model locations and group membership into the core of Asset Link
  • Simplify location and group membership asset title plugins to use relationships from above refactoring

Fixed

  • Fix bug with file uploads caused by refactoring
  • Fix bug where group membership calculation breaks when group module is not enabled
  • Fix bug where inventory calculation breaks when inventory module is not enabled

Screen Captures

Update DLQ + delete/retry

Explanation: Field A is already located in Field C which is already located in Field B. Attempting to move Field B to Field A thus throws a circular location constraint violation when the update is sent to the server. The update gets retried a few times then moved to an internal DLQ whence users can choose to retry or delete the update.

1 Like

I’ve now released version 0.11.0 with the following change-logs;

[0.11.0] - 2023-02-11

Added

  • Expose jmespath for import by plugins
  • Implement “computed” group/location relationships
  • Add a “persistent UX tray” area after the Asset Link toolbar title

Changed

  • Make updates non-blocking with the remote when offline
  • Make the toolbar title decoratable
  • Pin editor dialogs from manage plugins plugin in new persistent UX tray

Fixed

  • Fire “changed:” events after updates have been fully settled with the memory source
  • Fix test for multiple movement locations/geometries and confirm that no fetch calls occur when offline

Screen captures

Persistent Plugin Editor Dialogs

3 Likes

I’ve now released version 0.12.0 with the following change-log;

[0.12.0] - 2023-02-20

Added

  • Add some functional tests in a more scalable fashion
  • Add security warning/confirmation about installing untrusted plugins and plugin lists
  • Add an option to disable subrequest grouping to simplify testing
  • Update the memory cache when new data is supplied in the ‘includes’ field of remote server responses
  • Locally compute inventory values when necessary
  • Add a log page and basic support for viewing editing logs
  • Add a tasks page for viewing upcoming/late/recent logs

Changed

  • Switch to connecting to the farm-faux-cloud on port 1880
  • Conditionally compute location/geometry/group values
  • Throw exceptions when log-types/asset-types/taxonomy-vocabularies are missing
  • Clean up tests a little
  • Rename OpenInFarmOSMetaActionProvider plugin to OpenAssetInFarmOSMetaActionProvider for clarity

Fixed

  • Fix a race condition related to going offline in one of the tests
  • Fix bug where the asset geometry/locations computed fields aren’t initially calculated for new assets
  • Fix a bug with how query results are merged when options.fullResponse is set
  • Fix populating missing geometry/location/group computed fields for new assets
  • Cleanup logic around how querying location/group relations works
  • Fix a bug where clearing local data fails in development without the service worker installed
  • Fix a bug creating widget decorators via the shorthand without specifying a predicate
  • Fix asset group and location members page slots to only apply to the asset page

Screen captures

Basic log viewing/creation support & tasks page:

3 Likes

I’ve now released version 1.0.0-alpha1 with the following change-log;

[1.0.0-alpha1] - 2023-02-28

Added

  • Add a “Reload from Server” meta action to assets and logs
  • Add support for asynchronous routes
  • Add convenience mechanisms for working with taxonomy terms

Changed

  • Handle Ctrl-s/Cmd-s to save from the plugin code editor
  • Update the test docker-compose environment to enable a few of the optional modules and add more default test data

Fixed

  • Make loading of group members & location occupants actually fall through the cache when online
  • Make the remote search phase actually fall through the cache when online
  • Honor forceRemote and new verifyCacheIntegrity options in FarmDataModelOrbitMemorySourceDecorator
  • Make meta actions menu auto-close
  • Load asset page title locations/groups refresh from the server (if online) upon log changes
  • Make the find asset page load the asset again fully to ensure that all relationships are included
  • Fix bug with inventory queries

[0.13.0] - 2023-02-24

Fixed

  • Skip adding sidebar to map popups
  • Fix connection status race condition and precache key structural data-model data
1 Like

hi,
asset link module is a good idea! I wanted to try to install asset link but it doesn’t work on my farmos installation. the module does not load anything and the icon is not clickable. Is there any particular procedure to make the module work? Thank you

1 Like

Hi @altix, welcome to the forum and thanks for taking the time to try Asset Link! :grin:

There shouldn’t be any extra steps needed beyond installing the farmOS module so this is probably a bug. I do need more information to determine the cause though.

I’ve opened an issue at Report of Asset Link not loading · Issue #34 · symbioquine/farmOS_asset_link · GitHub - if you’re comfortable with GitHub, it would be awesome if you could check for errors in your browser console and provide them on that issue along with what versions of Asset Link and farmOS you’re running.

Otherwise, I can help with diagnosis via Matrix chat https://matrix.to/#/@symbioquine:matrix.org or in a new forum thread here.

2 Likes