mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PluginsList Panel: Redirect to catalog app for updating plugins (#34893)
* feat(pluginlistpanel): if catalog app is enabled redirect user if plugin is upgradable * refactor(catalog): update copy if plugin is disabled
This commit is contained in:
@@ -3,6 +3,7 @@ import { useAsync } from 'react-use';
|
||||
import { css, cx } from '@emotion/css';
|
||||
import { GrafanaTheme, PanelProps, PluginMeta, PluginType } from '@grafana/data';
|
||||
import { CustomScrollbar, ModalsController, stylesFactory, Tooltip, useStyles } from '@grafana/ui';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { UpdatePluginModal } from './components/UpdatePluginModal';
|
||||
@@ -48,13 +49,16 @@ export function PluginList(props: PanelProps) {
|
||||
className={cx(styles.message, styles.messageUpdate)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
showModal(UpdatePluginModal, {
|
||||
pluginID: plugin.id,
|
||||
pluginName: plugin.name,
|
||||
onDismiss: hideModal,
|
||||
isOpen: true,
|
||||
});
|
||||
if (config.pluginAdminEnabled) {
|
||||
locationService.push(`/a/grafana-plugin-admin-app/plugin/${plugin.id}`);
|
||||
} else {
|
||||
showModal(UpdatePluginModal, {
|
||||
pluginID: plugin.id,
|
||||
pluginName: plugin.name,
|
||||
onDismiss: hideModal,
|
||||
isOpen: true,
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
Update available!
|
||||
|
||||
Reference in New Issue
Block a user