Skip to content

Commit

Permalink
fixup! Compile and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fanf authored and VinceMacBuche committed Nov 19, 2020
1 parent e099fb0 commit 3d92b1d
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ object ChangeValidationConf extends RudderPluginModule {
, woChangeRequestRepository
, notificationService
, () => Full(RudderConfig.workflowLevelService.workflowEnabled)
, () => RudderConfig.configService.rudder_workflow_self_validation.toBox
, () => RudderConfig.configService.rudder_workflow_self_deployment.toBox
, () => RudderConfig.configService.rudder_workflow_self_validation().toBox
, () => RudderConfig.configService.rudder_workflow_self_deployment().toBox
)

lazy val supervisedTargetRepo = new SupervisedTargetsReposiory(
Expand Down Expand Up @@ -250,7 +250,7 @@ object ChangeValidationConf extends RudderPluginModule {
)
, new UserValidationNeeded(roValidatedUserRepository)
)
, () => RudderConfig.configService.rudder_workflow_enabled.toBox
, () => RudderConfig.configService.rudder_workflow_enabled().toBox
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class EitherRoChangeRequestRepository(cond: () => Box[Boolean], whenTrue: RoChan
cond().flatMap( if(_) method(whenTrue) else method(whenFalse) )
}

def getAll() : Box[Vector[ChangeRequest]] = condApply( _.getAll )
def getAll() : Box[Vector[ChangeRequest]] = condApply( _.getAll() )

