feat(apps): more polish on app dashboard save warning, #5529

This commit is contained in:
Torkel Ödegaard
2016-07-12 08:41:56 +02:00
parent f3db2fa262
commit b2acac3a41
4 changed files with 12 additions and 5 deletions

View File

@ -139,10 +139,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
return Json(412, util.DynMap{"status": "version-mismatch", "message": err.Error()})
}
if pluginErr, ok := err.(m.UpdatePluginDashboardError); ok {
message := "Dashboard is belongs to plugin " + pluginErr.PluginId + "."
message := "The dashboard belongs to plugin " + pluginErr.PluginId + "."
// look up plugin name
if pluginDef, exist := plugins.Plugins[pluginErr.PluginId]; exist {
message = "Dashboard is belongs to plugin " + pluginDef.Name + "."
message = "The dashboard belongs to plugin " + pluginDef.Name + "."
}
return Json(412, util.DynMap{"status": "plugin-dashboard", "message": message})
}