| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I see this PR is still in draft mode. Are you still working on this? |
Sorry, something went wrong.
No, the PR is ready, but it's depending on other PRs, so can't be merged |
Sorry, something went wrong.
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
| const { data: plugin } = usePlugin( | ||
| 'Panel', | ||
| panelDefinition.spec.plugin.kind, | ||
| undefined, |
There was a problem hiding this comment.
we probably can include the plugin version and registry as part of the options, so we don't have to pass undefined and the hook signature does not change drastically
Sorry, something went wrong.
| const { data: plugin } = usePlugin( | ||
| 'Panel', | ||
| panelDefinition.spec.plugin.kind, | ||
| undefined, | ||
| getPluginOverrides(panelDefinition.spec.plugin), | ||
| ); |
There was a problem hiding this comment.
| const { data: plugin } = usePlugin( | |
| 'Panel', | |
| panelDefinition.spec.plugin.kind, | |
| undefined, | |
| getPluginOverrides(panelDefinition.spec.plugin), | |
| ); | |
| const { data: plugin } = usePlugin( | |
| 'Panel', | |
| panelDefinition.spec.plugin.kind, | |
| { | |
| version: panelDefinition.spec.metadata?.version, | |
| registry: panelDefinition.spec.metadata?.registry, | |
| } | |
| ); |
Sorry, something went wrong.
| * Extract the pinned version/registry from a plugin definition's `metadata`, if any. Returns `undefined` when nothing | ||
| * is pinned so the plugin resolves to its latest available version. | ||
| */ | ||
| export function getPluginOverrides( |
There was a problem hiding this comment.
We don't need this function and can pass the values of plugin?.metadata?.version and plugin?.metadata?.registry directly as the latest version is left empty on purpose.
Sorry, something went wrong.
| options?: UsePluginOptions<T>, | ||
| overrides?: PluginDefinitionMetadata, |
There was a problem hiding this comment.
| options?: UsePluginOptions<T>, | |
| overrides?: PluginDefinitionMetadata, | |
| options?: UsePluginOptions<T>, |
Sorry, something went wrong.
| @@ -45,57 +46,111 @@ export function usePluginRegistry(): PluginRegistryContextType { | |||
|
|
|||
| // Allows consumers to pass useQuery options from react-query when loading a plugin | |||
| type UsePluginOptions<T extends PluginType> = Omit< | |||
There was a problem hiding this comment.
| type UsePluginOptions<T extends PluginType> = Omit< | |
| type UsePluginOptions<T extends PluginType> = Omit< | |
| UseQueryOptions<PluginImplementation<T>, Error, PluginImplementation<T>, UsePluginQueryKey>, | |
| 'queryKey' | 'queryFn' | |
| > & { | |
| /** Pin resolution to a specific plugin version. When omitted, the latest available version is used. */ | |
| version?: string; | |
| /** Pin resolution to a specific plugin registry. */ | |
| registry?: string; | |
| }; |
Sorry, something went wrong.
| const plugin = await getPlugin({ | ||
| kind: PROFILE_QUERY_KEY, | ||
| name: profileQueryKind, | ||
| ...getPluginOverrides(definition.spec.plugin), |
There was a problem hiding this comment.
| ...getPluginOverrides(definition.spec.plugin), | |
| version: definition.spec.plugin.metadata?.version, | |
| registry: definition.spec.plugin.metadata?.registry, |
Sorry, something went wrong.
| undefined, | ||
| getPluginOverrides(definition.spec.plugin), |
There was a problem hiding this comment.
| undefined, | |
| getPluginOverrides(definition.spec.plugin), | |
| { | |
| version: definition.spec.plugin.metadata?.version, | |
| registry: definition.spec.plugin.metadata?.registry, | |
| } |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
The goal of this PR is to improve the handling of plugin versioning in dashboard:
What is doing the lock mode?
Lock will enforce versioning on all plugins. It will use latest version installed. When a new version is available, it will show a button to update, with a nice diff based on the first panel using the plugin (only for panel plugin). If the plugin version pinned is no longer available, it will show a error.
Blocked, need spec release v0.3.0-beta.4 fixed (token expired, need @Nexucis back :p) and need perses/plugins#773 too
Screenshots
Checklist
following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
UI Changes
See e2e docs for more details. Common issues include: