Skip to content

Commit

Permalink
Fixes #11291: Highlight DSC compatible technique versions in the avai…
Browse files Browse the repository at this point in the history
…lable versions table.
  • Loading branch information
RaphaelGauthier committed Aug 25, 2017
1 parent 4d3c85b commit f855ba4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import com.normation.rudder.web.model.JsInitContextLinkUtil
import com.normation.rudder.domain.policies.GlobalPolicyMode
import com.normation.rudder.domain.policies.Tags
import com.normation.rudder.domain.policies.Tag
import com.normation.inventory.domain.AgentType

/**
* Snippet for managing the System and Active Technique libraries.
Expand Down Expand Up @@ -355,16 +356,21 @@ class DirectiveManagement extends DispatchSnippet with Loggable {
val isDeprecated = t.deprecrationInfo.isDefined
val deprecationMessage = t.deprecrationInfo.map(_.message).getOrElse("")
val acceptationDate = DateFormaterService.getFormatedDate(timeStamp)
val dscSupport = t.agentConfigs.forall { _.agentType match{
case AgentType.Dsc => true
case _ => false
}}
val action = {
val ajax = SHtml.ajaxCall(JsNull, (_) => newDirective(t, activeTechnique, workflowEnabled))
AnonFunc("",ajax)
}
JsObj(
( "version" -> v.toString )
, ( "isDeprecated" -> isDeprecated)
, ("deprecationMessage" -> deprecationMessage)
, ("acceptationDate" -> acceptationDate)
, ( "action" -> action)
( "version" -> v.toString )
, ( "isDeprecated" -> isDeprecated)
, ( "deprecationMessage" -> deprecationMessage)
, ( "acceptationDate" -> acceptationDate)
, ( "dscSupport" -> dscSupport)
, ( "action" -> action)
)
}
val dataArray = JsArray(techniqueVersionInfo.toList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,14 @@ <h4>Available versions</h4>
<tbody>
<tr ng-repeat="technique in techniques" ng-hide="display(technique)">
<td>{{technique.version}}
<span ng-if="technique.dscSupport" title="" tooltipid="dsc_{{$index}}" class="dsc-icon tooltipable"></span>
<span ng-if="technique.isDeprecated" title="" tooltipid="version_{{$index}}" class="glyphicon glyphicon-info-sign text-danger deprecatedTechniqueIcon tooltipable"></span>
<div ng-if="technique.isDeprecated" class="tooltipContent" id="version_{{$index}}">
<div>Deprecated: {{technique.deprecationMessage}}</div>
</div>
<div ng-if="technique.dscSupport" class="tooltipContent" id="dsc_{{$index}}">
<p>This Technique version is compatible with the <b class="dsc">DSC agent</b> <i class="dsc-icon"></i>.</p>
</div>
</td>
<td>{{technique.acceptationDate}}</td>
<lift:authz role="directive_write">
Expand Down
2 changes: 1 addition & 1 deletion rudder-web/src/main/webapp/style/rudder/rudder-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -2651,7 +2651,7 @@ img.deprecation-icon{
.tooltip-content .info-dsc{
margin-top:5px;
}
.tooltip-content .info-dsc b{
.tooltip-content .info-dsc b, b.dsc{
color:#440e62;
margin-left: 0 !important;
}
Expand Down

0 comments on commit f855ba4

Please sign in to comment.