project-flogo / flogo-web

Project Flogo Web UI
http://flogo.io
BSD 3-Clause "New" or "Revised" License
63 stars 36 forks source link

Server side support for contribution icons and client side support for activity icons #1309

Closed fcastill closed 4 years ago

fcastill commented 4 years ago

Description

1. Added server side support for custom contrib icons

When contribution schemas are loaded the server checks for the existence of property display.icon in the descriptor.json. If the schema defines a the property display.icon then the server verifies that the referenced icon file exists and that it has a valid format and location. If the validation passes then the icon path is normalized and stored in the contrib database.

This PR adds a new "icon" endpoint in the contributions REST API /contributions/microservices/icons/:contribRef. If an icon exists for the passed contribRef then the endpoint will respond with the corresponding custom icon file. It will return a code 404 (not found) if the contrib didn't define a custom icon.

The contributions data served by the contributions REST API now includes a property icon that if present it indicates that the contribution has a valid custom icon. This property points to the its corresponding icons endpoint at /contributions/microservices/icons/:contribRef.

2. Display activity icons in client side

Updated both flow and stream client plugins to support activity icons.

Note that this PR only add support for custom activity icons. Trigger support is still TBD.

Motivation and Context

Part of #1261

How has this been tested?

Mock trigger and activity with custom icons are available at https://github.com/fcastill/flogo-contrib-test and they can be installed to test this functionality.

Screenshots (if appropriate):

Screen Shot 2020-06-18 at 4 08 59 PM Screen Shot 2020-06-18 at 4 07 23 PM Screen Shot 2020-06-18 at 4 07 33 PM

Types of changes

Checklist: