Skip to content

Commit

Permalink
Fixes #22516: Search bar doesn't work for group properties
Browse files Browse the repository at this point in the history
  • Loading branch information
clarktsiory committed Oct 23, 2023
1 parent 4fa57e9 commit 7ae11dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ object QSLdapBackend {
IpAddresses -> A_LIST_OF_IP,
PolicyServerId -> A_POLICY_SERVER_UUID,
Properties -> A_NODE_PROPERTY,
GroupProperties -> A_JSON_PROPERTY,
CustomProperties -> A_CUSTOM_PROPERTY,
NodeState -> A_STATE,
GroupId -> A_NODE_GROUP_UUID,
Expand Down Expand Up @@ -391,6 +392,7 @@ object QSLdapBackend {
case IpAddresses => Some(EQ(a.ldapName, token)) // ipHostNumber doesn't have substring match :/
case PolicyServerId => sub(a, token)
case Properties => sub(a, token)
case GroupProperties => sub(a, token)
case CustomProperties => sub(a, token)
case NodeState => sub(a, token)
case GroupId => sub(a, token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ object QSAttribute {
override val display = "Node State"
}
case object Properties extends QSAttribute { override val name = "properties" }
case object GroupProperties extends QSAttribute { override val name = "properties" }
case object CustomProperties extends QSAttribute { override val name = "properties" }

// Groups
Expand Down Expand Up @@ -238,7 +239,7 @@ object QSObject {
}
case object Group extends QSObject {
override val name = "group"
override val attributes: Set[QSAttribute] = Common.attributes ++ Set(GroupId, IsDynamic)
override val attributes: Set[QSAttribute] = Common.attributes ++ Set(GroupId, GroupProperties, IsDynamic)
}
case object Directive extends QSObject {
override val name = "directive"
Expand Down Expand Up @@ -299,9 +300,12 @@ object QSMapping {
}

// set of names by attribute
val attributeNames = {
val attributeNames: Map[QSAttribute, Set[String]] = {
import QSAttribute._
val descriptions = Set(Description, LongDescription).map(_.name) ++ Set("descriptions")
val properties = Set(Properties, GroupProperties, CustomProperties).map(_.name) ++
Set("node.props", "nodeprops", "node_properties", "nodeproperties") ++
Set("group.props", "groupprops", "group_properties", "groupproperties")

QSAttribute.all.map { a =>
a match {
Expand All @@ -322,8 +326,9 @@ object QSMapping {
case Ram => (a, Set(Ram.name, "memory"))
case IpAddresses => (a, Set(IpAddresses.name, "ip", "ips", "networkips"))
case PolicyServerId => (a, Set(PolicyServerId.name, "policyserver"))
case Properties => (a, Set(Properties.name, "node.props", "nodeprops", "node_properties", "nodeproperties"))
case CustomProperties => (a, Set(CustomProperties.name, "node.props", "nodeprops", "node_properties", "nodeproperties"))
case Properties => (a, properties)
case GroupProperties => (a, properties)
case CustomProperties => (a, properties)
case NodeState => (a, Set(NodeState.name, "nodestate"))
case GroupId => (a, Set(GroupId.name, "groupid", "group_id"))
case IsDynamic => (a, Set(IsDynamic.name))
Expand Down

0 comments on commit 7ae11dd

Please sign in to comment.