Skip to content

Commit

Permalink
Add 'Host group rules' settings page
Browse files Browse the repository at this point in the history
The 'Host group rules' > 'Settings' page
should show the information of a given
automember entry.

Signed-off-by: Carla Martinez <carlmart@redhat.com>
  • Loading branch information
carma12 committed Feb 14, 2025
1 parent 4af3b1d commit 92f9be9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/navigation/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,17 @@ export const AppRoutes = ({ isInitialDataLoaded }): React.ReactElement => {
</Route>
<Route path="host-group-rules">
<Route path="" element={<AutoMemHostRules />} />
<Route path=":cn">
<Route
path=""
element={
<AutoMemUserRulesTabs
section="settings"
automemberType="hostgroup"
/>
}
/>
</Route>
</Route>
<Route path="hbac-rules">
<Route path="" element={<HBACRules />} />
Expand Down
6 changes: 5 additions & 1 deletion src/pages/AutoMemUserRules/AutoMemSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ const AutoMemSettings = (props: PropsToSettings) => {
// RPC calls
const [saveAutomember] = useSaveAutomemberMutation();

// Infer pathname from automemberType
const pathname =
props.automemberType === "group" ? "user-group-rules" : "host-group-rules";

// Update current route data to Redux and highlight the current page in the Nav bar
useUpdateRoute({ pathname: "user-group-rules", noBreadcrumb: true });
useUpdateRoute({ pathname: pathname, noBreadcrumb: true });

// Get 'ipaObject' and 'recordOnChange' to use in 'IpaTextInput'
const { ipaObject, recordOnChange } = asRecord(
Expand Down

0 comments on commit 92f9be9

Please sign in to comment.