Skip to content

Commit

Permalink
Fixes #24986: Enable scala 3 cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
fanf committed Jun 14, 2024
1 parent b96db07 commit a855029
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,23 +271,25 @@ class NodeGroupUnserialisationImpl(
tryo(s.text.toBoolean)
) ?~! ("Missing attribute 'isSystem' in entry type nodeGroup : " + entry)
properties: Seq[GroupProperty] <- traverse(group \ "properties" \ "property") { p =>
val name = (p \ "name").text.trim
if (name.isEmpty) {
Failure(s"Found unexpected xml under <properties> tag (name is blank): ${p}")
} else {
GroupProperty
.parse(
name,
ParseRev((p \ "revision").text.trim),
StringEscapeUtils.unescapeXml((p \ "value").text.trim): @nowarn(
"msg=class StringEscapeUtils in package lang3 is deprecated"
),
(p \ "inheritMode").headOption.flatMap(p => InheritMode.parseString(p.text.trim).toOption),
(p \ "provider").headOption.map(p => PropertyProvider(p.text.trim))
)
.toBox
}
}
val name = (p \ "name").text.trim
if (name.isEmpty) {
Failure(s"Found unexpected xml under <properties> tag (name is blank): ${p}")
} else {
GroupProperty
.parse(
name,
ParseRev((p \ "revision").text.trim),
StringEscapeUtils.unescapeXml((p \ "value").text.trim): @nowarn(
"msg=class StringEscapeUtils in package lang3 is deprecated"
),
(p \ "inheritMode").headOption.flatMap(p =>
InheritMode.parseString(p.text.trim).toOption
),
(p \ "provider").headOption.map(p => PropertyProvider(p.text.trim))
)
.toBox
}
}
} yield {
NodeGroup(
id = id,
Expand Down Expand Up @@ -851,7 +853,7 @@ class ApiAccountUnserialisationImpl extends ApiAccountUnserialisation {
Full(ApiAuthorization.RO)
case Some(Text(text)) if text == ApiAuthorizationKind.RW.name =>
Full(ApiAuthorization.RW)
case Some(xml @ <acl>{_*}</acl>) if xml.child.nonEmpty => unserAcl(xml.child.head)
case Some(xml @ <acl>{_*}</acl>) if xml.child.nonEmpty => unserAcl(xml.child.head)
// all other case: serialization pb => None
case _ => Full(ApiAuthorization.None)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ object RudderJsonResponse {
// Internal error with a specific schema
def internalError[A](id: Option[String], schema: ResponseSchema, obj: A, errorMsg: Option[String])(implicit
prettify: Boolean,
encoder: JsonEncoder[A]
encoder: JsonEncoder[A]
): LiftJsonResponse[? <: JsonRudderApiResponse[?]] = {
schema.dataContainer match {
case Some(key) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ object DisplayNode extends Loggable {
|</div>""".stripMargin.replaceAll("\n", " ")
}

val nodeStateClasses: String = "node-state " ++ escape(getNodeState(node.rudderSettings.state).toLowerCase).replaceAll(" ", "-")
val nodeStateClasses: String =
"node-state " ++ escape(getNodeState(node.rudderSettings.state).toLowerCase).replaceAll(" ", "-")
val nodeStateIcon = {
<span class={nodeStateClasses}></span>
}
Expand Down

0 comments on commit a855029

Please sign in to comment.