Skip to content

Commit

Permalink
Adapt the 'Kerberos ticket' subsection fields
Browse files Browse the repository at this point in the history
The fields of the 'Kerberos ticket' subsection
need to be adapted to synchronize wirh the data
from the `krbtoilicy_show` JSON RPC method (previously
adapted in the RPC wrapper and used through the
`useUserSettingsData` custom hook).

Signed-off-by: Carla Martinez <[email protected]>
  • Loading branch information
carma12 committed Nov 15, 2023
1 parent 469c012 commit 2ff058f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const UserSettings = (props: PropsToUserSettings) => {
id="kerberos-ticket"
text="Kerberos ticket"
/>
<UsersKerberosTicket />
<UsersKerberosTicket krbPolicyData={props.krbPolicyData || []} />
<TitleLayout
key={4}
headingLevel="h2"
Expand Down
19 changes: 10 additions & 9 deletions src/components/UsersSections/UsersKerberosTicket.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React from "react";
// PatternFly
import {
Flex,
Expand All @@ -8,11 +8,12 @@ import {
TextInput,
} from "@patternfly/react-core";

const UsersKerberosTicket = () => {
// TODO: This state variables should update the user data via the IPA API (`krbtpolicy_mod`)
const [maxRenew] = useState("");
const [maxLife] = useState("");
interface PropsToKrbTicket {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
krbPolicyData: Record<string, any>;
}

const UsersKerberosTicket = (props: PropsToKrbTicket) => {
return (
<Flex direction={{ default: "column", md: "row" }}>
<FlexItem flex={{ default: "flex_1" }}>
Expand All @@ -21,10 +22,10 @@ const UsersKerberosTicket = () => {
<TextInput
id="max-renew"
name="krbmaxrenewableage"
value={maxRenew}
value={props.krbPolicyData.krbmaxrenewableage}
type="text"
aria-label="max renew in seconds"
isDisabled
readOnlyVariant="plain"
/>
</FormGroup>
</Form>
Expand All @@ -35,10 +36,10 @@ const UsersKerberosTicket = () => {
<TextInput
id="max-life"
name="krbmaxticketlife"
value={maxLife}
value={props.krbPolicyData.krbmaxticketlife}
type="text"
aria-label="max life in seconds"
isDisabled
readOnlyVariant="plain"
/>
</FormGroup>
</Form>
Expand Down

0 comments on commit 2ff058f

Please sign in to comment.