def get(changeRequestId:ChangeRequestId) : Box[Option[ChangeRequest]] = condApply( _.get(changeRequestId) )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ChangeValidationPluginDef(override val status: PluginStatus) extends Defau
else
Full(RedirectWithState("/secure/utilities/eventLogs", redirection ) )
)
) submenus (
).submenus(
Menu("changeRequestsList", <span>Change requests</span>) /
"secure" / "plugins" / "changes" / "changeRequests"
>> Hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class EitherWorkflowService(cond: () => Box[Boolean], whenTrue: WorkflowService,
override def findStep(changeRequestId: ChangeRequestId) : Box[WorkflowNodeId] =
current.findStep(changeRequestId)
override def getAllChangeRequestsStep() : Box[Map[ChangeRequestId,WorkflowNodeId]] =
current.getAllChangeRequestsStep
current.getAllChangeRequestsStep()
override def isEditable(currentUserRights: Seq[String], currentStep: WorkflowNodeId, isCreator: Boolean): Boolean =
current.isEditable(currentUserRights, currentStep, isCreator)
override def isPending(currentStep:WorkflowNodeId): Boolean =
Expand Down Expand Up @@ -262,7 +262,7 @@ class TwoValidationStepsWorkflowServiceImpl(


def getAllChangeRequestsStep() : Box[Map[ChangeRequestId,WorkflowNodeId]] = {
roWorkflowRepo.getAllChangeRequestsState
roWorkflowRepo.getAllChangeRequestsState()
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class WorkflowInformation extends CometActor with CometListener with Loggable {
</li>

def render = {
val xml = RudderConfig.configService.rudder_workflow_enabled.toBox match {
val xml = RudderConfig.configService.rudder_workflow_enabled().toBox match {
case eb:EmptyBox =>
val e = eb ?~! "Error when trying to read Rudder configuration for workflow activation"
logger.error(e.messageChain)
Expand Down Expand Up @@ -178,6 +178,6 @@ class WorkflowInformation extends CometActor with CometListener with Loggable {
}

override def lowPriority = {
case WorkflowUpdate => reRender
case WorkflowUpdate => reRender()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ChangeRequestChangesForm(
_ =>
changeRequest match {
case cr: ConfigurationChangeRequest =>
ruleCategoryRepository.getRootCategory.toBox match {
ruleCategoryRepository.getRootCategory().toBox match {
case Full(rootRuleCategory) =>

( "#changeTree ul *" #> new ChangesTreeNode(cr, rootRuleCategory).toXml &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import com.normation.rudder.domain.workflows._
import com.normation.rudder.services.workflows.NoWorkflowAction
import com.normation.rudder.services.workflows.WorkflowAction
import com.normation.rudder.web.ChooseTemplate
import com.normation.rudder.web.components._
import com.normation.rudder.web.model._
import com.normation.utils.DateFormaterService
import net.liftweb.common._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ class ChangeRequestManagement extends DispatchSnippet with Loggable {
}

def getLines() = {
val changeRequests = if (currentUser) roCrRepo.getAll else roCrRepo.getByContributor(CurrentUser.actor)
val changeRequests = if (currentUser) roCrRepo.getAll() else roCrRepo.getByContributor(CurrentUser.actor)
JsTableData(changeRequests match {
case Full(changeRequests) =>

val eventMap = getLastEventsMap

val workflowStateMap : Map[ChangeRequestId,WorkflowNodeId]= workflowService.getAllChangeRequestsStep match {
val workflowStateMap : Map[ChangeRequestId,WorkflowNodeId]= workflowService.getAllChangeRequestsStep() match {
case Full(stateMap) => stateMap
case eb:EmptyBox =>
val fail = eb ?~! "Could not find change requests state"
Expand All @@ -131,7 +131,7 @@ class ChangeRequestManagement extends DispatchSnippet with Loggable {
} )
}
def dataTableInit = {
val refresh = AnonFunc( SHtml.ajaxInvoke(() => JsRaw(s"refreshTable('${changeRequestTableId}',${getLines.json.toJsCmd})")))
val refresh = AnonFunc( SHtml.ajaxInvoke(() => JsRaw(s"refreshTable('${changeRequestTableId}',${getLines().json.toJsCmd})")))

val filter = initFilter match {
case Full(filter) => s"$$('#${changeRequestTableId}').dataTable().fnFilter('${filter}',1,true,false,true);"
Expand All @@ -157,7 +157,7 @@ class ChangeRequestManagement extends DispatchSnippet with Loggable {
logger.error(fail.messageChain)
Map()
}
val workflowEventsMap : Map[ChangeRequestId,EventLog] = workflowLoggerService.getLastWorkflowEvents match {
val workflowEventsMap : Map[ChangeRequestId,EventLog] = workflowLoggerService.getLastWorkflowEvents() match {
case Full(map) => map
case eb:EmptyBox =>
val fail = eb ?~! "Could not find last Change requests events requests state"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class ChangeValidationSettings extends DispatchSnippet {
def workflowConfiguration: NodeSeq => NodeSeq = { xml : NodeSeq =>

// initial values, updated on successfull submit
var initEnabled = configService.rudder_workflow_enabled.toBox
var initSelfVal = configService.rudder_workflow_self_validation.toBox
var initSelfDep = configService.rudder_workflow_self_deployment.toBox
var initEnabled = configService.rudder_workflow_enabled().toBox
var initSelfVal = configService.rudder_workflow_self_validation().toBox
var initSelfDep = configService.rudder_workflow_self_deployment().toBox

// form values
var enabled = initEnabled.getOrElse(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class GetActiveTechniqueIds(
allEntries <- con.searchSub(rudderDit.ACTIVE_TECHNIQUES_LIB.dn, filter, A_ACTIVE_TECHNIQUE_UUID)
ids <- ZIO.foreach(allEntries) { e => e.required(A_ACTIVE_TECHNIQUE_UUID).toIO }
} yield {
ids.map(ActiveTechniqueId).toList
ids.toList.map(ActiveTechniqueId)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ object UserManagementService {
Failure(err.msg)
case Right(file) =>
tryo(ConstructingParser.fromFile(file.toJava, preserveWS = true)).flatMap { parsedFile =>
val userXML = parsedFile.document.children
val userXML = parsedFile.document().children
(userXML \\ "authentication").head match {
case e: Elem =>
val newXml =
Expand All @@ -164,7 +164,7 @@ object UserManagementService {
Failure(err.msg)
case Right(file) =>
tryo(ConstructingParser.fromFile(file.toJava, preserveWS = true)).flatMap { parsedFile =>
val userXML = parsedFile.document.children
val userXML = parsedFile.document().children
val toUpdate = (userXML \\ "authentication").head
val newXml = new RuleTransformer(new RewriteRule {
override def transform(n: Node): NodeSeq = n match {
Expand All @@ -183,7 +183,7 @@ object UserManagementService {
Failure(err.msg)
case Right(file) =>
tryo(ConstructingParser.fromFile(file.toJava, preserveWS = true)).flatMap{ parsedFile =>
val userXML = parsedFile.document.children
val userXML = parsedFile.document().children
val toUpdate = (userXML \\ "authentication").head
val newXml = new RuleTransformer(new RewriteRule {
override def transform(n: Node): NodeSeq = n match {
Expand Down

0 comments on commit 3d92b1d

Please sign in to comment.