Display a warning in the Installed tab if the admin is about to disable or uninstall a detached plugin (#4098)

* Display a warning in the Installed tab if the admin is about to disable or uninstall a detached plugin.

* @since

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>
This commit is contained in:
Jesse GlickandOleg Nenashev authored and Oleg Nenashev committed 2019-07-09 08:54:15 +02:00
1 parent d37bcb54d9
commit 2bfded176c
4 files changed
+27 -1

No files matched your search

@@ -84,6 +84,7 @@ import static hudson.PluginWrapper.PluginDisableStatus.ERROR_DISABLING;
import static hudson.PluginWrapper.PluginDisableStatus.NOT_DISABLED_DEPENDANTS;
import static hudson.PluginWrapper.PluginDisableStatus.NO_SUCH_PLUGIN;
import static java.util.logging.Level.WARNING;
import jenkins.plugins.DetachedPluginsUtil;
import static org.apache.commons.io.FilenameUtils.getBaseName;
/**
@@ -999,6 +1000,15 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
return !archive.exists();
}
/**
* Same as {@link DetachedPluginsUtil#isDetachedPlugin}.
* @since TODO
*/
@Exported
public boolean isDetached() {
return DetachedPluginsUtil.isDetachedPlugin(shortName);
}
/**
* Sort by short name.
*/