GitHub PullRequestReviewCommentEvent at 2014-05-28 16:28:51
Repository: rudder
Actor: ncharles
Payload: {"comment":{"url":"https://api.github.com/repos/Normation/rudder/pulls/comments/13140611","id":13140611,"diff_hunk":"@@ -0,0 +1,471 @@\n+/*\n+*************************************************************************************\n+* Copyright 2014 Normation SAS\n+*************************************************************************************\n+*\n+* This program is free software: you can redistribute it and/or modify\n+* it under the terms of the GNU Affero General Public License as\n+* published by the Free Software Foundation, either version 3 of the\n+* License, or (at your option) any later version.\n+*\n+* In accordance with the terms of section 7 (7. Additional Terms.) of\n+* the GNU Affero GPL v3, the copyright holders add the following\n+* Additional permissions:\n+* Notwithstanding to the terms of section 5 (5. Conveying Modified Source\n+* Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU Affero GPL v3\n+* licence, when you create a Related Module, this Related Module is\n+* not considered as a part of the work and may be distributed under the\n+* license agreement of your choice.\n+* A \"Related Module\" means a set of sources files including their\n+* documentation that, without modification of the Source Code, enables\n+* supplementary functions or services in addition to those offered by\n+* the Software.\n+*\n+* This program is distributed in the hope that it will be useful,\n+* but WITHOUT ANY WARRANTY; without even the implied warranty of\n+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+* GNU Affero General Public License for more details.\n+*\n+* You should have received a copy of the GNU Affero General Public License\n+* along with this program. If not, see <http://www.gnu.org/licenses/agpl.html>.\n+*\n+*************************************************************************************\n+*/\n+\n+package com.normation.rudder.web.components\n+\n+import com.normation.rudder.domain.policies._\n+import com.normation.rudder.repository.FullActiveTechniqueCategory\n+import com.normation.inventory.domain.NodeId\n+import com.normation.rudder.domain.nodes.NodeInfo\n+import scala.xml._\n+import net.liftweb.http._\n+import net.liftweb.common._\n+import com.normation.rudder.domain.reports.bean._\n+import net.liftweb.util.Helpers._\n+import net.liftweb.util.Helpers\n+import net.liftweb.http.js.JsCmds._\n+import net.liftweb.http.js.JE._\n+import net.liftweb.http.js.JsCmd\n+import bootstrap.liftweb.RudderConfig\n+import com.normation.rudder.web.components.popup.RuleCompliancePopup\n+import com.normation.rudder.web.model.WBTextField\n+import com.normation.rudder.web.model.WBTextAreaField\n+import com.normation.rudder.web.model.WBSelectField\n+\n+/**\n+ *   This component display the compliance of a Rule by showing compliance of every Directive  \n+ *   It generates all Data and put them in a DataTable\n+ */\n+object RuleCompliance {\n+  private def details =\n+    (for {\n+      xml <- Templates(\"templates-hidden\" :: \"components\" :: \"ComponentRuleEditForm\" :: Nil)\n+    } yield {\n+      chooseTemplate(\"component\", \"details\", xml)\n+    }) openOr Nil\n+}\n+\n+class RuleCompliance (rule : Rule) extends Loggable {\n+\n+  private[this] val reportingService = RudderConfig.reportingService\n+  private[this] val categoryService  = RudderConfig.ruleCategoryService\n+\n+  val popup = new RuleCompliancePopup(rule)\n+\n+  def  display(directiveLib: FullActiveTechniqueCategory, allNodeInfos: Map[NodeId, NodeInfo]) : NodeSeq = {\n+\n+    (\n+      \"#ruleName\" #>   rule.name &\n+      \"#ruleCategory\" #> categoryService.shortFqdn(rule.categoryId) &\n+      \"#rudderID\" #> rule.id.value.toUpperCase &\n+      \"#ruleShortDescription\" #> rule.shortDescription &\n+      \"#ruleLongDescription\" #>  rule.longDescription &\n+      \"#compliancedetails\" #> showCompliance(directiveLib, allNodeInfos)","path":"rudder-web/src/main/scala/com/normation/rudder/web/components/RuleCompliance.scala","position":84,"original_position":84,"commit_id":"57074059d88a0358878f817f24ba117f147457fe","original_commit_id":"57074059d88a0358878f817f24ba117f147457fe","user":{"login":"ncharles","id":76947,"avatar_url":"https://avatars.githubusercontent.com/u/76947?","gravatar_id":"0d07ee0ebb9bd7cfb103a8320f1a10bf","url":"https://api.github.com/users/ncharles","html_url":"https://github.com/ncharles","followers_url":"https://api.github.com/users/ncharles/followers","following_url":"https://api.github.com/users/ncharles/following{/other_user}","gists_url":"https://api.github.com/users/ncharles/gists{/gist_id}","starred_url":"https://api.github.com/users/ncharles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncharles/subscriptions","organizations_url":"https://api.github.com/users/ncharles/orgs","repos_url":"https://api.github.com/users/ncharles/repos","events_url":"https://api.github.com/users/ncharles/events{/privacy}","received_events_url":"https://api.github.com/users/ncharles/received_events","type":"User","site_admin":false},"body":"could you use same Case everytime ?\r\nso use complianceDetails","created_at":"2014-05-28T16:28:51Z","updated_at":"2014-05-28T16:28:51Z","html_url":"https://github.com/Normation/rudder/pull/520#discussion_r13140611","pull_request_url":"https://api.github.com/repos/Normation/rudder/pulls/520","_links":{"self":{"href":"https://api.github.com/repos/Normation/rudder/pulls/comments/13140611"},"html":{"href":"https://github.com/Normation/rudder/pull/520#discussion_r13140611"},"pull_request":{"href":"https://api.github.com/repos/Normation/rudder/pulls/520"}}}}