Skip to content
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 #26062: There is no "refresh" on the compliance in directive page and group page #6128

Open
wants to merge 2 commits into
base: branches/rudder/8.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ displayNodesComplianceTable model =
[ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters")
, i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][]
]
, button [class "btn btn-sm btn-primary btn-refresh", onClick (CallApi getDirectiveCompliance)]
[ i [class "fa fa-refresh"][] ]
]
, displayComplianceFilters complianceFilters UpdateComplianceFilters
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ displayRulesComplianceTable model =
[ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters")
, i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][]
]
, button [class "btn btn-sm btn-primary btn-export", onClick (CallApi getCSVExport) ]
[ text "Export " , i [ class "fa fa-download" ] [] ]
, div [class "ms-auto my-auto"]
[ button [class "btn btn-sm btn-primary btn-export me-2", onClick (CallApi getCSVExport) ]
[ text "Export " , i [ class "fa fa-download" ] [] ]
, button [class "btn btn-sm btn-default btn-refresh", onClick (CallApi getDirectiveCompliance)]
[ i [class "fa fa-refresh"][] ]
]
]
, displayComplianceFilters complianceFilters UpdateComplianceFilters
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type Msg
| GetPolicyModeResult (Result Error String)
| GetGroupComplianceResult (Result Error GroupCompliance)
--| Export (Result Error String) --TODO: later
| RefreshCompliance ComplianceScope
| CallApi (Model -> Cmd Msg)
| LoadCompliance ComplianceScope

Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ filtersView model =
let
filters = model.ui.ruleFilters
complianceFilters = model.ui.complianceFilters
complianceScope = model.complianceScope
isGlobalMode = isGlobalCompliance model
in
div [class "table-header extra-filters"]
Expand Down Expand Up @@ -398,6 +399,8 @@ filtersView model =
[ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters")
, i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][]
]
, button [class "btn btn-default btn-sm btn-refresh", onClick (RefreshCompliance complianceScope)]
[ i [class "fa fa-refresh"][] ]
]
, displayComplianceFilters complianceFilters UpdateComplianceFilters
]
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ update msg model =
-- Err err ->
-- processApiError "Export directive compliance" err model

RefreshCompliance complianceScope ->
let
getCompliance = case complianceScope of
GlobalCompliance -> getGlobalGroupCompliance
TargetedCompliance -> getTargetedGroupCompliance
in
(model, getCompliance model)

LoadCompliance complianceScope ->
let
ui = model.ui
Expand Down