mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PluginCatalog: Update message about insufficient permissions (#67664)
Changed so we map the enum into different message.
This commit is contained in:
parent
76284ed3a6
commit
21d28c1cb5
@ -58,8 +58,7 @@ export const InstallControlsWarning = ({ plugin, pluginStatus, latestCompatibleV
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!hasPermission && !isExternallyManaged) {
|
if (!hasPermission && !isExternallyManaged) {
|
||||||
const message = `You do not have permission to ${pluginStatus} this plugin.`;
|
return <div className={styles.message}>{statusToMessage(pluginStatus)}</div>;
|
||||||
return <div className={styles.message}>{message}</div>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!plugin.isPublished) {
|
if (!plugin.isPublished) {
|
||||||
@ -101,3 +100,17 @@ export const getStyles = (theme: GrafanaTheme2) => {
|
|||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function statusToMessage(status: PluginStatus): string {
|
||||||
|
switch (status) {
|
||||||
|
case PluginStatus.INSTALL:
|
||||||
|
case PluginStatus.REINSTALL:
|
||||||
|
return `You do not have permission to install this plugin.`;
|
||||||
|
case PluginStatus.UNINSTALL:
|
||||||
|
return `You do not have permission to uninstall this plugin.`;
|
||||||
|
case PluginStatus.UPDATE:
|
||||||
|
return `You do not have permission to update this plugin.`;
|
||||||
|
default:
|
||||||
|
return `You do not have permission to manage this plugin.`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user