mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 19:28:16 +00:00
misc: added client id and secret focus toggle
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
|||||||
SelectItem
|
SelectItem
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
|
import { useToggle } from "@app/hooks";
|
||||||
import { useGetOIDCConfig } from "@app/hooks/api";
|
import { useGetOIDCConfig } from "@app/hooks/api";
|
||||||
import { useCreateOIDCConfig, useUpdateOIDCConfig } from "@app/hooks/api/oidcConfig/mutations";
|
import { useCreateOIDCConfig, useUpdateOIDCConfig } from "@app/hooks/api/oidcConfig/mutations";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
@@ -107,6 +108,9 @@ export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [isClientIdFocused, setIsClientIdFocused] = useToggle();
|
||||||
|
const [isClientSecretFocused, setIsClientSecretFocused] = useToggle();
|
||||||
|
|
||||||
const configurationTypeValue = watch("configurationType");
|
const configurationTypeValue = watch("configurationType");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -339,9 +343,14 @@ export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
|
|||||||
<FormControl label="Client ID" errorText={error?.message} isError={Boolean(error)}>
|
<FormControl label="Client ID" errorText={error?.message} isError={Boolean(error)}>
|
||||||
<Input
|
<Input
|
||||||
placeholder="Client ID"
|
placeholder="Client ID"
|
||||||
type="password"
|
type={isClientIdFocused ? "text" : "password"}
|
||||||
autoComplete="off"
|
onFocus={() => setIsClientIdFocused.on()}
|
||||||
{...field}
|
{...field}
|
||||||
|
onBlur={() => {
|
||||||
|
field.onBlur();
|
||||||
|
setIsClientIdFocused.off();
|
||||||
|
}}
|
||||||
|
autoComplete="off"
|
||||||
className="bg-mineshaft-800"
|
className="bg-mineshaft-800"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -357,10 +366,15 @@ export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
|
|||||||
isError={Boolean(error)}
|
isError={Boolean(error)}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
placeholder="Client Secret"
|
|
||||||
type="password"
|
|
||||||
autoComplete="off"
|
|
||||||
{...field}
|
{...field}
|
||||||
|
placeholder="Client Secret"
|
||||||
|
type={isClientSecretFocused ? "text" : "password"}
|
||||||
|
autoComplete="off"
|
||||||
|
onFocus={() => setIsClientSecretFocused.on()}
|
||||||
|
onBlur={() => {
|
||||||
|
field.onBlur();
|
||||||
|
setIsClientSecretFocused.off();
|
||||||
|
}}
|
||||||
className="bg-mineshaft-800"
|
className="bg-mineshaft-800"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user