mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* feat(pluginlistpanel): if catalog app is enabled redirect user if plugin is upgradable
* refactor(catalog): update copy if plugin is disabled
(cherry picked from commit 8c93899b15
)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
parent
ba313788d5
commit
727119f9ce
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Page } from 'components/Page';
|
||||
import { AppRootProps, NavModelItem } from '@grafana/data';
|
||||
import { css } from '@emotion/css';
|
||||
|
||||
export const NotEnabled = ({ onNavChanged }: AppRootProps) => {
|
||||
const node: NavModelItem = {
|
||||
@ -16,8 +17,16 @@ export const NotEnabled = ({ onNavChanged }: AppRootProps) => {
|
||||
|
||||
return (
|
||||
<Page>
|
||||
To enabled installing plugins, set the{' '}
|
||||
<a href="https://grafana.com/docs/grafana/latest/plugins/catalog">Plugin Catalog</a> instructions
|
||||
To enable installing plugins, please refer to the{' '}
|
||||
<a
|
||||
className={css`
|
||||
text-decoration: underline;
|
||||
`}
|
||||
href="https://grafana.com/docs/grafana/latest/plugins/catalog"
|
||||
>
|
||||
Plugin Catalog
|
||||
</a>{' '}
|
||||
instructions
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
@ -86,7 +86,6 @@ class AppRootPage extends Component<Props, State> {
|
||||
}
|
||||
|
||||
onNavChanged = (nav: NavModel) => {
|
||||
console.log('NAV CHANGED!!!', nav);
|
||||
this.setState({ nav });
|
||||
};
|
||||
|
||||
|
@ -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!
|
||||
|
Loading…
Reference in New Issue
Block a user