After working on the peertube-plugin-categories
I encoutered the following issues. I’ll probably create Github issues from some of these and even submit PR …but mb I’m missing a few obvious things…
Overall
-
unregister
should take the same arguments asregister
ex: when the extension is uninstalled how to reset settings or storage?
-
typescript
type definition should be exposed
see Expose Typescript type definition · Issue #4201 · Chocobozzz/PeerTube · GitHub
Categories (or constants customization overall)
-
getCategories
should be exposed oncategoryManager
-
other getter methods should probably be added to retrieve the customizations done mb
getAddedCategories
,getDeletedCategories
, … -
categories
shouldn’t be modified in memory but stored somewhere in database
many potential unwanted side effects
Missing hooks
- [client-hook] form submit success/settings changed success
- add a way to set the form submission as failed server side
ex: throwing in the plugin
handleSettingsChages
doesn’t do anything
ex: this could allow custom error messages
Translation
might be just me, so please forgive me…
- it seems plugin translation system doesn’t work
see PeerTube/plugin.service.ts at v3.2.1 · Chocobozzz/PeerTube · GitHub
it seems thehelpers
property is never populated…
- I don’t know whcich
i18n
library is used internally, but there should be a way to add parameters to the translationkey
.
Something like the following:
Hello {name}, how are you today?
To avoid having lengthy keys, I tried to use technical key instead of plain english (ex:
settings.greeting
) but renounce because of the previous point (bug?).
Settings
- as there is a
registerSetting
method there probably should be anunregisterSettting
method - an
html
form element added viaregisterSetting
is never found back in the settings
thus it can never be retrieved or updated via the `settingsManager
- missing
delete
method on thesettingsManager
mb clear settings automatically when the plugin is uninstalled?
OR leave the choice to the plugin developer?
-
there could be an input type
file
-
Question: how to implement efficiently a datagrid on the settings page? Should it be part of the plugin API?*
…or mb there is a way to reuse part of the Angular UI?
Storage
- missing
delete
method onstorageManager
same thought as for the settings: shall it be cleared on uninstall?
Here’s an HedgeDoc version of this list, if it can be of any help:
HedgeDoc - Collaborative markdown notes