Skip to content

Commit

Permalink
Fixes #17093: Add \"technical preview\" status for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaadF committed Apr 14, 2020
1 parent 20e7000 commit e496314
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ class Boot extends Loggable {
override val shortName: String = sn
override val description: NodeSeq = <p>{p.name}</p>
override val version: PluginVersion = p.version
override val versionInfo: Option[String] = None
override val status: PluginStatus = AlwaysEnabledPluginStatus
override val init = ()
override val basePackage: String = p.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ trait DefaultPluginDef extends RudderPluginDef {
PluginVersion(0,0,1, s"ERROR-PARSING-VERSION: ${versionString}")
)
}
override lazy val versionInfo = {
val info = buildConf.getString("version-info")
if (info.isEmpty) None else Some(info)

// val content = for {
// info <- IO.effect {buildConf.getString("version-info")}
// } yield {
// Some(info)
// }
// content.catchSome {
// case missingErr: ConfigException.Missing =>
// ApplicationLogger.info("Missing version-info in build.conf")
// None.succeed
// case typeErr: ConfigException.WrongType =>
// ApplicationLogger.error("Wrong type version-info in build.conf")
// None.succeed
// case e =>
// ApplicationLogger.error(s"Error occurs when trying to get version-info in build.conf, cause by : ${e}")
// None.succeed
// }
}


override def description : NodeSeq = (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ trait RudderPluginDef {
*/
def version : PluginVersion

/**
* Additional information about the version. I.E : "technical preview"
*/
def versionInfo : Option[String]




/*
* Information about the plugin activation status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,27 @@ class PluginManagement extends DispatchSnippet with Loggable {

private[this] def displayPlugin(p:RudderPluginDef)(xml:NodeSeq) : NodeSeq = {
(
"data-plugin=name *" #> p.displayName &
"data-plugin=name *" #> {
val version = p.versionInfo match {
case Some(info) => info
case None => ""
}
<h4 class="page-subtitle">
{p.displayName}
<span class="badge-plugin-version">{version}</span>
</h4>

} &
"data-plugin=fullid" #> p.name.value &
"data-plugin=baseclass" #> p.id &
"data-plugin=version" #> p.version.toString &
// "data-plugin=versioninfo" #> {
// val version = p.versionInfo match {
// case Some(info) => info
// case None => ""
// }
// <span class="badge-plugin-version" data-placement="top" data-html="true" title="" data-original-title="">{version}</span>
// } &
"data-plugin=description" #> p.description &
"data-plugin=statusInformation" #> p.statusInformation
)(xml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ <h3 class="page-title">Plugins</h3>

<div class="lift:administration.PluginManagement.display">
<div class="inner-portlet">
<h4 class="page-subtitle" data-plugin="name">[Here comes the plugins name]</h4>
<div data-plugin="name"></div>


<div class="col-xs-12 callout-fade callout-info">
<div class="marker">
Expand All @@ -39,6 +40,7 @@ <h4 class="page-subtitle" data-plugin="name">[Here comes the plugins name]</h4>
<ul class="pluginpadd">
<li><b>Plugin ID:</b> <span data-plugin="fullid">[Here comes the plugin full id]</span></li>
<li><b>Plugin version:</b> <span data-plugin="version">[Here comes the plugin version]</span></li>
<!-- <li><b>Version information:</b> <div data-plugin="versioninfo">[Here comes the plugin version]</div></li>-->
<li><b>Plugin base class:</b> <span data-plugin="baseclass">[Here comes the plugin base class]</span></li>
</ul>
<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,15 @@ table .innerDetails li{
padding: 0 10px;
}

.badge-plugin-version{
margin-left:15px;
display: inline-block;
background-color: #deefff;
color: #455eff;
padding: 5px;
border-radius: 3px;
font-size:12px;
}
/*************************
* Misc
**************************/
Expand Down

0 comments on commit e496314

Please sign in to comment.