Skip to content

Commit

Permalink
Merge branch 'bug_20692/displays_a_warning_icon_for_directives_that_a…
Browse files Browse the repository at this point in the history
…re_not_used_by_any_rule_pr' into branches/rudder/7.0
  • Loading branch information
Jenkins CI committed Apr 4, 2022
2 parents 1e7e8c1 + bc82d04 commit ada31f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,28 @@ directivesTab model details =
("", text "")
else
(" is-disabled", span[class "badge-disabled"][])

isUsed = (getAllElems model.rulesTree)
|> List.concatMap (\ r -> r.directives)
|> List.member d.id

unusedWarning =
if isUsed then text ""
else
span
[ class "fa fa-warning text-warning-rudder bs-tooltip"
, attribute "data-toggle" "tooltip"
, attribute "data-placement" "bottom"
, attribute "data-container" "body"
, attribute "data-html" "true"
, attribute "data-original-title" (buildTooltipContent "Unused directive" "This directive is not used in any rule")
][]
in
li [class ("jstree-node jstree-leaf directiveNode" ++ disabledClass)]
[ i [class "jstree-icon jstree-ocl"][]
, a [class ("jstree-anchor" ++ selectedClass), onClick (addDirectives d.id)]
[ badgePolicyMode model.policyMode d.policyMode
, unusedWarning
, span [class "item-name tooltipable"][text d.displayName]
, disabledLabel
, buildTagsTree d.tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
.content-wrapper .rudder-template .jstree .fa.jstree-icon{
margin-right: 2px;
}
.content-wrapper .rudder-template .jstree .rudder-label.label-sm{
.content-wrapper .rudder-template .jstree .rudder-label.label-sm,
.content-wrapper .rudder-template .jstree .fa-warning{
margin-right: 4px;
}
.main-details .well{
Expand Down

0 comments on commit ada31f8

Please sign in to comment.