Skip to content

Commit

Permalink
use value when it's present
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jan de Wit <[email protected]>
  • Loading branch information
edewit committed Oct 25, 2024
1 parent d76f5fc commit 9d6213a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default class ProviderBaseGeneralSettingsPage extends PageObject {
#jwksUrl = "config.jwksUrl";
#pkceSwitch = "#config\\.pkceEnabled";
#pkceMethod = "#pkceMethod";
#clientAuth = "#clientAuthentication";
#clientAuth = "#clientAuthMethod";
#clientAssertionSigningAlg = "#clientAssertionSigningAlg";
#clientAssertionAudienceInput = "#clientAssertionAudience";
#jwtX509HeadersSwitch = "#jwtX509HeadersEnabled";
Expand Down
3 changes: 2 additions & 1 deletion js/libs/ui-shared/src/controls/PasswordControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
UseControllerProps,
useController,
} from "react-hook-form";
import { getRuleValue } from "../utils/getRuleValue";
import { FormLabel } from "./FormLabel";
import { PasswordInput, PasswordInputProps } from "./PasswordInput";

Expand All @@ -32,7 +33,7 @@ export const PasswordControl = <
props: PasswordControlProps<T, P>,
) => {
const { labelIcon, ...rest } = props;
const required = !!props.rules?.required;
const required = !!getRuleValue(props.rules?.required);
const defaultValue = props.defaultValue ?? ("" as PathValue<T, P>);

const { field, fieldState } = useController({
Expand Down
4 changes: 2 additions & 2 deletions js/libs/ui-shared/src/controls/TextControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
UseControllerProps,
useController,
} from "react-hook-form";

import { getRuleValue } from "../utils/getRuleValue";
import { FormLabel } from "./FormLabel";

export type TextControlProps<
Expand All @@ -36,7 +36,7 @@ export const TextControl = <
props: TextControlProps<T, P>,
) => {
const { labelIcon, helperText, ...rest } = props;
const required = !!props.rules?.required;
const required = !!getRuleValue(props.rules?.required);
const defaultValue = props.defaultValue ?? ("" as PathValue<T, P>);

const { field, fieldState } = useController({
Expand Down

0 comments on commit 9d6213a

Please sign in to comment.