-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: expose plugins and changelog in the API and app #744
Conversation
@cooper-joe this is a very early version of the changelog (+ highlighting plugins) in the App Hub. My plan is to follow up with UX improvements once the basics are working, but wanted to keep you in the loop (and also, maybe - even in this basic version - there are some UX wins that can be gained) |
ac4b7e7
to
9955193
Compare
bd14cde
to
6cf7371
Compare
@@ -50,6 +50,9 @@ const getApps = ( | |||
builder.where((builder) => { | |||
builder.where('name', 'ilike', `%${query}%`) | |||
builder.orWhere('organisation', 'ilike', `%${query}%`) | |||
if (query.match(/plugin/i)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an obscure way to find plugins - by searching for the exact word "plugin". A backdoor until we decide how/if we expose finding plugins in the UI.
@@ -0,0 +1,43 @@ | |||
const joi = require('joi') | |||
|
|||
const paramsSchema = joi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the existing updateApp did too many things and I didn't want to use it - although this in theory can be used to update any properties in the app object, for now, I am restricting, through the joi validation, it to only the d2config and changelog.
51c2b02
to
1444a09
Compare
1444a09
to
2e517e3
Compare
created a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments. In particular curious about these two points which I may be misremembering where we landed in earlier discussions:
- Exposing not just hasPlugin but also pluginType in view and API
- Storing d2config per version (so that we can track changes to app d2config over time)
@@ -15,6 +15,9 @@ const convertDbAppViewRowToAppApiV1Object = (app) => ({ | |||
|
|||
name: app.name, | |||
description: app.description || '', | |||
|
|||
hasChangelog: app.has_changelog, | |||
hasPlugin: app.has_plugin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should hasPlugin
also expose the pluginType
from d2.config.js
? That's an immediate win since we have both dashboard and capture plugin types available to day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This PR is included in version 2.35.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This adds functionality to show the changelog in the UI and visually differentiate plugins in the list of apps. Implements HUB-156 and HUB-144.
From a UX perspective, both these functionalities will be improved in upcoming tickets, but this PR sets the ground for how we do it, while exposing a very basic UI to test the functionality.
After a first discussion, we decided to move
d2config
andchangelog
columns to theapp
table instead ofappeversion
- in addition, we added achange_summary
column to versions table that would allow users to highlight what changed in a specific version. Thed2config
is taken from the uploaded zip file - while we attempt to get the change log from the zip file or the GitHub source url. Once we have the full change log - if we have it - we can display it in the UI in numerous ways, for now, we just implemented the simplest solution to show the full change logThe workflow is as follows:
d2.config.js
(as a JSON type) andCHANGELOG.md
to theapp
table.d2config
andchangelog
from the last version.has_plugin
is added to theapp_view
view.has_plugin
inspects the JSON type and returns a flag whether a plugin entry point is found or not. This is returned to/apps
endpoint and/apps/:id
.d2config
- rather than just the plugin info - is saved as it could be used to infer other information (i.e offline support, RTL support etc..).d2.config
andchangelog.md
are not returned fully as part of apps or appversions endpoints - only an indicator that they exist, or inferred info (i.e.has_plugins
)/apps/:id/changelog
. It is separate to avoid returning a potentially large text file in the apps or apps/:id response. We only return an indicator, which the UI can use to show a "view changes" button, and when that is clicked, it calls the API and returns the changelog.change_summary
added to the version table where users can just highlight what changed in a specific version manually - this is not exposed yet in the UI.ToDO :
UX
The UX, especially for the Changelog, is a placeholder - once we have the changelog info, we can parse and display as we want. I want a simple version in first, and that we agree on the database and API structure.
But here are some UX questions that came to mind while working on this:
Screenshots