Skip to content

Commit

Permalink
Merge branch 'bug_20954/edit_mode_should_be_enabled_by_default_when_c…
Browse files Browse the repository at this point in the history
…reating_a_rule_pr' into branches/rudder/7.0
  • Loading branch information
Jenkins CI committed Apr 4, 2022
2 parents 1ad54a2 + 4343707 commit 1e7e8c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ update msg model =
NewRule id ->
let
rule = Rule id "" "rootRuleCategory" "" "" True False [] [] "" (RuleStatus "" Nothing) []
ruleDetails = RuleDetails Nothing rule Information defaultRulesUI Nothing []
ruleDetails = RuleDetails Nothing rule Information {defaultRulesUI | editGroups = True, editDirectives = True} Nothing []
in
({model | mode = RuleForm ruleDetails}, Cmd.none)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ editionTemplate model details =
originRule = details.originRule

rule = details.rule
ruleTitle = case originRule of
Nothing -> span[style "opacity" "0.4"][text "New rule"]
Just r -> text r.name
(ruleTitle, isNewRule) = case originRule of
Nothing -> (span[style "opacity" "0.4"][text "New rule"], True)
Just r -> (text r.name, False)
(classDisabled, badgeDisabled) = if (Maybe.withDefault True (Maybe.map .enabled originRule)) then
("", text "")
else
Expand Down Expand Up @@ -148,14 +148,18 @@ editionTemplate model details =
]
]
]
, li[class ("ui-tabs-tab" ++ (if details.tab == Nodes then " ui-tabs-active" else ""))]
, ( if isNewRule then
text ""
else
li[class ("ui-tabs-tab" ++ (if details.tab == Nodes then " ui-tabs-active" else ""))]
[ a[onClick (UpdateRuleForm {details | tab = Nodes })]
[ text "Nodes"
, span[class "badge badge-secondary badge-resources tooltip-bs"]
[ span [class "nb-resources"] [ text (String.fromInt(getRuleNbNodes details))]
]
]
]
)
, li[class ("ui-tabs-tab" ++ (if details.tab == Groups then " ui-tabs-active" else ""))]
[ a[onClick (UpdateRuleForm {details | tab = Groups })]
[ text "Groups"
Expand All @@ -164,14 +168,18 @@ editionTemplate model details =
]
]
]
, li[class ("ui-tabs-tab" ++ (if details.tab == TechnicalLogs then " ui-tabs-active" else ""))]
, ( if isNewRule then
text ""
else
li[class ("ui-tabs-tab" ++ (if details.tab == TechnicalLogs then " ui-tabs-active" else ""))]
[ a[onClick (UpdateRuleForm {details | tab = TechnicalLogs })]
[ text "Recent Changes"
, span[class "badge badge-secondary badge-resources tooltip-bs"]
[ span [class "nb-resources"] [text (String.fromFloat (countRecentChanges details.rule.id model.changes))]
]
]
]
)
]
]
, div [class "main-details"]
Expand Down

0 comments on commit 1e7e8c1

Please sign in to comment.