Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Aug 23, 2017
1 parent 30ba7b2 commit b7a651c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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 => false
case _ => true
}}
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
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>DSC agent</b> <i class="dsc-icon"></i>.</p>
</div>
</td>
<td>{{technique.acceptationDate}}</td>
<lift:authz role="directive_write">
Expand Down

0 comments on commit b7a651c

Please sign in to comment.