New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #16326: Display compliance bar in Node details #2693
Fixes #16326: Display compliance bar in Node details #2693
Conversation
2752c62
to
fd8b56b
Compare
node <- nodeInfo | ||
t <- asyncComplianceService.nodeCompliance(node.id) | ||
} yield { | ||
ComplianceLevelSerialisation.ComplianceLevelToJs(t(node.id).get).toJsArray() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never use get !! this thows exception ! in fact your service should return a Box[ComplianceLevel], not the Map[NodeId,Option[ComplianceLevel]]
Also don't do t(node.id), it's also a get and it throws exception !!
@@ -468,6 +485,7 @@ object DisplayNode extends Loggable { | |||
|
|||
<div class="status-info col-lg-6 col-sm-5 col-xs-12"> | |||
<h3>Status information</h3> | |||
<div id={s"compliance-bar-${nodeInfo.get.id.value}"}></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should have a class "node-compliance-bar" and define all the css done below in a css file targeting that class
fd8b56b
to
60d35c0
Compare
val node = new NodeCompliance(Set(nodeId), Set()) | ||
node.computeCompliance match { | ||
case Full(contentMap) => | ||
contentMap.values.head match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
head throws exception too, especially if this is empty
You shoud should do
contentMap.get(nodeId) match case Some(Some(compiance)) => Full(Compliance) case _ =>
60d35c0
to
0b71933
Compare
0b71933
to
1a2ae0a
Compare
OK, merging this PR |
https://issues.rudder.io/issues/16326