Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow Diagram: load adaptor icons from adaptors #943

Closed
josephjclark opened this issue Jul 18, 2023 · 1 comment · Fixed by #1120
Closed

Workflow Diagram: load adaptor icons from adaptors #943

josephjclark opened this issue Jul 18, 2023 · 1 comment · Fixed by #1120
Assignees

Comments

@josephjclark
Copy link
Contributor

josephjclark commented Jul 18, 2023

The current design for the Workflow Diagram is to include an icon on each node to represent the adaptor.

https://github.com/OpenFn/Lightning/blob/main/assets/js/workflow-diagram/components/adaptor-icons.tsx

  1. Create a install-adaptor-icons mix task.
  2. Make sure to either include the task in the docker image itself or make sure that the mix task gets called once the server starts up... when the app is deployed it could "install-adaptors" and "install-adaptor-icons".

Icon location

All adaptors have icon files in their /adaptors/packages/<adaptor-name>/assets/square.png folder. (at the time of writing these are not bundled into the package).

Other thoughts for icon loading (later maybe?)

Images can be loaded from jsdelivr. We can use it like a CDN and load the image files directly - a bit like how we load typescript files for the adaptor docs.

We probably want a server-side proxy for this, to enable caching and prevent cross-site requests.

Alternatively, we may want to consider loading icons from github (which probably doesn't allow us to use version control)

Icon format

Adaptors should provide square and circle icons.

Ideally all adaptor icons would be provided as SVG files, because we can scale and, if necessary, colour them.

Should we also support other image formats? This will make image loading harder. I suppose we could add a non-standard property to package.json to point to the icon file (but this means we need to make two requests to load the icon). I'd prefer to just be strict on SVGs.

Missing icons

Assuming we want to version icons (and we may not), old adaptors won't have an icon file.

If an icon isn't found for the current version, we should try and load an icon from @latest before falling back to just using the adaptor name.

Offline usage

We have a requirement for Lightning to run offline, in which case it can't call out for adaptor icons.

If we have a server-side proxy and cache, we could provide a script to pre-load the cache with icons for some adaptors.

@taylordowns2000
Copy link
Member

taylordowns2000 commented Sep 5, 2023

with @stuartc , @elias-ba Right now the thought is:

  1. install-adaptor-icons mix task that loads them locally (like install-adaptors or install-schemas)
  2. add a process that pre-seeds a list of available images for a given adaptorName (AdaptorService/ex-cache/new gen server?) - this second part needs more detail. first lets target building the icons into the docker image

@NickOpenFn NickOpenFn added the needs detail More detail is needed before development can start label Sep 13, 2023
@NickOpenFn NickOpenFn self-assigned this Sep 13, 2023
@NickOpenFn NickOpenFn removed the needs detail More detail is needed before development can start label Sep 14, 2023
@NickOpenFn NickOpenFn assigned midigofrank and unassigned NickOpenFn Sep 14, 2023
@OpenFn OpenFn deleted a comment from NickOpenFn Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants