Skip to content

Commit

Permalink
Fixes #19873: Saving a rule with deleted directives/groups does not c…
Browse files Browse the repository at this point in the history
…orrect it
  • Loading branch information
fanf committed Aug 27, 2021
1 parent cdb7068 commit 25b9a98
Showing 1 changed file with 16 additions and 3 deletions.
Expand Up @@ -151,9 +151,22 @@ tabContent model details isNewRule=
buildListRow ids =
let
--Get more information about directives, to correctly sort them by displayName
directives = model.directives
|> List.filter (\d -> List.member d.id ids)
|> List.sortWith (compareOn .displayName)
directives =
let
knownDirectives = model.directives
|> List.filter (\d -> List.member d.id ids)
|> List.sortWith (compareOn .displayName)
in
-- add missing directives
let
knonwIds = List.map .id knownDirectives
in
List.append
knownDirectives
(ids
|> List.filter (\id -> not (List.member id knonwIds) )
|> List.map (\id -> (Directive id ("Missing directive with ID "++id.value) "" "" "" False False ""))
)

rowDirective : Directive -> Html Msg
rowDirective directive =
Expand Down

0 comments on commit 25b9a98

Please sign in to comment.